From d8a5b42df4a3a9621124a55739fe3830e51087c5 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Fri, 30 Oct 2026 22:57:49 -0700 Subject: [PATCH 1/8] Synchronized with the latest API changes --- CHANGELOG.md | 23 + CLAUDE.md | 6 + README.md | 96 +++- openapi/seclai.openapi.json | 930 ++++++++++++++++++++++++++++++++++-- src/client.ts | 217 +++++++-- src/index.ts | 24 + src/openapi.ts | 460 +++++++++++++++++- src/types.ts | 197 +++++++- src/versions.ts | 3 +- tests/client.test.ts | 228 ++++++++- 10 files changed, 2082 insertions(+), 102 deletions(-) create mode 100644 CLAUDE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 8358b0f..f837640 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [1.8.0] - 2026-10-31 + +### Changed + +- Sync the bundled OpenAPI spec and regenerate the types. Existing responses gain properties: `decision` on `AgentRunStepResponse`, `created_resources`, `solution_id` and the run and credit limits `max_runs_total`, `max_runs_per_day`, `max_runs_per_hour`, `max_credits_per_run` and `max_credits_per_period` on `AgentSummaryResponse`, `max_credits_per_period`, `spend_cap_action`, `spend_cap_delete_order` and `spend_cap_reached` on `SourceResponse`, and `release_waiting_reason` on `SourceContentStatusResponse` +- Move `SeclaiApiVersion.Latest` to `2026-10-28`. Nothing is sent unless `apiVersion` is set, so a client that passes `SeclaiApiVersion.Latest` now opts into `2026-10-28`: an `if_else` or `switch` step's `output` is the result of the arm it took, where it was a `{"branch": ...}` marker naming the arm. Read the arm from the step's new `decision`, which is set on every version +- Mark `severity` on `listAlerts()` deprecated. It has never been sent, because `GET /alerts` has no severity filter + +### Added + +- Add `listAgentExamples()` for the agent gallery, searchable with `query` and filterable by `useCase`, and accept `agent_template` entries from it on `createAgent()` with `resource_bindings` and `create_missing_resources` +- Add `setSlackTriggerConfig()` to configure an agent's `SLACK_COMMAND` trigger: its Slack connection, form, channels, activation, reply visibility and conversation settings +- Accept the run and credit limits on `updateAgent()`: `max_runs_total`, `max_runs_per_day`, `max_runs_per_hour`, `max_credits_per_run` and `max_credits_per_period`, a `set_max_*` flag for each to remove it, and `apply_import_run_limits` +- Accept a spend limit on `updateSource()`: `max_credits_per_period`, `spend_cap_action` and `spend_cap_delete_order` +- Accept the query filters the API declares and no method sent: `status`, `flaggedOnly`, `timeFrom` and `timeTo` on `listEvaluationResults()` and `listAgentEvaluationResults()`, which also takes `step`; `status`, `step`, `timeFrom` and `timeTo` on `listEvaluationRuns()`; `startedAfter` on `listCompatibleRuns()`; `days`, `startDate` and `endDate` on `getNonManualEvaluationSummary()` and `getMemoryBankStats()`; `limit` and `offset` on `getMemoryBankAiLastConversation()` and `getAiAssistantMemoryBankHistory()`; `agentId`, `sourceConnectionId`, `timeFrom` and `timeTo` on `listAlerts()`; `agentId`, `sourceConnectionId` and `scope` on `listAlertConfigs()`; `organizationId` and `includeDefaults` on `listOrganizationAlertPreferences()`; `limit` on `listGovernanceAiConversations()`; `type` on `listMemoryBanks()`; `agentId` and `unreadOnly` on `listModelAlerts()`; `requireToolUse`, `requireStructuredOutput`, `requireThinking`, `minContextTokens` and `minOutputTokens` on `getModelRecommendations()`; and `search` on `listSolutions()` +- Add the `SeclaiApiVersion.V2026_10_28` constant, so that version is accepted as `apiVersion` +- Add the type exports `AgentExampleListResponse`, `SetSlackTriggerConfigRequest`, `SlackTriggerConfigResponse`, `SlackTriggerActivation`, `SlackTriggerScope`, `SlackReplyVisibility`, `SpendCapAction` and `SpendCapDeleteOrder`, and the option types `ListAgentExamplesOptions`, `ListEvaluationResultsOptions`, `ListAgentEvaluationResultsOptions`, `ListEvaluationRunsOptions`, `ListCompatibleRunsOptions`, `DateRangeOptions`, `LastConversationOptions`, `ListAlertsOptions`, `ListAlertConfigsOptions`, `ListOrganizationAlertPreferencesOptions`, `ListMemoryBanksOptions`, `ListModelAlertsOptions`, `ModelRecommendationsOptions` and `ListSolutionsOptions` + +### Fixed + +- Make every field of `UpdateAgentRequest` optional. `updateAgent()` required `set_default_evaluation_tier`, `set_prompt_model_auto_rollback_triggers` and `set_sampling_config`, which the server defaults to `false`, so `updateAgent(id, { name })` did not compile + ## [1.7.0] - 2026-10-21 ### Changed @@ -246,6 +268,7 @@ _Stable release. No functional changes since 0.0.1._ _Initial release._ +[1.8.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.8.0 [1.7.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.7.0 [1.6.1]: https://github.com/seclai/seclai-javascript/releases/tag/1.6.1 [1.6.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.6.0 diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..4d144a0 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,6 @@ +# seclai-javascript + +## Git and PRs + +- **Never commit or push.** No `git commit`, `git push`, `gh pr create`, no merging, not after finishing a task, not after addressing review comments, not after checks pass. The user commits all work themselves. Leave the changes in the working tree and say the work is ready. Do not offer to commit either. +- **Never conclude that a branch has no PR. Run `gh pr view`.** `gh pr view --json number,url,state` answers it in one call. A diff target you were handed (`HEAD~1..HEAD`, a commit range, a path) says what to read, never whether a PR exists. With `/code-review --comment`, post the findings to that PR. If the command comes back empty, report that it found none, not that there is no PR. diff --git a/README.md b/README.md index 183a515..73d9054 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,8 @@ a request that used to succeed, or (from `2026-10-21`) which fields can be - `2026-10-21` changes evaluation numbers you may be reading: an `error` result no longer counts as `failed` or toward the rates, and `testDraftEvaluation()` returns `null` `score` and `passed` for one. +- `2026-10-28` changes what an `if_else` or `switch` step's `output` contains. + Read the arm it took from the step's `decision`, which is set on every version. | Version | What it changes | | --- | --- | @@ -202,6 +204,7 @@ a request that used to succeed, or (from `2026-10-21`) which fields can be | `2026-10-18` | A source's `document_images` defaults to `true` on every embedder. Below it it defaults to `false` on a text-only embedder | | `2026-10-19` | `createSource()` rejects `polling_max_items` on any source type but an RSS feed with a 400. Below it the value is stored | | `2026-10-21` | An evaluation result whose evaluator returned no verdict (`error`) is left out of `failed` and of `pass_rate` / `failure_rate` in `getNonManualEvaluationSummary()`, and `getEvaluationCriteriaSummary()` averages `average_score` over passed and failed results only. `testDraftEvaluation()` returns `score` and `passed` as `null` for an `error` result. Below it the summary counts `error` results in `failed` and the rates, `average_score` includes their stored scores, and the test draft returns `score` 0.5 and `passed: false`. The summary's `error` count is returned on every version | +| `2026-10-28` | An `if_else` or `switch` step's `output` is the result of the arm it took, or its input when that arm is empty or it took none. Below it the `output` is a `{"branch": ...}` marker naming the arm, with no `attachments`. The step's `decision` names the arm on every version | **`Latest` moves with the SDK.** `SeclaiApiVersion.Latest` is the newest version the installed release knows, so upgrading the package can opt a client that @@ -209,7 +212,8 @@ passes it into every version added since — `1.6.0` moved it from `2026-07-27` `2026-10-03`, across the `2026-09-30` output change, and `1.7.0` moves it to `2026-10-21`, across the `2026-10-05` status change, the `2026-10-13` and `2026-10-19` source-setting rejections, the `2026-10-16` input change and the -`2026-10-21` evaluation change. Pass a +`2026-10-21` evaluation change, and `1.8.0` moves it to `2026-10-28`, +across the `if_else` / `switch` step-output change. Pass a dated constant such as `SeclaiApiVersion.V2026_07_27` to keep behaviour fixed across upgrades. @@ -270,6 +274,10 @@ const fetched = await client.getAgent("agent_id"); const updated = await client.updateAgent("agent_id", { name: "Renamed" }); await client.deleteAgent("agent_id"); +// Run and credit limits. To remove one, send its set_max_* flag and omit the value. +await client.updateAgent("agent_id", { max_runs_per_hour: 60, max_credits_per_period: 500 }); +await client.updateAgent("agent_id", { set_max_runs_per_hour: true }); + // Pause / resume — a disabled agent stops firing from every trigger path const callers = await client.getAgentCallers("agent_id"); // live agents calling this one await client.disableAgent("agent_id"); // 409 if any caller above is still live @@ -299,6 +307,27 @@ const imported = await client.createAgent({ // `imported.import_warnings` lists any items that couldn't be applied. ``` +### Agent examples + +The agent gallery lists example agents to start from. Pass an entry's `key` as +`agent_template` to `createAgent()`. Bind each resource the template needs with +`resource_bindings`, or set `create_missing_resources` to have the API create the +ones you leave out; `created_resources` reports what it made. + + +```ts +const examples = await client.listAgentExamples({ query: "support", useCase: "customer_support", limit: 10 }); +console.log(examples.data, examples.pagination.total); + +const agent = await client.createAgent({ + name: "Support triage", + agent_template: "support-triage", + resource_bindings: { knowledge_base: "kb_id" }, + create_missing_resources: true, +}); +console.log(agent.created_resources); // { slot: resource_id } for each resource it created +``` + ### Agent runs ```ts @@ -429,6 +458,28 @@ Set `run_on_attachment_mismatch: true` to run an email whose attachments do not fit what the agent accepts: files it cannot take are left out and the problems are listed in the run's `email_attachment_issues` metadata. By default the run fails. +### Agent Slack triggers + +Configure an agent's `SLACK_COMMAND` trigger, which people run from Slack with +`/seclai` or the message shortcut. Omitted fields are left unchanged. + + +```ts +const slack = await client.setSlackTriggerConfig("agent_id", "trigger_id", { + scope: "selected_channels", // or "bot_channels" + channel_ids: ["C0123456789"], + activation: "everywhere", // or "channel_opt_in" + visibility: "private", // or "channel" + allow_dms: true, + turns_enabled: true, // let people keep the conversation going + max_turns: 5, + form: [{ key: "ticket", label: "Ticket ID", type: "short_text", required: true }], +}); +console.log(slack.missing_scopes); // Slack scopes the connection lacks for optional features +``` + +Each form value reaches the run as `{{metadata.}}`. + ### Accepted attachments Declare the input attachments a trigger accepts. A run's files are each assigned @@ -503,18 +554,20 @@ const draft = await client.testDraftEvaluation("agent_id", { step_output: "...", if (draft.status !== "error") console.log(draft.score, draft.passed); // Results by criteria -const results = await client.listEvaluationResults("criteria_id"); +const results = await client.listEvaluationResults("criteria_id", { flaggedOnly: true, timeFrom: "2026-10-01T00:00:00Z" }); const summary = await client.getEvaluationCriteriaSummary("criteria_id"); await client.createEvaluationResult("criteria_id", { ... }); // Results by run const runResults = await client.listRunEvaluationResults("agent_id", "run_id"); +const agentResults = await client.listAgentEvaluationResults("agent_id", { status: "failed", step: "step_id" }); +const evalRuns = await client.listEvaluationRuns("agent_id", { timeFrom: "2026-10-01T00:00:00Z" }); // Non-manual evaluation summary -const nonManual = await client.getNonManualEvaluationSummary("agent_id"); +const nonManual = await client.getNonManualEvaluationSummary("agent_id", { days: 7 }); // Compatible runs for a criteria -const compatible = await client.listCompatibleRuns("criteria_id"); +const compatible = await client.listCompatibleRuns("criteria_id", { startedAfter: "2026-10-01T00:00:00Z" }); ``` ### Knowledge bases @@ -530,14 +583,14 @@ await client.deleteKnowledgeBase("kb_id"); ### Memory banks ```ts -const banks = await client.listMemoryBanks(); +const banks = await client.listMemoryBanks({ type: "conversation" }); const bank = await client.createMemoryBank({ name: "Chat Memory", type: "conversation" }); const fetched = await client.getMemoryBank("mb_id"); await client.updateMemoryBank("mb_id", { name: "Renamed" }); await client.deleteMemoryBank("mb_id"); // Stats & compaction -const stats = await client.getMemoryBankStats("mb_id"); +const stats = await client.getMemoryBankStats("mb_id", { startDate: "2026-10-01", endDate: "2026-10-31" }); await client.compactMemoryBank("mb_id"); // Test compaction @@ -550,7 +603,7 @@ const agents = await client.getAgentsUsingMemoryBank("mb_id"); // AI assistant const suggestion = await client.generateMemoryBankConfig({ user_input: "..." }); -const history = await client.getMemoryBankAiLastConversation(); +const history = await client.getMemoryBankAiLastConversation({ limit: 5 }); await client.acceptMemoryBankAiSuggestion("conv_id", { ... }); // Source management @@ -567,6 +620,21 @@ await client.updateSource("source_id", { name: "Renamed" }); await client.deleteSource("source_id"); ``` +A spend limit caps the credits a source may commit per billing period. When it is +reached, `stop` refuses new uploads and email, and `delete` removes entries in +`spend_cap_delete_order` to make room. Send `null` to remove the limit. + + +```ts +const capped = await client.updateSource("source_id", { + max_credits_per_period: 1000, + spend_cap_action: "delete", + spend_cap_delete_order: "oldest_published", +}); +console.log(capped.spend_cap_reached); +await client.updateSource("source_id", { max_credits_per_period: null }); +``` + Indexing status of a source's content, keyed by the `content_version_id` the upload methods return: @@ -728,7 +796,7 @@ const bytes = new Uint8Array(await file.arrayBuffer()); ### Solutions ```ts -const solutions = await client.listSolutions(); +const solutions = await client.listSolutions({ search: "billing" }); const sol = await client.createSolution({ name: "My Solution" }); const fetched = await client.getSolution("solution_id"); await client.updateSolution("solution_id", { name: "Renamed" }); @@ -761,7 +829,7 @@ await client.markSolutionConversationTurn("solution_id", "conversation_id", { .. ```ts const plan = await client.generateGovernanceAiPlan({ user_input: "Add a toxicity policy" }); -const convs = await client.listGovernanceAiConversations(); +const convs = await client.listGovernanceAiConversations({ limit: 10 }); await client.acceptGovernanceAiPlan("conversation_id"); await client.declineGovernanceAiPlan("conversation_id"); ``` @@ -769,7 +837,7 @@ await client.declineGovernanceAiPlan("conversation_id"); ### Alerts ```ts -const alerts = await client.listAlerts({ status: "active" }); +const alerts = await client.listAlerts({ status: "active", agentId: "agent_id", timeFrom: "2026-10-01T00:00:00Z" }); const alert = await client.getAlert("alert_id"); await client.changeAlertStatus("alert_id", { status: "resolved" }); await client.addAlertComment("alert_id", { text: "Investigating" }); @@ -779,14 +847,14 @@ await client.subscribeToAlert("alert_id"); await client.unsubscribeFromAlert("alert_id"); // Alert configs -const configs = await client.listAlertConfigs(); +const configs = await client.listAlertConfigs({ agentId: "agent_id" }); await client.createAlertConfig({ ... }); await client.getAlertConfig("config_id"); await client.updateAlertConfig("config_id", { ... }); await client.deleteAlertConfig("config_id"); // Organization preferences -const prefs = await client.listOrganizationAlertPreferences(); +const prefs = await client.listOrganizationAlertPreferences({ includeDefaults: true }); await client.updateOrganizationAlertPreference("org_id", "alert_type", { ... }); ``` @@ -807,11 +875,11 @@ const embedders = await client.listEmbeddingModels({ supportsInputMedia: "image" const rerankers = await client.listRerankerModels(); console.log(embedders.models, embedders.default_model_type, rerankers.models); -const alerts = await client.listModelAlerts(); +const alerts = await client.listModelAlerts({ unreadOnly: true }); await client.markModelAlertRead("alert_id"); await client.markAllModelAlertsRead(); const unread = await client.getUnreadModelAlertCount(); -const recs = await client.getModelRecommendations("model_id"); +const recs = await client.getModelRecommendations("model_id", { requireToolUse: true, minContextTokens: 100_000 }); // Model playground experiments const experiment = await client.createExperiment({ model_ids: ["model_id"], prompt: "..." }); diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index 0ca4052..4220dcc 100644 --- a/openapi/seclai.openapi.json +++ b/openapi/seclai.openapi.json @@ -419,12 +419,30 @@ "title": "AgentEvaluationTier", "type": "string" }, + "AgentExampleListResponse": { + "properties": { + "data": { + "items": {}, + "title": "Data", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponse" + } + }, + "required": [ + "data", + "pagination" + ], + "title": "AgentExampleListResponse", + "type": "object" + }, "AgentExportResponse": { "description": "Portable JSON snapshot of an agent definition.", "properties": { "agent": { "additionalProperties": true, - "description": "Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, created_at, updated_at.", + "description": "Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, max_credits_per_run, max_credits_per_period, max_runs_per_hour, max_runs_per_day, max_runs_total, created_at, updated_at.", "title": "Agent", "type": "object" }, @@ -963,6 +981,18 @@ "title": "Credits Used", "type": "number" }, + "decision": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The arm an `if_else` or `switch` step took: `then` or `else`, or the case name or `else`. Null for other step types, until the step has decided, and when a `switch` took no arm.", + "title": "Decision" + }, "duration_seconds": { "anyOf": [ { @@ -1008,7 +1038,7 @@ "type": "null" } ], - "description": "Output text produced by the step, if any; its files are in `attachments`. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step output files and is not a `for_each`.", + "description": "Output text produced by the step, if any; its files are in `attachments`. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step output files and is not a `for_each`. For an `if_else` or `switch`, the result of the arm it took (its input when that arm is empty or it took none); below `Seclai-Version: 2026-10-28`, the `{\"branch\": ...}` marker naming that arm, with no `attachments`.", "title": "Output" }, "output_content_type": { @@ -1289,6 +1319,21 @@ "title": "Created At", "type": "string" }, + "created_resources": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "On a create from an `agent_template`: {slot: resource_id} for each resource `create_missing_resources` created.", + "title": "Created Resources" + }, "default_evaluation_tier": { "anyOf": [ { @@ -1369,12 +1414,72 @@ "description": "One entry per item dropped or substituted during import. Present only on endpoints that accept agent_definition; null on non-import calls; [] when the import had no skips.", "title": "Import Warnings" }, + "max_credits_per_period": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Credit limit per billing period; null when none.", + "title": "Max Credits Per Period" + }, + "max_credits_per_run": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Credit limit per run; null when none.", + "title": "Max Credits Per Run" + }, "max_retries": { "default": 3, "description": "Max retries for eval_and_retry mode.", "title": "Max Retries", "type": "integer" }, + "max_runs_per_day": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Runs per day limit; null when none.", + "title": "Max Runs Per Day" + }, + "max_runs_per_hour": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Runs per hour limit; null when none.", + "title": "Max Runs Per Hour" + }, + "max_runs_total": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Limit on runs in total; null when none.", + "title": "Max Runs Total" + }, "name": { "description": "Agent name.", "title": "Name", @@ -1426,6 +1531,18 @@ "description": "Sampling configuration for sample_and_flag mode.", "title": "Sampling Config" }, + "solution_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "On a create from an `agent_template` that created resources: the solution grouping the agent with them.", + "title": "Solution Id" + }, "trigger_id": { "anyOf": [ { @@ -4526,7 +4643,7 @@ "type": "string" }, "reason": { - "description": "Why it was refused: sender_not_allowed, unauthenticated_sender, unreadable_from, sender_blocked, spam, virus, unsafe_content, rate_limited, account_not_chargeable or empty_message; or, for a message the source received before, what became of the earlier one: repeat_stored, repeat_held, repeat_deleted or repeat_in_progress.", + "description": "Why it was refused: sender_not_allowed, unauthenticated_sender, unreadable_from, sender_blocked, spam, virus, unsafe_content, rate_limited, account_not_chargeable, spend_limit_reached or empty_message; or, for a message the source received before, what became of the earlier one: repeat_stored, repeat_held, repeat_deleted or repeat_in_progress.", "title": "Reason", "type": "string" }, @@ -7828,7 +7945,7 @@ "type": "null" } ], - "description": "The input attachments the trigger accepts; ``null`` accepts any files (one attachment named ``files``). Only ``dynamic_input`` and ``email_received`` triggers take files.", + "description": "The input attachments the trigger accepts; ``null`` accepts any files (one attachment named ``files``). Only ``dynamic_input``, ``email_received`` and ``slack_command`` triggers take files.", "title": "Accepted Attachments" } }, @@ -7852,6 +7969,179 @@ "title": "SetAutoBlockModeRequest", "type": "object" }, + "SetSlackTriggerConfigApiRequest": { + "description": "Omitted fields are left unchanged.", + "properties": { + "activation": { + "anyOf": [ + { + "$ref": "#/components/schemas/SlackTriggerActivation" + }, + { + "type": "null" + } + ], + "description": "`everywhere` in scope, or `channel_opt_in`." + }, + "allow_dms": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Runnable in the app's own DMs.", + "title": "Allow Dms" + }, + "channel_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Channel Ids" + }, + "form": { + "anyOf": [ + { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Form fields `{key, label, type, required, hint, choices, max_length}`. `type`: short_text, long_text, number, single_choice, multi_choice, yes_no, date, slack_user or slack_channel. Each value reaches the run as `{{metadata.}}`.", + "title": "Form" + }, + "include_invoker_email": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Include Invoker Email" + }, + "input": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The trigger's input template. Each `{{metadata.}}` in it must be a form field key or a platform key; it is checked together with `form`.", + "title": "Input" + }, + "max_turns": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Max Turns" + }, + "mcp_client_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The account's connected Slack (Bot) MCP client.", + "title": "Mcp Client Id" + }, + "notify_failure_after_answer": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Notify Failure After Answer" + }, + "scope": { + "anyOf": [ + { + "$ref": "#/components/schemas/SlackTriggerScope" + }, + { + "type": "null" + } + ], + "description": "`selected_channels` (see `channel_ids`) or `bot_channels`." + }, + "start_without_form": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Start Without Form" + }, + "turns_anyone": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Turns Anyone" + }, + "turns_enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Turns Enabled" + }, + "visibility": { + "anyOf": [ + { + "$ref": "#/components/schemas/SlackReplyVisibility" + }, + { + "type": "null" + } + ], + "description": "`channel`, or `private` (replies in the person's DM)." + } + }, + "title": "SetSlackTriggerConfigApiRequest", + "type": "object" + }, "SkippedAttachmentReason": { "enum": [ "displayed_in_body", @@ -7908,21 +8198,173 @@ "title": "SkippedAttachmentResponse", "type": "object" }, - "SolutionSourceConnectionResponse": { + "SlackReplyVisibility": { + "enum": [ + "channel", + "private" + ], + "title": "SlackReplyVisibility", + "type": "string" + }, + "SlackTriggerActivation": { + "enum": [ + "everywhere", + "channel_opt_in" + ], + "title": "SlackTriggerActivation", + "type": "string" + }, + "SlackTriggerConfigApiResponse": { "properties": { - "id": { - "format": "uuid", - "title": "Id", + "activation": { + "title": "Activation", "type": "string" }, - "name": { - "title": "Name", + "agent_id": { + "format": "uuid", + "title": "Agent Id", "type": "string" - } - }, - "required": [ - "id", - "name" + }, + "allow_dms": { + "title": "Allow Dms", + "type": "boolean" + }, + "channel_ids": { + "items": { + "type": "string" + }, + "title": "Channel Ids", + "type": "array" + }, + "form": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Form", + "type": "array" + }, + "include_invoker_email": { + "title": "Include Invoker Email", + "type": "boolean" + }, + "max_turns": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Max Turns" + }, + "mcp_client_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Mcp Client Id" + }, + "missing_scopes": { + "description": "Scopes the Slack connection lacks for optional features.", + "items": { + "type": "string" + }, + "title": "Missing Scopes", + "type": "array" + }, + "notify_failure_after_answer": { + "title": "Notify Failure After Answer", + "type": "boolean" + }, + "scope": { + "title": "Scope", + "type": "string" + }, + "slack_team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Slack Team Id" + }, + "start_without_form": { + "title": "Start Without Form", + "type": "boolean" + }, + "trigger_id": { + "format": "uuid", + "title": "Trigger Id", + "type": "string" + }, + "turns_anyone": { + "title": "Turns Anyone", + "type": "boolean" + }, + "turns_enabled": { + "title": "Turns Enabled", + "type": "boolean" + }, + "visibility": { + "title": "Visibility", + "type": "string" + } + }, + "required": [ + "trigger_id", + "agent_id", + "mcp_client_id", + "slack_team_id", + "form", + "scope", + "allow_dms", + "activation", + "visibility", + "start_without_form", + "turns_enabled", + "turns_anyone", + "max_turns", + "include_invoker_email", + "notify_failure_after_answer", + "channel_ids", + "missing_scopes" + ], + "title": "SlackTriggerConfigApiResponse", + "type": "object" + }, + "SlackTriggerScope": { + "enum": [ + "selected_channels", + "bot_channels" + ], + "title": "SlackTriggerScope", + "type": "string" + }, + "SolutionSourceConnectionResponse": { + "properties": { + "id": { + "format": "uuid", + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "id", + "name" ], "title": "SolutionSourceConnectionResponse", "type": "object" @@ -8161,7 +8603,7 @@ }, "held_for_review": { "default": false, - "description": "An ENFORCE governance policy blocked this item at import. It is held for review and is not retrievable: resolving its blocking evaluations releases it into the source, and it is purged when the hold window ends.", + "description": "An ENFORCE governance policy blocked this item at import. It is held for review and is not retrievable: resolving its blocking evaluations releases it into the source; left unresolved, it is purged when the hold window ends.", "title": "Held For Review", "type": "boolean" }, @@ -8206,6 +8648,18 @@ "title": "Pulled At", "type": "string" }, + "release_waiting_reason": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Set on a held item review approved whose release was refused: why it waits, the account being unable to pay for it or the source's spend limit having no room for it. Its release is retried; null until one is refused.", + "title": "Release Waiting Reason" + }, "source_connection_content_version_id": { "anyOf": [ { @@ -8215,7 +8669,7 @@ "type": "null" } ], - "description": "ID to pass to `GET /contents/{id}`. `null` until the item has finished indexing \u2014 an item that is still processing, or that failed, has no retrievable content and keeps this `null`.", + "description": "ID to pass to `GET /contents/{id}`. `null` while the item has no retrievable content.", "title": "Source Connection Content Version Id" }, "title": { @@ -8684,6 +9138,18 @@ ], "description": "Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom." }, + "max_credits_per_period": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "The source's spend limit: credits it may commit per billing period. Null when it has none.", + "title": "Max Credits Per Period" + }, "media_types": { "description": "Media kinds in a web page's main content that are attached to the page's item and indexed (subset of ['images', 'video']). On a website or RSS source 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files.", "items": { @@ -8780,6 +9246,22 @@ "title": "Source Type", "type": "string" }, + "spend_cap_action": { + "$ref": "#/components/schemas/SpendCapAction", + "default": "stop", + "description": "What the source does once it reaches its spend limit." + }, + "spend_cap_delete_order": { + "$ref": "#/components/schemas/SpendCapDeleteOrder", + "default": "oldest_added", + "description": "Which entries a `delete` spend limit removes first." + }, + "spend_cap_reached": { + "default": false, + "description": "True while the spend limit refuses uploads and email to this source.", + "title": "Spend Cap Reached", + "type": "boolean" + }, "system_managed": { "default": false, "description": "Indicates if this source is automatically managed by the system (e.g., agent traces).", @@ -8823,6 +9305,24 @@ "title": "SourceResponse", "type": "object" }, + "SpendCapAction": { + "enum": [ + "stop", + "delete" + ], + "title": "SpendCapAction", + "type": "string" + }, + "SpendCapDeleteOrder": { + "description": "Which entries a DELETE cap removes first.", + "enum": [ + "oldest_added", + "oldest_published", + "largest_first" + ], + "title": "SpendCapDeleteOrder", + "type": "string" + }, "StandaloneTestCompactionRequest": { "description": "Request body for testing a compaction prompt *without* an existing bank.\n\nUsed on the create-memory-bank page where no bank ID exists yet.\n``compaction_prompt`` is required (no bank to fall back to).\nContent must come from ``sample_entries`` or ``generate_direction``\n(no existing entries to fetch).", "properties": { @@ -9739,6 +10239,19 @@ "description": "Kinds of file listed beside a feed item's content to attach to the item and index, on an RSS source. Subset of ['enclosures', 'item_image', 'media_rss']; any other value is refused. [] attaches none. Applies to items added after it changes. Omit the field to leave it unchanged.", "title": "Feed Attachments" }, + "max_credits_per_period": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Spend limit: the credits this source may commit per billing period \u2014 what the account was charged for it this period plus the storage of what it holds until the period ends. Send null to remove the limit; omit to leave it unchanged.", + "title": "Max Credits Per Period" + }, "media_types": { "anyOf": [ { @@ -9791,6 +10304,28 @@ ], "description": "New retention period in days \u2014 content older than this is deleted permanently. Send null to clear the window: content is then kept indefinitely. Omit the field to leave it unchanged.", "title": "Retention Days" + }, + "spend_cap_action": { + "anyOf": [ + { + "$ref": "#/components/schemas/SpendCapAction" + }, + { + "type": "null" + } + ], + "description": "Once the limit is reached: `stop` refuses new content; `delete` deletes entries, in `spend_cap_delete_order`, to make room, and refuses new content as `stop` does once spend already fills the limit. Deleting does not return credits already spent." + }, + "spend_cap_delete_order": { + "anyOf": [ + { + "$ref": "#/components/schemas/SpendCapDeleteOrder" + }, + { + "type": "null" + } + ], + "description": "Which entries `delete` removes first: `oldest_added`, `oldest_published` or `largest_first`." } }, "title": "UpdateSourceBody", @@ -10325,9 +10860,15 @@ "type": "null" } ], - "description": "Template to initialize the agent from. Values: blank, retrieval_example, simple_qa, summarizer, json_extractor, content_change_notifier, scheduled_report, webhook_pipeline.", + "description": "Agent gallery entry to start from: a `key` from GET /agents/examples, or `blank`. The keys retrieval_example and simple_qa remain accepted for their gallery entries.", "title": "Agent Template" }, + "create_missing_resources": { + "default": false, + "description": "For an `agent_template`: create each creatable resource slot left out of `resource_bindings`, and group the agent with them in a new solution. When false, an unbound slot the template needs is an error.", + "title": "Create Missing Resources", + "type": "boolean" + }, "description": { "anyOf": [ { @@ -10360,11 +10901,33 @@ "title": "Name", "type": "string" }, + "resource_bindings": { + "anyOf": [ + { + "additionalProperties": { + "format": "uuid", + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "For an `agent_template`: the existing resource to use for each of the template's resource slots, as {slot: resource_id}. GET /agents/examples lists each template's slots.", + "title": "Resource Bindings" + }, "trigger_type": { - "default": "dynamic_input", - "description": "Trigger type: dynamic_input, template_input, schedule, new_content, email_received.", - "title": "Trigger Type", - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Defaults to dynamic_input, or to the template's own trigger type for an `agent_template` without `agent_definition`.", + "title": "Trigger Type" } }, "required": [ @@ -10498,6 +11061,12 @@ "description": "Optional payload in the same format produced by GET /agents/{id}/export. When provided, agent metadata fields the request does not set explicitly are taken from the payload, and the agent's workflow is replaced from `agent.definition`. The previous version is preserved in history. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload.", "title": "Agent Definition" }, + "apply_import_run_limits": { + "default": false, + "description": "With `agent_definition`, also replace the agent's run limits with the payload's (a null there removes a limit). Off by default: the agent keeps its limits.", + "title": "Apply Import Run Limits", + "type": "boolean" + }, "default_evaluation_tier": { "anyOf": [ { @@ -10549,6 +11118,32 @@ "description": "Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'.", "title": "Evaluation Mode" }, + "max_credits_per_period": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Credit limit per billing period of the paying account: once reached, runs stop at their next step and new runs are refused.", + "title": "Max Credits Per Period" + }, + "max_credits_per_run": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Credit limit per run: a run that reaches it is stopped before its next step.", + "title": "Max Credits Per Run" + }, "max_retries": { "anyOf": [ { @@ -10561,6 +11156,45 @@ "description": "Max retries for eval_and_retry mode (1-10).", "title": "Max Retries" }, + "max_runs_per_day": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Runs per day; at most the plan's run quota.", + "title": "Max Runs Per Day" + }, + "max_runs_per_hour": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Runs per hour; at most the plan's run quota.", + "title": "Max Runs Per Hour" + }, + "max_runs_total": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Runs in total; once reached, new runs are refused.", + "title": "Max Runs Total" + }, "name": { "anyOf": [ { @@ -10642,6 +11276,36 @@ "title": "Set Default Evaluation Tier", "type": "boolean" }, + "set_max_credits_per_period": { + "default": false, + "description": "When true and max_credits_per_period is omitted, removes the limit.", + "title": "Set Max Credits Per Period", + "type": "boolean" + }, + "set_max_credits_per_run": { + "default": false, + "description": "When true and max_credits_per_run is omitted, removes the limit.", + "title": "Set Max Credits Per Run", + "type": "boolean" + }, + "set_max_runs_per_day": { + "default": false, + "description": "When true and max_runs_per_day is omitted, removes the limit.", + "title": "Set Max Runs Per Day", + "type": "boolean" + }, + "set_max_runs_per_hour": { + "default": false, + "description": "When true and max_runs_per_hour is omitted, removes the limit.", + "title": "Set Max Runs Per Hour", + "type": "boolean" + }, + "set_max_runs_total": { + "default": false, + "description": "When true and max_runs_total is omitted, removes the limit.", + "title": "Set Max Runs Total", + "type": "boolean" + }, "set_prompt_model_auto_rollback_triggers": { "default": false, "description": "When true and prompt_model_auto_rollback_triggers is omitted, clears the list to null (revert to system defaults).", @@ -13663,7 +14327,7 @@ ] }, "post": { - "description": "Create a new agent.\n\nTrigger types:\n- `dynamic_input`: triggered via API with user-provided input\n- `template_input`: triggered via API with a predefined template\n- `schedule`: triggered on a schedule\n- `new_content`: triggered when new content arrives\n- `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`, using the `trigger_id` this response returns.\n\nTemplates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline`\n\nImporting an existing agent:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; items that don't resolve in this account are reported in the response's `import_warnings` array.\n- Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: target_uuid}` on this call to substitute them before save.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account.", + "description": "Create a new agent.\n\nTrigger types:\n- `dynamic_input`: triggered via API with user-provided input\n- `template_input`: triggered via API with a predefined template\n- `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`, using the `trigger_id` this response returns.\n\nStarting from the agent gallery:\n- Pass a `key` from `GET /agents/examples` as `agent_template`, or `blank` for an empty agent.\n- Bind the template's resource slots to existing resources with `resource_bindings`, or set `create_missing_resources` to have the creatable ones created.\n\nImporting an existing agent:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; items that don't resolve in this account are reported in the response's `import_warnings` array.\n- Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: target_uuid}` on this call to substitute them before save.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account.", "operationId": "create_agent_api_agents_post", "parameters": [ { @@ -14883,6 +15547,127 @@ ] } }, + "/agents/examples": { + "get": { + "description": "List the agent gallery: example agents to start from, searchable by text and filterable by use case. Pass an entry's `key` as `agent_template` on POST /agents, with `resource_bindings` for the resources it needs.", + "operationId": "list_agent_examples_api_agents_examples_get", + "parameters": [ + { + "description": "Words every match must contain.", + "in": "query", + "name": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Words every match must contain.", + "title": "Query" + } + }, + { + "description": "Only entries for this use case.", + "in": "query", + "name": "use_case", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Only entries for this use case.", + "title": "Use Case" + } + }, + { + "description": "Page number", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "description": "Page number", + "minimum": 1, + "title": "Page", + "type": "integer" + } + }, + { + "description": "Items per page", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 20, + "description": "Items per page", + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentExampleListResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", + "schema": { + "type": "integer" + } + } + } + } + }, + "summary": "List agent gallery examples", + "tags": [ + "agents" + ] + } + }, "/agents/inbound-email-rejections": { "get": { "description": "List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, unknown alias, spam/virus, flood-shed) for this account's agents.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", @@ -15524,7 +16309,7 @@ ] }, "put": { - "description": "Update an agent's name, description, evaluation settings, and model lifecycle settings.\n\nEvaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, `sampling_config`.\n\nModel lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', 'governance_block', 'agent_run_failed').\n\nReplacing the workflow from an export:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only touches the workflow + agent metadata \u2014 alert_configs, evaluation_criteria, governance_policies, schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints for those, or `POST /agents` to import as a new agent).\n- `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same shape as `POST /agents`).\n\nAt least one field must be provided.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account.", + "description": "Update an agent's name, description, evaluation settings, model lifecycle settings and run limits.\n\nEvaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, `sampling_config`.\n\nModel lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', 'governance_block', 'agent_run_failed').\n\nRun limits (each must be greater than 0; pass the paired `set_: true` with the value omitted to remove one): `max_credits_per_run`, `max_credits_per_period`, `max_runs_per_hour`, `max_runs_per_day`, `max_runs_total`. A runs-per-hour or per-day value above the plan's run quota is rejected with 400.\n\nReplacing the workflow from an export:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only touches the workflow + agent metadata \u2014 alert_configs, evaluation_criteria, governance_policies, schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints for those, or `POST /agents` to import as a new agent).\n- `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same shape as `POST /agents`).\n\nAt least one field must be provided.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account.", "operationId": "update_agent_api_agents__agent_id__put", "parameters": [ { @@ -17658,6 +18443,94 @@ ] } }, + "/agents/{agent_id}/triggers/{trigger_id}/slack-config": { + "put": { + "description": "Set the Slack connection, form, channels, visibility and conversation settings of an agent's SLACK_COMMAND trigger, which people run from Slack with `/seclai` or the message shortcut. Omitted fields are left unchanged.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account.", + "operationId": "set_slack_trigger_config_api_api_agents__agent_id__triggers__trigger_id__slack_config_put", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Agent Id", + "type": "string" + } + }, + { + "in": "path", + "name": "trigger_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Trigger Id", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/X-Account-Id" + }, + { + "$ref": "#/components/parameters/Seclai-Version" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetSlackTriggerConfigApiRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SlackTriggerConfigApiResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", + "schema": { + "type": "integer" + } + } + } + } + }, + "summary": "Configure a SLACK_COMMAND trigger", + "tags": [ + "agents" + ] + } + }, "/agents/{agent_id}/upload-input": { "post": { "description": "Upload a file to use as input for a `dynamic_input` agent run. Any other agent rejects the upload with HTTP 400.\n\n**Size limit:** 200 MB per file.\n\nFrom `Seclai-Version: 2026-10-16` a file of any type is accepted and is `ready` at once: pass `input_upload_id` to `POST /agents/{agent_id}/runs`. Each step receives the file itself when its model reads that type, and otherwise its text (OCR, extraction or transcript), made once for the steps that need it; a type nothing reads or converts is passed on as a file only. `input` carries a `# filename` heading per file.\n\nEarlier versions accept only these extensions: avi, bmp, csv, docx, epub, flac, gif, html, jpg, json, m4a, markdown, md, mov, mp3, mp4, msg, ogg, pdf, png, ppt, pptx, svg, tiff, txt, wav, webp, xls, xlsx, xml, zip. They write each file's text into `input`, so poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready` before running.\n\nThe agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention (the agent-traces source's retention period; free default 7 days).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", @@ -18683,7 +19556,7 @@ ] }, "post": { - "description": "Create a new alert configuration.\n\nAgent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, model_deprecated, model_sunset.\nSource alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike.\n\nDistribution types: owner, owner_admins, selected_members. Organization accounts are normalized to owner_admins.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", + "description": "Create a new alert configuration.\n\nAgent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, model_deprecated, model_sunset.\nSource alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike, source_spend_limit_reached (needs source_connection_id).\n\nDistribution types: owner, owner_admins, selected_members. Organization accounts are normalized to owner_admins.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", "operationId": "create_alert_config_api_alerts_configs_post", "parameters": [ { @@ -26487,7 +27360,7 @@ ] }, "put": { - "description": "Update a content source's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nSystem-managed sources only allow `retention_days` updates.", + "description": "Update a content source's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nSystem-managed sources only allow `retention_days` updates.\n\nA source with a spend limit that reaches it refuses new content with a 402 `source_spend_limit_reached` (`spend_cap_action: stop`), or deletes entries to make room (`delete`); a `delete` source whose spend already fills the limit refuses new content too.", "operationId": "update_source_api_sources__source_connection_id__put", "parameters": [ { @@ -28023,8 +28896,9 @@ "2026-10-16", "2026-10-18", "2026-10-19", - "2026-10-21" + "2026-10-21", + "2026-10-28" ], - "latest": "2026-10-21" + "latest": "2026-10-28" } } diff --git a/src/client.ts b/src/client.ts index 038541c..34bf3ef 100644 --- a/src/client.ts +++ b/src/client.ts @@ -178,6 +178,23 @@ import type { UpdateSolutionRequest, UpdateSourceBody, UploadAgentInputApiResponse, + AgentExampleListResponse, + ListAgentExamplesOptions, + SetSlackTriggerConfigRequest, + SlackTriggerConfigResponse, + ListSolutionsOptions, + ListMemoryBanksOptions, + ListEvaluationResultsOptions, + ListAgentEvaluationResultsOptions, + ListEvaluationRunsOptions, + ListCompatibleRunsOptions, + DateRangeOptions, + LastConversationOptions, + ListAlertsOptions, + ListAlertConfigsOptions, + ListOrganizationAlertPreferencesOptions, + ListModelAlertsOptions, + ModelRecommendationsOptions, } from "./types"; /** Default API base URL (can be overridden with `baseUrl` or `SECLAI_API_URL`). */ @@ -917,6 +934,21 @@ export class Seclai { })) as AgentListResponse; } + /** + * List the agent gallery: example agents to start from. + * + * Pass an entry's `key` as `agent_template` to {@link createAgent}, with + * `resource_bindings` for the resources it needs. + * + * @param opts - Text search, use-case filter and pagination. + * @returns A page of gallery entries. + */ + async listAgentExamples(opts: ListAgentExamplesOptions = {}): Promise { + return (await this.request("GET", "/agents/examples", { + query: { query: opts.query, use_case: opts.useCase, page: opts.page, limit: opts.limit }, + })) as AgentExampleListResponse; + } + /** * Create a new agent. * @@ -1735,12 +1767,22 @@ export class Seclai { * List evaluation results for a specific criteria. * * @param criteriaId - Criteria identifier. - * @param opts - Pagination options. + * @param opts - Pagination, status, flag and time-range filters. */ - async listEvaluationResults(criteriaId: string, opts: ListOptions = {}): Promise { + async listEvaluationResults( + criteriaId: string, + opts: ListEvaluationResultsOptions = {}, + ): Promise { return keyedList( await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/results`, { - query: { page: opts.page, limit: opts.limit }, + query: { + page: opts.page, + limit: opts.limit, + status: opts.status, + flagged_only: opts.flaggedOnly, + time_from: opts.timeFrom, + time_to: opts.timeTo, + }, }), "data", PAGE_COUNTERS, @@ -1762,12 +1804,12 @@ export class Seclai { * List runs compatible with a specific evaluation criteria. * * @param criteriaId - Criteria identifier. - * @param opts - Pagination options. + * @param opts - Pagination and a `startedAfter` filter. */ - async listCompatibleRuns(criteriaId: string, opts: ListOptions = {}): Promise { + async listCompatibleRuns(criteriaId: string, opts: ListCompatibleRunsOptions = {}): Promise { return keyedList( await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/compatible-runs`, { - query: { page: opts.page, limit: opts.limit }, + query: { page: opts.page, limit: opts.limit, started_after: opts.startedAfter }, }), "data", PAGE_COUNTERS, @@ -1789,12 +1831,23 @@ export class Seclai { * List all evaluation results for an agent. * * @param agentId - Agent identifier. - * @param opts - Pagination options. + * @param opts - Pagination, status, step, flag and time-range filters. */ - async listAgentEvaluationResults(agentId: string, opts: ListOptions = {}): Promise { + async listAgentEvaluationResults( + agentId: string, + opts: ListAgentEvaluationResultsOptions = {}, + ): Promise { return keyedList( await this.request("GET", `/agents/${agentId}/evaluation-results`, { - query: { page: opts.page, limit: opts.limit }, + query: { + page: opts.page, + limit: opts.limit, + status: opts.status, + step: opts.step, + flagged_only: opts.flaggedOnly, + time_from: opts.timeFrom, + time_to: opts.timeTo, + }, }), "data", PAGE_COUNTERS, @@ -1805,12 +1858,19 @@ export class Seclai { * List evaluation run summaries for an agent. * * @param agentId - Agent identifier. - * @param opts - Pagination options. + * @param opts - Pagination, status, step and time-range filters. */ - async listEvaluationRuns(agentId: string, opts: ListOptions = {}): Promise { + async listEvaluationRuns(agentId: string, opts: ListEvaluationRunsOptions = {}): Promise { return keyedList( await this.request("GET", `/agents/${agentId}/evaluation-runs`, { - query: { page: opts.page, limit: opts.limit }, + query: { + page: opts.page, + limit: opts.limit, + status: opts.status, + step: opts.step, + time_from: opts.timeFrom, + time_to: opts.timeTo, + }, }), "data", PAGE_COUNTERS, @@ -1821,10 +1881,14 @@ export class Seclai { * Get a summary of non-manual evaluations across an agent's runs. * * @param agentId - Agent identifier. + * @param opts - Date range; the server defaults to the last 30 days. */ - async getNonManualEvaluationSummary(agentId: string): Promise { + async getNonManualEvaluationSummary( + agentId: string, + opts: DateRangeOptions = {}, + ): Promise { return (await this.request("GET", "/agents/evaluation-results/non-manual-summary", { - query: { agent_id: agentId }, + query: { agent_id: agentId, days: opts.days, start_date: opts.startDate, end_date: opts.endDate }, })) as NonManualEvaluationSummaryResponse; } @@ -1855,6 +1919,32 @@ export class Seclai { })) as EmailTriggerConfigResponse; } + // ═══════════════════════════════════════════════════════════════════════════ + // Agent Slack Triggers + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Configure an agent's `SLACK_COMMAND` trigger, which people run from Slack + * with `/seclai` or the message shortcut. + * + * Sets the Slack connection, form, channels, reply visibility and conversation + * settings. Omitted fields are left unchanged. + * + * @param agentId - Agent identifier. + * @param triggerId - Trigger identifier. + * @param body - The fields to set. + * @returns The trigger's full Slack config, including any `missing_scopes`. + */ + async setSlackTriggerConfig( + agentId: string, + triggerId: string, + body: SetSlackTriggerConfigRequest, + ): Promise { + return (await this.request("PUT", `/agents/${agentId}/triggers/${triggerId}/slack-config`, { + json: body, + })) as SlackTriggerConfigResponse; + } + /** * Replace the input attachments a trigger accepts. * @@ -2092,13 +2182,13 @@ export class Seclai { /** * List memory banks. * - * @param opts - Pagination and sorting options. + * @param opts - Pagination, sorting and a `type` filter. * @returns Paginated list of memory banks. */ - async listMemoryBanks(opts: SortableListOptions = {}): Promise { + async listMemoryBanks(opts: ListMemoryBanksOptions = {}): Promise { return keyedList( await this.request("GET", "/memory_banks", { - query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }, + query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order, type: opts.type }, }), "memory_banks", PAGE_COUNTERS, @@ -2161,9 +2251,12 @@ export class Seclai { * Get stats for a memory bank. * * @param memoryBankId - Memory bank identifier. + * @param opts - Date range; the server defaults to the last 30 days. */ - async getMemoryBankStats(memoryBankId: string): Promise { - return await this.request("GET", `/memory_banks/${memoryBankId}/stats`); + async getMemoryBankStats(memoryBankId: string, opts: DateRangeOptions = {}): Promise { + return await this.request("GET", `/memory_banks/${memoryBankId}/stats`, { + query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate }, + }); } /** @@ -2224,9 +2317,13 @@ export class Seclai { /** * Get the last AI conversation for memory banks. + * + * @param opts - How many turns to return and skip. */ - async getMemoryBankAiLastConversation(): Promise { - return (await this.request("GET", "/memory_banks/ai-assistant/last-conversation")) as MemoryBankLastConversationResponse; + async getMemoryBankAiLastConversation(opts: LastConversationOptions = {}): Promise { + return (await this.request("GET", "/memory_banks/ai-assistant/last-conversation", { + query: { limit: opts.limit, offset: opts.offset }, + })) as MemoryBankLastConversationResponse; } /** @@ -2710,12 +2807,12 @@ export class Seclai { /** * List solutions. * - * @param opts - Pagination and sorting options. + * @param opts - Pagination, sorting and a name `search`. * @returns Paginated list of solutions. */ - async listSolutions(opts: SortableListOptions = {}): Promise { + async listSolutions(opts: ListSolutionsOptions = {}): Promise { return (await this.request("GET", "/solutions", { - query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }, + query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order, search: opts.search }, })) as SolutionListResponse; } @@ -2936,10 +3033,12 @@ export class Seclai { /** * List governance AI conversations. + * + * @param opts - `limit`: how many conversations (the server defaults to 20). */ - async listGovernanceAiConversations(): Promise { + async listGovernanceAiConversations(opts: { limit?: number } = {}): Promise { return listItems( - await this.request("GET", "/governance/ai-assistant/conversations"), + await this.request("GET", "/governance/ai-assistant/conversations", { query: { limit: opts.limit } }), ); } @@ -2972,13 +3071,21 @@ export class Seclai { * @param opts - Pagination and filter options. * @returns Paginated list of alerts. */ - async listAlerts(opts: ListOptions & { status?: string; severity?: string } = {}): Promise { + async listAlerts(opts: ListAlertsOptions = {}): Promise { // `severity` is deliberately not forwarded: GET /alerts declares no such // filter, so it never filtered anything, and sending it is a 422 once // `apiVersion` is 2026-07-27 or later. Accepted and dropped so existing // call sites keep working. return (await this.request("GET", "/alerts", { - query: { page: opts.page, limit: opts.limit, status: opts.status }, + query: { + page: opts.page, + limit: opts.limit, + status: opts.status, + agent_id: opts.agentId, + source_connection_id: opts.sourceConnectionId, + time_from: opts.timeFrom, + time_to: opts.timeTo, + }, })) as AlertListResponse; } @@ -3042,9 +3149,17 @@ export class Seclai { * `configs` and `total` are populated on every API version; `data` and * `pagination` are also present once `apiVersion` is 2026-07-27 or later. */ - async listAlertConfigs(opts: ListOptions = {}): Promise { + async listAlertConfigs(opts: ListAlertConfigsOptions = {}): Promise { return keyedList( - await this.request("GET", "/alerts/configs", { query: { page: opts.page, limit: opts.limit } }), + await this.request("GET", "/alerts/configs", { + query: { + page: opts.page, + limit: opts.limit, + agent_id: opts.agentId, + source_connection_id: opts.sourceConnectionId, + scope: opts.scope, + }, + }), "configs", ["total"], ); @@ -3094,10 +3209,16 @@ export class Seclai { /** * List organization alert preferences. + * + * @param opts - Organization filter, and whether to include default subscriptions. */ - async listOrganizationAlertPreferences(): Promise { + async listOrganizationAlertPreferences( + opts: ListOrganizationAlertPreferencesOptions = {}, + ): Promise { return keyedList( - await this.request("GET", "/alerts/organization-preferences/list"), + await this.request("GET", "/alerts/organization-preferences/list", { + query: { organization_id: opts.organizationId, include_defaults: opts.includeDefaults }, + }), "preferences", ["total"], ); @@ -3129,15 +3250,17 @@ export class Seclai { /** * List model alerts. * - * @param opts - Pagination options. + * @param opts - Pagination, an agent filter and `unreadOnly`. */ - async listModelAlerts(opts: ListOptions = {}): Promise { + async listModelAlerts(opts: ListModelAlertsOptions = {}): Promise { // The endpoint declares limit/offset, not page, so `page` was ignored and // every page after the first returned page 1. const limit = opts.limit ?? 50; const offset = opts.page && opts.page > 1 ? (opts.page - 1) * limit : undefined; return keyedList( - await this.request("GET", "/models/alerts", { query: { offset, limit: opts.limit } }), + await this.request("GET", "/models/alerts", { + query: { offset, limit: opts.limit, agent_id: opts.agentId, unread_only: opts.unreadOnly }, + }), "alerts", ["total"], ); @@ -3170,9 +3293,21 @@ export class Seclai { * Get model recommendations. * * @param modelId - Model identifier. + * @param opts - Capabilities and limits a recommended model must have. */ - async getModelRecommendations(modelId: string): Promise { - return (await this.request("GET", `/models/${modelId}/recommendations`)) as ModelRecommendationsResponse; + async getModelRecommendations( + modelId: string, + opts: ModelRecommendationsOptions = {}, + ): Promise { + return (await this.request("GET", `/models/${modelId}/recommendations`, { + query: { + require_tool_use: opts.requireToolUse, + require_structured_output: opts.requireStructuredOutput, + require_thinking: opts.requireThinking, + min_context_tokens: opts.minContextTokens, + min_output_tokens: opts.minOutputTokens, + }, + })) as ModelRecommendationsResponse; } /** @@ -3628,9 +3763,13 @@ export class Seclai { /** * Get AI assistant memory bank conversation history. + * + * @param opts - How many turns to return and skip. */ - async getAiAssistantMemoryBankHistory(): Promise { - return (await this.request("GET", "/ai-assistant/memory-bank/last-conversation")) as MemoryBankLastConversationResponse; + async getAiAssistantMemoryBankHistory(opts: LastConversationOptions = {}): Promise { + return (await this.request("GET", "/ai-assistant/memory-bank/last-conversation", { + query: { limit: opts.limit, offset: opts.offset }, + })) as MemoryBankLastConversationResponse; } /** diff --git a/src/index.ts b/src/index.ts index e8ae7ea..1802710 100644 --- a/src/index.ts +++ b/src/index.ts @@ -72,6 +72,20 @@ export type { PaginationResponse, ListOptions, SortableListOptions, + ListAgentExamplesOptions, + ListSolutionsOptions, + ListMemoryBanksOptions, + ListEvaluationResultsOptions, + ListAgentEvaluationResultsOptions, + ListEvaluationRunsOptions, + ListCompatibleRunsOptions, + DateRangeOptions, + LastConversationOptions, + ListAlertsOptions, + ListAlertConfigsOptions, + ListOrganizationAlertPreferencesOptions, + ListModelAlertsOptions, + ModelRecommendationsOptions, // Identity MeResponse, @@ -79,6 +93,7 @@ export type { // Agents AgentListResponse, + AgentExampleListResponse, AgentDefinitionResponse, AgentExportResponse, AgentSummaryResponse, @@ -97,6 +112,13 @@ export type { SetEmailTriggerConfigRequest, EmailTriggerConfigResponse, + // Agent Slack Triggers + SetSlackTriggerConfigRequest, + SlackTriggerConfigResponse, + SlackTriggerActivation, + SlackTriggerScope, + SlackReplyVisibility, + // Agent Email Governance AgentEmailOptOutResponse, AgentEmailOptOutListResponse, @@ -216,6 +238,8 @@ export type { SourceConnectionResponse, CreateSourceBody, UpdateSourceBody, + SpendCapAction, + SpendCapDeleteOrder, FileUploadResponse, InlineTextUploadRequest, InlineTextReplaceRequest, diff --git a/src/openapi.ts b/src/openapi.ts index b08e65c..4e4835e 100644 --- a/src/openapi.ts +++ b/src/openapi.ts @@ -27,11 +27,11 @@ export interface paths { * Trigger types: * - `dynamic_input`: triggered via API with user-provided input * - `template_input`: triggered via API with a predefined template - * - `schedule`: triggered on a schedule - * - `new_content`: triggered when new content arrives * - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`, using the `trigger_id` this response returns. * - * Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline` + * Starting from the agent gallery: + * - Pass a `key` from `GET /agents/examples` as `agent_template`, or `blank` for an empty agent. + * - Bind the template's resource slots to existing resources with `resource_bindings`, or set `create_missing_resources` to have the creatable ones created. * * Importing an existing agent: * - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; items that don't resolve in this account are reported in the response's `import_warnings` array. @@ -314,6 +314,26 @@ export interface paths { patch?: never; trace?: never; }; + "/agents/examples": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List agent gallery examples + * @description List the agent gallery: example agents to start from, searchable by text and filterable by use case. Pass an entry's `key` as `agent_template` on POST /agents, with `resource_bindings` for the resources it needs. + */ + get: operations["list_agent_examples_api_agents_examples_get"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/agents/inbound-email-rejections": { parameters: { query?: never; @@ -508,12 +528,14 @@ export interface paths { get: operations["get_agent_metadata_api_agents__agent_id__get"]; /** * Update agent metadata - * @description Update an agent's name, description, evaluation settings, and model lifecycle settings. + * @description Update an agent's name, description, evaluation settings, model lifecycle settings and run limits. * * Evaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, `sampling_config`. * * Model lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', 'governance_block', 'agent_run_failed'). * + * Run limits (each must be greater than 0; pass the paired `set_: true` with the value omitted to remove one): `max_credits_per_run`, `max_credits_per_period`, `max_runs_per_hour`, `max_runs_per_day`, `max_runs_total`. A runs-per-hour or per-day value above the plan's run quota is rejected with 400. + * * Replacing the workflow from an export: * - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only touches the workflow + agent metadata — alert_configs, evaluation_criteria, governance_policies, schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints for those, or `POST /agents` to import as a new agent). * - `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same shape as `POST /agents`). @@ -1143,6 +1165,28 @@ export interface paths { patch?: never; trace?: never; }; + "/agents/{agent_id}/triggers/{trigger_id}/slack-config": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Configure a SLACK_COMMAND trigger + * @description Set the Slack connection, form, channels, visibility and conversation settings of an agent's SLACK_COMMAND trigger, which people run from Slack with `/seclai` or the message shortcut. Omitted fields are left unchanged. + * + * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account. + */ + put: operations["set_slack_trigger_config_api_api_agents__agent_id__triggers__trigger_id__slack_config_put"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/agents/{agent_id}/upload-input": { parameters: { query?: never; @@ -1430,7 +1474,7 @@ export interface paths { * @description Create a new alert configuration. * * Agent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, model_deprecated, model_sunset. - * Source alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike. + * Source alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike, source_spend_limit_reached (needs source_connection_id). * * Distribution types: owner, owner_admins, selected_members. Organization accounts are normalized to owner_admins. * @@ -3481,6 +3525,8 @@ export interface paths { * @description Update a content source's configuration. Only provided fields are changed; omitted fields are left unchanged. * * System-managed sources only allow `retention_days` updates. + * + * A source with a spend limit that reaches it refuses new content with a 402 `source_spend_limit_reached` (`spend_cap_action: stop`), or deletes entries to make room (`delete`); a `delete` source whose spend already fills the limit refuses new content too. */ put: operations["update_source_api_sources__source_connection_id__put"]; /** @@ -4160,6 +4206,12 @@ export interface components { * @enum {string} */ AgentEvaluationTier: "fast" | "balanced" | "thorough"; + /** AgentExampleListResponse */ + AgentExampleListResponse: { + /** Data */ + data: unknown[]; + pagination: components["schemas"]["PaginationResponse"]; + }; /** * AgentExportResponse * @description Portable JSON snapshot of an agent definition. @@ -4167,7 +4219,7 @@ export interface components { AgentExportResponse: { /** * Agent - * @description Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, created_at, updated_at. + * @description Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, max_credits_per_run, max_credits_per_period, max_runs_per_hour, max_runs_per_day, max_runs_total, created_at, updated_at. */ agent: { [key: string]: unknown; @@ -4437,6 +4489,11 @@ export interface components { * @description Credits consumed by this step across every attempt it made. Some charges made outside any step, such as governance screening of the run's input, count toward the run's total but no step's. The timestamps above and the tool calls below describe the latest attempt only. */ credits_used: number; + /** + * Decision + * @description The arm an `if_else` or `switch` step took: `then` or `else`, or the case name or `else`. Null for other step types, until the step has decided, and when a `switch` took no arm. + */ + decision?: string | null; /** * Duration Seconds * @description Duration of the step attempt in seconds. @@ -4454,7 +4511,7 @@ export interface components { input: string | null; /** * Output - * @description Output text produced by the step, if any; its files are in `attachments`. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step output files and is not a `for_each`. + * @description Output text produced by the step, if any; its files are in `attachments`. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step output files and is not a `for_each`. For an `if_else` or `switch`, the result of the arm it took (its input when that arm is empty or it took none); below `Seclai-Version: 2026-10-28`, the `{"branch": ...}` marker naming that arm, with no `attachments`. */ output: string | null; /** @@ -4598,6 +4655,13 @@ export interface components { * @description ISO 8601 creation timestamp. */ created_at: string; + /** + * Created Resources + * @description On a create from an `agent_template`: {slot: resource_id} for each resource `create_missing_resources` created. + */ + created_resources?: { + [key: string]: string; + } | null; /** * Default Evaluation Tier * @description Default evaluation tier: fast, balanced, or thorough. @@ -4640,12 +4704,37 @@ export interface components { * @description One entry per item dropped or substituted during import. Present only on endpoints that accept agent_definition; null on non-import calls; [] when the import had no skips. */ import_warnings?: components["schemas"]["ImportSkipResponse"][] | null; + /** + * Max Credits Per Period + * @description Credit limit per billing period; null when none. + */ + max_credits_per_period?: number | null; + /** + * Max Credits Per Run + * @description Credit limit per run; null when none. + */ + max_credits_per_run?: number | null; /** * Max Retries * @description Max retries for eval_and_retry mode. * @default 3 */ max_retries: number; + /** + * Max Runs Per Day + * @description Runs per day limit; null when none. + */ + max_runs_per_day?: number | null; + /** + * Max Runs Per Hour + * @description Runs per hour limit; null when none. + */ + max_runs_per_hour?: number | null; + /** + * Max Runs Total + * @description Limit on runs in total; null when none. + */ + max_runs_total?: number | null; /** * Name * @description Agent name. @@ -4681,6 +4770,11 @@ export interface components { sampling_config?: { [key: string]: unknown; } | null; + /** + * Solution Id + * @description On a create from an `agent_template` that created resources: the solution grouping the agent with them. + */ + solution_id?: string | null; /** * Trigger Id * @description ID of the agent's trigger, for the `/agents/{agent_id}/triggers/{trigger_id}/…` endpoints such as `accepted-attachments` and `email-config`. @@ -6164,7 +6258,7 @@ export interface components { id: string; /** * Reason - * @description Why it was refused: sender_not_allowed, unauthenticated_sender, unreadable_from, sender_blocked, spam, virus, unsafe_content, rate_limited, account_not_chargeable or empty_message; or, for a message the source received before, what became of the earlier one: repeat_stored, repeat_held, repeat_deleted or repeat_in_progress. + * @description Why it was refused: sender_not_allowed, unauthenticated_sender, unreadable_from, sender_blocked, spam, virus, unsafe_content, rate_limited, account_not_chargeable, spend_limit_reached or empty_message; or, for a message the source received before, what became of the earlier one: repeat_stored, repeat_held, repeat_deleted or repeat_in_progress. */ reason: string; /** @@ -7873,7 +7967,7 @@ export interface components { SetAcceptedAttachmentsRequest: { /** * Accepted Attachments - * @description The input attachments the trigger accepts; ``null`` accepts any files (one attachment named ``files``). Only ``dynamic_input`` and ``email_received`` triggers take files. + * @description The input attachments the trigger accepts; ``null`` accepts any files (one attachment named ``files``). Only ``dynamic_input``, ``email_received`` and ``slack_command`` triggers take files. */ accepted_attachments: components["schemas"]["AcceptedAttachmentSlot"][] | null; }; @@ -7885,6 +7979,54 @@ export interface components { /** Mode */ mode: string; }; + /** + * SetSlackTriggerConfigApiRequest + * @description Omitted fields are left unchanged. + */ + SetSlackTriggerConfigApiRequest: { + /** @description `everywhere` in scope, or `channel_opt_in`. */ + activation?: components["schemas"]["SlackTriggerActivation"] | null; + /** + * Allow Dms + * @description Runnable in the app's own DMs. + */ + allow_dms?: boolean | null; + /** Channel Ids */ + channel_ids?: string[] | null; + /** + * Form + * @description Form fields `{key, label, type, required, hint, choices, max_length}`. `type`: short_text, long_text, number, single_choice, multi_choice, yes_no, date, slack_user or slack_channel. Each value reaches the run as `{{metadata.}}`. + */ + form?: { + [key: string]: unknown; + }[] | null; + /** Include Invoker Email */ + include_invoker_email?: boolean | null; + /** + * Input + * @description The trigger's input template. Each `{{metadata.}}` in it must be a form field key or a platform key; it is checked together with `form`. + */ + input?: string | null; + /** Max Turns */ + max_turns?: number | null; + /** + * Mcp Client Id + * @description The account's connected Slack (Bot) MCP client. + */ + mcp_client_id?: string | null; + /** Notify Failure After Answer */ + notify_failure_after_answer?: boolean | null; + /** @description `selected_channels` (see `channel_ids`) or `bot_channels`. */ + scope?: components["schemas"]["SlackTriggerScope"] | null; + /** Start Without Form */ + start_without_form?: boolean | null; + /** Turns Anyone */ + turns_anyone?: boolean | null; + /** Turns Enabled */ + turns_enabled?: boolean | null; + /** @description `channel`, or `private` (replies in the person's DM). */ + visibility?: components["schemas"]["SlackReplyVisibility"] | null; + }; /** * SkippedAttachmentReason * @enum {string} @@ -7913,6 +8055,69 @@ export interface components { */ size_bytes: number | null; }; + /** + * SlackReplyVisibility + * @enum {string} + */ + SlackReplyVisibility: "channel" | "private"; + /** + * SlackTriggerActivation + * @enum {string} + */ + SlackTriggerActivation: "everywhere" | "channel_opt_in"; + /** SlackTriggerConfigApiResponse */ + SlackTriggerConfigApiResponse: { + /** Activation */ + activation: string; + /** + * Agent Id + * Format: uuid + */ + agent_id: string; + /** Allow Dms */ + allow_dms: boolean; + /** Channel Ids */ + channel_ids: string[]; + /** Form */ + form: { + [key: string]: unknown; + }[]; + /** Include Invoker Email */ + include_invoker_email: boolean; + /** Max Turns */ + max_turns: number | null; + /** Mcp Client Id */ + mcp_client_id: string | null; + /** + * Missing Scopes + * @description Scopes the Slack connection lacks for optional features. + */ + missing_scopes: string[]; + /** Notify Failure After Answer */ + notify_failure_after_answer: boolean; + /** Scope */ + scope: string; + /** Slack Team Id */ + slack_team_id: string | null; + /** Start Without Form */ + start_without_form: boolean; + /** + * Trigger Id + * Format: uuid + */ + trigger_id: string; + /** Turns Anyone */ + turns_anyone: boolean; + /** Turns Enabled */ + turns_enabled: boolean; + /** Visibility */ + visibility: string; + }; + /** + * SlackTriggerScope + * @enum {string} + */ + SlackTriggerScope: "selected_channels" | "bot_channels"; /** SolutionSourceConnectionResponse */ SolutionSourceConnectionResponse: { /** @@ -8079,7 +8284,7 @@ export interface components { extracted_media_limit?: number | null; /** * Held For Review - * @description An ENFORCE governance policy blocked this item at import. It is held for review and is not retrievable: resolving its blocking evaluations releases it into the source, and it is purged when the hold window ends. + * @description An ENFORCE governance policy blocked this item at import. It is held for review and is not retrievable: resolving its blocking evaluations releases it into the source; left unresolved, it is purged when the hold window ends. * @default false */ held_for_review: boolean; @@ -8103,9 +8308,14 @@ export interface components { * @description Timestamp when the item was uploaded or pulled. */ pulled_at: string; + /** + * Release Waiting Reason + * @description Set on a held item review approved whose release was refused: why it waits, the account being unable to pay for it or the source's spend limit having no room for it. Its release is retried; null until one is refused. + */ + release_waiting_reason?: string | null; /** * Source Connection Content Version Id - * @description ID to pass to `GET /contents/{id}`. `null` until the item has finished indexing — an item that is still processing, or that failed, has no retrievable content and keeps this `null`. + * @description ID to pass to `GET /contents/{id}`. `null` while the item has no retrievable content. */ source_connection_content_version_id: string | null; /** @@ -8313,6 +8523,11 @@ export interface components { id: string; /** @description Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom. */ index_mode?: components["schemas"]["SourceIndexMode"] | null; + /** + * Max Credits Per Period + * @description The source's spend limit: credits it may commit per billing period. Null when it has none. + */ + max_credits_per_period?: number | null; /** * Media Types * @description Media kinds in a web page's main content that are attached to the page's item and indexed (subset of ['images', 'video']). On a website or RSS source 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files. @@ -8364,6 +8579,22 @@ export interface components { * @description Type of the source connection. */ source_type: string; + /** + * @description What the source does once it reaches its spend limit. + * @default stop + */ + spend_cap_action: components["schemas"]["SpendCapAction"]; + /** + * @description Which entries a `delete` spend limit removes first. + * @default oldest_added + */ + spend_cap_delete_order: components["schemas"]["SpendCapDeleteOrder"]; + /** + * Spend Cap Reached + * @description True while the spend limit refuses uploads and email to this source. + * @default false + */ + spend_cap_reached: boolean; /** * System Managed * @description Indicates if this source is automatically managed by the system (e.g., agent traces). @@ -8381,6 +8612,17 @@ export interface components { */ url: string | null; }; + /** + * SpendCapAction + * @enum {string} + */ + SpendCapAction: "stop" | "delete"; + /** + * SpendCapDeleteOrder + * @description Which entries a DELETE cap removes first. + * @enum {string} + */ + SpendCapDeleteOrder: "oldest_added" | "oldest_published" | "largest_first"; /** * StandaloneTestCompactionRequest * @description Request body for testing a compaction prompt *without* an existing bank. @@ -8793,6 +9035,11 @@ export interface components { * @description Kinds of file listed beside a feed item's content to attach to the item and index, on an RSS source. Subset of ['enclosures', 'item_image', 'media_rss']; any other value is refused. [] attaches none. Applies to items added after it changes. Omit the field to leave it unchanged. */ feed_attachments?: string[] | null; + /** + * Max Credits Per Period + * @description Spend limit: the credits this source may commit per billing period — what the account was charged for it this period plus the storage of what it holds until the period ends. Send null to remove the limit; omit to leave it unchanged. + */ + max_credits_per_period?: number | null; /** * Media Types * @description Media kinds in a web page's main content to attach to the page's item and index, on a website or RSS source. Subset of ['images', 'video']. From `Seclai-Version: 2026-10-13` any other value, and any kind on another source type, is refused with a 400; older versions drop an unknown value and store the rest. A kind the source's embedder cannot index is stored and not indexed (see `supported_input_media` on GET /models/embedders). [] attaches no media from web pages. 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files. Applies to pages and documents added after it changes. @@ -8813,6 +9060,10 @@ export interface components { * @description New retention period in days — content older than this is deleted permanently. Send null to clear the window: content is then kept indefinitely. Omit the field to leave it unchanged. */ retention_days?: number | null; + /** @description Once the limit is reached: `stop` refuses new content; `delete` deletes entries, in `spend_cap_delete_order`, to make room, and refuses new content as `stop` does once spend already fills the limit. Deleting does not return credits already spent. */ + spend_cap_action?: components["schemas"]["SpendCapAction"] | null; + /** @description Which entries `delete` removes first: `oldest_added`, `oldest_published` or `largest_first`. */ + spend_cap_delete_order?: components["schemas"]["SpendCapDeleteOrder"] | null; }; /** UploadAgentInputApiResponse */ UploadAgentInputApiResponse: { @@ -9072,9 +9323,15 @@ export interface components { } | null; /** * Agent Template - * @description Template to initialize the agent from. Values: blank, retrieval_example, simple_qa, summarizer, json_extractor, content_change_notifier, scheduled_report, webhook_pipeline. + * @description Agent gallery entry to start from: a `key` from GET /agents/examples, or `blank`. The keys retrieval_example and simple_qa remain accepted for their gallery entries. */ agent_template?: string | null; + /** + * Create Missing Resources + * @description For an `agent_template`: create each creatable resource slot left out of `resource_bindings`, and group the agent with them in a new solution. When false, an unbound slot the template needs is an error. + * @default false + */ + create_missing_resources: boolean; /** * Description * @description Optional description. @@ -9092,12 +9349,18 @@ export interface components { * @description Name for the new agent. */ name: string; + /** + * Resource Bindings + * @description For an `agent_template`: the existing resource to use for each of the template's resource slots, as {slot: resource_id}. GET /agents/examples lists each template's slots. + */ + resource_bindings?: { + [key: string]: string; + } | null; /** * Trigger Type - * @description Trigger type: dynamic_input, template_input, schedule, new_content, email_received. - * @default dynamic_input + * @description Defaults to dynamic_input, or to the template's own trigger type for an `agent_template` without `agent_definition`. */ - trigger_type: string; + trigger_type?: string | null; }; /** * GovernancePolicyRefResponse @@ -9163,6 +9426,12 @@ export interface components { agent_definition?: { [key: string]: unknown; } | null; + /** + * Apply Import Run Limits + * @description With `agent_definition`, also replace the agent's run limits with the payload's (a null there removes a limit). Off by default: the agent keeps its limits. + * @default false + */ + apply_import_run_limits: boolean; /** * Default Evaluation Tier * @description Default evaluation tier: 'fast', 'balanced', or 'thorough'. @@ -9185,11 +9454,36 @@ export interface components { * @description Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'. */ evaluation_mode?: string | null; + /** + * Max Credits Per Period + * @description Credit limit per billing period of the paying account: once reached, runs stop at their next step and new runs are refused. + */ + max_credits_per_period?: number | null; + /** + * Max Credits Per Run + * @description Credit limit per run: a run that reaches it is stopped before its next step. + */ + max_credits_per_run?: number | null; /** * Max Retries * @description Max retries for eval_and_retry mode (1-10). */ max_retries?: number | null; + /** + * Max Runs Per Day + * @description Runs per day; at most the plan's run quota. + */ + max_runs_per_day?: number | null; + /** + * Max Runs Per Hour + * @description Runs per hour; at most the plan's run quota. + */ + max_runs_per_hour?: number | null; + /** + * Max Runs Total + * @description Runs in total; once reached, new runs are refused. + */ + max_runs_total?: number | null; /** * Name * @description New name for the agent. @@ -9225,6 +9519,36 @@ export interface components { * @default false */ set_default_evaluation_tier: boolean; + /** + * Set Max Credits Per Period + * @description When true and max_credits_per_period is omitted, removes the limit. + * @default false + */ + set_max_credits_per_period: boolean; + /** + * Set Max Credits Per Run + * @description When true and max_credits_per_run is omitted, removes the limit. + * @default false + */ + set_max_credits_per_run: boolean; + /** + * Set Max Runs Per Day + * @description When true and max_runs_per_day is omitted, removes the limit. + * @default false + */ + set_max_runs_per_day: boolean; + /** + * Set Max Runs Per Hour + * @description When true and max_runs_per_hour is omitted, removes the limit. + * @default false + */ + set_max_runs_per_hour: boolean; + /** + * Set Max Runs Total + * @description When true and max_runs_total is omitted, removes the limit. + * @default false + */ + set_max_runs_total: boolean; /** * Set Prompt Model Auto Rollback Triggers * @description When true and prompt_model_auto_rollback_triggers is omitted, clears the list to null (revert to system defaults). @@ -11368,6 +11692,60 @@ export interface operations { }; }; }; + list_agent_examples_api_agents_examples_get: { + parameters: { + query?: { + /** @description Words every match must contain. */ + query?: string | null; + /** @description Only entries for this use case. */ + use_case?: string | null; + /** @description Page number */ + page?: number; + /** @description Items per page */ + limit?: number; + }; + header?: { + /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ + "X-Account-Id"?: components["parameters"]["X-Account-Id"]; + /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ + "Seclai-Version"?: components["parameters"]["Seclai-Version"]; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["AgentExampleListResponse"]; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ + 503: { + headers: { + /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ + "Retry-After"?: number; + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ServiceUnavailableError"]; + }; + }; + }; + }; list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get: { parameters: { query?: { @@ -13065,6 +13443,58 @@ export interface operations { }; }; }; + set_slack_trigger_config_api_api_agents__agent_id__triggers__trigger_id__slack_config_put: { + parameters: { + query?: never; + header?: { + /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ + "X-Account-Id"?: components["parameters"]["X-Account-Id"]; + /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ + "Seclai-Version"?: components["parameters"]["Seclai-Version"]; + }; + path: { + agent_id: string; + trigger_id: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["SetSlackTriggerConfigApiRequest"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["SlackTriggerConfigApiResponse"]; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ + 503: { + headers: { + /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ + "Retry-After"?: number; + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ServiceUnavailableError"]; + }; + }; + }; + }; api_upload_agent_input_api_agents__agent_id__upload_input_post: { parameters: { query?: never; diff --git a/src/types.ts b/src/types.ts index 2f6bbc4..0994363 100644 --- a/src/types.ts +++ b/src/types.ts @@ -49,6 +49,12 @@ export type OrganizationInfoResponse = components["schemas"]["OrganizationInfoRe /** Paginated list of agents. */ export type AgentListResponse = components["schemas"]["routers__api__agents__AgentListResponse"]; +/** + * A page of the agent gallery. Each entry's `key` goes in `agent_template` on + * {@link CreateAgentRequest}, with `resource_bindings` for the resources it needs. + */ +export type AgentExampleListResponse = components["schemas"]["AgentExampleListResponse"]; + /** Full agent configuration including definition and metadata. */ export type AgentDefinitionResponse = components["schemas"]["AgentDefinitionResponse"]; @@ -66,11 +72,25 @@ export type AgentSummaryResponse = components["schemas"]["AgentSummaryResponse"] */ export type CreateAgentRequest = Omit< components["schemas"]["routers__api__agents__CreateAgentRequest"], - "accepted_attachments" -> & { accepted_attachments?: AcceptedAttachmentSlotInput[] | null }; + "accepted_attachments" | "create_missing_resources" +> & { + accepted_attachments?: AcceptedAttachmentSlotInput[] | null; + /** + * With `agent_template`, create any resource the template needs that + * `resource_bindings` does not bind. Defaults to `false`. + */ + create_missing_resources?: boolean; +}; -/** Request body for updating an agent. */ -export type UpdateAgentRequest = components["schemas"]["routers__api__agents__UpdateAgentRequest"]; +/** + * Request body for updating an agent. Every field is optional. + * + * To remove a run or credit limit, send its `set_max_*` flag as `true` and omit + * the matching `max_*` field. The `set_*` flags and `apply_import_run_limits` + * default to `false` on the server; the generated schema marks them required + * only because they declare a default. + */ +export type UpdateAgentRequest = Partial; /** * Request body for updating an agent definition (steps, model, etc.). @@ -151,6 +171,27 @@ export type SetEmailTriggerConfigRequest = components["schemas"]["routers__api__ /** An `EMAIL_RECEIVED` trigger's resolved email address(es) and inbound-handling config. */ export type EmailTriggerConfigResponse = components["schemas"]["EmailTriggerConfigResponse"]; +// ─── Agent Slack Triggers ──────────────────────────────────────────────────── + +/** + * Request body for configuring a `SLACK_COMMAND` trigger. + * + * Every field is optional, and an omitted field is left unchanged. + */ +export type SetSlackTriggerConfigRequest = components["schemas"]["SetSlackTriggerConfigApiRequest"]; + +/** A `SLACK_COMMAND` trigger's Slack connection, form, channels and conversation settings. */ +export type SlackTriggerConfigResponse = components["schemas"]["SlackTriggerConfigApiResponse"]; + +/** Where a Slack trigger runs within its scope: `everywhere` or `channel_opt_in`. */ +export type SlackTriggerActivation = components["schemas"]["SlackTriggerActivation"]; + +/** Which channels a Slack trigger covers: `selected_channels` or `bot_channels`. */ +export type SlackTriggerScope = components["schemas"]["SlackTriggerScope"]; + +/** Who sees a Slack trigger's reply: `channel` or `private`. */ +export type SlackReplyVisibility = components["schemas"]["SlackReplyVisibility"]; + // ─── Agent Email Governance ────────────────────────────────────────────────── /** A recipient's opt-out from an account's agent emails (one agent, or account-wide). */ @@ -532,6 +573,15 @@ export type CreateSourceBody = components["schemas"]["CreateSourceBody"]; /** Request body for updating a source. */ export type UpdateSourceBody = components["schemas"]["UpdateSourceBody"]; +/** What a source does when it reaches `max_credits_per_period`: `stop` or `delete`. */ +export type SpendCapAction = components["schemas"]["SpendCapAction"]; + +/** + * Which entries a `delete` spend cap removes first: `oldest_added`, + * `oldest_published` or `largest_first`. + */ +export type SpendCapDeleteOrder = components["schemas"]["SpendCapDeleteOrder"]; + /** Upload response for file uploads to a source. */ export type FileUploadResponse = components["schemas"]["routers__api__sources__FileUploadResponse"]; @@ -891,3 +941,142 @@ export interface SortableListOptions extends ListOptions { /** Sort order. */ order?: "asc" | "desc"; } + +/** Filters for {@link Seclai.listAgentExamples}. */ +export interface ListAgentExamplesOptions extends ListOptions { + /** Words every matching example must contain. */ + query?: string; + /** Only examples for this use case. */ + useCase?: string; +} + +/** Filters for {@link Seclai.listSolutions}. */ +export interface ListSolutionsOptions extends SortableListOptions { + /** Keep solutions whose name contains this text (case-insensitive). */ + search?: string; +} + +/** Filters for {@link Seclai.listMemoryBanks}. */ +export interface ListMemoryBanksOptions extends SortableListOptions { + /** Keep only one bank type: `conversation` or `general`. */ + type?: string; +} + +/** Filters for {@link Seclai.listEvaluationResults}. */ +export interface ListEvaluationResultsOptions extends ListOptions { + /** Keep only one result status. */ + status?: string; + /** Keep only flagged results. Defaults to `false`. */ + flaggedOnly?: boolean; + /** Earliest result time, ISO 8601. */ + timeFrom?: string; + /** Latest result time, ISO 8601. */ + timeTo?: string; +} + +/** Filters for {@link Seclai.listAgentEvaluationResults}. */ +export interface ListAgentEvaluationResultsOptions extends ListEvaluationResultsOptions { + /** Keep only results for this agent step. */ + step?: string; +} + +/** Filters for {@link Seclai.listEvaluationRuns}. */ +export interface ListEvaluationRunsOptions extends ListOptions { + /** Keep only one status. */ + status?: string; + /** Keep only runs for this agent step. */ + step?: string; + /** Earliest time, ISO 8601. */ + timeFrom?: string; + /** Latest time, ISO 8601. */ + timeTo?: string; +} + +/** Filters for {@link Seclai.listCompatibleRuns}. */ +export interface ListCompatibleRunsOptions extends ListOptions { + /** Only runs started after this time, ISO 8601. */ + startedAfter?: string; +} + +/** + * Date range for {@link Seclai.getNonManualEvaluationSummary} and + * {@link Seclai.getMemoryBankStats}. `startDate` and `endDate` take precedence + * over `days` when given. + */ +export interface DateRangeOptions { + /** Days back from today. The server defaults to 30. */ + days?: number; + /** First day, `YYYY-MM-DD`. */ + startDate?: string; + /** Last day, `YYYY-MM-DD`. */ + endDate?: string; +} + +/** Paging for the AI-assistant last-conversation methods. */ +export interface LastConversationOptions { + /** Most turns to return. The server defaults to 5. */ + limit?: number; + /** Most-recent turns to skip. The server defaults to 0. */ + offset?: number; +} + +/** Filters for {@link Seclai.listAlerts}. */ +export interface ListAlertsOptions extends ListOptions { + /** Keep only one alert status. */ + status?: string; + /** + * Accepted for compatibility and never sent: `GET /alerts` has no severity + * filter. + * + * @deprecated The API has no severity filter; this never filtered anything. + */ + severity?: string; + /** Keep only alerts for this agent. */ + agentId?: string; + /** Keep only alerts for this source connection. */ + sourceConnectionId?: string; + /** Earliest alert time, ISO 8601. */ + timeFrom?: string; + /** Latest alert time, ISO 8601. */ + timeTo?: string; +} + +/** Filters for {@link Seclai.listAlertConfigs}. */ +export interface ListAlertConfigsOptions extends ListOptions { + /** Keep only configs for this agent. */ + agentId?: string; + /** Keep only configs for this source connection. */ + sourceConnectionId?: string; + /** `source` lists the account-level source alert configs. */ + scope?: string; +} + +/** Filters for {@link Seclai.listOrganizationAlertPreferences}. */ +export interface ListOrganizationAlertPreferencesOptions { + /** Keep only one organization's preferences. */ + organizationId?: string; + /** Also list the default subscription for every alert type. Defaults to `false`. */ + includeDefaults?: boolean; +} + +/** Filters for {@link Seclai.listModelAlerts}. */ +export interface ListModelAlertsOptions extends ListOptions { + /** Keep only alerts for this agent. */ + agentId?: string; + /** Keep only unread alerts. Defaults to `false`. */ + unreadOnly?: boolean; +} + +/** Requirements for {@link Seclai.getModelRecommendations}. */ +export interface ModelRecommendationsOptions { + /** Only models that support tool use. */ + requireToolUse?: boolean; + /** Only models that support structured output. */ + requireStructuredOutput?: boolean; + /** Only models that support thinking. */ + requireThinking?: boolean; + /** Smallest acceptable context window, in tokens. */ + minContextTokens?: number; + /** Smallest acceptable output limit, in tokens. */ + minOutputTokens?: number; +} diff --git a/src/versions.ts b/src/versions.ts index e24e4d4..bbde5d8 100644 --- a/src/versions.ts +++ b/src/versions.ts @@ -22,10 +22,11 @@ export const SeclaiApiVersion = { V2026_10_18: "2026-10-18", V2026_10_19: "2026-10-19", V2026_10_21: "2026-10-21", + V2026_10_28: "2026-10-28", /** Baseline applied to an unpinned, header-less caller. */ Default: "2026-07-01", /** Newest version known to this SDK release. May lag the server. */ - Latest: "2026-10-21", + Latest: "2026-10-28", } as const; /** diff --git a/tests/client.test.ts b/tests/client.test.ts index 55d9e67..3345299 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -2460,6 +2460,96 @@ describe("Agent Email Triggers", () => { }); }); +describe("Agent Slack Triggers", () => { + test("setSlackTriggerConfig sends PUT /agents/:id/triggers/:tid/slack-config", async () => { + const client = makeClient((req) => { + const u = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(u.pathname).toBe("/agents/ag_1/triggers/tr_1/slack-config"); + expect(u.search).toBe(""); + expect(JSON.parse(req.bodyText!)).toEqual({ + scope: "selected_channels", + channel_ids: ["C1", "C2"], + visibility: "private", + turns_enabled: true, + max_turns: 5, + }); + return jsonResponse({ + trigger_id: "tr_1", + agent_id: "ag_1", + mcp_client_id: null, + slack_team_id: "T1", + form: [], + scope: "selected_channels", + allow_dms: false, + activation: "everywhere", + visibility: "private", + start_without_form: false, + turns_enabled: true, + turns_anyone: false, + max_turns: 5, + include_invoker_email: false, + notify_failure_after_answer: false, + channel_ids: ["C1", "C2"], + missing_scopes: ["users:read.email"], + }); + }); + const config = await client.setSlackTriggerConfig("ag_1", "tr_1", { + scope: "selected_channels", + channel_ids: ["C1", "C2"], + visibility: "private", + turns_enabled: true, + max_turns: 5, + }); + expect(config.channel_ids).toEqual(["C1", "C2"]); + expect(config.missing_scopes).toEqual(["users:read.email"]); + }); + + test("setSlackTriggerConfig sends only the fields given", async () => { + const client = makeClient((req) => { + expect(JSON.parse(req.bodyText!)).toEqual({ allow_dms: true }); + return jsonResponse({ trigger_id: "tr_1", allow_dms: true }); + }); + await client.setSlackTriggerConfig("ag_1", "tr_1", { allow_dms: true }); + }); +}); + +describe("Agent Examples", () => { + test("listAgentExamples sends GET /agents/examples with its filters", async () => { + const client = makeClient((req) => { + const u = new URL(req.url); + expect(req.method).toBe("GET"); + expect(u.pathname).toBe("/agents/examples"); + expect(Object.fromEntries(u.searchParams)).toEqual({ + query: "support inbox", + use_case: "customer_support", + page: "2", + limit: "10", + }); + return jsonResponse({ + data: [{ key: "support-triage" }], + pagination: { page: 2, limit: 10, total: 11, pages: 2, has_next: false, has_prev: true }, + }); + }); + const res = await client.listAgentExamples({ + query: "support inbox", + useCase: "customer_support", + page: 2, + limit: 10, + }); + expect(res.data).toEqual([{ key: "support-triage" }]); + expect(res.pagination.total).toBe(11); + }); + + test("listAgentExamples sends no query without options", async () => { + const client = makeClient((req) => { + expect(new URL(req.url).search).toBe(""); + return jsonResponse({ data: [], pagination: { page: 1, limit: 20, total: 0, pages: 0, has_next: false, has_prev: false } }); + }); + await client.listAgentExamples(); + }); +}); + // ───────────────────────────────────────────────────────────────────────────── // Agent Email Governance // ───────────────────────────────────────────────────────────────────────────── @@ -3058,7 +3148,7 @@ describe("API version constants", () => { test("a constant reaches the wire", async () => { const client = makeClient( (req) => { - expect(req.headers["seclai-version"]).toBe("2026-10-21"); + expect(req.headers["seclai-version"]).toBe("2026-10-28"); return jsonResponse({ data: [] }); }, { apiVersion: SeclaiApiVersion.Latest }, @@ -3765,3 +3855,139 @@ describe("Header edge cases from untyped callers", () => { ).toThrow("defaultHeaders['seclai-version']"); }); }); + + +describe("Query filters", () => { + type Row = [string, string, (c: Seclai) => Promise, Record]; + const rows: Row[] = [ + [ + "listEvaluationResults", + "/agents/evaluation-criteria/c1/results", + (c) => + c.listEvaluationResults("c1", { + status: "completed", + flaggedOnly: true, + timeFrom: "2026-10-01T00:00:00Z", + timeTo: "2026-10-31T00:00:00Z", + }), + { status: "completed", flagged_only: "true", time_from: "2026-10-01T00:00:00Z", time_to: "2026-10-31T00:00:00Z" }, + ], + [ + "listCompatibleRuns", + "/agents/evaluation-criteria/c1/compatible-runs", + (c) => c.listCompatibleRuns("c1", { startedAfter: "2026-10-01T00:00:00Z" }), + { started_after: "2026-10-01T00:00:00Z" }, + ], + [ + "listAgentEvaluationResults", + "/agents/a1/evaluation-results", + (c) => + c.listAgentEvaluationResults("a1", { + status: "failed", + step: "s1", + flaggedOnly: false, + timeFrom: "2026-10-01", + timeTo: "2026-10-02", + }), + { status: "failed", step: "s1", flagged_only: "false", time_from: "2026-10-01", time_to: "2026-10-02" }, + ], + [ + "listEvaluationRuns", + "/agents/a1/evaluation-runs", + (c) => c.listEvaluationRuns("a1", { status: "completed", step: "s1", timeFrom: "2026-10-01", timeTo: "2026-10-02" }), + { status: "completed", step: "s1", time_from: "2026-10-01", time_to: "2026-10-02" }, + ], + [ + "getNonManualEvaluationSummary", + "/agents/evaluation-results/non-manual-summary", + (c) => c.getNonManualEvaluationSummary("a1", { days: 7, startDate: "2026-10-01", endDate: "2026-10-07" }), + { agent_id: "a1", days: "7", start_date: "2026-10-01", end_date: "2026-10-07" }, + ], + [ + "getAiAssistantMemoryBankHistory", + "/ai-assistant/memory-bank/last-conversation", + (c) => c.getAiAssistantMemoryBankHistory({ limit: 3, offset: 2 }), + { limit: "3", offset: "2" }, + ], + [ + "listAlerts", + "/alerts", + (c) => + c.listAlerts({ + agentId: "a1", + sourceConnectionId: "s1", + timeFrom: "2026-10-01T00:00:00Z", + timeTo: "2026-10-02T00:00:00Z", + }), + { agent_id: "a1", source_connection_id: "s1", time_from: "2026-10-01T00:00:00Z", time_to: "2026-10-02T00:00:00Z" }, + ], + [ + "listAlertConfigs", + "/alerts/configs", + (c) => c.listAlertConfigs({ agentId: "a1", sourceConnectionId: "s1", scope: "source" }), + { agent_id: "a1", source_connection_id: "s1", scope: "source" }, + ], + [ + "listOrganizationAlertPreferences", + "/alerts/organization-preferences/list", + (c) => c.listOrganizationAlertPreferences({ organizationId: "o1", includeDefaults: true }), + { organization_id: "o1", include_defaults: "true" }, + ], + [ + "listGovernanceAiConversations", + "/governance/ai-assistant/conversations", + (c) => c.listGovernanceAiConversations({ limit: 5 }), + { limit: "5" }, + ], + ["listMemoryBanks", "/memory_banks", (c) => c.listMemoryBanks({ type: "general" }), { type: "general" }], + [ + "getMemoryBankAiLastConversation", + "/memory_banks/ai-assistant/last-conversation", + (c) => c.getMemoryBankAiLastConversation({ limit: 4, offset: 1 }), + { limit: "4", offset: "1" }, + ], + [ + "getMemoryBankStats", + "/memory_banks/mb1/stats", + (c) => c.getMemoryBankStats("mb1", { days: 14, startDate: "2026-10-01", endDate: "2026-10-14" }), + { days: "14", start_date: "2026-10-01", end_date: "2026-10-14" }, + ], + [ + "listModelAlerts", + "/models/alerts", + (c) => c.listModelAlerts({ agentId: "a1", unreadOnly: true }), + { agent_id: "a1", unread_only: "true" }, + ], + [ + "getModelRecommendations", + "/models/m1/recommendations", + (c) => + c.getModelRecommendations("m1", { + requireToolUse: true, + requireStructuredOutput: false, + requireThinking: true, + minContextTokens: 100000, + minOutputTokens: 8000, + }), + { + require_tool_use: "true", + require_structured_output: "false", + require_thinking: "true", + min_context_tokens: "100000", + min_output_tokens: "8000", + }, + ], + ["listSolutions", "/solutions", (c) => c.listSolutions({ search: "billing" }), { search: "billing" }], + ]; + + test.each(rows)("%s sends its filters as snake_case query keys", async (_name, path, call, query) => { + const client = makeClient((req) => { + const u = new URL(req.url); + expect(req.method).toBe("GET"); + expect(u.pathname).toBe(path); + expect(Object.fromEntries(u.searchParams)).toEqual(query); + return jsonResponse({ data: [], pagination: { page: 1, limit: 20, total: 0, pages: 0, has_next: false, has_prev: false } }); + }); + await call(client); + }); +}); From 1d46266dc8b8db2f000a71e7dbdb0b3d66b5111a Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Fri, 30 Oct 2026 23:02:13 -0700 Subject: [PATCH 2/8] #minor From c04a61240d47acbee76037180ca0c7ad84e18c11 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Fri, 30 Oct 2026 23:24:32 -0700 Subject: [PATCH 3/8] Resolved review comments --- CHANGELOG.md | 8 ++- README.md | 15 ++-- src/client.ts | 31 +++++---- src/index.ts | 4 +- src/types.ts | 158 ++++++++++++++++++++++++++++--------------- tests/client.test.ts | 72 ++++++++++++++++++++ 6 files changed, 212 insertions(+), 76 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f837640..4476bc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,17 +10,19 @@ ### Added -- Add `listAgentExamples()` for the agent gallery, searchable with `query` and filterable by `useCase`, and accept `agent_template` entries from it on `createAgent()` with `resource_bindings` and `create_missing_resources` +- Add `listAgentExamples()` for the agent gallery, searchable with `query` and filterable by `useCase`, returning typed `AgentExample` entries with the `resources` each needs, and accept `agent_template` entries from it on `createAgent()` with `resource_bindings` and `create_missing_resources` - Add `setSlackTriggerConfig()` to configure an agent's `SLACK_COMMAND` trigger: its Slack connection, form, channels, activation, reply visibility and conversation settings - Accept the run and credit limits on `updateAgent()`: `max_runs_total`, `max_runs_per_day`, `max_runs_per_hour`, `max_credits_per_run` and `max_credits_per_period`, a `set_max_*` flag for each to remove it, and `apply_import_run_limits` - Accept a spend limit on `updateSource()`: `max_credits_per_period`, `spend_cap_action` and `spend_cap_delete_order` -- Accept the query filters the API declares and no method sent: `status`, `flaggedOnly`, `timeFrom` and `timeTo` on `listEvaluationResults()` and `listAgentEvaluationResults()`, which also takes `step`; `status`, `step`, `timeFrom` and `timeTo` on `listEvaluationRuns()`; `startedAfter` on `listCompatibleRuns()`; `days`, `startDate` and `endDate` on `getNonManualEvaluationSummary()` and `getMemoryBankStats()`; `limit` and `offset` on `getMemoryBankAiLastConversation()` and `getAiAssistantMemoryBankHistory()`; `agentId`, `sourceConnectionId`, `timeFrom` and `timeTo` on `listAlerts()`; `agentId`, `sourceConnectionId` and `scope` on `listAlertConfigs()`; `organizationId` and `includeDefaults` on `listOrganizationAlertPreferences()`; `limit` on `listGovernanceAiConversations()`; `type` on `listMemoryBanks()`; `agentId` and `unreadOnly` on `listModelAlerts()`; `requireToolUse`, `requireStructuredOutput`, `requireThinking`, `minContextTokens` and `minOutputTokens` on `getModelRecommendations()`; and `search` on `listSolutions()` +- Accept the query filters the API declares and no method sent: `status`, `flaggedOnly`, `timeFrom` and `timeTo` on `listEvaluationResults()` and `listAgentEvaluationResults()`, which also takes `step`; `status`, `step`, `timeFrom` and `timeTo` on `listEvaluationRuns()`; `startedAfter` on `listCompatibleRuns()`; `days`, `startDate` and `endDate` on `getNonManualEvaluationSummary()` and `getMemoryBankStats()` (each method documents how the dates combine with `days`); `limit` and `offset` on `getMemoryBankAiLastConversation()` and `getAiAssistantMemoryBankHistory()`; `agentId`, `sourceConnectionId`, `timeFrom` and `timeTo` on `listAlerts()`; `agentId`, `sourceConnectionId` and `scope` on `listAlertConfigs()`; `organizationId` and `includeDefaults` on `listOrganizationAlertPreferences()`; `limit` on `listGovernanceAiConversations()`; `type` on `listMemoryBanks()`; `agentId` and `unreadOnly` on `listModelAlerts()`; `requireToolUse`, `requireStructuredOutput`, `requireThinking`, `minContextTokens` and `minOutputTokens` on `getModelRecommendations()`; and `search` on `listSolutions()` +- Let `getNonManualEvaluationSummary()` omit `agentId` for the account-wide summary - Add the `SeclaiApiVersion.V2026_10_28` constant, so that version is accepted as `apiVersion` -- Add the type exports `AgentExampleListResponse`, `SetSlackTriggerConfigRequest`, `SlackTriggerConfigResponse`, `SlackTriggerActivation`, `SlackTriggerScope`, `SlackReplyVisibility`, `SpendCapAction` and `SpendCapDeleteOrder`, and the option types `ListAgentExamplesOptions`, `ListEvaluationResultsOptions`, `ListAgentEvaluationResultsOptions`, `ListEvaluationRunsOptions`, `ListCompatibleRunsOptions`, `DateRangeOptions`, `LastConversationOptions`, `ListAlertsOptions`, `ListAlertConfigsOptions`, `ListOrganizationAlertPreferencesOptions`, `ListMemoryBanksOptions`, `ListModelAlertsOptions`, `ModelRecommendationsOptions` and `ListSolutionsOptions` +- Add the type exports `AgentExampleListResponse`, `AgentExample`, `AgentExampleResource`, `SetSlackTriggerConfigRequest`, `SlackTriggerConfigResponse`, `SlackTriggerActivation`, `SlackTriggerScope`, `SlackReplyVisibility`, `SpendCapAction` and `SpendCapDeleteOrder`, and the option types `ListAgentExamplesOptions`, `ListEvaluationResultsOptions`, `ListAgentEvaluationResultsOptions`, `ListEvaluationRunsOptions`, `ListCompatibleRunsOptions`, `DateRangeOptions`, `OffsetPageOptions`, `ListAlertsOptions`, `ListAlertConfigsOptions`, `ListOrganizationAlertPreferencesOptions`, `ListMemoryBanksOptions`, `ListModelAlertsOptions`, `ModelRecommendationsOptions` and `ListSolutionsOptions` ### Fixed - Make every field of `UpdateAgentRequest` optional. `updateAgent()` required `set_default_evaluation_tier`, `set_prompt_model_auto_rollback_triggers` and `set_sampling_config`, which the server defaults to `false`, so `updateAgent(id, { name })` did not compile +- Make server-defaulted fields optional on the request types that required them, so a call can leave them to the server: `description` on `CreateSolutionRequest` (`createSolution({ name })` did not compile), `priority` on `AgentRunRequest`, `enabled` and `distribution_type` on `CreateAlertConfigRequest`, `mode`, `type` and `strip_quoted_reply_chains` on `CreateMemoryBankBody`, `enabled` and `pass_threshold` on `CreateEvaluationCriteriaRequest`, `flagged`, `retry_count` and `retry_triggered` on `CreateEvaluationResultRequest`, `content_type` on `InlineTextUploadRequest` and `InlineTextReplaceRequest`, `entry_count` on `TestCompactionRequest`, `entry_count` and `bank_type` on `StandaloneTestCompactionRequest`, `match_type` on `BlockEmailSenderRequest`, `delegated` on `AddEmailDomainRequest`, `mode` on `GenerateAgentStepsRequest`, `pass_threshold` on `TestDraftEvaluationRequest`, `top_n` on `AgentTraceSearchRequest`, `confirm_deletions` on `AiAssistantAcceptRequest`, and the playground settings on `PlaygroundCreateRequest`. Response types are unchanged ## [1.7.0] - 2026-10-21 diff --git a/README.md b/README.md index 73d9054..66ed44f 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ Leave `apiVersion` unset and the header is omitted, so the account's pinned baseline applies and responses keep their current shapes. Upgrading this package alone never changes the wire contract. -Known versions are on `SeclaiApiVersion` (`V2026_07_01` through `V2026_10_21`, +Known versions are on `SeclaiApiVersion` (`V2026_07_01` through `V2026_10_28`, plus `Default` and `Latest`), imported from `@seclai/sdk`. A version this release was **not** built against throws at construction: a newer version can reshape responses, and this client would decode them incorrectly rather than reject them. @@ -317,12 +317,16 @@ ones you leave out; `created_resources` reports what it made. ```ts const examples = await client.listAgentExamples({ query: "support", useCase: "customer_support", limit: 10 }); -console.log(examples.data, examples.pagination.total); +const example = examples.data[0]; +console.log(example.key, example.title, examples.pagination.total); +for (const slot of example.resources) { + console.log(slot.slot, slot.kind, slot.creatable); // what resource_bindings can bind +} const agent = await client.createAgent({ name: "Support triage", - agent_template: "support-triage", - resource_bindings: { knowledge_base: "kb_id" }, + agent_template: example.key, + resource_bindings: { [example.resources[0].slot]: "kb_id" }, create_missing_resources: true, }); console.log(agent.created_resources); // { slot: resource_id } for each resource it created @@ -563,8 +567,9 @@ const runResults = await client.listRunEvaluationResults("agent_id", "run_id"); const agentResults = await client.listAgentEvaluationResults("agent_id", { status: "failed", step: "step_id" }); const evalRuns = await client.listEvaluationRuns("agent_id", { timeFrom: "2026-10-01T00:00:00Z" }); -// Non-manual evaluation summary +// Non-manual evaluation summary, for one agent or the whole account const nonManual = await client.getNonManualEvaluationSummary("agent_id", { days: 7 }); +const accountWide = await client.getNonManualEvaluationSummary(undefined, { startDate: "2026-10-01", endDate: "2026-10-31" }); // Compatible runs for a criteria const compatible = await client.listCompatibleRuns("criteria_id", { startedAfter: "2026-10-01T00:00:00Z" }); diff --git a/src/client.ts b/src/client.ts index 34bf3ef..51cb2d2 100644 --- a/src/client.ts +++ b/src/client.ts @@ -189,7 +189,7 @@ import type { ListEvaluationRunsOptions, ListCompatibleRunsOptions, DateRangeOptions, - LastConversationOptions, + OffsetPageOptions, ListAlertsOptions, ListAlertConfigsOptions, ListOrganizationAlertPreferencesOptions, @@ -1878,13 +1878,15 @@ export class Seclai { } /** - * Get a summary of non-manual evaluations across an agent's runs. + * Get a summary of non-manual evaluations, for one agent or the whole account. * - * @param agentId - Agent identifier. - * @param opts - Date range; the server defaults to the last 30 days. + * @param agentId - Agent identifier. Omit (pass `undefined`) for the account-wide summary. + * @param opts - Date range. `startDate` and `endDate` together set the range; + * `startDate` alone runs from it through today; otherwise the last `days` + * days apply (server default 30), and an `endDate` without `startDate` is ignored. */ async getNonManualEvaluationSummary( - agentId: string, + agentId?: string, opts: DateRangeOptions = {}, ): Promise { return (await this.request("GET", "/agents/evaluation-results/non-manual-summary", { @@ -2011,7 +2013,7 @@ export class Seclai { * @param opts.offset - Rows to skip (default 0). */ async listBlockedEmailSenders( - opts: { limit?: number; offset?: number } = {}, + opts: OffsetPageOptions = {}, ): Promise { return keyedList( await this.request("GET", "/agents/blocked-email-senders", { @@ -2251,7 +2253,8 @@ export class Seclai { * Get stats for a memory bank. * * @param memoryBankId - Memory bank identifier. - * @param opts - Date range; the server defaults to the last 30 days. + * @param opts - Date range. Only `startDate` and `endDate` together replace + * `days`; either one alone is ignored and the last `days` days apply (server default 30). */ async getMemoryBankStats(memoryBankId: string, opts: DateRangeOptions = {}): Promise { return await this.request("GET", `/memory_banks/${memoryBankId}/stats`, { @@ -2318,9 +2321,9 @@ export class Seclai { /** * Get the last AI conversation for memory banks. * - * @param opts - How many turns to return and skip. + * @param opts - Turns to return (server default 5) and most-recent turns to skip (default 0). */ - async getMemoryBankAiLastConversation(opts: LastConversationOptions = {}): Promise { + async getMemoryBankAiLastConversation(opts: OffsetPageOptions = {}): Promise { return (await this.request("GET", "/memory_banks/ai-assistant/last-conversation", { query: { limit: opts.limit, offset: opts.offset }, })) as MemoryBankLastConversationResponse; @@ -3394,9 +3397,11 @@ export class Seclai { /** * List model playground experiments. * - * @param opts - Optional filters and pagination. + * @param opts - Date range and offset paging. Only `startDate` and `endDate` + * together replace `days`; either one alone is ignored and the last `days` + * days apply (server default 30). */ - async listExperiments(opts: { days?: number; startDate?: string; endDate?: string; limit?: number; offset?: number } = {}): Promise { + async listExperiments(opts: DateRangeOptions & OffsetPageOptions = {}): Promise { return keyedList( await this.request("GET", "/models/playground/experiments", { query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate, limit: opts.limit, offset: opts.offset }, @@ -3764,9 +3769,9 @@ export class Seclai { /** * Get AI assistant memory bank conversation history. * - * @param opts - How many turns to return and skip. + * @param opts - Turns to return (server default 5) and most-recent turns to skip (default 0). */ - async getAiAssistantMemoryBankHistory(opts: LastConversationOptions = {}): Promise { + async getAiAssistantMemoryBankHistory(opts: OffsetPageOptions = {}): Promise { return (await this.request("GET", "/ai-assistant/memory-bank/last-conversation", { query: { limit: opts.limit, offset: opts.offset }, })) as MemoryBankLastConversationResponse; diff --git a/src/index.ts b/src/index.ts index 1802710..5d0a673 100644 --- a/src/index.ts +++ b/src/index.ts @@ -80,7 +80,7 @@ export type { ListEvaluationRunsOptions, ListCompatibleRunsOptions, DateRangeOptions, - LastConversationOptions, + OffsetPageOptions, ListAlertsOptions, ListAlertConfigsOptions, ListOrganizationAlertPreferencesOptions, @@ -94,6 +94,8 @@ export type { // Agents AgentListResponse, AgentExampleListResponse, + AgentExample, + AgentExampleResource, AgentDefinitionResponse, AgentExportResponse, AgentSummaryResponse, diff --git a/src/types.ts b/src/types.ts index 0994363..c520e8c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -9,6 +9,15 @@ */ import type { components } from "./openapi"; +/** + * `T` with the keys `K` optional. openapi-typescript marks every property that + * declares a `default` as required, which is right for a response (the server + * always sends it) and wrong for a request body (the server fills it in). Apply + * this to a request type's server-defaulted keys only; the test + * "request types leave server-defaulted fields optional" lists them from the spec. + */ +type WithServerDefaults = Omit & Partial>; + // ─── General ───────────────────────────────────────────────────────────────── /** JSON-serializable values accepted/returned by the SDK's low-level `request()` method. */ @@ -53,7 +62,68 @@ export type AgentListResponse = components["schemas"]["routers__api__agents__Age * A page of the agent gallery. Each entry's `key` goes in `agent_template` on * {@link CreateAgentRequest}, with `resource_bindings` for the resources it needs. */ -export type AgentExampleListResponse = components["schemas"]["AgentExampleListResponse"]; +export type AgentExampleListResponse = Omit & { + data: AgentExample[]; +}; + +/** + * A resource an {@link AgentExample} needs: bind it in `resource_bindings` under + * `slot`, or let `create_missing_resources` create it when `creatable`. + */ +export interface AgentExampleResource { + /** Slot name, the key in `resource_bindings`. */ + slot: string; + /** Resource kind: knowledge_base, memory_bank, source_connection, mcp_client or cloud_drive_connection. */ + kind: string; + /** Display name of the slot. */ + label: string; + /** What the slot is used for. */ + description: string; + /** The id that stands for this resource in `definition`. */ + placeholder: string; + /** Whether `create_missing_resources` can create it. When false it must be bound to an existing resource. */ + creatable: boolean; + /** For a memory_bank slot, the bank type a bound bank must have. */ + memory_bank_type: string | null; + /** Whether the steps in `definition` name this slot. */ + named_in_definition: boolean; + /** Whether the entry's trigger names this slot; it applies only when the agent keeps the entry's trigger type. */ + named_in_trigger: boolean; + /** Slots whose creation uses this one. */ + named_in_create_of: string[]; +} + +/** + * One agent gallery entry from {@link Seclai.listAgentExamples}. Pass `key` as + * `agent_template` on {@link CreateAgentRequest}. + * + * Typed by hand: the spec declares the list's items without a schema. + */ +export interface AgentExample { + /** Pass as `agent_template` when creating an agent. */ + key: string; + title: string; + summary: string; + use_cases: string[]; + tags: string[]; + /** Other `agent_template` values that create this entry. */ + aliases: string[]; + /** A request to the AI assistant that describes this agent. */ + prompt: string; + /** The trigger type the entry is built for. */ + trigger_type: string; + /** The date the entry was added to the gallery, `YYYY-MM-DD`. */ + created_at: string; + /** The template_input trigger's input, when the entry sets one. */ + trigger_input: string | null; + /** The template_input trigger's schedules, applied on create when the trigger type is the entry's own. */ + schedules: Record[]; + /** The trigger's declared attachment slots. Empty when the entry declares none. */ + accepted_attachments: Record[]; + resources: AgentExampleResource[]; + /** The agent definition, naming each resource by its placeholder. */ + definition: Record; +} /** Full agent configuration including definition and metadata. */ export type AgentDefinitionResponse = components["schemas"]["AgentDefinitionResponse"]; @@ -71,15 +141,10 @@ export type AgentSummaryResponse = components["schemas"]["AgentSummaryResponse"] * server-defaulted `min` can be omitted. */ export type CreateAgentRequest = Omit< - components["schemas"]["routers__api__agents__CreateAgentRequest"], - "accepted_attachments" | "create_missing_resources" + WithServerDefaults, + "accepted_attachments" > & { accepted_attachments?: AcceptedAttachmentSlotInput[] | null; - /** - * With `agent_template`, create any resource the template needs that - * `resource_bindings` does not bind. Defaults to `false`. - */ - create_missing_resources?: boolean; }; /** @@ -201,7 +266,7 @@ export type AgentEmailOptOutResponse = components["schemas"]["AgentEmailOptOutRe export type AgentEmailOptOutListResponse = VersionedList; /** Request body for blocking an inbound email sender or domain. */ -export type BlockEmailSenderRequest = components["schemas"]["BlockEmailSenderRequest"]; +export type BlockEmailSenderRequest = WithServerDefaults; /** A single blocked inbound email sender. */ export type BlockedEmailSenderResponse = components["schemas"]["BlockedEmailSenderResponse"]; @@ -233,16 +298,10 @@ export type ResumeInboundResponse = components["schemas"]["ResumeInboundResponse // ─── Agent Runs ────────────────────────────────────────────────────────────── /** Request body for starting an agent run. */ -export type AgentRunRequest = components["schemas"]["AgentRunRequest"]; +export type AgentRunRequest = WithServerDefaults; -/** - * Request body for starting an agent run in streaming mode (SSE). - * - * `include_reasoning` has a server-side default of `false` and stays optional — - * the generated type marks it required only because the schema declares a default. - */ -export type AgentRunStreamRequest = Omit & - Partial>; +/** Request body for starting an agent run in streaming mode (SSE). `include_reasoning` defaults to `false`. */ +export type AgentRunStreamRequest = WithServerDefaults; /** Response body describing an agent run. */ export type AgentRunResponse = components["schemas"]["AgentRunResponse"]; @@ -263,7 +322,7 @@ export type AgentRunFileResponse = components["schemas"]["AgentRunFileResponse"] export type AgentRunToolCallResponse = components["schemas"]["AgentRunToolCallResponse"]; /** Search request for agent runs (traces). */ -export type AgentTraceSearchRequest = components["schemas"]["routers__api__agents__AgentTraceSearchRequest"]; +export type AgentTraceSearchRequest = WithServerDefaults; /** Search response containing matching agent runs. */ export type AgentTraceSearchResponse = components["schemas"]["AgentTraceSearchResponse"]; @@ -288,7 +347,7 @@ export type AttachmentRefsSourceApiSummary = components["schemas"]["AttachmentRe // ─── Agent Steps AI Assistant ──────────────────────────────────────────────── /** Request body for generating agent workflow steps via AI. */ -export type GenerateAgentStepsRequest = components["schemas"]["GenerateAgentStepsRequest"]; +export type GenerateAgentStepsRequest = WithServerDefaults; /** Response containing AI-generated agent workflow steps. */ export type GenerateAgentStepsResponse = components["schemas"]["GenerateAgentStepsResponse"]; @@ -416,7 +475,7 @@ export type EvaluationCriteriaListResponse = { }; /** Request body for creating evaluation criteria. */ -export type CreateEvaluationCriteriaRequest = components["schemas"]["CreateEvaluationCriteriaRequest"]; +export type CreateEvaluationCriteriaRequest = WithServerDefaults; /** Request body for updating evaluation criteria. */ export type UpdateEvaluationCriteriaRequest = components["schemas"]["UpdateEvaluationCriteriaRequest"]; @@ -428,7 +487,7 @@ export type EvaluationResultResponse = components["schemas"]["EvaluationResultRe export type EvaluationResultListResponse = VersionedList; /** Request body for creating a manual evaluation result. */ -export type CreateEvaluationResultRequest = components["schemas"]["CreateEvaluationResultRequest"]; +export type CreateEvaluationResultRequest = WithServerDefaults; /** Summary of evaluation results for a criteria. */ export type EvaluationResultSummaryResponse = components["schemas"]["EvaluationResultSummaryResponse"]; @@ -476,7 +535,7 @@ export type NonManualEvaluationSummaryResponse = components["schemas"]["schemas_ export type NonManualEvaluationModeStatResponse = components["schemas"]["schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse"]; /** Request for testing a draft evaluation. */ -export type TestDraftEvaluationRequest = components["schemas"]["TestDraftEvaluationRequest"]; +export type TestDraftEvaluationRequest = WithServerDefaults; /** * Response from testing a draft evaluation. When `status` is `error` (no @@ -521,7 +580,7 @@ export type MemoryBankListResponse = VersionedList; /** Request body for updating a memory bank. */ export type UpdateMemoryBankBody = components["schemas"]["UpdateMemoryBankBody"]; @@ -545,13 +604,13 @@ export type MemoryBankLastConversationResponse = components["schemas"]["routers_ export type MemoryBankConversationTurnResponse = components["schemas"]["routers__api__memory_banks__MemoryBankConversationTurnResponse"]; /** Compaction test request for memory banks. */ -export type TestCompactionRequest = components["schemas"]["TestCompactionRequest"]; +export type TestCompactionRequest = WithServerDefaults; /** Compaction test response. */ export type CompactionTestResponse = components["schemas"]["CompactionTestResponseModel"]; /** Standalone compaction test request. */ -export type StandaloneTestCompactionRequest = components["schemas"]["StandaloneTestCompactionRequest"]; +export type StandaloneTestCompactionRequest = WithServerDefaults; /** Compaction evaluation model result. */ export type CompactionEvaluationModel = components["schemas"]["CompactionEvaluationModel"]; @@ -586,10 +645,10 @@ export type SpendCapDeleteOrder = components["schemas"]["SpendCapDeleteOrder"]; export type FileUploadResponse = components["schemas"]["routers__api__sources__FileUploadResponse"]; /** Request body for uploading inline text to a source. */ -export type InlineTextUploadRequest = components["schemas"]["InlineTextUploadRequest"]; +export type InlineTextUploadRequest = WithServerDefaults; /** Request body for replacing content with inline text. */ -export type InlineTextReplaceRequest = components["schemas"]["InlineTextReplaceRequest"]; +export type InlineTextReplaceRequest = WithServerDefaults; /** One content item's indexing status within a source. */ export type SourceContentStatusResponse = components["schemas"]["SourceContentStatusResponse"]; @@ -701,7 +760,7 @@ export type SolutionResponse = components["schemas"]["routers__api__solutions__S export type SolutionSummaryResponse = components["schemas"]["SolutionSummaryResponse"]; /** Request body for creating a solution. */ -export type CreateSolutionRequest = components["schemas"]["CreateSolutionRequest"]; +export type CreateSolutionRequest = WithServerDefaults; /** Request body for updating a solution. */ export type UpdateSolutionRequest = components["schemas"]["UpdateSolutionRequest"]; @@ -731,7 +790,7 @@ export type AiAssistantGenerateRequest = components["schemas"]["routers__api__so export type AiAssistantGenerateResponse = components["schemas"]["AiAssistantGenerateResponse"]; /** AI assistant accept request for solutions. */ -export type AiAssistantAcceptRequest = components["schemas"]["routers__api__solutions__AiAssistantAcceptRequest"]; +export type AiAssistantAcceptRequest = WithServerDefaults; /** AI assistant accept response for solutions. */ export type AiAssistantAcceptResponse = components["schemas"]["AiAssistantAcceptResponse"]; @@ -773,7 +832,7 @@ export type GovernanceAppliedActionResponse = components["schemas"]["AppliedActi // ─── Alerts ────────────────────────────────────────────────────────────────── /** Request body for creating an alert config. */ -export type CreateAlertConfigRequest = components["schemas"]["CreateAlertConfigRequest"]; +export type CreateAlertConfigRequest = WithServerDefaults; /** Request body for updating an alert config. */ export type UpdateAlertConfigRequest = components["schemas"]["UpdateAlertConfigRequest"]; @@ -846,7 +905,7 @@ export type VariantCategoryResponse = components["schemas"]["VariantCategoryResp export type VariantOptionResponse = components["schemas"]["VariantOptionResponse"]; /** Request body for creating a model playground experiment. */ -export type PlaygroundCreateRequest = components["schemas"]["PlaygroundCreateRequest"]; +export type PlaygroundCreateRequest = WithServerDefaults; /** * Input type for {@link SeclaiClient.createExperiment}. @@ -860,7 +919,7 @@ export type CreateExperimentInput = Pick; /** * Input type for {@link Seclai.addEmailDomain}. @@ -958,8 +1017,8 @@ export interface ListSolutionsOptions extends SortableListOptions { /** Filters for {@link Seclai.listMemoryBanks}. */ export interface ListMemoryBanksOptions extends SortableListOptions { - /** Keep only one bank type: `conversation` or `general`. */ - type?: string; + /** Keep only one bank type. */ + type?: "conversation" | "general" | (string & {}); } /** Filters for {@link Seclai.listEvaluationResults}. */ @@ -980,17 +1039,8 @@ export interface ListAgentEvaluationResultsOptions extends ListEvaluationResults step?: string; } -/** Filters for {@link Seclai.listEvaluationRuns}. */ -export interface ListEvaluationRunsOptions extends ListOptions { - /** Keep only one status. */ - status?: string; - /** Keep only runs for this agent step. */ - step?: string; - /** Earliest time, ISO 8601. */ - timeFrom?: string; - /** Latest time, ISO 8601. */ - timeTo?: string; -} +/** Filters for {@link Seclai.listEvaluationRuns}: those of {@link ListAgentEvaluationResultsOptions} except `flaggedOnly`. */ +export type ListEvaluationRunsOptions = Omit; /** Filters for {@link Seclai.listCompatibleRuns}. */ export interface ListCompatibleRunsOptions extends ListOptions { @@ -999,9 +1049,9 @@ export interface ListCompatibleRunsOptions extends ListOptions { } /** - * Date range for {@link Seclai.getNonManualEvaluationSummary} and - * {@link Seclai.getMemoryBankStats}. `startDate` and `endDate` take precedence - * over `days` when given. + * Date range for {@link Seclai.getNonManualEvaluationSummary}, + * {@link Seclai.getMemoryBankStats} and {@link Seclai.listExperiments}. Each + * endpoint combines the dates with `days` its own way; see the method. */ export interface DateRangeOptions { /** Days back from today. The server defaults to 30. */ @@ -1012,11 +1062,11 @@ export interface DateRangeOptions { endDate?: string; } -/** Paging for the AI-assistant last-conversation methods. */ -export interface LastConversationOptions { - /** Most turns to return. The server defaults to 5. */ +/** Offset paging. Each method documents its server defaults and bounds. */ +export interface OffsetPageOptions { + /** Most items to return. */ limit?: number; - /** Most-recent turns to skip. The server defaults to 0. */ + /** Items to skip. */ offset?: number; } @@ -1048,7 +1098,7 @@ export interface ListAlertConfigsOptions extends ListOptions { /** Keep only configs for this source connection. */ sourceConnectionId?: string; /** `source` lists the account-level source alert configs. */ - scope?: string; + scope?: "source" | (string & {}); } /** Filters for {@link Seclai.listOrganizationAlertPreferences}. */ diff --git a/tests/client.test.ts b/tests/client.test.ts index 3345299..28c84ba 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -1951,6 +1951,17 @@ describe("Agent Evaluations — extended", () => { }); await client.getNonManualEvaluationSummary("ag_1"); }); + + test("getNonManualEvaluationSummary without agentId asks for the account-wide summary", async () => { + const client = makeClient((req) => { + const u = new URL(req.url); + expect(u.pathname).toBe("/agents/evaluation-results/non-manual-summary"); + expect(u.searchParams.has("agent_id")).toBe(false); + expect(u.searchParams.get("start_date")).toBe("2026-10-01"); + return jsonResponse({ by_mode: [] }); + }); + await client.getNonManualEvaluationSummary(undefined, { startDate: "2026-10-01" }); + }); }); // ───────────────────────────────────────────────────────────────────────────── @@ -3991,3 +4002,64 @@ describe("Query filters", () => { await call(client); }); }); + +describe("Request types", () => { + // openapi-typescript marks a property that declares a `default` as required. + // For a schema only ever sent as a request body that is wrong, so src/types.ts + // wraps each such alias in WithServerDefaults<…, "key" | …>. This lists the + // keys from the spec, so a new server default fails here rather than shipping + // a request type that forces callers to send it. + test("request types leave server-defaulted fields optional", () => { + const spec = JSON.parse( + readFileSync(new URL("../openapi/seclai.openapi.json", import.meta.url), "utf8"), + ); + const types = readFileSync(new URL("../src/types.ts", import.meta.url), "utf8"); + const schemas: Record = spec.components.schemas; + + const reach = (node: unknown, into: Set): void => { + if (Array.isArray(node)) return node.forEach((n) => reach(n, into)); + if (!node || typeof node !== "object") return; + const ref = (node as { $ref?: string }).$ref; + if (ref?.startsWith("#/components/schemas/")) { + const name = ref.slice("#/components/schemas/".length); + if (!into.has(name)) { + into.add(name); + reach(schemas[name], into); + } + } + Object.values(node).forEach((n) => reach(n, into)); + }; + const requests = new Set(); + const responses = new Set(); + for (const ops of Object.values(spec.paths)) { + for (const op of Object.values(ops)) { + if (!op || typeof op !== "object") continue; + reach(op.requestBody, requests); + for (const [code, r] of Object.entries(op.responses ?? {})) { + if (code.startsWith("2")) reach(r, responses); + } + } + } + + const missing: string[] = []; + for (const name of requests) { + if (responses.has(name)) continue; + const schema = schemas[name]; + const required = new Set(schema.required ?? []); + const defaulted = Object.entries(schema.properties ?? {}) + .filter(([k, v]) => "default" in v && !required.has(k)) + .map(([k]) => k); + if (defaulted.length === 0) continue; + const ref = `components["schemas"]["${name}"]`; + if (!types.includes(ref)) continue; // not exported as a request type + if (types.includes(`Partial<${ref}>`)) continue; + const wrapped = types.match( + new RegExp(`WithServerDefaults<${ref.replace(/[[\]"]/g, "\\$&")},\\s*([^>]+)>`), + ); + for (const key of defaulted) { + if (!wrapped || !wrapped[1].includes(`"${key}"`)) missing.push(`${name}.${key}`); + } + } + expect(missing).toEqual([]); + }); +}); From ae297a3d7ef2bb4b46904ad1114b27e1dd51c8c5 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Fri, 30 Oct 2026 23:32:38 -0700 Subject: [PATCH 4/8] Squashed '.claude/skills/seclai-changelog/' changes from 3558844..aea19cd aea19cd Updated skills git-subtree-dir: .claude/skills/seclai-changelog git-subtree-split: aea19cd492abe95322e1066cee228c529b9e2db4 --- .claude/skills/seclai-sdk-sync/SKILL.md | 305 - .claude/skills/seclai-sdk-sync/docexamples.py | 230 - .claude/skills/seclai-sdk-sync/sdksync.py | 1278 - .gitattributes | 22 - .github/copilot-instructions.md | 41 - .github/workflows/main-build.yaml | 166 - .github/workflows/pr-build.yaml | 42 - .gitignore | 9 - CHANGELOG.md | 228 - LICENSE | 21 - README.md | 836 - .../seclai-changelog/SKILL.md => SKILL.md | 2 +- openapi/seclai.openapi.json | 26535 ---------------- package-lock.json | 2937 -- package.json | 49 - scripts/set-readme-version.mjs | 44 - scripts/set-version.mjs | 56 - src/auth.ts | 602 - src/client.ts | 3462 -- src/errors.ts | 92 - src/index.ts | 329 - src/openapi.ts | 18578 ----------- src/types.ts | 802 - src/versions.ts | 38 - tests/client.test.ts | 3094 -- tsconfig.json | 19 - tsup.config.ts | 9 - typedoc.json | 15 - .../validate.py => validate.py | 0 vitest.config.ts | 8 - 30 files changed, 1 insertion(+), 59848 deletions(-) delete mode 100644 .claude/skills/seclai-sdk-sync/SKILL.md delete mode 100755 .claude/skills/seclai-sdk-sync/docexamples.py delete mode 100755 .claude/skills/seclai-sdk-sync/sdksync.py delete mode 100644 .gitattributes delete mode 100644 .github/copilot-instructions.md delete mode 100644 .github/workflows/main-build.yaml delete mode 100644 .github/workflows/pr-build.yaml delete mode 100644 .gitignore delete mode 100644 CHANGELOG.md delete mode 100644 LICENSE delete mode 100644 README.md rename .claude/skills/seclai-changelog/SKILL.md => SKILL.md (96%) delete mode 100644 openapi/seclai.openapi.json delete mode 100644 package-lock.json delete mode 100644 package.json delete mode 100644 scripts/set-readme-version.mjs delete mode 100644 scripts/set-version.mjs delete mode 100644 src/auth.ts delete mode 100644 src/client.ts delete mode 100644 src/errors.ts delete mode 100644 src/index.ts delete mode 100644 src/openapi.ts delete mode 100644 src/types.ts delete mode 100644 src/versions.ts delete mode 100644 tests/client.test.ts delete mode 100644 tsconfig.json delete mode 100644 tsup.config.ts delete mode 100644 typedoc.json rename .claude/skills/seclai-changelog/validate.py => validate.py (100%) delete mode 100644 vitest.config.ts diff --git a/.claude/skills/seclai-sdk-sync/SKILL.md b/.claude/skills/seclai-sdk-sync/SKILL.md deleted file mode 100644 index bfdad17..0000000 --- a/.claude/skills/seclai-sdk-sync/SKILL.md +++ /dev/null @@ -1,305 +0,0 @@ ---- -name: seclai-sdk-sync -description: Sync a Seclai SDK (seclai-python, seclai-javascript, seclai-go, seclai-csharp, seclai-cli, seclai-mcp) to a new OpenAPI spec, or add endpoints to one. Use when a new openapi/seclai.openapi.json has been copied in, when asked to add missing endpoints or check endpoint coverage, or when auditing an SDK against the API spec. ---- - -# Syncing a Seclai SDK to a new spec - -> **Vendored file — do not edit in place.** The canonical copy lives in the -> `seclai/sdk-tools` repository at `skills/seclai-sdk-sync/`, and is mirrored -> into each SDK repo with `git subtree`. Edits made here are reported as drift by -> `sdk-tools/sync.sh --check` and are overwritten on the next pull. To change it, -> change it upstream — or, if you can't reach that repo, open an issue on this -> one describing the fix and a maintainer will carry it across. - -Run the analysis with `sdksync.py`, bundled next to this file, rather than -hand-rolling greps. Every ad-hoc parity regex written so far has missed methods -with multi-line signatures. - -```bash -S=.claude/skills/seclai-sdk-sync/sdksync.py # vendored into each SDK repo - -python3 $S spec-diff HEAD # what the new spec changed -python3 $S parity . # spec paths with no request call -python3 $S params . # params the endpoint does not accept -python3 $S returns . # return types that disagree with the spec -python3 $S models . --since HEAD # hand-written models left behind -python3 $S surface 1.3.0 # is this release breaking? -python3 $S api-delta 1.3.0 # public methods added since a tag -``` - -The three audits are three different directions, and each finds what the others -structurally cannot: - -| | direction | catches | -| --- | --- | --- | -| `parity` | spec → client | endpoints nobody implemented | -| `params` | client → spec | query keys the endpoint ignores or requires | -| `returns` | client → spec | a response shape the client can no longer deserialize | - -`parity`, `params`, `returns`, `models` and `surface` exit non-zero on a finding, so all work as CI gates. -Run the **canonical** copy from `sdk-tools`, or `./sync.sh --check` first. The -vendored copies go stale whenever a repo has uncommitted work, since `sync.sh` -skips dirty repos — a stale `spec-diff` reported 123 changed paths as -"description/params only" and hid 26 response changes. - -Run them over the **whole spec**, never just the diff — `GET /me` sat unimplemented -in both the Python and JavaScript SDKs for months because each sync only looked at -its own new paths. - -## `params` — the check that catches what tests cannot - -`parity` walks spec→client. `params` walks client→spec, and that direction finds a -different and more dangerous class of defect, because the API silently ignores -query params it does not declare: - -- **UNDECLARED** — the client sends a key the endpoint does not accept. The filter - simply does nothing and the caller gets unfiltered results. -- **NOT IN SPEC** — the client calls a path the spec does not declare. `parity` - cannot see this by construction. -- **UNPARSED** — a query-construction site the extractor could not read. Treated as - an error, never as clean: a parser that gives up quietly is the failure this tool - exists to prevent. -- **UNEXPOSED** (warning) — a declared param no method sends; a coverage gap. - -Tests do not defend against this class. The SDK tests were written from the same -table as the code, so they assert the same wrong parameter names — one Go test -asserted the buggy `query` instead of the required `q`, locking the defect in. The -spec is the only independent oracle. - -**Treat a finding you believe is wrong as a bug in the tool, not as noise to skip.** -Twice now that instinct was right: Go's `GetMe` was reported as sending -page/limit/sort/order it never sends (a method block ran on past its own function -and swallowed the helpers below it), and `Search` was reported as never sending its -required `q` (the extractor read `q["k"] =` but not the map literal that sets it). -Four of six Go findings were artefacts. Since both were fixed, all four SDKs report -the *same* three findings — independently-written clients agreeing is the signal -that the check is reading them correctly. - -## `returns` — the axis that catches a changed response - -Compares each method's **declared return type** against the spec's response -schema, and splits the result by how much it costs you: - -- **SHAPE MISMATCH** (error) — the client commits to a list and the endpoint - returns an object, or the reverse. This throws at deserialization; a shipped - SDK is already broken. This is the 2026-07 envelope change. -- **NAME DIFFERS** (warning) — same shape, different type name. All four SDKs - drop the spec's `Model` and `Api` affixes by convention, so this tier is mostly - noise by design. Keep it out of CI with `--quiet-renamed`. -- **UNTYPED** (warning) — the spec names a schema and the client returns - `JsonElement` / `json.RawMessage` / `unknown` / `JSONValue`. Not a defect, but - it is the coverage backlog: seclai-python reports 206. - -**A typed façade is invisible to this check.** seclai-csharp and seclai-go keep -their raw `JsonElement` / `json.RawMessage` methods and put the typed forms on -`client.Typed` / `client.Typed()`, so a raw-return signature is deliberate, not a -gap. Those façade methods delegate rather than issuing their own request, so -`block_call` finds no verb in them and they are never matched — the UNTYPED count -for those two SDKs will not drop as typing improves. Check the façade before -concluding an endpoint is untyped. seclai-javascript needs no façade (`unknown` -to a concrete type is source compatible) and does report zero. - -**Dated versioning breaks the one-shape assumption.** Since `Seclai-Version` -(2026-07-28) an operation can have two legal response bodies — a bare array by -default, the canonical `{data, pagination}` envelope once the caller opts in — -and the spec documents only the default. A client that decodes both and declares -the envelope is therefore reported as a SHAPE MISMATCH and is *correct*. Two Go -methods sit in that state deliberately. Verify against the header before -"fixing" one; do not retype a permissive client to satisfy this check. - -A wholly untyped return is never a shape error — it commits to nothing and -deserializes anything. But `list[dict[str, Any]]` **is** a commitment to a list, -and is graded as one. - -## `surface` — is this release breaking? - -Diffs the public API surface against the last released tag. Neither the changelog -nor the compiler can answer this: in 2026-07 a C# method gained an optional -parameter, every call site still compiled, the build was green — and it was -**binary breaking**, because adding a parameter changes the method's metadata -token and a consumer that does not recompile fails at runtime. - -Run it before writing the changelog and before tagging: - -```bash -python3 $S surface 1.3.0 # csharp/python: bare tag. go: v-prefixed -``` - -Findings are graded by what actually breaks a caller, because a raw signature -diff called 21 JavaScript changes breaking when none were: - -- **REMOVED / BREAKING** (error) — a released signature no longer works: method - gone, parameter list changed, or a return type changed in a static language. -- **WARN** — compatible but worth checking: a *trailing* optional parameter - (source compatible; flagged as binary breaking for C#), `unknown` narrowed to a - concrete type in TypeScript (safe), or a Python return annotation (not enforced - — but confirm the runtime value did not change too). - -An optional parameter inserted *mid-list* is graded breaking, not a warning: in -C# a positional `M(id, token)` then tries to bind `token` to the new parameter. -Use an overload rather than growing a parameter list. - -## Verifying a bulk edit - -`as`/cast assertions are unchecked, so a green typecheck proves nothing about a -mass find-and-replace. A regex pass over `client.ts` in 2026-07 rewrote 129 -return sites — 20 intended — and broke the parens twice. - -Extract a per-method profile from the old and new sources and diff it, rather -than reading the patch: name, verb, path, query keys, request-call count. 162 of -167 methods came back byte-identical and the 5 differences were each an intended -edit, which is the assurance the diff itself cannot give. `surface` covers the -signature half of this; the request half is a few lines of `re.finditer` over -both revisions. - -## `models` — hand-written models that fell behind - -Only seclai-csharp: everywhere else regeneration keeps models in step. Use -`--since `, which limits the report to properties a schema **gained** since -that rev. Without it you get every long-standing coverage gap — 27 for -seclai-csharp, none of them actionable, which is how a gate gets muted. - -It cannot see models whose schema is declared inline rather than as a named -component; it prints how many are unchecked for that reason. Two of the six -models left stale in 2026-07 were in that blind spot, so treat the count as real. - -## `docexamples` — compile the README - -```bash -D=.claude/skills/seclai-sdk-sync/docexamples.py -python3 $D list . # every fence and whether it is checked -python3 $D check . # compile the marked ones -``` - -Opt-in: mark a fence by putting `` on the line directly above -it. Invisible on GitHub, npm and pkg.go.dev. Most fences are deliberate fragments — -3 of 39 TypeScript fences carry an import — so compiling everything would mean -rewriting the READMEs first. `list` prints the marked fraction so coverage can be -raised over time. TypeScript and Go only; Python examples are plain dicts with -nothing to typecheck. - -Mark any example you add or change. `npm run typecheck` and `go build` do **not** -cover README snippets, and two shipped PRs contained examples that could not compile. - -## The repos are not uniform - -| Repo | Client | Bundles spec | Notes | -| --- | --- | --- | --- | -| seclai-python | generated + hand-written wrappers | yes | `make generate`, then black | -| seclai-javascript | types generated, methods hand-written | yes | `npm run generate` | -| seclai-go | hand-written | yes | | -| seclai-csharp | hand-rolled from the start | **no** | no codegen library was suitable; still at near-full parity — sync it like the others | -| seclai-cli | wraps `@seclai/sdk` | no | coverage question is command-to-SDK-method | -| seclai-mcp | no client source | no | | - -For repos without a bundled spec, point at one: -`--spec ../seclai-python/openapi/seclai.openapi.json`. - -## Workflow - -1. **Confirm the spec is identical** across the repos that bundle it. They must - not diverge — a local edit is always wrong; fix the spec upstream in `seclai`. -2. **`spec-diff`** to see added/removed/changed paths and schema property changes. - - Under each changed path it names what a client can observe — `+query`, - `~query … is now required`, `~request`, `~response` — and only says - `(docs only)` when nothing but prose moved. A `~response` line is the one to - stop on: it means a **shipped** SDK is already failing to deserialize, because - the server changed under it. In the 2026-07 fast-follow two endpoints went from - a bare array to a paginated envelope, breaking the method in all four SDKs. - - Do not stop at the new paths. The `SCHEMA PROPERTY CHANGES` section lists - **existing** models that gained fields, and those are easy to miss because - nothing about them looks new. Repos with generated models pick them up on - regeneration; hand-written ones (seclai-csharp) do not. In the 2026-07 sync six - C# models were left stale this way, including the `disabled` fields that agent - pause/resume depends on — the methods shipped but the state they set was - invisible in the response. -3. **Regenerate**, per repo: - - python: `make generate`, then **immediately** `poetry run black .` — the - generator formats with ruff but the repo commits black, so raw output shows - ~240 changed files that collapse to ~60 real ones. - - javascript: `npm run generate` (no churn; types only). - - go / csharp: nothing to regenerate. -4. **`parity`** to list what is missing. Implement every path, not just the ones - that look interesting — binary/stream endpoints with no JSON schema are the - ones that get skipped. -5. **Write the methods.** In Python they must land in **both** `Seclai` and - `AsyncSeclai`. Generating both from a single table of method definitions is - the reliable way to keep them identical; hand-writing 2×N methods into an - 8,000-line file drifts, and no test asserts the two classes match. Working - emitters from the last sync are in `emit-examples/` in the `sdk-tools` repo — - copy and adapt one, they are reference material rather than a supported API. - - Generation removes transcription drift but propagates a wrong table uniformly - to every call site. Two defects in the last sync were faithful emissions of a - bad table. Audit the result with `params` before trusting it. -6. **Tests** — sync and async for each method, asserting verb, path, query params - and body. Python uses `httpx.MockTransport`; JavaScript uses a `makeClient` - fetch stub. -7. **README** — one section per new endpoint group. -8. **Version constants** — if `spec-diff` printed `API VERSIONS CHANGED`, update - each SDK's version constants. They are pinned per release and an unknown - version is rejected at construction, so a new API version is unusable until - they are updated. Each SDK has a test asserting the constants match - `x-seclai-versions`, so this fails loudly if skipped. -9. **`surface`** against the last released tag — confirm the release is additive, - or decide deliberately to bump the major. -10. **Changelog** — use the `seclai-changelog` skill. Write entries against the - last released tag, never against the branch's earlier state. -11. **Gate**: `make lint && make test` (python) or - `npm run typecheck && npm test && npm run build` (javascript). Re-run `parity` - and confirm zero missing. - -## Naming - -A new method name sets precedent for all six SDKs — the first repo synced defines -it and the rest should follow. Check whether a sibling already named the same -endpoint before inventing one, and prefer the sibling's name transliterated to -local conventions (`searchDocs` / `search_docs` / `SearchDocs`). - -## Typing conventions - -- Return the shape the spec declares: a `$ref` becomes the aliased type, never an - untyped map. See the `seclai-changelog` skill for the full table and the - breaking-change rules. -- **JavaScript:** openapi-typescript emits any property carrying a `default` as - **required**, even when the spec omits it from `required`. Wrap the generated - request so server-defaulted fields stay optional: - `Pick & Partial>` — see `AddEmailDomainInput`. -- Query params are camelCase in the method signature, snake_case on the wire. - -## Repo gotchas - -**seclai-python** - -- `poetry run black .` will reformat the **subtree-vendored** `.claude/skills/` - files and silently drift them from canonical. `.claude` must stay excluded in - black `extend-exclude`, ruff `exclude`, and mypy `exclude`. -- `make generate` always prints - `Unable to parse schema … duplicate models with name "FileUploadResponse"`. - Pre-existing and non-fatal — `routers__api__sources__` and - `routers__api__contents__FileUploadResponse` share a title. Generation completes. -- `seclai/_generated/seclai_api_client/` is **not** regenerated and nothing - imports it. It is stale and safe to ignore; do not treat it as a source of truth. -- mypy rejects assigning the result of a `-> None` method, so tests for - 204-returning endpoints must call without binding a variable. - -**seclai-csharp** - -- Adding a parameter — even an optional one — is **binary breaking** for a NuGet - consumer that does not recompile, and inserting one before a trailing - `CancellationToken` breaks positional callers at compile time too. Add an - overload instead. `surface` catches both. - -**seclai-javascript** - -- `npm run typecheck` does not cover README snippets. Paste any example into a - scratch `.ts` importing from `../src/index` and compile it before claiming it works. - -## Release - -The version comes from the merge commit message, read by `seclai/github-tag-action` -with `DEFAULT_BUMP: patch`. A sync that adds endpoints needs `#minor` in the PR -title, or it ships as a patch and the changelog heading will not match the tag. diff --git a/.claude/skills/seclai-sdk-sync/docexamples.py b/.claude/skills/seclai-sdk-sync/docexamples.py deleted file mode 100755 index 3ec8b2b..0000000 --- a/.claude/skills/seclai-sdk-sync/docexamples.py +++ /dev/null @@ -1,230 +0,0 @@ -#!/usr/bin/env python3 -"""Compile the README examples of a Seclai SDK. Never executes them. - - docexamples.py list [repo] every fence, with its marker state - docexamples.py check [repo] compile the marked fences - -Opt-in by marker. Most fences are deliberate fragments — 3 of 39 TypeScript -fences and 2 of 34 Go fences carry an import — so compiling everything would -mean rewriting the READMEs first. Mark a fence by putting this immediately -above it; it is an HTML comment, so it stays invisible on GitHub, npm and -pkg.go.dev: - - - -`list` prints the marked fraction so coverage is a number that can be driven up -over time rather than a cliff to be turned off. - -Unlike sdksync.py this shells out to the repo's own toolchain, so it only runs -where that toolchain exists. It is deliberately a separate script: a doc check -that needs `tsc` must never be able to break the spec audit that does not. -""" -from __future__ import annotations - -import argparse -import re -import shutil -import subprocess -import sys -from pathlib import Path - -MARKER = "" -SCRATCH = ".doccheck" - -LANGS = { - "javascript": {"detect": "src/client.ts", "fence": "ts", "tool": "npx"}, - "go": {"detect": "client.go", "fence": "go", "tool": "go"}, -} - - -def die(msg: str) -> None: - print(f"error: {msg}", file=sys.stderr) - raise SystemExit(2) - - -def detect(repo: Path) -> str | None: - for name, cfg in LANGS.items(): - if (repo / cfg["detect"]).exists(): - return name - return None - - -def fences(readme: str, tag: str) -> list[tuple[int, bool, str]]: - """(1-indexed start line, marked, body) for every ``` fence.""" - out = [] - for m in re.finditer(rf"```{tag}\n(.*?)```", readme, re.S): - line = readme[:m.start()].count("\n") + 1 - before = readme[:m.start()].rstrip().rsplit("\n", 1)[-1].strip() - out.append((line, before == MARKER, m.group(1))) - return out - - -# ── per-language compilation ───────────────────────────────────────────────── -def check_javascript(repo: Path, marked: list[tuple[int, str]]) -> list[str]: - scratch = repo / SCRATCH - shutil.rmtree(scratch, ignore_errors=True) - scratch.mkdir() - # (README line of the fence, number of lines prepended before the body). - origin: list[tuple[int, int]] = [] - try: - for i, (line, body) in enumerate(marked): - parts = [] - if "import " not in body: - parts.append('import { Seclai } from "../src/index";') - if not re.search(r"\b(const|let|var)\s+client\b", body): - parts.append("declare const client: Seclai;") - # Wrapped so top-level `await` is legal in a fragment. - parts.append("export async function _example() {") - origin.append((line, len(parts))) - parts += [body, "}"] - (scratch / f"ex{i}.ts").write_text("\n".join(parts)) - - r = subprocess.run( - ["npx", "tsc", "--noEmit", "--strict", "--skipLibCheck", - "--target", "es2022", "--module", "esnext", - "--moduleResolution", "bundler", "--lib", "es2022,dom", - "--noUnusedLocals", "false", - *[str(p) for p in sorted(scratch.glob("*.ts"))]], - cwd=repo, capture_output=True, text=True) - if r.returncode == 0: - return [] - # Map "ex3.ts(12,5): error ..." back to a README line number. SCRATCH is - # escaped because it starts with a `.`, which as a regex metachar would - # match any character. The tsc line number is used rather than discarded: - # without it every error in a fence pointed at the fence header, so a - # 30-line example gave the reader one line number for all of them. - pat = re.compile(rf"^{re.escape(SCRATCH)}/ex(\d+)\.ts\((\d+),\d+\):\s*(.*)$") - out = [] - for ln in (r.stdout + r.stderr).splitlines(): - m = pat.match(ln) - if m: - readme_line, prefix = origin[int(m.group(1))] - # Body line 1 sits at generated line prefix+1 and at README line - # readme_line+1, so the two differ by exactly `prefix`. - out.append(f"README.md:{max(readme_line, readme_line + int(m.group(2)) - prefix)}" - f" — {m.group(3)}") - elif ln.strip(): - out.append(ln) - return out - finally: - shutil.rmtree(scratch, ignore_errors=True) - - -def check_go(repo: Path, marked: list[tuple[int, str]]) -> list[str]: - gomod = (repo / "go.mod").read_text() - module = re.search(r"^module\s+(\S+)", gomod, re.M) - if not module: - die("cannot read module path from go.mod") - scratch = repo / SCRATCH - shutil.rmtree(scratch, ignore_errors=True) - scratch.mkdir() - try: - (scratch / "go.mod").write_text( - f"module doccheck\n\ngo 1.22\n\n" - f"require {module.group(1)} v0.0.0\n\n" - f"replace {module.group(1)} => ..\n") - if (repo / "go.sum").exists(): - shutil.copy(repo / "go.sum", scratch / "go.sum") - - # Every example goes into one file, so remember where each body landed. - # `go build` reports `./main.go:42:3: ...` and the finally block deletes - # main.go, so an unmapped diagnostic points the reader at a file that no - # longer exists. (first generated line, last generated line, README line) - text = ("package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n" - f"\t\"{module.group(1)}\"\n)\n\n" - "var (\n\tctx = context.Background()\n\t_ = fmt.Sprint\n" - f"\tclient, _ = seclai.NewClient(seclai.Options{{APIKey: \"k\"}})\n)\n\n") - spans: list[tuple[int, int, int]] = [] - for i, (line, b) in enumerate(marked): - if i: - text += "\n\n" - text += f"func _example{i}() {{\n" - first = text.count("\n") + 1 - text += f"{b}\n" - spans.append((first, text.count("\n"), line)) - text += "}" - text += "\n\nfunc main() {}\n" - (scratch / "main.go").write_text(text) - - subprocess.run(["go", "mod", "tidy"], cwd=scratch, - capture_output=True, text=True) - r = subprocess.run(["go", "build", "./..."], cwd=scratch, - capture_output=True, text=True) - if r.returncode == 0: - return [] - pat = re.compile(r"^\.?/?main\.go:(\d+):(?:\d+:)?\s*(.*)$") - out = [] - for ln in (r.stdout + r.stderr).splitlines(): - m = pat.match(ln.strip()) - if not m: - if ln.strip(): - out.append(ln) - continue - gen = int(m.group(1)) - hit = next(((f, la, rl) for f, la, rl in spans if f <= gen <= la), None) - if hit is None: - out.append(ln) - else: - first, _last, readme_line = hit - out.append(f"README.md:{readme_line + gen - first + 1} — {m.group(2)}") - return out - finally: - shutil.rmtree(scratch, ignore_errors=True) - - -CHECKERS = {"javascript": check_javascript, "go": check_go} - - -def main() -> int: - ap = argparse.ArgumentParser(prog="docexamples", description=__doc__, - formatter_class=argparse.RawDescriptionHelpFormatter) - sub = ap.add_subparsers(dest="cmd", required=True) - for name, help_ in (("list", "every fence and its marker state"), - ("check", "compile the marked fences")): - p = sub.add_parser(name, help=help_) - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--readme", default="README.md") - - args = ap.parse_args() - repo = Path(args.repo).resolve() - lang = detect(repo) - if not lang: - print(f"{repo.name}: no TypeScript or Go client here — nothing to compile") - return 0 - - readme = repo / args.readme - if not readme.exists(): - die(f"no {args.readme} in {repo}") - found = fences(readme.read_text(), LANGS[lang]["fence"]) - marked = [(line, body) for line, mark, body in found if mark] - - if args.cmd == "list": - print(f"{repo.name} [{lang}] — {len(found)} fence(s), " - f"{len(marked)} marked ({len(marked) * 100 // max(len(found), 1)}%)") - for line, mark, _ in found: - print(f" README.md:{line:<5} {'checked' if mark else '-'}") - return 0 - - if not marked: - print(f"{repo.name} [{lang}] — no fences marked with {MARKER}; nothing to check") - return 0 - - # The docstring promises this "only runs where that toolchain exists"; say so - # instead of letting subprocess raise FileNotFoundError at the reader. - tool = LANGS[lang]["tool"] - if not shutil.which(tool): - die(f"{tool} is not on PATH; `docexamples check` needs the {lang} toolchain") - - problems = CHECKERS[lang](repo, marked) - print(f"{repo.name} [{lang}] — compiled {len(marked)} marked fence(s)") - if problems: - print(f"\n{len(problems)} problem(s):") - for p in problems: - print(f" {p}") - return 1 - print("all marked examples compile") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.claude/skills/seclai-sdk-sync/sdksync.py b/.claude/skills/seclai-sdk-sync/sdksync.py deleted file mode 100755 index 7d3b7ca..0000000 --- a/.claude/skills/seclai-sdk-sync/sdksync.py +++ /dev/null @@ -1,1278 +0,0 @@ -#!/usr/bin/env python3 -"""Analysis helpers for syncing a Seclai SDK to a new OpenAPI spec. - -Subcommands: - parity spec paths that have no request call in the hand-written client - params query params the client sends that the endpoint does not declare - returns client return types that disagree with the spec's response schema - models hand-written models missing properties their schema declares - surface public API surface diff against a released tag - spec-diff paths and schemas added/removed/changed between two spec revisions - api-delta public client methods added/removed between two git revisions - -Stdlib only, so it runs in every SDK repo regardless of language toolchain. - -Scope: parity and api-delta understand the four SDKs that issue HTTP requests -directly — python, javascript, go, csharp. seclai-cli wraps @seclai/sdk and -seclai-mcp ships no client source, so both are reported as not-applicable -rather than silently passing. -""" -from __future__ import annotations - -import argparse -import json -import re -import subprocess -import sys -from pathlib import Path - -VERBS = ("GET", "POST", "PUT", "PATCH", "DELETE") - -# A quoted path literal. Matched as "everything up to the closing quote" rather -# than a character class: C# interpolations embed calls — -# $"/agents/runs/{Uri.EscapeDataString(runId)}/cancel" — and a class that omits -# parentheses silently fails to match the whole literal, so the path is never -# extracted and the endpoint looks unimplemented. -PATH_LITERAL_RE = r"""(?:"(/[^"\n]*)"|`(/[^`\n]*)`|'(/[^'\n]*)')""" - -# ── Language table ─────────────────────────────────────────────────────────── -# `sources` are HAND-WRITTEN client files only. Generated trees must never be -# scanned: they contain a module per endpoint and would make parity always pass. -# Query-key extraction, used by `params`. Two forms: -# key_re — the key is captured directly (go: q["k"] = ; csharp: ["k"] = ) -# dict_at — the keys live inside a brace-delimited literal that follows an -# anchor. These MUST be sliced by brace matching, not regex: the -# multi-line `params=_strip_none(\n {...}\n)` form defeats a -# non-greedy regex and yields an empty key set, which reads as -# "this method sends no params" — a silent false pass. -# helpers — positional helper calls that expand to a fixed, ordered key list. -# Expansion is arity-aware: only as many keys as arguments supplied. -LANGS = { - "python": { - "sig_re": r"\n (?:async )?def ([a-z]\w*)\(([^)]*)\)\s*->\s*([^:]+):", - "sig_groups": ("name", "params", "ret"), - "detect": "seclai/seclai.py", - "sources": ["seclai/seclai.py"], - "method_re": r"^[ \t]+(?:async )?def ([a-z][a-z0-9_]*)\(", - # Private helpers start with `_` and so never anchor a block of their - # own; without this the public method above them swallows their request - # calls. `api_key`, a plain property, was credited with GET /sources. - "boundary_re": r"^[ \t]*(?:async )?def |^class ", - "verb_re": r'"(GET|POST|PUT|PATCH|DELETE)"', - "return_re": r"\s*->\s*([^:\n]+):", - "dict_at": [r"params\s*=\s*(?:_strip_none\()?\s*"], - "dict_key_re": r'"([a-zA-Z_][a-zA-Z0-9_]*)"\s*:', - "skip": {"request", "request_raw", "stream", "paginate"}, - }, - "javascript": { - "sig_re": r"\n (?:async )?(\w+)\(([^)]*)\)\s*:\s*([^{\n]+?)\s*\{", - "sig_groups": ("name", "params", "ret"), - "detect": "src/client.ts", - "sources": ["src/client.ts"], - # Exactly two spaces: class members sit at that indent, while statements - # inside a body sit at four or more. A looser `^[ \t]+` also matches - # `return (await this.request(...)` and attributes findings to "return". - # The indent alone is not enough: the module-level helpers above the class - # put `if (` and `for (` at exactly two spaces as well, and without the - # lookahead `api-delta` lists methods named `if` and `for`. - "method_re": (r"^ (?:async )?\*?" - r"(?!(?:if|for|while|switch|catch|do|else|try|return|new|typeof|await)\b)" - r"([a-zA-Z_][a-zA-Z0-9_]*)\s*[(<]"), - "verb_re": r'"(GET|POST|PUT|PATCH|DELETE)"', - "return_re": r"\s*:\s*([^{\n]+?)\s*\{", - "dict_at": [r"query:\s*"], - "dict_key_re": r'["\']?([a-zA-Z_][a-zA-Z0-9_]*)["\']?\s*:', - "skip": {"request", "requestRaw", "uploadFile", "paginate"}, - }, - "go": { - "sig_re": r"func \(c \*Client\) (\w+)\(([^)]*)\) \(([^)]*)\)", - "sig_groups": ("name", "params", "ret"), - "detect": "client.go", - "sources": ["*.go"], - "exclude": ["*_test.go"], - "method_re": r"^func \(c \*Client\) ([A-Z][A-Za-z0-9]*)\(", - # Free functions and type decls end a block; without this the helpers - # between two client methods are read as part of the earlier one. - "boundary_re": r"^(?:func|type|var|const)\b", - "verb_re": r"http\.Method(Get|Post|Put|Patch|Delete)", - # Go returns `(*T, error)`; take the first element of the tuple. - "return_re": r"\s*\(?\s*([^,{\n]+?)\s*(?:,\s*error)?\s*\)?\s*\{", - "key_re": r'q\["([a-zA-Z_][a-zA-Z0-9_]*)"\]\s*=', - # Go builds a query either by subscript assignment (key_re) or as a map - # literal. Reading only the former made Search and SearchDocs — whose - # required `q` is set in the literal — report as never sending it, the - # false positive twin of the bug this check exists to find. - "dict_at": [r"map\[string\]string"], - "dict_key_re": r'"([a-zA-Z_][a-zA-Z0-9_]*)"\s*:', - "helpers": {"listQuery(": ["page", "limit"]}, - "skip": {"Do", "buildURL"}, - }, - "csharp": { - "sig_re": r"public (?:async )?([\w<>,?\[\]. ]+?) ([A-Z]\w*)\(([^)]*)\)", - "sig_groups": ("ret", "name", "params"), - "detect": "src/Seclai/SeclaiClient.cs", - "sources": ["src/Seclai/*.cs"], - "method_re": r"public (?:async )?[\w<>,?\[\]. ]+ ([A-Z][A-Za-z0-9]*)\s*\(", - # Same reason as python: only `public` anchors a block, so the private - # Send*/BuildUri helpers fall inside whichever method precedes them. - "boundary_re": r"^ (?:private|internal|protected|static)\b", - "verb_re": r"HttpMethod\.(Get|Post|Put|Patch|Delete)", - # C# puts the return type BEFORE the method name, so unlike the other - # three it is read from the block head, not from after the parameters. - "return_head_re": r"^\s*public (?:async )?(.+?)\s+[A-Z][A-Za-z0-9]*\s*\(", - "key_re": r'\["([a-zA-Z_][a-zA-Z0-9_]*)"\]\s*=', - "helpers": {"PaginationQuery(": ["page", "limit", "sort", "order"]}, - "skip": {"SendJsonAsync", "SendNoContentAsync", "SendRawAsync", "BuildUri", "PaginationQuery"}, - }, -} - -NOT_APPLICABLE = { - "seclai-cli": "wraps @seclai/sdk; coverage is SDK-method-to-command, not spec-path", - "seclai-mcp": "ships no client source", -} - - -def die(msg: str) -> None: - print(f"error: {msg}", file=sys.stderr) - raise SystemExit(2) - - -def detect_lang(repo: Path) -> str | None: - for name, cfg in LANGS.items(): - if (repo / cfg["detect"]).exists(): - return name - return None - - -def source_files(repo: Path, cfg: dict) -> list[Path]: - out: list[Path] = [] - for pat in cfg["sources"]: - out.extend(sorted(repo.glob(pat)) if "*" in pat else ([repo / pat] if (repo / pat).exists() else [])) - for pat in cfg.get("exclude", []): - excl = set(repo.glob(pat)) - out = [p for p in out if p not in excl] - return out - - -def normalise(path: str) -> str: - """Collapse every placeholder form to `{}` so paths compare across languages.""" - path = re.sub(r"\$\{[^}]*\}", "{}", path) # JS template ${agentId} - path = re.sub(r"\{[^}]*\}", "{}", path) # py f-string / C# interpolation / spec - path = re.sub(r"%[sdv]", "{}", path) # go fmt.Sprintf - return path.rstrip("/") or "/" - - -def extract_paths(text: str, verb_re: str) -> dict[str, set[str]]: - """Map normalised path -> set of verbs seen near its occurrences. - - Verb association is best-effort: it scans a window around each occurrence. - Absence of a verb is reported as a warning, never as a hard miss. - """ - found: dict[str, set[str]] = {} - for m in re.finditer(PATH_LITERAL_RE, text): - p = normalise(next(g for g in m.groups() if g is not None)) - if p == "/" or not p.startswith("/"): - continue - window = text[max(0, m.start() - 220): m.end() + 60] - verbs = {v.upper() for v in re.findall(verb_re, window)} - found.setdefault(p, set()).update(verbs) - return found - - -def load_spec(ref: str | None, path: str, repo: Path) -> dict: - if ref: - try: - blob = subprocess.check_output( - ["git", "-C", str(repo), "show", f"{ref}:{path}"], stderr=subprocess.DEVNULL) - except subprocess.CalledProcessError: - die(f"cannot read {path} at {ref}") - return json.loads(blob) - f = Path(path) if Path(path).is_absolute() else repo / path - if not f.exists(): - die(f"no spec at {f}\n" - " Only seclai-python, seclai-javascript and seclai-go bundle the spec.\n" - " For the others, point at one explicitly, e.g.\n" - " --spec ../seclai-python/openapi/seclai.openapi.json") - return json.loads(f.read_text()) - - -# ── params ─────────────────────────────────────────────────────────────────── -def balanced_slice(text: str, at: int, opener: str = "{", closer: str = "}") -> str | None: - """Return the brace-delimited literal starting at or after `at`. - - Regex cannot do this: query literals span lines and nest, and a non-greedy - match silently truncates at the first inner `}`. - """ - i = text.find(opener, at) - if i == -1: - return None - depth, j = 0, i - while j < len(text): - if text[j] == opener: - depth += 1 - elif text[j] == closer: - depth -= 1 - if depth == 0: - return text[i + 1: j] - j += 1 - return None - - -def split_args(sig: str) -> list[str]: - """Split a comma-separated argument or parameter list at depth 0. - - A naive `split(",")` turns `Dictionary q` into two entries, - which over-counts arity for the query helpers and reports a phantom - signature change for `surface`. - """ - out, depth, cur = [], 0, "" - for ch in sig: - if ch in "<([{": - depth += 1 - elif ch in ">)]}": - depth -= 1 - if ch == "," and depth == 0: - out.append(cur.strip()) - cur = "" - else: - cur += ch - if cur.strip(): - out.append(cur.strip()) - return [p for p in out if p and p != "*"] - - -def spec_query_index(spec: dict) -> dict[tuple[str, str], tuple[str, set[str], set[str]]]: - """(VERB, normalised path) -> (raw path, declared query names, required names). - - Resolves `$ref` against components.parameters and merges path-level params - into each operation, both of which the spec uses. - """ - comp = spec.get("components", {}).get("parameters", {}) - - def resolve(p: dict) -> dict: - ref = p.get("$ref") - if ref and ref.startswith("#/components/parameters/"): - return comp.get(ref.rsplit("/", 1)[-1], {}) - return p - - index: dict[tuple[str, str], tuple[str, set[str], set[str]]] = {} - for raw, ops in spec.get("paths", {}).items(): - shared = [resolve(p) for p in ops.get("parameters", [])] - for verb, op in ops.items(): - if verb not in ("get", "post", "put", "patch", "delete"): - continue - params = shared + [resolve(p) for p in op.get("parameters", [])] - q = {p["name"] for p in params if p.get("in") == "query" and "name" in p} - req = {p["name"] for p in params - if p.get("in") == "query" and p.get("required") and "name" in p} - index[(verb.upper(), normalise(raw))] = (raw, q, req) - return index - - -def method_blocks(text: str, method_re: str, boundary_re: str | None = None): - """Yield (name, body). Each block ends at the next method OR declaration. - - Ending only at the next *method* anchor makes a block swallow everything - between two methods, so any free function declared in the gap is attributed - to the method above it. In seclai-go that made `GetMe` — which sends no query - at all — appear to send page/limit/sort/order, because the `listQuery` and - `sortableListQuery` helpers sit between it and the next client method. Four - of six reported Go errors were that one artefact, and a check that cries wolf - is a check somebody turns off. - """ - ms = list(re.finditer(method_re, text, re.M)) - bounds = [m.start() for m in re.finditer(boundary_re, text, re.M)] if boundary_re else [] - for i, m in enumerate(ms): - end = ms[i + 1].start() if i + 1 < len(ms) else len(text) - nxt = next((b for b in bounds if b > m.start()), None) - if nxt is not None: - end = min(end, nxt) - yield m.group(1), text[m.start():end] - - -def block_call(body: str, verb_re: str) -> tuple[str, str] | None: - """First (VERB, normalised path) issued inside a method body. - - The path must appear AFTER the verb: taking the first path-like literal - anywhere in the block picks up example paths out of docstrings and prose. - """ - v = re.search(verb_re, body) - if not v: - return None - p = re.search(PATH_LITERAL_RE, body[v.end():v.end() + 400]) - if not p: - return None - path = normalise(next(g for g in p.groups() if g is not None)) - if path == "/": - return None - return v.group(1).upper(), path - - -def block_query_keys(body: str, cfg: dict) -> tuple[set[str], bool]: - """(keys, parsed_ok). parsed_ok is False when a construction site was found - but could not be read — reported as an error, never as "sends nothing".""" - keys: set[str] = set() - ok = True - - for anchor, ordered in (cfg.get("helpers") or {}).items(): - for m in re.finditer(re.escape(anchor), body): - args = balanced_slice(body, m.end() - 1, "(", ")") - if args is None: - ok = False - continue - keys |= set(ordered[:len(split_args(args))]) - - if "key_re" in cfg: - keys |= set(re.findall(cfg["key_re"], body)) - - indirect = False - for anchor in cfg.get("dict_at", []): - for m in re.finditer(anchor, body): - rest = body[m.end():] - stripped = rest.lstrip() - if not stripped.startswith("{"): - # `params=params` / `query: someVar` — a reference, not a literal. - # Not readable here, but the literal is usually assigned earlier in - # the same block, so only treat it as unaudited if nothing was found. - indirect = True - continue - lit = balanced_slice(body, m.end()) - if lit is None: - ok = False - continue - keys |= set(re.findall(cfg["dict_key_re"], lit)) - - if indirect and not keys: - ok = False - return keys, ok - - -def cmd_params(args) -> int: - repo = Path(args.repo).resolve() - name = repo.name - if name in NOT_APPLICABLE: - print(f"{name}: not applicable — {NOT_APPLICABLE[name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - die(f"cannot detect SDK language in {repo}") - cfg = LANGS[lang] - files = source_files(repo, cfg) - if not files: - die(f"no client sources found for {lang} in {repo}") - - spec = load_spec(args.rev, args.spec, repo) - index = spec_query_index(spec) - - undeclared, not_in_spec, unparsed, exposed = set(), set(), set(), {} - missing_required: set[tuple[str, str, str]] = set() - - for f in files: - text = f.read_text(errors="replace") - for mname, body in method_blocks(text, cfg["method_re"], cfg.get("boundary_re")): - if mname in cfg.get("skip", ()): - continue - call = block_call(body, cfg["verb_re"]) - if not call: - continue - keys, ok = block_query_keys(body, cfg) - if not ok: - unparsed.add((mname, f"{call[0]} {call[1]}")) - if call not in index: - not_in_spec.add((mname, f"{call[0]} {call[1]}")) - continue - raw, declared, required = index[call] - exposed.setdefault((call[0], raw), set()).update(keys) - if ok: - # Only trust this when the query construction parsed: an - # unreadable site would otherwise look like "sends nothing". - for k in sorted(required - keys): - missing_required.add((mname, f"{call[0]} {raw}", k)) - for k in sorted(keys - declared): - undeclared.add((mname, f"{call[0]} {raw}", k, tuple(sorted(declared)))) - - print(f"{name} [{lang}] — {len(files)} client file(s), " - f"{len(index)} spec operations") - - if undeclared: - print(f"\nUNDECLARED ({len(undeclared)}) — sent but the endpoint does not accept it:") - for m, op, k, decl in sorted(undeclared): - print(f" {m} ({op})") - print(f" sends: {k}") - print(f" accepts: {', '.join(decl) or '(none)'}") - - if not_in_spec: - print(f"\nNOT IN SPEC ({len(not_in_spec)}) — client calls a path the spec does not declare:") - for m, op in sorted(not_in_spec): - print(f" {m} ({op})") - - if missing_required: - print(f"\nMISSING REQUIRED ({len(missing_required)}) — the endpoint requires this" - f" and no code path sends it:") - for m, op, k in sorted(missing_required): - print(f" {m} ({op}) needs: {k}") - - if unparsed: - print(f"\nUNPARSED ({len(unparsed)}) — query construction could not be read;" - f" treat as unaudited, not as clean:") - for m, op in sorted(unparsed): - print(f" {m} ({op})") - - if not args.quiet_unexposed: - gaps = [] - for (verb, _npath), (raw, declared, _req) in index.items(): - got = exposed.get((verb, raw)) - if got is None: - continue # endpoint not implemented at all — parity's job - missing = declared - got - if missing: - gaps.append((f"{verb} {raw}", sorted(missing))) - if gaps: - print(f"\nUNEXPOSED ({len(gaps)}) — declared query params no method sends:") - for op, names in sorted(gaps): - print(f" {op}: {', '.join(names)}") - - # A method whose query could not be read AND whose path is not in the spec is - # one problem, not two; counting it twice inflated the gate's error total. - errors = (len(undeclared) + len(not_in_spec) + len(missing_required) - + len(unparsed - not_in_spec)) - print() - if errors: - print(f"{errors} error(s)") - return 1 - print("no parameter mismatches") - return 0 - - -# ── parity ─────────────────────────────────────────────────────────────────── -def cmd_parity(args) -> int: - repo = Path(args.repo).resolve() - name = repo.name - if name in NOT_APPLICABLE: - print(f"{name}: not applicable — {NOT_APPLICABLE[name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - die(f"cannot detect SDK language in {repo} (looked for " - + ", ".join(c["detect"] for c in LANGS.values()) + ")") - cfg = LANGS[lang] - files = source_files(repo, cfg) - if not files: - die(f"no client sources found for {lang} in {repo}") - - spec = load_spec(args.rev, args.spec, repo) - text = "\n".join(f.read_text(errors="replace") for f in files) - impl = extract_paths(text, cfg["verb_re"]) - - missing, partial = [], [] - total = 0 - for p, ops in sorted(spec.get("paths", {}).items()): - verbs = {v.upper() for v in ops if v in ("get", "post", "put", "patch", "delete")} - if not verbs: - continue - total += len(verbs) - norm = normalise(p) - if norm not in impl: - missing += [f"{v} {p}" for v in sorted(verbs)] - else: - seen = impl[norm] - if seen and not verbs <= seen: - partial += [f"{v} {p}" for v in sorted(verbs - seen)] - - print(f"{name} [{lang}] — {len(files)} client file(s), " - f"{total} spec operations across {len(spec.get('paths', {}))} paths") - if missing: - print(f"\nMISSING — no request call for this path ({len(missing)}):") - for m in missing: - print(f" {m}") - if partial and not args.quiet_partial: - print(f"\nverb not detected near an existing path ({len(partial)}) " - f"— best-effort, verify by hand:") - for m in partial: - print(f" {m}") - if not missing: - print("\nfull path parity") - return 1 if missing else 0 - - -# ── spec-diff ──────────────────────────────────────────────────────────────── -def _schema_label(sch: dict | None) -> str: - """A short, comparable name for a response/request schema.""" - if not sch: - return "none" - if "$ref" in sch: - return sch["$ref"].rsplit("/", 1)[-1] - if sch.get("type") == "array": - return f"array<{_schema_label(sch.get('items'))}>" - if sch.get("type") == "object" or "properties" in sch: - return "object" - return sch.get("type", "unknown") - - -def _json_schema(op: dict, section: str, code: str | None = None) -> dict | None: - node = op.get("requestBody") if section == "request" else op.get("responses", {}).get(code, {}) - return (node or {}).get("content", {}).get("application/json", {}).get("schema") - - -def diff_operation(old: dict, new: dict, path: str, verb: str, - old_q: dict | None = None, new_q: dict | None = None) -> list[str]: - """What actually changed on one operation, beyond its prose. - - `old_q`/`new_q` are prebuilt `spec_query_index` results. Rebuilding them here - walks and $ref-resolves the whole 124-path spec twice for every changed - operation; the caller builds them once. - - The original implementation labelled every non-verb change - "description/params only", which reads as "nothing to do". In the 2026-07 - fast-follow two endpoints silently changed their 200 body from a bare array - to a paginated envelope — a change that breaks every shipped client at - runtime — and the tool reported them as prose edits. Anything a client can - observe gets named here; only genuine prose edits fall through to "docs only". - """ - old_q = spec_query_index(old) if old_q is None else old_q - new_q = spec_query_index(new) if new_q is None else new_q - lo = old_q.get((verb, normalise(path))) - ln = new_q.get((verb, normalise(path))) - oop = old["paths"][path][verb.lower()] - nop = new["paths"][path][verb.lower()] - out: list[str] = [] - - if lo and ln: - _, oq, oreq = lo - _, nq, nreq = ln - if nq - oq: - out.append("+query " + ", ".join(sorted(nq - oq))) - if oq - nq: - out.append("-query " + ", ".join(sorted(oq - nq))) - for name in sorted((nreq - oreq) & (oq & nq)): - out.append(f"~query {name} is now required") - for name in sorted((oreq - nreq) & (oq & nq)): - out.append(f"~query {name} is no longer required") - - ob, nb = _schema_label(_json_schema(oop, "request")), _schema_label(_json_schema(nop, "request")) - if ob != nb: - out.append(f"~request {ob} -> {nb}") - - for code in sorted(set(oop.get("responses", {})) | set(nop.get("responses", {}))): - if code.startswith("4") or code.startswith("5"): - continue - a = _schema_label(_json_schema(oop, "response", code)) - b = _schema_label(_json_schema(nop, "response", code)) - if a != b: - out.append(f"~response {code}: {a} -> {b}") - return out - - -def cmd_spec_diff(args) -> int: - repo = Path(args.repo).resolve() - old = load_spec(args.old, args.spec, repo) - new = load_spec(args.new, args.spec, repo) if args.new else load_spec(None, args.spec, repo) - - op, np_ = set(old.get("paths", {})), set(new.get("paths", {})) - os_, ns_ = set(old.get("components", {}).get("schemas", {})), set(new.get("components", {}).get("schemas", {})) - - def ops(spec, p): - return sorted(v.upper() for v in spec["paths"][p] if v in ("get", "post", "put", "patch", "delete")) - - print(f"paths: {len(op)} -> {len(np_)} schemas: {len(os_)} -> {len(ns_)}") - - if np_ - op: - print(f"\nADDED PATHS ({len(np_ - op)}):") - for p in sorted(np_ - op): - print(f" {p} [{', '.join(ops(new, p))}]") - if op - np_: - print(f"\nREMOVED PATHS ({len(op - np_)}):") - for p in sorted(op - np_): - print(f" {p}") - - changed, breaking = [], 0 - old_q, new_q = spec_query_index(old), spec_query_index(new) - for p in sorted(np_ & op): - if json.dumps(old["paths"][p], sort_keys=True) == json.dumps(new["paths"][p], sort_keys=True): - continue - oo, nn = set(ops(old, p)), set(ops(new, p)) - lines = [] - if nn - oo: - lines.append("+verbs " + ", ".join(sorted(nn - oo))) - if oo - nn: - lines.append("-verbs " + ", ".join(sorted(oo - nn))) - for verb in sorted(oo & nn): - lines += [f"{verb} {d}" - for d in diff_operation(old, new, p, verb, old_q, new_q)] - breaking += sum(1 for ln in lines if "~response" in ln or ln.startswith("-verbs")) - changed.append(f" {p}" + ("\n" + "\n".join(f" {ln}" for ln in lines) if lines - else " (docs only)")) - if changed: - print(f"\nCHANGED PATHS ({len(changed)}):") - print("\n".join(changed)) - if breaking: - print(f"\n !! {breaking} response/verb change(s) above can break a shipped client.") - print(" Check the SDK's declared return type, not just its query params.") - - if ns_ - os_: - print(f"\nADDED SCHEMAS ({len(ns_ - os_)}):") - for s in sorted(ns_ - os_): - print(f" {s}") - if os_ - ns_: - print(f"\nREMOVED SCHEMAS ({len(os_ - ns_)}):") - for s in sorted(os_ - ns_): - print(f" {s}") - - ov = old.get("x-seclai-versions") or {} - nv = new.get("x-seclai-versions") or {} - if ov != nv: - print("\nAPI VERSIONS CHANGED:") - for key in ("default", "latest"): - if ov.get(key) != nv.get(key): - print(f" {key}: {ov.get(key)} -> {nv.get(key)}") - gained = [v for v in nv.get("known", []) if v not in ov.get("known", [])] - if gained: - print(f" +known {', '.join(gained)}") - print(" Each SDK pins these as constants and rejects an unknown version, so " - "update them\n or the new version cannot be selected. Their tests assert " - "the constants match this block.") - - prop_changes = [] - for k in sorted(ns_ & os_): - o = set((old["components"]["schemas"][k].get("properties") or {})) - n = set((new["components"]["schemas"][k].get("properties") or {})) - if o != n: - bits = [] - if n - o: - bits.append("+" + ",".join(sorted(n - o))) - if o - n: - bits.append("-" + ",".join(sorted(o - n))) - prop_changes.append(f" {k}: {' '.join(bits)}") - if prop_changes: - print(f"\nSCHEMA PROPERTY CHANGES ({len(prop_changes)}):") - print("\n".join(prop_changes)) - return 0 - - -# ── api-delta ──────────────────────────────────────────────────────────────── -def verify_rev(repo: Path, rev: str | None) -> None: - """Fail loudly on an unresolvable rev. - - Without this, an unreadable rev yields an empty method set and the delta - reports every method in the SDK as newly added — a confident wrong answer. - """ - if rev is None: - return - r = subprocess.run(["git", "-C", str(repo), "rev-parse", "--verify", "--quiet", f"{rev}^{{commit}}"], - capture_output=True, text=True) - if r.returncode != 0: - die(f"not a git revision in {repo.name}: {rev!r}") - - -def methods_at(repo: Path, rev: str | None, cfg: dict, files: list[Path]) -> set[str]: - names: set[str] = set() - for f in files: - rel = f.relative_to(repo) - if rev: - try: - text = subprocess.check_output( - ["git", "-C", str(repo), "show", f"{rev}:{rel}"], - stderr=subprocess.DEVNULL).decode("utf-8", "replace") - except subprocess.CalledProcessError: - continue - else: - text = f.read_text(errors="replace") - for m in re.finditer(cfg["method_re"], text, re.M): - n = m.group(1) - if not n.startswith("_"): - names.add(n) - return names - - -def cmd_api_delta(args) -> int: - repo = Path(args.repo).resolve() - name = repo.name - if name in NOT_APPLICABLE: - print(f"{name}: not applicable — {NOT_APPLICABLE[name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - die(f"cannot detect SDK language in {repo}") - cfg = LANGS[lang] - files = source_files(repo, cfg) - - verify_rev(repo, args.old) - verify_rev(repo, args.new) - old = methods_at(repo, args.old, cfg, files) - new = methods_at(repo, args.new, cfg, files) - - added, removed = sorted(new - old), sorted(old - new) - label_new = args.new or "working tree" - print(f"{name} [{lang}] {args.old} -> {label_new}") - print(f"\nADDED ({len(added)}):") - for n in added: - print(f" {n}") - if removed: - print(f"\nREMOVED ({len(removed)}):") - for n in removed: - print(f" {n}") - print("\n note: a name in both lists was renamed or re-signatured, not deleted —" - "\n check the signature diff before writing a Removed changelog entry.") - return 0 - - -# ── returns ────────────────────────────────────────────────────────────────── -# The third axis. `parity` walks spec->client paths, `params` walks client->spec -# query keys, and neither can see a response shape. In 2026-07 two endpoints -# changed their 200 body from a bare array to a paginated envelope; every shipped -# SDK still declared a list, so all four broke at runtime and both checks stayed -# green. This compares the client's DECLARED return type against the spec's. - -# Untyped escape hatches. Returning one is legal but means the caller gets no -# help from the compiler, so it is reported as a warning when the spec has a name. -UNTYPED = { - "csharp": {"JsonElement", "JsonDocument", "object", "string", "Stream", "byte[]"}, - "go": {"json.RawMessage", "any", "interface{}", "map[string]any", "[]byte"}, - "python": {"Any", "dict", "dict[str, Any]", "Dict[str, Any]", "object", "bytes", - "JSONValue", "JSONObject"}, - "javascript": {"unknown", "any", "object", "Blob", "ArrayBuffer", "string"}, -} -NO_RETURN = {"csharp": {"Task", "void"}, "go": {"error", ""}, - "python": {"None"}, "javascript": {"void"}} - - -def short_label(label: str) -> str: - """Drop the spec's module qualification: `routers__api__agents__X` -> `X`. - - No SDK reproduces that qualification in its own type names, so comparing the - full name marks every qualified schema as a mismatch — 38 of 38 C# findings - on the first run, which is a broken check rather than a broken SDK. - """ - m = re.match(r"^array<(.+)>$", label) - if m: - return f"array<{short_label(m.group(1))}>" - return label.rsplit("__", 1)[-1] - - -def strip_generated_prefix(name: str) -> str: - """`RoutersApiAgentsSetEmailTriggerConfigRequest` -> the spec's short name. - - oapi-codegen flattens the spec's `routers__api__agents__X` qualification into - the type name, so a literal comparison against the schema name never matches. - """ - return re.sub(r"^Routers(?:Api|Authenticated)[A-Z][a-zA-Z]*?(?=[A-Z])", "", name) - - -def normalise_type(t: str, lang: str) -> str: - """A client return type expressed the way `_schema_label` labels a schema.""" - t = t.strip().rstrip(";").strip() - for wrapper in (r"^Task<(.+)>$", r"^Promise<(.+)>$", r"^Awaitable\[(.+)\]$"): - m = re.match(wrapper, t) - if m: - t = m.group(1).strip() - t = t.lstrip("*&").replace(" | null", "").replace(" | undefined", "") - t = re.sub(r"\s*\|\s*None$", "", t) - t = t.rstrip("?") - # The escape hatches come FIRST. `byte[]` and `[]byte` are whole-blob - # returns, but they also match the array patterns below, so testing shape - # first turned every binary endpoint into an `array` and graded it a - # SHAPE MISMATCH against the spec's object — a hard error, exit 1, on code - # that is correct. Nothing in UNTYPED is a real list, so this cannot mask - # `list[dict[str, Any]]`, which is not in the table. - if t in NO_RETURN.get(lang, set()): - return "none" - if t in UNTYPED.get(lang, set()): - return "?" - for arr in (r"^List<(.+)>$", r"^IReadOnlyList<(.+)>$", r"^\[\](.+)$", - r"^list\[(.+)\]$", r"^List\[(.+)\]$", r"^(.+)\[\]$"): - m = re.match(arr, t) - if m: - return f"array<{normalise_type(m.group(1), lang)}>" - return strip_generated_prefix(t) - - -def block_return(body: str, cfg: dict) -> str | None: - """The declared return type of the method a block starts with. - - Read by slicing the parameter list with paren matching rather than by regex: - signatures wrap across lines and contain nested parens and generics, both of - which truncate a regex silently — and a silent truncation here reads as - "this method declares nothing to check". - """ - if "return_head_re" in cfg: - m = re.match(cfg["return_head_re"], body, re.S) - return m.group(1).strip() if m else None - # Start at the paren the method anchor itself ends on. Taking the first `(` - # in the block instead picks up Go's receiver — `func (c *Client) GetMe(` — - # so the "return type" came back as the rest of the signature. - anchor = re.match(cfg["method_re"], body, re.M) - if not anchor: - return None - open_paren = body.find("(", anchor.end() - 1) - if open_paren == -1: - return None - params = balanced_slice(body, open_paren, "(", ")") - if params is None: - return None - rest = body[open_paren + len(params) + 2:] - m = re.match(cfg["return_re"], rest, re.S) - return m.group(1).strip() if m else None - - -def cmd_returns(args) -> int: - repo = Path(args.repo).resolve() - if repo.name in NOT_APPLICABLE: - print(f"{repo.name}: not applicable — {NOT_APPLICABLE[repo.name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - die(f"cannot detect SDK language in {repo}") - cfg = LANGS[lang] - if "return_re" not in cfg and "return_head_re" not in cfg: - print(f"{repo.name} [{lang}] — return types are not declared; nothing to check.") - return 0 - files = source_files(repo, cfg) - if not files: - # Silence here is a false pass: no sources means no methods means - # "nothing disagrees with the spec", which is what a mis-pointed repo - # argument looks like. - die(f"no client sources found for {lang} in {repo}") - spec = load_spec(args.rev, args.spec, repo) - - want: dict[tuple[str, str], str] = {} - for raw, ops in spec.get("paths", {}).items(): - for verb, op in ops.items(): - if verb not in ("get", "post", "put", "patch", "delete"): - continue - for code in ("200", "201", "202"): - if code in op.get("responses", {}): - want[(verb.upper(), normalise(raw))] = short_label( - _schema_label(_json_schema(op, "response", code))) - break - - mismatched, renamed, untyped, n = [], [], [], 0 - for path in files: - text = path.read_text(encoding="utf-8", errors="replace") - for mname, body in method_blocks(text, cfg["method_re"], cfg.get("boundary_re")): - if mname in cfg.get("skip", set()): - continue - call = block_call(body, cfg["verb_re"]) - if not call or call not in want: - continue - declared = block_return(body, cfg) - if declared is None: - continue - n += 1 - got, expect = normalise_type(declared, lang), want[call] - if expect in ("object", "none", "unknown", "?"): - continue # the spec itself declares nothing to match - if got == expect or strip_generated_prefix(got) == expect: - continue - # Separate the two failure modes. A list where the API returns an - # envelope throws at deserialization; a type NAMED differently from - # its schema is only cosmetic, and the SDKs rename by convention — - # all four drop the spec's `Model` and `Api` affixes. Ranking those - # equally buried the one real finding under eleven harmless ones. - # A wholly untyped return (`JsonElement`, `unknown`, `JSONValue`) - # commits to no shape at all and deserializes anything, so it is a - # coverage warning, never a shape error. - if got == "?": - untyped.append((mname, call, expect, declared)) - # Shape next. `list[dict[str, Any]]` IS a commitment to a list and is - # also untyped; testing untyped-ness first classified seclai-python's - # list_evaluation_criteria as a soft warning and reported the repo - # clean, when it is exactly as broken as the Go and JS ones. - elif got.startswith("array<") != expect.startswith("array<"): - mismatched.append((mname, call, expect, declared)) - elif "?" in got: - untyped.append((mname, call, expect, declared)) - else: - renamed.append((mname, call, expect, declared)) - - print(f"{repo.name} [{lang}] — {n} method(s) with both a declared return type " - f"and a named response schema") - - if mismatched: - print(f"\nSHAPE MISMATCH ({len(mismatched)}) — list vs object; this fails at deserialization:") - for name, (verb, p), expect, declared in mismatched: - print(f" {name} ({verb} {p})\n spec: {expect}\n code: {declared}") - if renamed and not args.quiet_renamed: - print(f"\nWARN — NAME DIFFERS ({len(renamed)}) — same shape, different type name:") - for name, (verb, p), expect, declared in renamed: - print(f" {name} ({verb} {p}): {declared}, spec calls it {expect}") - if untyped and not args.quiet_untyped: - print(f"\nWARN — UNTYPED ({len(untyped)}) — spec names a schema, the client returns a blob:") - for name, (verb, p), expect, declared in untyped: - print(f" {name} ({verb} {p}): {declared}, spec declares {expect}") - - if mismatched: - print(f"\n{len(mismatched)} return type(s) disagree with the spec in SHAPE.") - return 1 - print("\nno return type disagrees with the spec in shape") - return 0 - - - -# ── surface ────────────────────────────────────────────────────────────────── -def public_surface(text: str, cfg: dict) -> dict[str, set[tuple[str, str]]]: - """method name -> {(return type, parameter list)}. A set, because C# and Go - both allow overloads/variants under one name.""" - out: dict[str, set[tuple[str, str]]] = {} - order = cfg["sig_groups"] - - def norm(x: str | None) -> str: - return " ".join((x or "").split()) - - for m in re.finditer(cfg["sig_re"], text, re.S): - parts = dict(zip(order, m.groups())) - out.setdefault(norm(parts["name"]), set()).add((norm(parts["ret"]), norm(parts["params"]))) - return out - - - -# Kept as an alias: the tests and the older call sites name it `_params`. -_params = split_args - - -def classify_change(lang: str, old: tuple[str, str], new: tuple[str, str]) -> tuple[str, str]: - """(severity, label) for one signature change. severity is 'break' or 'warn'. - - Not every signature change breaks a caller, and a check that says it does is - a check people switch off. Narrowing a return from `unknown` to a concrete - type is safe for every TypeScript consumer; a Python return annotation is not - enforced at all. Adding an optional parameter still compiles everywhere — but - it changes the method's metadata token, so a C# consumer that does not - recompile breaks at runtime. That last case is real and easy to miss. - """ - old_ret, old_par = old - new_ret, new_par = new - if old_par != new_par: - op, np_ = split_args(old_par), split_args(new_par) - # `len(np_) > len(op)` matters: `split_args` drops Python's bare `*`, so - # `f(self, a, b)` -> `f(self, a, *, b)` yields two IDENTICAL lists, the - # empty tail passes `all()` vacuously, and making a parameter - # keyword-only — which breaks every positional caller — was graded - # "optional parameters added — source compatible". - added_optional = (len(np_) > len(op) - and np_[:len(op)] == op - and all("=" in a for a in np_[len(op):])) - if added_optional: - if lang == "csharp": - return "warn", "optional parameters added — source compatible, but binary breaking for consumers that do not recompile" - return "warn", "optional parameters added — source compatible" - return "break", "parameter list changed" - if old_ret != new_ret: - if lang == "javascript" and "unknown" in old_ret and "unknown" not in new_ret: - return "warn", "return narrowed from unknown — safe for consumers" - if lang == "python": - return "warn", "return annotation changed — not enforced at runtime, but check the value did not change" - return "break", "return type changed" - return "warn", "signature reordered" - - -def cmd_surface(args) -> int: - """Diff the public API surface against a released tag. - - The check that answers "is this release breaking?". Reading the changelog - cannot answer it, and neither can the compiler: adding an optional parameter - in C# still compiles for every caller but breaks any consumer that does not - recompile. That is exactly how a binary-breaking change reached an - otherwise-additive release in 2026-07. - """ - repo = Path(args.repo).resolve() - if repo.name in NOT_APPLICABLE: - print(f"{repo.name}: not applicable — {NOT_APPLICABLE[repo.name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - die(f"cannot detect SDK language in {repo}") - cfg = LANGS[lang] - if "sig_re" not in cfg: - print(f"{repo.name} [{lang}] — no signature pattern; nothing to compare.") - return 0 - verify_rev(repo, args.rev) - - files = source_files(repo, cfg) - if not files: - die(f"no client sources found for {lang} in {repo}") - rel = [str(f.relative_to(repo)) for f in files] - # `verify_rev` proves the rev resolves; it does not prove the sources existed - # under these paths back then. A rename since the tag makes every `git show` - # fail, and swallowing that yields an empty baseline — zero removed, zero - # changed, "no breaking change" — the same confident wrong answer one level - # down. Joined with newlines so the last line of one file cannot merge with - # the first line of the next. - old_parts = [] - for r in rel: - p = subprocess.run(["git", "-C", str(repo), "show", f"{args.rev}:{r}"], - capture_output=True, text=True) - if p.returncode == 0: - old_parts.append(p.stdout) - if not old_parts: - die(f"none of the client sources exist at {args.rev} in {repo.name} " - f"({', '.join(rel)}) — were they renamed since the tag?") - old_text = "\n".join(old_parts) - new_text = "\n".join(f.read_text(encoding="utf-8", errors="replace") for f in files) - - old, new = public_surface(old_text, cfg), public_surface(new_text, cfg) - removed = sorted(set(old) - set(new)) - added = sorted(set(new) - set(old)) - changed = [k for k in sorted(set(old) & set(new)) if old[k] - new[k]] - - print(f"{repo.name} [{lang}] — {len(old)} public method(s) at {args.rev}, {len(new)} now") - - if removed: - print(f"\nREMOVED ({len(removed)}) — every caller breaks:") - for k in removed: - print(f" {k}") - breaks, warns = [], [] - for k in changed: - gone = sorted(old[k] - new[k]) - now = sorted(new[k] - old[k]) - sev, label = ("break", "signature removed") - if len(gone) == 1 and len(now) == 1: - sev, label = classify_change(lang, gone[0], now[0]) - (breaks if sev == "break" else warns).append((k, label, gone, now)) - - def show(rows: list) -> None: - for k, label, gone, now in rows: - print(f" {k} — {label}") - for ret, params in gone: - print(f" was: {ret} ({params[:100]})") - for ret, params in now: - print(f" now: {ret} ({params[:100]})") - - if breaks: - print(f"\nBREAKING ({len(breaks)}) — a released signature no longer works:") - show(breaks) - if warns and not args.quiet_warn: - print(f"\nWARN — CHANGED ({len(warns)}) — compatible, but verify:") - show(warns) - if added and not args.quiet_added: - print(f"\nADDED ({len(added)}):") - print(" " + ", ".join(added)) - - if removed or breaks: - print(f"\n{len(removed) + len(breaks)} breaking change(s). Keep the old form and add " - "alongside it, or bump the major.") - return 1 - print("\nno breaking change — every released signature still works") - return 0 - - -# ── Model completeness ─────────────────────────────────────────────────────── -# Only for SDKs whose models are written by hand. Where a generator owns the -# models, regeneration keeps them in step and this check has nothing to say. -MODEL_LANGS = { - "csharp": { - "glob": "src/Seclai/Models/*.cs", - "class_re": r"public (?:sealed |abstract )?class (\w+)", - "prop_re": r'\[JsonPropertyName\("([^"]+)"\)\]', - }, -} - - -def git_location(spec: Path, fallback: Path) -> tuple[Path, str]: - """(git work tree, path relative to its root) for a spec file. - - `git show REV:path` resolves `path` from the repo ROOT, so pointing -C at - the file's own directory silently fails. seclai-csharp bundles no spec and - is always audited with --spec pointing into seclai-python, so this is the - normal case, not the edge case. - - A RELATIVE path is resolved against `fallback` first, exactly as `load_spec` - resolves it. `--spec ../seclai-python/openapi/seclai.openapi.json` is the - form `load_spec`'s own error message recommends, and treating it as - repo-root-relative sent `git show` looking for `../seclai-python/...` inside - seclai-csharp, so `models --since` died on the one workflow it exists for. - """ - full = spec if spec.is_absolute() else (fallback / spec) - if not full.exists(): - # Nothing on disk to locate; assume repo-root-relative, as before. - return fallback, str(spec) - try: - top = subprocess.check_output( - ["git", "-C", str(full.parent), "rev-parse", "--show-toplevel"], - stderr=subprocess.DEVNULL, text=True).strip() - except (subprocess.CalledProcessError, FileNotFoundError): - die(f"{full} is not inside a git work tree; --since needs one") - root = Path(top) - try: - return root, str(full.resolve().relative_to(root.resolve())) - except ValueError: - die(f"{full} resolves outside its own work tree {root}; --since cannot read it") - - -def spec_schema_index(spec: dict) -> dict[str, list[tuple[str, set[str]]]]: - """Short schema name -> [(full name, property names)]. - - The spec qualifies some schemas by module (`routers__api__agents__X`), and - two modules can export the same trailing name, so a short name may resolve - to more than one schema. - """ - index: dict[str, list[tuple[str, set[str]]]] = {} - for full, sch in (spec.get("components", {}).get("schemas") or {}).items(): - short = full.rsplit("__", 1)[-1] - index.setdefault(short, []).append((full, set(sch.get("properties") or {}))) - return index - - -def cmd_models(args) -> int: - repo = Path(args.repo).resolve() - if repo.name in NOT_APPLICABLE: - print(f"{repo.name}: not applicable — {NOT_APPLICABLE[repo.name]}") - return 0 - lang = args.lang or detect_lang(repo) - if not lang: - # `MODEL_LANGS.get(None)` is None, so without this an undetectable repo - # printed "models are generated; nothing to check" and exited 0. - die(f"cannot detect SDK language in {repo}") - cfg = MODEL_LANGS.get(lang) - if not cfg: - print(f"{repo.name} [{lang}] — models are generated; nothing to check by hand.") - return 0 - - spec = load_spec(args.rev, args.spec, repo) - index = spec_schema_index(spec) - - # `--since` narrows the report to properties the schema GAINED since a rev. - # Without it the C# models show 27 findings, every one a coverage gap that - # predates this sync — a signal nobody can act on, and a gate nobody keeps. - # With it the question becomes the one that actually bit: did this sync - # leave a model behind? Six were, in 2026-07, and only review caught them. - gained: dict[str, set[str]] | None = None - if args.since: - spec_repo, rel = git_location(Path(args.spec), repo) - before = spec_schema_index(load_spec(args.since, rel, spec_repo)) - gained = {} - for short, cands in index.items(): - now = set.union(*(p for _, p in cands)) - was = set.union(*(p for _, p in before[short])) if short in before else set() - if now - was: - gained[short] = now - was - - files = sorted(repo.glob(cfg["glob"])) - scope = f", {len(gained)} schema(s) changed since {args.since}" if gained is not None else "" - print(f"{repo.name} [{lang}] — {len(files)} model file(s), {len(index)} spec schema names{scope}") - - missing, extra, unmatched = [], [], [] - for f in files: - text = f.read_text(encoding="utf-8", errors="replace") - m = re.search(cfg["class_re"], text) - if not m: - continue - cls = m.group(1) - have = set(re.findall(cfg["prop_re"], text)) - cands = index.get(cls) - if not cands: - unmatched.append(cls) - continue - # With more than one candidate, only properties common to all of them are - # unambiguously missing. A gate that guesses is a gate that gets muted. - want = set.intersection(*(p for _, p in cands)) - if gained is not None: - want &= gained.get(cls, set()) - gone = want - have - if gone: - missing.append((cls, sorted(gone), [n for n, _ in cands])) - if len(cands) == 1 and gained is None: - surplus = have - cands[0][1] - if surplus: - extra.append((cls, sorted(surplus))) - - if missing: - print(f"\nMISSING PROPERTIES ({len(missing)}) — the spec declares these and the model does not:") - for cls, props, full in missing: - where = f" [{', '.join(full)}]" if full != [cls] else "" - print(f" {cls}{where}\n {', '.join(props)}") - if extra: - print(f"\nWARN — EXTRA PROPERTIES ({len(extra)}) — in the model, not in the schema:") - for cls, props in extra: - print(f" {cls}: {', '.join(props)}") - if unmatched and not args.quiet_unmatched and gained is None: - print(f"\nWARN — NOT IN SPEC ({len(unmatched)}) — model classes with no matching schema:") - print(" " + ", ".join(sorted(unmatched))) - - if unmatched: - # Not a finding: the spec declares some request bodies inline rather than - # as a named component, so CreateSourceRequest and UpdateSourceRequest — - # both of which WERE left stale in 2026-07 — have nothing to match - # against. Say so, so the count is never read as full coverage. - print(f"\n note: {len(unmatched)} model class(es) have no named schema " - f"and are unchecked (inline request bodies land here).") - - if missing: - print(f"\n{len(missing)} model(s) behind the spec.") - return 1 - print("\nall models carry every property their schema declares") - return 0 - - -def main() -> int: - ap = argparse.ArgumentParser(prog="sdksync", description=__doc__, - formatter_class=argparse.RawDescriptionHelpFormatter) - sub = ap.add_subparsers(dest="cmd", required=True) - - p = sub.add_parser("parity", help="spec paths with no request call in the client") - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--spec", default="openapi/seclai.openapi.json") - p.add_argument("--rev", help="read the spec from this git rev instead of the working tree") - p.add_argument("--lang", choices=list(LANGS)) - p.add_argument("--quiet-partial", action="store_true", help="suppress the best-effort verb warnings") - p.set_defaults(func=cmd_parity) - - p = sub.add_parser("params", help="query params the client sends that the endpoint does not declare") - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--spec", default="openapi/seclai.openapi.json") - p.add_argument("--rev", help="read the spec from this git rev instead of the working tree") - p.add_argument("--lang", choices=list(LANGS)) - p.add_argument("--quiet-unexposed", action="store_true", - help="suppress the declared-but-never-sent report") - p.set_defaults(func=cmd_params) - - p = sub.add_parser("returns", help="client return types that disagree with the spec response") - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--spec", default="openapi/seclai.openapi.json") - p.add_argument("--rev", help="read the spec from this git rev instead of the working tree") - p.add_argument("--lang", choices=list(LANGS)) - p.add_argument("--quiet-untyped", action="store_true", - help="suppress the returns-a-blob report") - p.add_argument("--quiet-renamed", action="store_true", - help="suppress the same-shape-different-name report") - p.set_defaults(func=cmd_returns) - - p = sub.add_parser("surface", help="public API surface diff against a released tag") - p.add_argument("rev", help="git rev of the last release, e.g. 1.3.0 or v1.5.0") - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--lang", choices=list(LANGS)) - p.add_argument("--quiet-added", action="store_true", help="suppress the added-methods list") - p.add_argument("--quiet-warn", action="store_true", help="suppress the compatible-change report") - p.set_defaults(func=cmd_surface) - - p = sub.add_parser("models", help="hand-written models missing properties their schema declares") - p.add_argument("repo", nargs="?", default=".") - p.add_argument("--spec", default="openapi/seclai.openapi.json") - p.add_argument("--rev", help="read the spec from this git rev instead of the working tree") - p.add_argument("--lang", choices=list(LANGS)) - p.add_argument("--since", metavar="REV", - help="only report properties the schema gained since this spec rev " - "(the sync gate; without it every long-standing gap is listed)") - p.add_argument("--quiet-unmatched", action="store_true", - help="suppress the model-classes-with-no-schema report") - p.set_defaults(func=cmd_models) - - p = sub.add_parser("spec-diff", help="paths/schemas added, removed or changed between revisions") - p.add_argument("old", help="git rev of the older spec") - p.add_argument("new", nargs="?", help="git rev of the newer spec (default: working tree)") - p.add_argument("--repo", default=".") - p.add_argument("--spec", default="openapi/seclai.openapi.json") - p.set_defaults(func=cmd_spec_diff) - - p = sub.add_parser("api-delta", help="public client methods added/removed between revisions") - p.add_argument("old", help="git rev") - p.add_argument("new", nargs="?", help="git rev (default: working tree)") - p.add_argument("--repo", default=".") - p.add_argument("--lang", choices=list(LANGS)) - p.set_defaults(func=cmd_api_delta) - - args = ap.parse_args() - return args.func(args) - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index b6bfad2..0000000 --- a/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# Files produced by tooling rather than written by hand. -# -# `linguist-generated` collapses them in GitHub's diff view and drops them from -# the repository language stats, so a sync PR opens on the files a reviewer can -# actually act on. A 2026-07 sync changed 14,000 lines of which 864 were -# hand-written; everything else was regenerated, exported or vendored. -# -# They are still committed and still reviewable — just expand-on-demand. - -# openapi-typescript output. Regenerated wholesale by `npm run generate`. -src/openapi.ts linguist-generated=true - -# Exported from the API repo, never edited here. Review it with -# `sdksync.py spec-diff`, which reports the client-observable changes; the raw -# JSON diff runs to thousands of lines that nobody reads line by line. -openapi/*.json linguist-generated=true - -package-lock.json linguist-generated=true - -# Vendored from seclai/sdk-tools by `sync.sh` via git subtree. Edited upstream, -# never here, so it is noise in a diff for this repo. -.claude/skills/** linguist-generated=true diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md deleted file mode 100644 index 5ff359d..0000000 --- a/.github/copilot-instructions.md +++ /dev/null @@ -1,41 +0,0 @@ -# Copilot Instructions — seclai-javascript - -## Build & Lint Pipeline - -```sh -npm run build # tsup — produces CJS, ESM, and DTS bundles -npm test # vitest -``` - -## Quality gates (must pass to report completion) - -- **ALL tests must pass with ZERO failures. No exceptions.** CI/CD runs the full test suite on every PR. A test failure blocks the build. -- **`npm run build` must succeed with ZERO errors.** The DTS build is strict — type errors in `.d.ts` generation will fail the build even if runtime JS works fine. -- **Do not dismiss test or build failures as pre-existing or unrelated.** The `main` branch CI/CD is green. Any failure on a feature branch was caused by changes on that branch. -- **CRITICAL — NEVER INVESTIGATE ERROR ORIGIN OR BLAME**: When a type, build, or test error appears, **fix it immediately**. Do NOT run `git blame` or use git history to argue that an error is "pre-existing" or not your responsibility. Tools like `git diff`, `git log`, and `git show` may be used to understand and review changes, but never to avoid fixing an error. There is no scenario where knowing the origin of an error changes what you must do: **fix it**. -- **CRITICAL — NEVER PIPE TEST OR BUILD OUTPUT**: Do not append `| tail`, `| head`, `| grep`, or any pipe to `npm test`, `npm run build`, or similar commands. Piping hides errors. Always run with full unfiltered output. - -## Key Rules - -- After ANY change to `openapi/seclai.openapi.json`, run `npm run generate` to regenerate `src/openapi.ts`. Forgetting this causes type errors in the DTS build. -- `src/types.ts` maps user-facing type aliases to `components["schemas"][...]`. Schema names can change between API versions (e.g. `routers__api__*__` prefixes may be added or removed). Verify names against `src/openapi.ts` after regeneration. -- `tsconfig.json` uses `exactOptionalPropertyTypes: true` — optional properties must use `prop?: T | undefined`, not just `prop?: T`. -- The OpenAPI spec here is NOT identical to `seclai-go`/`seclai-python` (different version baseline). Apply equivalent description changes separately. -- OpenAPI specs are generated from the main `seclai` app repo. Description or endpoint changes made here must also be applied upstream, or they will be overwritten on the next generation. -- `.github/copilot-instructions.md` shares common sections (quality gates, git rules, editing rules, self-correction rules) across all SDK repos. When updating shared rules, apply the same change to all repos: `seclai-python`, `seclai-javascript`, `seclai-go`, `seclai-csharp`, `seclai-cli`, `seclai-mcp`. -- `writeSsoCache` uses atomic rename; on Windows, must `fs.unlink` the destination before `fs.rename`. -- Auth: streaming methods must use resolved auth headers, not `this.apiKey` directly. -- Do not run ad-hoc scripts; add tests instead. - -## Git rules - -- **NEVER use `git stash`.** Use `git diff`, `git log`, or `git show` instead. -- Do not run `git checkout` to switch branches, `git reset`, or any other destructive git operation without explicit user approval. - -## Editing rules - -- Do not use CLI text tools (sed/awk). Use the editor-based patch tool. - -## Self-correction rules - -- **NEVER promise to "do better" without updating these instruction files.** If a recurring mistake is identified, edit this file with a concrete rule that prevents the mistake. Do that FIRST, then continue work. diff --git a/.github/workflows/main-build.yaml b/.github/workflows/main-build.yaml deleted file mode 100644 index 2c25e6f..0000000 --- a/.github/workflows/main-build.yaml +++ /dev/null @@ -1,166 +0,0 @@ -name: Release Build - -on: - push: - branches: - - main - -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - -jobs: - npm: - name: Build, Typecheck, and Publish to npm - runs-on: ubuntu-latest - permissions: - id-token: write - contents: write - outputs: - version: ${{ steps.next-tag.outputs.new_tag }} - steps: - - name: Checkout files - uses: actions/checkout@v5 - with: - fetch-depth: "0" - - - name: Determine next version tag - id: next-tag - uses: seclai/github-tag-action@1.75.0 - env: - DEFAULT_BUMP: patch - DRY_RUN: "true" - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: "24" - cache: "npm" - registry-url: "https://registry.npmjs.org" - - - name: Install dependencies - run: npm ci - - - name: Test - run: npm test - - - name: Typecheck - run: npm run typecheck - - - name: Build - run: npm run build - - - name: Publish package to npm - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm run publish:ci - - - name: Push tag - run: | - git tag ${{ steps.next-tag.outputs.new_tag }} - git push origin ${{ steps.next-tag.outputs.new_tag }} - - - name: Create release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release create ${{ steps.next-tag.outputs.new_tag }} \ - --title "Release ${{ steps.next-tag.outputs.new_tag }}" \ - --generate-notes - - pages: - name: Publish Docs to GitHub Pages - needs: npm - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deploy-pages.outputs.page_url }} - permissions: - id-token: write - contents: write - pages: write - steps: - - name: Checkout files - uses: actions/checkout@v5 - with: - ref: ${{ needs.npm.outputs.version }} - fetch-depth: "0" - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "npm" - - - name: Install dependencies - run: npm ci - - - name: Generate SDK documentation - env: - VERSION: ${{ needs.npm.outputs.version }} - run: | - set -euo pipefail - - npm run docs - - # typedoc writes to build/docs; stage into versioned folders + latest - rm -rf build/docs_tmp - mv build/docs build/docs_tmp - - mkdir -p "build/docs/${VERSION}" "build/docs/latest" - cp -R build/docs_tmp/* "build/docs/${VERSION}/" - cp -R build/docs_tmp/* build/docs/latest/ - - # root redirect to latest/ - cat > build/docs/index.html <<'EOF' - - - - - Seclai JS SDK Docs -

Go to latest docs

- EOF - - - name: Checkout gh-pages branch - uses: actions/checkout@v5 - with: - ref: gh-pages - path: gh-pages - fetch-depth: 0 - - - name: Publish SDK docs to GitHub Pages (versioned) - env: - VERSION: ${{ needs.npm.outputs.version }} - run: | - set -euo pipefail - - touch gh-pages/.nojekyll - - rm -rf "gh-pages/latest" "gh-pages/${VERSION}" "gh-pages/index.html" - cp -R "build/docs/latest" "gh-pages/latest" - cp -R "build/docs/${VERSION}" "gh-pages/${VERSION}" - cp "build/docs/index.html" "gh-pages/index.html" - - cd gh-pages - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add -A - if git diff --cached --quiet; then - echo "No doc changes to publish." - exit 0 - fi - git commit -m "Docs: ${VERSION}" - git push origin gh-pages - - - name: Configure GitHub Pages - uses: actions/configure-pages@v5 - - - name: Upload GitHub Pages artifact - uses: actions/upload-pages-artifact@v3 - with: - path: gh-pages - - - name: Deploy GitHub Pages - id: deploy-pages - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml deleted file mode 100644 index 1b1be87..0000000 --- a/.github/workflows/pr-build.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Pull Request Build - -on: - pull_request: - types: [opened, synchronize] - -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: Build and Typecheck - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - name: Checkout files - uses: actions/checkout@v5 - with: - fetch-depth: "0" - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "npm" - - - name: Install dependencies - run: npm ci - - - name: Test - run: npm test - - - name: Typecheck - run: npm run typecheck - - - name: Build - run: npm run build - - - name: Generate docs - run: npm run docs diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c68891c..0000000 --- a/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -node_modules -npm-debug.log* -yarn-debug.log* -yarn-error.log* -dist -build -.DS_Store -.version-backup.json -.README.md.bak diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 1f28701..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,228 +0,0 @@ -# Changelog - -## [1.6.0] - 2026-10-04 - -### Changed - -- Sync the bundled OpenAPI spec and regenerate the types. Existing responses gain properties, among them `attachments` on `AgentRunResponse` and `AgentRunStepResponse`, `trace_purged_at` on a run, `warnings` on a step, `strip_quoted_reply_chains` on memory banks, `effort` on playground experiments, `effort_options` and `chat_capable` on `PromptModelResponse`, and `embedder_warning` on `ContentFileUploadResponse` -- Move `SeclaiApiVersion.Latest` to `2026-10-03`. Nothing is sent unless `apiVersion` is set, so a client that passes `SeclaiApiVersion.Latest` now opts into the five versions added below -- Send an array passed in the `query` of `request()` or `requestRaw()` as a repeated parameter, one pair per element. It was joined with commas into a single value - -### Added - -- Add the cloud-drive methods `listCloudDriveProviders()`, `listCloudDrives()`, `getCloudDrive()`, `updateCloudDrive()`, `disconnectCloudDrive()`, `deleteCloudDrive()`, `getAgentsUsingCloudDrive()` and `listCloudDriveRejections()`. The four listings return the items as an array whether the endpoint answers with a bare array or, from `apiVersion` `2026-07-27`, the `{data, pagination}` envelope -- Add `listSourceContents()` and `getSourceContentStatus()` for the indexing status of a source's content. `contentVersionIds` polls a batch of uploads in one request, and an empty array returns an empty page without calling the API -- Add `listEmbeddingModels()` and `listRerankerModels()`. The list is under `models` on every API version, with the defaults and pricing beside it -- Add the `SeclaiApiVersion` constants `V2026_08_03`, `V2026_08_21`, `V2026_09_28`, `V2026_09_30` and `V2026_10_03`, so those versions are accepted as `apiVersion`. The README lists what each one changes -- Add the type exports for those endpoints, including `CloudDriveResponse`, `CloudDriveProviderResponse`, `CloudDriveRejectionResponse`, `CloudDriveUpdateRequest`, `AgentUsingCloudDriveResponse`, `SourceContentStatusResponse`, `SourceContentStatusListResponse`, `ListSourceContentsOptions`, `EmbeddingModelListResponse` and `RerankerModelListResponse`, plus `AgentRunFileResponse` and `EffortOptionsResponse` - -### Fixed - -- Make `paginate()` work with the list methods. It read `items` and `pagination.total_pages`, while they return `data` and `pagination.pages`, so `client.paginate((opts) => client.listSources(opts))` threw `TypeError: result.items is not iterable`. It now reads the `{data, pagination}` envelope and stops on `has_next`, walks the flat `{data, total, page, limit}` shape of the evaluation listings by `total`, yields a bare array once, still accepts a custom fetcher's `{items, pagination: {total_pages}}`, and throws `SeclaiError` on anything else. The fetcher's page type is exported as `PaginatedPage` -- Correct the `Seclai` class example, which destructured an `items` property `listAgents()` does not return - -## [1.5.0] - 2026-07-27 - -### Changed - -- Return typed results from the 20 methods that previously declared `unknown` — alerts, alert configs, model alerts and recommendations, playground experiments, search and the AI assistant acknowledgements. Narrowing `unknown` to a concrete type is source compatible, so no façade is needed here -- Stop sending `severity` from `listAlerts()`. `GET /alerts` declares no such filter, so it never filtered, and it becomes a 422 once `apiVersion` is `2026-07-27` or later. The option is still accepted and ignored -- Accept either wire shape from `listEvaluationCriteria()`. The endpoint is moving from a bare array to a paginated envelope, so the client now reads both and keeps returning `EvaluationCriteriaResponse[]` -- Sync the bundled OpenAPI spec with the API fixes found while updating the SDKs: `agent_id` is now declared on the non-manual evaluation summary, and `page`/`limit` on the evaluation and alert-config listings -- Deprecate `deleteAgentRun()`. It never deleted anything — the endpoint it calls is documented as "Cancel an agent run", and the API has no delete-a-run operation. Use `cancelAgentRun()` - -### Added - -- Add the `SeclaiApiVersion` constants and the `ApiVersion` type. An `apiVersion` this release was not built against throws at construction, since a newer version can reshape responses this client would mis-decode; set `allowUnknownApiVersion` to override -- Add 20 response type exports covering those endpoints, including `AlertResponse`, `AlertDetailResponse`, `AlertConfigResponse`, `ModelAlertResponse`, `ExperimentDetailResponse`, `SearchResponse` and `OkResponse` -- Add `listEvaluationCriteriaPage()` for the canonical `{data, pagination}` envelope, which the endpoint emits once `apiVersion` is `2026-07-27` or later -- Add an `apiVersion` client option, sent as the `Seclai-Version` header, opting into dated API changes released on or before that date. Omitted by default, so upgrading the SDK alone never changes response shapes -- Add `getApiVersion()` and `updateApiVersion()` to read the version a request resolves to and to pin or clear the account's version -- Add the `ApiVersionResponse` type export -- Add the `EvaluationCriteriaListResponse` type export - -### Fixed - -- Validate the merged `Seclai-Version` rather than the first match in `defaultHeaders`. The merge lets the last entry win, so two spellings of the header meant the guard could approve one value and the client send another -- Validate a `Seclai-Version` supplied through `defaultHeaders`, not just the `apiVersion` option. `defaultHeaders` is applied last so it wins, which left the unknown-version guard one header away from being bypassed; a differently-cased key also emitted two wire headers -- Throw from `getAgentAiConversationHistory()` when `opts.stepType` is missing. It was optional and dropped by `buildURL`, so a call without it still 422'd — the failure this method was changed to prevent -- Decode either wire shape in `listRunEvaluationResults()`. The endpoint answers with a bare array, which the declared envelope type could not read, so the method returned nothing; it now also reads the canonical `{data, pagination}` envelope. `listAgentEvaluationResults()` is genuinely flat and is unaffected -- Paginate `listModelAlerts()` with the `offset` the endpoint declares instead of `page`, which it does not accept — every page after the first returned page 1 -- Send `step_type` from `getAgentAiConversationHistory()`, along with `stepId`, `limit` and `offset`. The API marks `step_type` required and the method had no way to supply it, so every call answered 422 -- Request `GET /sources` rather than `GET /sources/`. The trailing-slash form is no longer declared by the API -- Point `cancelAgentRun()` at `DELETE /agents/runs/{run_id}`. It posted to `/agents/runs/{run_id}/cancel`, a path the API has never exposed, so cancelling a run always failed - -## [1.4.0] - 2026-07-25 - -### Changed - -- Sync the bundled OpenAPI spec, adding 22 paths and 22 schemas -- Extend `listModels()` with `supportsInputMedia` and `supportsOutputMedia` capability filters - -### Added - -- Add `getMe()` returning the authenticated user's account id and organization memberships -- Add `disableAgent()`, `enableAgent()`, and `getAgentCallers()` to pause and resume an agent across every trigger path -- Add `setEmailTriggerConfig()` to set the alias, sender allowlist, and inbound-handling flags on an `EMAIL_RECEIVED` trigger -- Add agent-email opt-out methods `listAgentEmailOptOuts()` and `removeAgentEmailOptOut()` -- Add inbound sender blocklist methods `listBlockedEmailSenders()`, `blockEmailSender()`, `unblockEmailSender()`, and `setAutoBlockMode()` -- Add inbound-email observability methods `listInboundEmailRejections()`, `getInboundEmailStatus()`, `cancelQueuedEmailRuns()`, and `resumeInboundEmail()` -- Add email domain management: `listEmailDomains()`, `addEmailDomain()`, `removeEmailDomain()`, `verifyEmailDomain()`, `setPrimaryEmailDomain()`, `useSharedEmailDomain()`, `sendEmailDomainTestEmail()`, and `getDmarcSummary()` -- Add `getGenerationTiers()` mapping each media-generation modality and tier to its model and cost -- Add `searchDocs()` for keyword or semantic search over the Seclai documentation - -### Fixed - -- Return `OrganizationAlertPreferenceResponse` from `updateOrganizationAlertPreference()` instead of `unknown`, so the response fields are reachable without a cast - -## [1.3.0] - 2026-06-05 - -### Changed - -- Accept `MemoryBankAiAssistantRequest` in `aiAssistantMemoryBank()` instead of the solutions request type ([#9](https://github.com/seclai/seclai-javascript/pull/9)) - -### Added - -- Add `getAgentAttachmentReferences()` to read an agent's static attachment-reference contract before staging uploads ([#9](https://github.com/seclai/seclai-javascript/pull/9)) -- Add `downloadAgentRunAttachment()` returning the raw `Response` for a file emitted by a run step ([#9](https://github.com/seclai/seclai-javascript/pull/9)) -- Add `deleteExperiment()` to soft-delete a model playground experiment ([#9](https://github.com/seclai/seclai-javascript/pull/9)) -- Add `InsufficientCreditsResponse` and `InsufficientCreditsDetail` types for HTTP 402 responses ([#9](https://github.com/seclai/seclai-javascript/pull/9)) -- Add `AgentRunToolCallResponse` and `ModalityRateResponse` types ([#9](https://github.com/seclai/seclai-javascript/pull/9)) - -## [1.2.0] - 2026-05-22 - -### Added - -- Add `previewImportAgent()` to dry-run an agent definition import and surface unresolved entity refs ([#8](https://github.com/seclai/seclai-javascript/pull/8)) -- Add agent import types, including `AgentDefinitionImportErrorResponse` with line and column positions into the canonical source echo ([#8](https://github.com/seclai/seclai-javascript/pull/8)) - -## [1.1.5] - 2026-04-24 - -### Added - -- Add `listModels()` and `getModel()` for the model catalog ([#7](https://github.com/seclai/seclai-javascript/pull/7)) -- Add model playground methods `listExperiments()`, `createExperiment()`, `getExperiment()`, and `cancelExperiment()` ([#7](https://github.com/seclai/seclai-javascript/pull/7)) -- Add `SourceIndexMode` and model pricing types ([#7](https://github.com/seclai/seclai-javascript/pull/7)) - -## [1.1.4] - 2026-04-02 - -### Added - -- Add `exportAgent()` returning a portable JSON snapshot of an agent definition ([#6](https://github.com/seclai/seclai-javascript/pull/6)) - -## [1.1.3] - 2026-03-27 - -### Changed - -- Default the SSO domain, client id, and region so a profile only needs `sso_account_id`, and allow overriding each via `SECLAI_SSO_DOMAIN`, `SECLAI_SSO_CLIENT_ID`, and `SECLAI_SSO_REGION` ([#5](https://github.com/seclai/seclai-javascript/pull/5)) -- Make `sso_account_id` optional when loading an SSO profile ([#5](https://github.com/seclai/seclai-javascript/pull/5)) - -### Added - -- Export the SSO helpers `loadSsoProfile()`, `readSsoCache()`, `writeSsoCache()`, `deleteSsoCache()`, and `isTokenValid()`, plus the `DEFAULT_SSO_*` constants ([#5](https://github.com/seclai/seclai-javascript/pull/5)) -- Add `GET /me` to the bundled OpenAPI spec; the corresponding `getMe()` client method arrived in 1.4.0 ([#5](https://github.com/seclai/seclai-javascript/pull/5)) - -## [1.1.2] - 2026-03-26 - -### Changed - -- Update the bundled OpenAPI spec's auth descriptions to match the supported auth options ([`6d534c4`](https://github.com/seclai/seclai-javascript/commit/6d534c4)) - -## [1.1.1] - 2026-03-26 - -### Added - -- Add OAuth SSO authentication with `~/.seclai/config` profiles, an on-disk token cache, and automatic refresh ([#4](https://github.com/seclai/seclai-javascript/pull/4)) -- Add an `accountId` option, sent as the `X-Account-Id` header, to switch organization account context ([#4](https://github.com/seclai/seclai-javascript/pull/4)) -- Add an `accessToken` option accepting either a static bearer token or a provider function called per request ([#4](https://github.com/seclai/seclai-javascript/pull/4)) - -## [1.1.0] - 2026-03-23 - -### Added - -- Expand endpoint coverage to knowledge bases, memory banks, sources, source exports, embedding migrations, content, solutions, alerts, governance, evaluations, and the AI assistants ([#3](https://github.com/seclai/seclai-javascript/pull/3)) -- Add `runStreamingAgent()`, an async iterator yielding every SSE event of a run ([#3](https://github.com/seclai/seclai-javascript/pull/3)) -- Add `runAgentAndPoll()` for environments where SSE is impractical ([#3](https://github.com/seclai/seclai-javascript/pull/3)) -- Add `requestRaw()` as a low-level escape hatch returning the raw `Response` ([#3](https://github.com/seclai/seclai-javascript/pull/3)) -- Add `search()` across all resource types in an account ([#3](https://github.com/seclai/seclai-javascript/pull/3)) - -## [1.0.7] - 2026-01-30 - -### Added - -- Add `uploadFileToContent()` to replace existing content with a file upload ([`729298f`](https://github.com/seclai/seclai-javascript/commit/729298f)) -- Add a `metadata` option to the upload methods, sent as a JSON string form field ([`729298f`](https://github.com/seclai/seclai-javascript/commit/729298f)) - -### Fixed - -- Export the `SourceFileUploadResponse` and `ContentFileUploadResponse` types ([`36bff73`](https://github.com/seclai/seclai-javascript/commit/36bff73)) - -## [1.0.6] - 2026-01-27 - -### Changed - -- Accept a run id alone in `getAgentRun()` and `deleteAgentRun()`; the leading agent id is now an optional overload ([`fcf6ff9`](https://github.com/seclai/seclai-javascript/commit/fcf6ff9)) - -## [1.0.5] - 2026-01-27 - -### Added - -- Add an `includeStepOutputs` option to `getAgentRun()` ([`795fd21`](https://github.com/seclai/seclai-javascript/commit/795fd21)) - -## [1.0.4] - 2026-01-27 - -### Changed - -- Document the 200 MiB upload limit and the supported MIME types on the upload methods ([`bece917`](https://github.com/seclai/seclai-javascript/commit/bece917)) - -### Fixed - -- Point the default base URL at `https://api.seclai.com` instead of `https://seclai.com` ([`bece917`](https://github.com/seclai/seclai-javascript/commit/bece917)) - -## [1.0.3] - 2026-01-13 - -### Fixed - -- Drop the `/api` prefix from request paths so they match the deployed API ([`3d72194`](https://github.com/seclai/seclai-javascript/commit/3d72194)) - -## [1.0.2] - 2026-01-13 - -### Added - -- Add `runStreamingAgentAndWait()` to block until a streaming run completes ([`b55503d`](https://github.com/seclai/seclai-javascript/commit/b55503d)) - -## [1.0.1] - 2026-01-12 - -### Added - -- Add a documentation homepage link to the package metadata ([`3786d9d`](https://github.com/seclai/seclai-javascript/commit/3786d9d)) -- Add a release script that stamps the version into the README ([`3786d9d`](https://github.com/seclai/seclai-javascript/commit/3786d9d)) - -## [1.0.0] - 2026-01-12 - -_Stable release. No functional changes since 0.0.1._ - -## [0.0.1] - 2026-01-12 - -_Initial release._ - -[1.6.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.6.0 -[1.5.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.5.0 -[1.4.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.4.0 -[1.3.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.3.0 -[1.2.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.2.0 -[1.1.5]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.5 -[1.1.4]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.4 -[1.1.3]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.3 -[1.1.2]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.2 -[1.1.1]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.1 -[1.1.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.0 -[1.0.7]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.7 -[1.0.6]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.6 -[1.0.5]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.5 -[1.0.4]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.4 -[1.0.3]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.3 -[1.0.2]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.2 -[1.0.1]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.1 -[1.0.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.0 -[0.0.1]: https://github.com/seclai/seclai-javascript/releases/tag/0.0.1 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d845663..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Seclai, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 39d8f21..0000000 --- a/README.md +++ /dev/null @@ -1,836 +0,0 @@ -# Seclai JavaScript SDK - -The official JavaScript/TypeScript SDK for the [Seclai](https://seclai.com) API. Provides full typed coverage of all API endpoints, file uploads, SSE streaming, polling helpers, and automatic pagination. - -Works in Node.js 18+, Deno, Bun, Cloudflare Workers, and any runtime with a `fetch` implementation. - -## Install - -```bash -npm install @seclai/sdk -``` - -## Quick start - -```ts -import { Seclai } from "@seclai/sdk"; - -const client = new Seclai({ apiKey: process.env.SECLAI_API_KEY }); - -// List all sources -const sources = await client.listSources(); - -// Run an agent and stream the result -const result = await client.runStreamingAgentAndWait( - "agent_id", - { input: "Summarize the latest uploads", metadata: {} }, - { timeoutMs: 120_000 }, -); -console.log(result); -``` - -## Configuration - -| Option | Environment variable | Default | -| --- | --- | --- | -| `apiKey` | `SECLAI_API_KEY` | — | -| `accessToken` | — | — | -| `profile` | `SECLAI_PROFILE` | `"default"` | -| `configDir` | `SECLAI_CONFIG_DIR` | `~/.seclai` | -| `autoRefresh` | — | `true` | -| `accountId` | — | — | -| `baseUrl` | `SECLAI_API_URL` | `https://api.seclai.com` | -| `apiKeyHeader` | — | `x-api-key` | -| `defaultHeaders` | — | `{}` | -| `fetch` | — | `globalThis.fetch` | - -### Authentication - -Credentials are resolved via a chain (first match wins): - -1. Explicit `apiKey` option -2. Explicit `accessToken` option (string or `() => string | Promise`) -3. `SECLAI_API_KEY` environment variable -4. SSO — cached tokens from `~/.seclai/sso/cache/` (requires a prior `seclai auth login`) - -```ts -// API key -const client = new Seclai({ apiKey: "sk-..." }); -``` - -```ts -// Static bearer token -const client = new Seclai({ accessToken: "eyJhbGciOi..." }); -``` - -```ts -// Dynamic bearer token provider (called per request) -const client = new Seclai({ - accessToken: async () => fetchTokenFromVault(), -}); -``` - -```ts -// SSO profile (uses cached tokens, auto-refreshes) -const client = new Seclai({ profile: "my-profile" }); -``` - -```ts -// Environment variable (no options needed) -// export SECLAI_API_KEY="sk-..." -const client = new Seclai(); -``` - -#### SSO authentication - -SSO is the default fallback when no explicit credentials are provided. The SDK -includes built-in production SSO defaults, so `seclai configure sso` is not -required. You only need to log in once to populate the token cache: - -```bash -npx @seclai/cli auth login # authenticate via browser — no prior setup needed -``` - -To customize SSO settings (e.g. for a staging environment), use `seclai configure sso` -or set environment variables: - -| Variable | Description | Default | -|---|---|---| -| `SECLAI_SSO_DOMAIN` | Cognito domain | `auth.seclai.com` | -| `SECLAI_SSO_CLIENT_ID` | Cognito app client ID | `4bgf8v9qmc5puivbaqon9n5lmr` | -| `SECLAI_SSO_REGION` | AWS region | `us-west-2` | - -## API documentation - -Online API documentation (latest): - -https://seclai.github.io/seclai-javascript/latest/ - -Release history is in [`CHANGELOG.md`](CHANGELOG.md). - -## API versioning - -The API dates its backward-incompatible changes. Nothing changes for you until -you opt in, either per client or by pinning the account: - -```ts -const client = new Seclai({ - apiKey: "...", - apiVersion: SeclaiApiVersion.V2026_07_27, // sent as the Seclai-Version header -}); - -const state = await client.getApiVersion(); // what this request resolved to -await client.updateApiVersion(SeclaiApiVersion.V2026_07_27); // pin the whole account -``` - -Leave `apiVersion` unset and the header is omitted, so the account's pinned -baseline applies and responses keep their current shapes. Upgrading this package -alone never changes the wire contract. - -Known versions are on `SeclaiApiVersion` (`V2026_07_01` through `V2026_10_03`, -plus `Default` and `Latest`), imported from `@seclai/sdk`. A version this release was -**not** built against throws at construction: a newer version can reshape -responses, and this client would decode them incorrectly rather than reject them. -Upgrade the package to adopt a new version, or set `allowUnknownApiVersion` if -you have to move first and accept that risk. - -The guard only covers the header. An account pinned server-side can still be -newer than this release — `getApiVersion()` reports the `effective_version` the -request resolved to, and comparing it against `SeclaiApiVersion.Latest` is how -you detect the gap. - -**What `2026-07-27` changes.** Undeclared query parameters become a 422 instead -of being ignored, and list endpoints move to the canonical `{data, pagination}` -envelope. The affected methods read both shapes, so they keep working either way -— but the metadata moves: - -| Method | Before | From 2026-07-27 | -| --- | --- | --- | -| `listEvaluationCriteriaPage()` | bare array | `data` + `pagination` | -| `listRunEvaluationResults()` | bare array | `data` + `pagination` | -| `listAlertConfigs()` | `configs` + `total` | `data` + `pagination` | -| `listModelAlerts()` | `alerts` + `total` | `data` + `pagination` | - -Prefer `pagination` over the flat `total`/`page`/`limit` properties, and read the -last two with `res.data ?? res.configs` / `res.data ?? res.alerts`. The legacy -keys will be deprecated and then removed once the canonical envelope is the -default. - -The cloud-drive listings (`listCloudDriveProviders()`, `listCloudDrives()`, -`getAgentsUsingCloudDrive()`, `listCloudDriveRejections()`) follow the same rule -and return the items as an array on either shape. `listEmbeddingModels()` and -`listRerankerModels()` move their list from `models` to `data`; both methods -populate `models` on either shape, with the defaults and pricing beside it. - -**Later versions.** Each is cumulative, and none changes a response shape this -client decodes: - -| Version | What it changes | -| --- | --- | -| `2026-08-03` | `createMemoryBank()` rejects `max_age_days` with a 400, and an omitted `retention_days` resolves per bank type instead of to 30 | -| `2026-08-21` | `createSource()` rejects an embedding dimension its embedder does not support with a 400 — `listEmbeddingModels()` reports the supported ones | -| `2026-09-28` | Agent-definition writes use the current file-list grammar: an omitted `attachments` keeps the stored list and `[]` means no files | -| `2026-09-30` | A run's and a step's `output`, and a step's `input`, are the text rather than a JSON manifest; files are in `attachments` on every version | -| `2026-10-03` | A new LLM step written without `attachments` takes its parent's files, and a new retrieval step's matched media are its files | - -## Resources - -### Identity - -Discover who the credential belongs to and which organizations it can act for. -Each organization's `account_id` is what you pass as the client's `accountId` -option (sent as the `X-Account-Id` header) to target that org context. - -```ts -const me = await client.getMe(); -console.log(me.account_id); // the user's personal account -for (const org of me.organizations) { - console.log(org.name, org.account_id); -} - -// Act as an organization -const orgClient = new Seclai({ accountId: me.organizations[0].account_id }); -``` - -### Agents - -```ts -// CRUD -const agents = await client.listAgents({ page: 1, limit: 20 }); -const agent = await client.createAgent({ name: "My Agent", description: "..." }); -const fetched = await client.getAgent("agent_id"); -const updated = await client.updateAgent("agent_id", { name: "Renamed" }); -await client.deleteAgent("agent_id"); - -// Pause / resume — a disabled agent stops firing from every trigger path -const callers = await client.getAgentCallers("agent_id"); // live agents calling this one -await client.disableAgent("agent_id"); // 409 if any caller above is still live -await client.enableAgent("agent_id"); - -// Definition (step workflow) -const def = await client.getAgentDefinition("agent_id"); -await client.updateAgentDefinition("agent_id", { steps: [...], change_id: def.change_id }); - -// Export / import an agent -const exported = await client.exportAgent("agent_id"); - -// Validate the payload first to surface unresolved entity refs in this account -const preview = await client.previewImportAgent({ agent_definition: exported }); -const unresolved = (preview.unresolved_refs ?? []) as Array<{ ref_id: string }>; -const entity_remap = Object.fromEntries( - unresolved.map((ref) => [ref.ref_id, /* picked target uuid */ ""]), -); - -// Commit — `entity_remap` substitutes workflow refs before save -const imported = await client.createAgent({ - name: "Imported", - trigger_type: "dynamic_input", - agent_definition: exported, - entity_remap, -}); -// `imported.import_warnings` lists any items that couldn't be applied. -``` - -### Agent runs - -```ts -// Start a run -const run = await client.runAgent("agent_id", { input: "Hello" }); - -// List & search runs -const runs = await client.listAgentRuns("agent_id", { status: "completed" }); -const search = await client.searchAgentRuns({ agent_id: "...", status: ["completed"] }); - -// Fetch run details (optionally with step outputs) -const detail = await client.getAgentRun("run_id", { includeStepOutputs: true }); - -// Cancel or delete -await client.cancelAgentRun("run_id"); -await client.deleteAgentRun("run_id"); -``` - -### Streaming - -The SDK provides two streaming patterns over the SSE `/runs/stream` endpoint: - -**Block until done** — returns the final `done` payload or throws on timeout: - -```ts -const result = await client.runStreamingAgentAndWait( - "agent_id", - { input: "Hello", metadata: {} }, - { timeoutMs: 60_000 }, -); -``` - -**Async iterator** — yields every SSE event as `{ event, data }`: - -```ts -for await (const event of client.runStreamingAgent( - "agent_id", - { input: "Hello" }, - { timeoutMs: 120_000 }, -)) { - console.log(event.event, event.data); - if (event.event === "done") break; -} -``` - -### Polling - -For environments where SSE is not practical, poll for a completed run: - -```ts -const result = await client.runAgentAndPoll( - "agent_id", - { input: "Hello" }, - { pollIntervalMs: 2_000, timeoutMs: 120_000 }, -); -``` - -### Agent input uploads - -```ts -// Discover which files (if any) the agent expects before staging uploads -const refs = await client.getAgentAttachmentReferences("agent_id"); -if (refs.requires_uploads) { - // refs.agent lists the exact_names / indexes_max / patterns a run batch must satisfy -} - -const upload = await client.uploadAgentInput("agent_id", { - file: new Uint8Array([...]), - fileName: "input.pdf", -}); -const status = await client.getAgentInputUploadStatus("agent_id", upload.upload_id); -``` - -### Agent run attachments - -```ts -// Download a file emitted by a step in an agent run. The attachment_id is the -// URL-safe-base64 storage_key surfaced in run output manifests / webhooks. -const resp = await client.downloadAgentRunAttachment("run_id", "attachment_id"); -const blob = await resp.blob(); // raw Response — stream or save the bytes -``` - -### Agent email triggers - -Configure the inbound address and handling rules on an agent's `EMAIL_RECEIVED` -trigger. Omitted fields are left unchanged; `null` (or `""` for `alias`) clears them. - -```ts -const config = await client.setEmailTriggerConfig("agent_id", "trigger_id", { - alias: "support", - allowed_senders: ["example.com", "ops@partner.com"], // empty/null accepts any sender - ignore_auto_generated: true, // drop auto-replies/bulk mail to prevent loops - require_sender_auth: true, // require SPF or DMARC even on an open inbox - queue_on_quota: false, // park over-rate mail instead of failing it -}); -console.log(config.email_addresses); // ["support.@agent.seclai.com", ...] -``` - -### Agent email governance - -```ts -// Recipients who opted out of this account's agent emails -const optOuts = await client.listAgentEmailOptOuts({ agentId: "agent_id", limit: 50 }); -await client.removeAgentEmailOptOut("optout_id"); // opt them back in - -// Blocked inbound senders (owner/admin only) -const blocked = await client.listBlockedEmailSenders({ limit: 50, offset: 0 }); -await client.blockEmailSender({ sender_email: "spam.example.com", match_type: "domain" }); -await client.unblockEmailSender("blocked_id"); - -// Auto-block on a governance BLOCK: "disabled" | "input" | "input_and_output" -await client.setAutoBlockMode({ mode: "input_and_output" }); - -// Inbound emails discarded before running an agent -const rejections = await client.listInboundEmailRejections({ agentId: "agent_id" }); - -// Account-wide overload circuit breaker -const status = await client.getInboundEmailStatus(); // { paused, queued_backlog } -await client.cancelQueuedEmailRuns(); // fail all QUEUED (over-quota parked) runs -await client.resumeInboundEmail(); // one-shot override; re-arms if still overloaded -``` - -### Agent AI assistant - -```ts -const steps = await client.generateAgentSteps("agent_id", { user_input: "Build a RAG pipeline" }); -const config = await client.generateStepConfig("agent_id", { step_type: "llm", user_input: "..." }); - -// Conversation history -const history = await client.getAgentAiConversationHistory("agent_id"); -await client.markAgentAiSuggestion("agent_id", "conversation_id", { accepted: true }); -``` - -### Agent evaluations - -```ts -const criteria = await client.listEvaluationCriteria("agent_id", { page: 1, limit: 50 }); -// page/limit only take effect with apiVersion "2026-07-27" or later; the legacy -// response is unpaginated. listEvaluationCriteriaPage() returns the same items -// plus a `pagination` object when opted in. -const created = await client.createEvaluationCriteria("agent_id", { name: "Accuracy", ... }); -const detail = await client.getEvaluationCriteria("criteria_id"); -await client.updateEvaluationCriteria("criteria_id", { ... }); -await client.deleteEvaluationCriteria("criteria_id"); - -// Test a draft -await client.testDraftEvaluation("agent_id", { criteria: { ... }, run_id: "..." }); - -// Results by criteria -const results = await client.listEvaluationResults("criteria_id"); -const summary = await client.getEvaluationCriteriaSummary("criteria_id"); -await client.createEvaluationResult("criteria_id", { ... }); - -// Results by run -const runResults = await client.listRunEvaluationResults("agent_id", "run_id"); - -// Non-manual evaluation summary -const nonManual = await client.getNonManualEvaluationSummary("agent_id"); - -// Compatible runs for a criteria -const compatible = await client.listCompatibleRuns("criteria_id"); -``` - -### Knowledge bases - -```ts -const kbs = await client.listKnowledgeBases(); -const kb = await client.createKnowledgeBase({ name: "Docs KB" }); -const fetched = await client.getKnowledgeBase("kb_id"); -await client.updateKnowledgeBase("kb_id", { name: "Renamed KB" }); -await client.deleteKnowledgeBase("kb_id"); -``` - -### Memory banks - -```ts -const banks = await client.listMemoryBanks(); -const bank = await client.createMemoryBank({ name: "Chat Memory", type: "conversation" }); -const fetched = await client.getMemoryBank("mb_id"); -await client.updateMemoryBank("mb_id", { name: "Renamed" }); -await client.deleteMemoryBank("mb_id"); - -// Stats & compaction -const stats = await client.getMemoryBankStats("mb_id"); -await client.compactMemoryBank("mb_id"); - -// Test compaction -const test = await client.testMemoryBankCompaction("mb_id", { ... }); -const standalone = await client.testCompactionPromptStandalone({ ... }); - -// Templates & agents -const templates = await client.listMemoryBankTemplates(); -const agents = await client.getAgentsUsingMemoryBank("mb_id"); - -// AI assistant -const suggestion = await client.generateMemoryBankConfig({ user_input: "..." }); -const history = await client.getMemoryBankAiLastConversation(); -await client.acceptMemoryBankAiSuggestion("conv_id", { ... }); - -// Source management -await client.deleteMemoryBankSource("mb_id"); -``` - -### Sources - -```ts -const sources = await client.listSources({ page: 1, limit: 20, order: "asc" }); -const source = await client.createSource({ name: "My Source", ... }); -const fetched = await client.getSource("source_id"); -await client.updateSource("source_id", { name: "Renamed" }); -await client.deleteSource("source_id"); -``` - -Indexing status of a source's content, keyed by the `content_version_id` the -upload methods return: - - -```ts -const failed = await client.listSourceContents("source_id", { status: "failed" }); -const batch = await client.listSourceContents("source_id", { - contentVersionIds: ["cv_1", "cv_2"], -}); -console.log(batch.pagination.total, failed.data.map((item) => item.error)); - -const one = await client.getSourceContentStatus("source_id", "cv_1"); -console.log(one.content_status); -``` - -### Cloud drives - - -```ts -const providers = await client.listCloudDriveProviders(); -const drives = await client.listCloudDrives(); -const drive = await client.getCloudDrive(drives[0].id); -await client.updateCloudDrive(drive.id, { name: "Contracts" }); - -// Which agents depend on it, and which files it skipped and why -const agents = await client.getAgentsUsingCloudDrive(drive.id); -const skipped = await client.listCloudDriveRejections(drive.id, { limit: 20 }); -console.log(providers.length, agents.length, skipped.map((r) => r.reason)); - -const disconnected = await client.disconnectCloudDrive(drive.id); // keeps the connection -console.log(disconnected.connected); -await client.deleteCloudDrive(drive.id); -``` - -### File uploads - -Upload a file to a source (max 200 MiB). The SDK infers MIME type from the file extension when `mimeType` is not provided. - -```ts -import { readFile } from "node:fs/promises"; - -await client.uploadFileToSource("source_id", { - file: await readFile("document.pdf"), - fileName: "document.pdf", - title: "Q4 Report", - metadata: { department: "finance" }, -}); -``` - -Upload inline text: - -```ts -await client.uploadInlineTextToSource("source_id", { - text: "Hello, world!", - title: "Greeting", -}); -``` - -Replace a content version with a new file: - -```ts -await client.uploadFileToContent("content_version_id", { - file: await readFile("updated.pdf"), - fileName: "updated.pdf", - mimeType: "application/pdf", -}); -``` - -### Source exports - -```ts -const exports = await client.listSourceExports("source_id"); -const exp = await client.createSourceExport("source_id", { format: "json" }); -const status = await client.getSourceExport("source_id", exp.id); -const estimate = await client.estimateSourceExport("source_id", {}); -const response = await client.downloadSourceExport("source_id", exp.id); -await client.deleteSourceExport("source_id", exp.id); -await client.cancelSourceExport("source_id", exp.id); -``` - -### Source embedding migrations - -```ts -const migration = await client.getSourceEmbeddingMigration("source_id"); -await client.startSourceEmbeddingMigration("source_id", { target_model: "..." }); -await client.cancelSourceEmbeddingMigration("source_id"); -``` - -### Content - -```ts -const detail = await client.getContentDetail("content_id", { start: 0, end: 1000 }); -const embeddings = await client.listContentEmbeddings("content_id"); -await client.deleteContent("content_id"); - -// Replace content with inline text -await client.replaceContentWithInlineText("content_id", { text: "Updated text", title: "Updated" }); - -// Upload a replacement file -await client.uploadFileToContent("content_id", { - file: await readFile("updated.pdf"), - fileName: "updated.pdf", -}); -``` - -### Solutions - -```ts -const solutions = await client.listSolutions(); -const sol = await client.createSolution({ name: "My Solution" }); -const fetched = await client.getSolution("solution_id"); -await client.updateSolution("solution_id", { name: "Renamed" }); -await client.deleteSolution("solution_id"); - -// Link / unlink resources -await client.linkAgentsToSolution("solution_id", { ids: ["agent_id"] }); -await client.unlinkAgentsFromSolution("solution_id", { ids: ["agent_id"] }); -await client.linkKnowledgeBasesToSolution("solution_id", { ids: ["kb_id"] }); -await client.unlinkKnowledgeBasesFromSolution("solution_id", { ids: ["kb_id"] }); -await client.linkSourceConnectionsToSolution("solution_id", { ids: ["source_id"] }); -await client.unlinkSourceConnectionsFromSolution("solution_id", { ids: ["source_id"] }); - -// AI assistant -const plan = await client.generateSolutionAiPlan("solution_id", { user_input: "Set up a RAG pipeline" }); -await client.acceptSolutionAiPlan("solution_id", "conversation_id", {}); -await client.declineSolutionAiPlan("solution_id", "conversation_id"); - -// AI-generated knowledge base / source within the solution -await client.generateSolutionAiKnowledgeBase("solution_id", { user_input: "..." }); -await client.generateSolutionAiSource("solution_id", { user_input: "..." }); - -// Conversations -const convs = await client.listSolutionConversations("solution_id"); -await client.addSolutionConversationTurn("solution_id", { user_input: "..." }); -await client.markSolutionConversationTurn("solution_id", "conversation_id", { ... }); -``` - -### Governance AI - -```ts -const plan = await client.generateGovernanceAiPlan({ user_input: "Add a toxicity policy" }); -const convs = await client.listGovernanceAiConversations(); -await client.acceptGovernanceAiPlan("conversation_id"); -await client.declineGovernanceAiPlan("conversation_id"); -``` - -### Alerts - -```ts -const alerts = await client.listAlerts({ status: "active" }); -const alert = await client.getAlert("alert_id"); -await client.changeAlertStatus("alert_id", { status: "resolved" }); -await client.addAlertComment("alert_id", { text: "Investigating" }); - -// Subscriptions -await client.subscribeToAlert("alert_id"); -await client.unsubscribeFromAlert("alert_id"); - -// Alert configs -const configs = await client.listAlertConfigs(); -await client.createAlertConfig({ ... }); -await client.getAlertConfig("config_id"); -await client.updateAlertConfig("config_id", { ... }); -await client.deleteAlertConfig("config_id"); - -// Organization preferences -const prefs = await client.listOrganizationAlertPreferences(); -await client.updateOrganizationAlertPreference("org_id", "alert_type", { ... }); -``` - -### Models - -```ts -// List models, optionally filtered by capability -const providers = await client.listModels({ supportsToolUse: true }); -const imageModels = await client.listModels({ supportsOutputMedia: "image" }); -const pdfModels = await client.listModels({ supportsInputMedia: "pdf" }); -const model = await client.getModel("model_id"); - -// Media-generation quality tiers (fast/balanced/thorough) and what each resolves to -const tiers = await client.getGenerationTiers(); - -// Embedding and reranker models, with their pricing -const embedders = await client.listEmbeddingModels({ supportsInputMedia: "image" }); -const rerankers = await client.listRerankerModels(); -console.log(embedders.models, embedders.default_model_type, rerankers.models); - -const alerts = await client.listModelAlerts(); -await client.markModelAlertRead("alert_id"); -await client.markAllModelAlertsRead(); -const unread = await client.getUnreadModelAlertCount(); -const recs = await client.getModelRecommendations("model_id"); - -// Model playground experiments -const experiment = await client.createExperiment({ model_ids: ["model_id"], prompt: "..." }); -const experiments = await client.listExperiments(); -const detail = await client.getExperiment("experiment_id"); -await client.cancelExperiment("experiment_id"); -await client.deleteExperiment("experiment_id"); // soft-delete, preserves audit history -``` - -### Search - -```ts -const results = await client.search({ query: "quarterly report" }); -const filtered = await client.search({ query: "my agent", entityType: "agent", limit: 5 }); -``` - -### Documentation search - -Search the Seclai docs. Results are global (not account-scoped) and each carries a -`doc_slug` plus an optional `anchor` for building a -`https://seclai.com/docs/[#]` link. - -```ts -// Fast title/summary match, no AI cost -const hits = await client.searchDocs({ query: "email triggers" }); - -// Semantic body match — adds a `highlight` with the best matching sentence -const semantic = await client.searchDocs({ - query: "how do I stop auto-reply loops", - mode: "semantic", - limit: 5, -}); -``` - -### Email domains - -Send and receive agent email on your own domain instead of the shared -`agent.seclai.com`. These endpoints require a user-bound credential (an -account-only API key is refused with 403) and, for mutations, an account owner/admin. - - -```ts -// Current domains, their DNS records, and what your plan allows -const { domains, can_add_custom, has_custom } = await client.listEmailDomains(); - -// Add a vanity subdomain (.seclai.com) or your own custom domain -const vanity = await client.addEmailDomain({ kind: "vanity", value: "acme" }); -const custom = await client.addEmailDomain({ - kind: "custom", - value: "agent.mycompany.com", - delegated: true, // let Seclai manage a dedicated Route53 zone -}); - -// Publish custom.dns_records at your DNS provider, then check without waiting -// for the background sweep -const checked = await client.verifyEmailDomain(custom.id); - -// Promote a verified domain, or fall back to the shared domain -await client.setPrimaryEmailDomain(custom.id); -await client.useSharedEmailDomain(); // keeps the domain configured & verified - -// Confirm delivery end-to-end (always sends to the account owner only) -await client.sendEmailDomainTestEmail(custom.id); - -// DMARC aggregate-report summary -const dmarc = await client.getDmarcSummary(custom.id, { days: 30, topSources: 10 }); - -// Removing a delegated domain returns a cleanup_note about the registrar NS record -const { cleanup_note } = await client.removeEmailDomain(custom.id); -``` - -### Top-level AI assistant - -```ts -// Generate plans for different resource types -const kb = await client.aiAssistantKnowledgeBase({ user_input: "Create a docs KB" }); -const src = await client.aiAssistantSource({ user_input: "Add a web source" }); -const sol = await client.aiAssistantSolution({ user_input: "Set up monitoring" }); -const mb = await client.aiAssistantMemoryBank({ user_input: "Create a chat memory" }); - -// Accept or decline the generated plan -await client.acceptAiAssistantPlan("conversation_id", { confirm_deletions: true }); -await client.declineAiAssistantPlan("conversation_id"); - -// Memory bank conversation history -const history = await client.getAiAssistantMemoryBankHistory(); -await client.acceptAiMemoryBankSuggestion("conversation_id", { ... }); - -// Feedback -await client.submitAiFeedback({ ... }); -``` - -## Pagination helper - -Automatically iterate through all pages of a list method: - - -```ts -for await (const source of client.paginate( - (opts) => client.listSources(opts), - { limit: 50 }, -)) { - console.log(source.name); -} -``` - -## Error handling - -All errors extend `SeclaiError`: - -```ts -import { - SeclaiError, - SeclaiConfigurationError, - SeclaiAPIStatusError, - SeclaiAPIValidationError, - SeclaiStreamingError, -} from "@seclai/sdk"; - -try { - await client.getAgent("bad_id"); -} catch (err) { - if (err instanceof SeclaiAPIValidationError) { - console.error("Validation:", err.validationError); - } else if (err instanceof SeclaiAPIStatusError) { - console.error(`HTTP ${err.statusCode}:`, err.responseText); - } else if (err instanceof SeclaiStreamingError) { - console.error("Stream failed for run:", err.runId); - } -} -``` - -## Cancellation (AbortSignal) - -All low-level methods support an `AbortSignal` for request cancellation: - -```ts -const controller = new AbortController(); - -// Cancel after 5 seconds -setTimeout(() => controller.abort(), 5_000); - -const data = await client.request("GET", "/agents", { - signal: controller.signal, -}); -``` - -## Low-level access - -For endpoints not yet covered by a convenience method, use `request` or `requestRaw`: - -```ts -// JSON request/response -const data = await client.request("POST", "/custom/endpoint", { - json: { key: "value" }, - query: { filter: "active" }, -}); - -// Raw Response (e.g. binary downloads) -const response = await client.requestRaw("GET", "/files/download/123"); -const blob = await response.blob(); -``` - -## Development - -### Install dependencies - -```bash -npm install -``` - -### Type checking - -```bash -npm run typecheck -``` - -### Build - -```bash -npm run build -``` - -This also regenerates `src/openapi.ts` from `openapi/seclai.openapi.json`. - -### Run tests - -```bash -npm test -``` - -### Generate docs - -Generate HTML docs into `build/docs/`: - -```bash -npm run docs -``` diff --git a/.claude/skills/seclai-changelog/SKILL.md b/SKILL.md similarity index 96% rename from .claude/skills/seclai-changelog/SKILL.md rename to SKILL.md index 06a0beb..358f4b5 100644 --- a/.claude/skills/seclai-changelog/SKILL.md +++ b/SKILL.md @@ -70,7 +70,7 @@ Do not guess the next version. Releases are cut by `seclai/github-tag-action` in - contains `#minor` → minor bump - otherwise → `DEFAULT_BUMP: patch` -So a PR that adds endpoints must say `#minor` in its title/merge commit, or the heading you write will not match the tag that gets cut. Confirm the intended bump with the user when it isn't stated, and flag the mismatch risk if the PR title lacks the keyword. +So a change that adds endpoints must say `#minor` in a commit message, or the heading you write will not match the tag that gets cut. The keyword goes in the commit message, not the PR title. Confirm the intended bump with the user when it isn't stated, and flag the mismatch risk if no commit message carries the keyword. Check `git tag --sort=-v:refname | head -1` for the current latest, then apply the bump. diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json deleted file mode 100644 index 058d09e..0000000 --- a/openapi/seclai.openapi.json +++ /dev/null @@ -1,26535 +0,0 @@ -{ - "components": { - "parameters": { - "Seclai-Version": { - "description": "Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it \u2014 e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key.", - "in": "header", - "name": "Seclai-Version", - "required": false, - "schema": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}$", - "type": "string" - } - }, - "X-Account-Id": { - "description": "Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication \u2014 the key's account is always used.", - "in": "header", - "name": "X-Account-Id", - "required": false, - "schema": { - "format": "uuid", - "type": "string" - } - } - }, - "schemas": { - "AddConversationTurnRequest": { - "properties": { - "actions_taken": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Actions taken by the AI", - "title": "Actions Taken" - }, - "ai_response": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI response text", - "title": "Ai Response" - }, - "user_input": { - "description": "User input text", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "AddConversationTurnRequest", - "type": "object" - }, - "AddEmailDomainRequest": { - "properties": { - "delegated": { - "default": false, - "title": "Delegated", - "type": "boolean" - }, - "kind": { - "description": "'vanity' or 'custom'", - "title": "Kind", - "type": "string" - }, - "value": { - "maxLength": 253, - "minLength": 1, - "title": "Value", - "type": "string" - } - }, - "required": [ - "kind", - "value" - ], - "title": "AddEmailDomainRequest", - "type": "object" - }, - "AgentAttachmentRefsApiResponse": { - "description": "Static attachment-reference contract for an agent.\n\nMirrors the MCP ``get_agent_attachment_references`` tool: returns\nwhat files (if any) an agent's templates expect on a run so API\nconsumers can stage uploads correctly before calling\n``POST /agents/{id}/runs``.", - "properties": { - "agent": { - "$ref": "#/components/schemas/AttachmentRefsSourceApiSummary", - "description": "Aggregated selector summary across all consumer steps. ``exact_names`` entries must each appear in the upload batch; ``indexes_max+1`` is the minimum file count; every ``patterns`` glob must match at least one upload." - }, - "requires_uploads": { - "description": "When ``false`` the agent's definition does NOT reference any uploaded attachments \u2014 ``POST /agents/{id}/upload-input`` will reject with HTTP 400. When ``true`` the ``agent`` block lists the specific selectors a run-time batch must satisfy.", - "title": "Requires Uploads", - "type": "boolean" - } - }, - "required": [ - "requires_uploads" - ], - "title": "AgentAttachmentRefsApiResponse", - "type": "object" - }, - "AgentCallerApiResponse": { - "description": "One agent that calls another (blocks disabling the callee while live).", - "properties": { - "disabled": { - "title": "Disabled", - "type": "boolean" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name", - "disabled" - ], - "title": "AgentCallerApiResponse", - "type": "object" - }, - "AgentDefinitionImportErrorResponse": { - "description": "422 body for invalid `agent_definition` payloads.\n\nMirrors `AgentDefinitionImportError.to_response_dict`.", - "properties": { - "error": { - "const": "invalid_agent_definition", - "description": "Stable machine-readable error code.", - "title": "Error", - "type": "string" - }, - "errors": { - "items": { - "$ref": "#/components/schemas/ImportFieldErrorModel" - }, - "title": "Errors", - "type": "array" - }, - "message": { - "title": "Message", - "type": "string" - }, - "source": { - "description": "Canonical pretty-printed echo of the supplied payload \u2014 error line/column refer to this string.", - "title": "Source", - "type": "string" - } - }, - "required": [ - "error", - "message", - "errors", - "source" - ], - "title": "AgentDefinitionImportErrorResponse", - "type": "object" - }, - "AgentDefinitionResponse": { - "properties": { - "change_id": { - "description": "Current change ID (use as expected_change_id when updating).", - "title": "Change Id", - "type": "string" - }, - "definition": { - "additionalProperties": true, - "description": "The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, regex_replace, gate, retry, evaluate_step, extract_data, extract_content, add_chat_turn, load_chat_history, add_memory, search_memory, load_memory, streaming_result, send_email, webhook_call, call_agent, write_metadata, write_content_attachment, load_content_attachment, load_content, display_result, merge, for_each, if_else, switch, and others.", - "title": "Definition", - "type": "object" - }, - "schema_version": { - "description": "Agent schema version.", - "title": "Schema Version", - "type": "string" - }, - "warnings": { - "anyOf": [ - { - "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Validation warnings, if any.", - "title": "Warnings" - } - }, - "required": [ - "change_id", - "definition", - "schema_version" - ], - "title": "AgentDefinitionResponse", - "type": "object" - }, - "AgentEmailOptOutListResponse": { - "description": "A page of agent-email opt-outs plus the total (for pagination).", - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/AgentEmailOptOutResponse" - }, - "title": "Items", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "items", - "total" - ], - "title": "AgentEmailOptOutListResponse", - "type": "object" - }, - "AgentEmailOptOutResponse": { - "description": "A recipient's opt-out from an account's agent emails (one agent or all).", - "properties": { - "agent_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "agent_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Name" - }, - "comment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Comment" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Reason" - }, - "recipient_email": { - "title": "Recipient Email", - "type": "string" - } - }, - "required": [ - "id", - "created_at", - "recipient_email", - "agent_id", - "agent_name", - "reason", - "comment" - ], - "title": "AgentEmailOptOutResponse", - "type": "object" - }, - "AgentEvaluationTier": { - "description": "Controls model selection for agent evaluation.\n\nLabels shown in UI:\n FAST \u2192 \"Fast and cheap\"\n BALANCED \u2192 \"Balanced speed and cost\"\n THOROUGH \u2192 \"Slow and thorough\"", - "enum": [ - "fast", - "balanced", - "thorough" - ], - "title": "AgentEvaluationTier", - "type": "string" - }, - "AgentExportResponse": { - "description": "Portable JSON snapshot of an agent definition.", - "properties": { - "agent": { - "additionalProperties": true, - "description": "Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, created_at, updated_at.", - "title": "Agent", - "type": "object" - }, - "alert_configs": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Alert configurations.", - "title": "Alert Configs" - }, - "dependencies": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Resolved dependency manifest. Keys: knowledge_bases, memory_banks, source_connections, agents, users \u2014 each a list of {id, name, description, \u2026}.", - "title": "Dependencies" - }, - "evaluation_criteria": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Evaluation criteria for agent steps.", - "title": "Evaluation Criteria" - }, - "export_version": { - "description": "Schema version of the export format (currently \"5\").", - "title": "Export Version", - "type": "string" - }, - "exported_at": { - "description": "ISO-8601 timestamp of when the export was generated.", - "title": "Exported At", - "type": "string" - }, - "governance_policies": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Agent-scoped governance policies.", - "title": "Governance Policies" - }, - "software_version": { - "description": "Application version that produced this export.", - "title": "Software Version", - "type": "string" - }, - "trigger": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Trigger configuration with schedules.", - "title": "Trigger" - } - }, - "required": [ - "export_version", - "exported_at", - "software_version", - "agent" - ], - "title": "AgentExportResponse", - "type": "object" - }, - "AgentRunAttemptResponse": { - "properties": { - "duration": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Duration of the attempt in seconds.", - "title": "Duration" - }, - "ended_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the attempt ended.", - "title": "Ended At" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if the attempt failed.", - "title": "Error" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the attempt started.", - "title": "Started At" - }, - "status": { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus", - "description": "Status of the agent run attempt." - } - }, - "required": [ - "status", - "started_at", - "ended_at", - "duration", - "error" - ], - "title": "AgentRunAttemptResponse", - "type": "object" - }, - "AgentRunFileResponse": { - "description": "A file in a run's or a step's output.", - "properties": { - "bytes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Size of the file in bytes, when known.", - "title": "Bytes" - }, - "download_url": { - "description": "`GET` URL that streams the file; accepts an API key or OAuth token.", - "title": "Download Url", - "type": "string" - }, - "id": { - "description": "File identifier, used to download it.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "mime": { - "description": "MIME type of the file.", - "title": "Mime", - "type": "string" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The file's name in this run, as sent to email recipients and webhooks and matched by `{{attachments[...]}}` selectors.", - "title": "Name" - } - }, - "required": [ - "id", - "name", - "mime", - "bytes", - "download_url" - ], - "title": "AgentRunFileResponse", - "type": "object" - }, - "AgentRunRequest": { - "properties": { - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input to provide to the agent upon running for agents with dynamic triggers.", - "title": "Input" - }, - "input_upload_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` \u2014 use that field to attach multiple files. May be combined with ``input``: the prompt text leads and the file's extracted text follows under a ``# {filename}`` heading.\n\n**Attachment visibility:** a step only sees the upload when its template references the input \u2014 via ``{{input}}`` / ``{{agent.input}}`` / ``{{step..input|output}}`` (implicit, all attachments) or the ``{{attachments[\u2026]}}`` family (explicit narrowing \u2014 e.g. ``{{attachments[0]}}``, ``{{attachments[*.pdf]}}``).\n\n**Per-batch validation:** every selector the agent's definition declares must be satisfied or the run is rejected with HTTP 400. Exact-name selectors require that filename to be present; indexed selectors require at least N+1 files; glob patterns require at least one matching filename.", - "title": "Input Upload Id" - }, - "input_upload_ids": { - "anyOf": [ - { - "items": { - "format": "uuid", - "type": "string" - }, - "maxItems": 20, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "IDs of multiple previously uploaded files. Each upload's extracted text is concatenated under a heading; each upload's binary is surfaced as a separate ``MediaAttachment`` so multi-modal prompt steps reason over all files at once. Steps narrow visibility via ``{{attachments[\u2026]}}`` selectors (by index, filename, or fnmatch glob). The batch must satisfy every selector the agent declares \u2014 exact names, indexed references (length must exceed the highest index), and glob patterns (each pattern needs at least one match). Mismatches return HTTP 400 with the unmet requirements listed. Mutually exclusive with ``input_upload_id`` (two spellings of the same batch), but may be combined with ``input`` \u2014 the prompt text leads and the per-file sections follow, so \"a photo plus a sentence about it\" needs no synthetic text upload. Max 20 uploads per run.", - "title": "Input Upload Ids" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/components/schemas/JsonValue" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Metadata to make available for string substitution expressions in agent tasks.", - "title": "Metadata" - }, - "priority": { - "default": false, - "description": "If true, the agent run will be treated as priority execution.", - "title": "Priority", - "type": "boolean" - }, - "replay_of_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Re-run this agent reusing a prior run's uploaded input files. The files are re-resolved server-side from the source run (which must belong to this account and agent) \u2014 you do not re-upload them. Combine with ``input`` to change the text while keeping the files. A fresh upload batch (``input_upload_id(s)``) takes precedence and disables replay. Binaries swept by retention fall back to their extracted text.", - "title": "Replay Of Run Id" - } - }, - "title": "AgentRunRequest", - "type": "object" - }, - "AgentRunResponse": { - "properties": { - "attachments": { - "description": "Files in the run's output, in order. Empty for runs that produced none, for runs made before files were listed here, and once the run's trace is purged.", - "items": { - "$ref": "#/components/schemas/AgentRunFileResponse" - }, - "title": "Attachments", - "type": "array" - }, - "attempts": { - "description": "List of attempts made for this agent run.", - "items": { - "$ref": "#/components/schemas/AgentRunAttemptResponse" - }, - "title": "Attempts", - "type": "array" - }, - "blocked_policies": { - "description": "Governance policies that produced at least one BLOCK verdict during this run. Deduplicated by policy id.", - "items": { - "$ref": "#/components/schemas/routers__api__agents__GovernancePolicyRefResponse" - }, - "title": "Blocked Policies", - "type": "array" - }, - "credits": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits consumed by the agent run, if applicable. Can still rise briefly after the run ends, while governance screening finishes.", - "title": "Credits" - }, - "error_count": { - "description": "Number of errors encountered during the run.", - "title": "Error Count", - "type": "integer" - }, - "flagged_policies": { - "description": "Governance policies that produced at least one FLAG verdict during this run. Deduplicated by policy id.", - "items": { - "$ref": "#/components/schemas/routers__api__agents__GovernancePolicyRefResponse" - }, - "title": "Flagged Policies", - "type": "array" - }, - "governance_input_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Result of the governance input evaluation: safe, blocked, skipped, or timed_out.", - "title": "Governance Input Status" - }, - "governance_input_wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Milliseconds spent waiting for governance input evaluation.", - "title": "Governance Input Wait Ms" - }, - "hitl_wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cumulative milliseconds the run was parked waiting for a human decision on a human_in_the_loop step. Subtracted from active duration in run-detail and duration-stats responses.", - "title": "Hitl Wait Ms" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input provided to the agent for this run.", - "title": "Input" - }, - "input_scan_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Result of the prompt injection scan: safe, unsafe, skipped, timed_out, or error.", - "title": "Input Scan Status" - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The run's output text; its files are in `attachments`. Below `Seclai-Version: 2026-09-30` an output that has files is instead the manifest JSON `{schema, text, attachments: [{storage_key, mime, name, label, bytes}]}`; `bytes` is absent on runs made before that version shipped.", - "title": "Output" - }, - "output_content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "MIME type of `output` \u2014 mirrors the terminal step's `output_content_type`. `text/plain` / `text/*` are free-form text and `application/json` is a JSON document. Below `Seclai-Version: 2026-09-30` an output that has files reads `application/vnd.seclai.manifest+json` (see `output`); the same files are in `attachments` on every version, each with a `download_url`. Null on runs that produced no terminal output or that pre-date this column.", - "title": "Output Content Type" - }, - "priority": { - "description": "Indicates if the run was treated as a priority execution.", - "title": "Priority", - "type": "boolean" - }, - "run_id": { - "description": "Unique identifier for the agent run.", - "title": "Run Id", - "type": "string" - }, - "scan_wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Milliseconds spent waiting for prompt injection scan.", - "title": "Scan Wait Ms" - }, - "status": { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus", - "description": "Current status of the agent run." - }, - "steps": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/AgentRunStepResponse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Step outputs and per-step timing/credits. Only included when requested.", - "title": "Steps" - }, - "trace_purged_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "When this run's trace content was deleted under the account's agent-trace retention window. Non-null means `input`, `output` and every step's and tool call's I/O are null **by design** and will never be available again \u2014 the run aged out, it did not fail. Branch on this rather than on a null `output`: a run that genuinely produced nothing looks identical. Status, timing and credits remain accurate.", - "title": "Trace Purged At" - }, - "wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cumulative milliseconds the run was parked on standard-mode wait steps. Subtracted from active duration in run-detail and duration-stats responses, exactly like hitl_wait_ms. Priority waits block inline and are not counted here.", - "title": "Wait Ms" - } - }, - "required": [ - "run_id", - "status", - "error_count", - "credits", - "priority", - "input", - "output", - "attempts" - ], - "title": "AgentRunResponse", - "type": "object" - }, - "AgentRunStepResponse": { - "properties": { - "agent_step_id": { - "description": "Agent step identifier.", - "title": "Agent Step Id", - "type": "string" - }, - "attachments": { - "description": "Files in this step's output, in order. Empty for steps that produced none, for steps run before files were listed here, and once the run's trace is purged.", - "items": { - "$ref": "#/components/schemas/AgentRunFileResponse" - }, - "title": "Attachments", - "type": "array" - }, - "credits_used": { - "description": "Credits consumed by this step across every attempt it made. Some charges made outside any step, such as governance screening of the run's input, count toward the run's total but no step's. The timestamps above and the tool calls below describe the latest attempt only.", - "title": "Credits Used", - "type": "number" - }, - "duration_seconds": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Duration of the step attempt in seconds.", - "title": "Duration Seconds" - }, - "ended_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the step attempt ended.", - "title": "Ended At" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input text provided to the step, if any. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step that produced it output files and is not a `for_each`.", - "title": "Input" - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Output text produced by the step, if any; its files are in `attachments`. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step output files and is not a `for_each`.", - "title": "Output" - }, - "output_content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Content type of the step output, if any.", - "title": "Output Content Type" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the step attempt started.", - "title": "Started At" - }, - "status": { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus", - "description": "Status of the step run." - }, - "step_type": { - "description": "Type of the agent step.", - "title": "Step Type", - "type": "string" - }, - "tool_calls": { - "description": "LLM tool calls made during this step (prompt_call steps only), ordered by execution. Empty for steps that invoked no tools.", - "items": { - "$ref": "#/components/schemas/AgentRunToolCallResponse" - }, - "title": "Tool Calls", - "type": "array" - }, - "warnings": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Authoring problems the step ran into, whether or not it then failed, such as a file name selector that matched none of its source's files.", - "title": "Warnings" - } - }, - "required": [ - "agent_step_id", - "step_type", - "status", - "input", - "output", - "output_content_type", - "started_at", - "ended_at", - "duration_seconds", - "credits_used" - ], - "title": "AgentRunStepResponse", - "type": "object" - }, - "AgentRunStreamRequest": { - "properties": { - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input to provide to the agent upon running for agents with dynamic triggers.", - "title": "Input" - }, - "input_upload_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` \u2014 use that field to attach multiple files. May be combined with ``input``. Subject to the same per-batch attachment-selector validation as the non-streaming endpoint.", - "title": "Input Upload Id" - }, - "input_upload_ids": { - "anyOf": [ - { - "items": { - "format": "uuid", - "type": "string" - }, - "maxItems": 20, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "IDs of multiple previously uploaded files. See the non-streaming endpoint for full semantics, including per-batch selector validation (exact names, indexed references, and glob patterns must all be satisfied or the run is rejected with HTTP 400) and combining the batch with ``input`` prompt text. Max 20.", - "title": "Input Upload Ids" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/components/schemas/JsonValue" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Metadata to make available for string substitution expressions in agent tasks.", - "title": "Metadata" - }, - "replay_of_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Re-run reusing a prior run's uploaded input files (re-resolved server-side from the source run, which must belong to this account and agent). A fresh upload batch takes precedence.", - "title": "Replay Of Run Id" - } - }, - "title": "AgentRunStreamRequest", - "type": "object" - }, - "AgentRunToolCallResponse": { - "description": "A single LLM tool call made during a prompt_call step.", - "properties": { - "credits_used": { - "default": 0.0, - "description": "Credits consumed by this tool call (0 for tools that don't bill).", - "title": "Credits Used", - "type": "number" - }, - "duration_seconds": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Duration of the tool call in seconds.", - "title": "Duration Seconds" - }, - "ended_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the tool call ended.", - "title": "Ended At" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message when the tool call failed.", - "title": "Error" - }, - "function_name": { - "description": "Name of the tool/function invoked.", - "title": "Function Name", - "type": "string" - }, - "id": { - "description": "Tool call identifier.", - "title": "Id", - "type": "string" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "JSON arguments the LLM passed to the tool, if persisted.", - "title": "Input" - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "JSON result the tool returned to the LLM, if persisted.", - "title": "Output" - }, - "round_index": { - "default": 0, - "description": "0-based tool-loop round this call belonged to.", - "title": "Round Index", - "type": "integer" - }, - "sequence": { - "default": 0, - "description": "0-based ordinal of this call within one attempt of the step, so it repeats across a retried step's attempts. This list holds the latest attempt only.", - "title": "Sequence", - "type": "integer" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the tool call started.", - "title": "Started At" - }, - "succeeded": { - "default": true, - "description": "Whether the tool call completed without error.", - "title": "Succeeded", - "type": "boolean" - } - }, - "required": [ - "id", - "function_name" - ], - "title": "AgentRunToolCallResponse", - "type": "object" - }, - "AgentSummaryResponse": { - "properties": { - "created_at": { - "description": "ISO 8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "default_evaluation_tier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Default evaluation tier: fast, balanced, or thorough.", - "title": "Default Evaluation Tier" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent description.", - "title": "Description" - }, - "disabled": { - "default": false, - "description": "Whether the agent is paused (disabled).", - "title": "Disabled", - "type": "boolean" - }, - "disabled_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ISO 8601 timestamp the agent was paused.", - "title": "Disabled At" - }, - "disabled_reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Why the agent is paused: 'manual' or 'email_overload'.", - "title": "Disabled Reason" - }, - "evaluation_mode": { - "default": "eval_and_retry", - "description": "Evaluation mode: output_expectation, eval_and_retry, or sample_and_flag.", - "title": "Evaluation Mode", - "type": "string" - }, - "id": { - "description": "Unique agent identifier.", - "title": "Id", - "type": "string" - }, - "import_warnings": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/ImportSkipResponse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "One entry per item dropped or substituted during import. Present only on endpoints that accept agent_definition; null on non-import calls; [] when the import had no skips.", - "title": "Import Warnings" - }, - "max_retries": { - "default": 3, - "description": "Max retries for eval_and_retry mode.", - "title": "Max Retries", - "type": "integer" - }, - "name": { - "description": "Agent name.", - "title": "Name", - "type": "string" - }, - "prompt_model_auto_rollback_enabled": { - "default": false, - "description": "Whether automatic rollback is enabled for upgraded models.", - "title": "Prompt Model Auto Rollback Enabled", - "type": "boolean" - }, - "prompt_model_auto_rollback_triggers": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Failure signals that trigger rollback. Defaults to agent_eval_fail, governance_block, agent_run_failed when null.", - "title": "Prompt Model Auto Rollback Triggers" - }, - "prompt_model_auto_upgrade_strategy": { - "default": "none", - "description": "Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter.", - "title": "Prompt Model Auto Upgrade Strategy", - "type": "string" - }, - "retry_on_failure": { - "default": true, - "description": "Whether to retry on evaluation failure.", - "title": "Retry On Failure", - "type": "boolean" - }, - "sampling_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Sampling configuration for sample_and_flag mode.", - "title": "Sampling Config" - }, - "trigger_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Trigger type for the agent.", - "title": "Trigger Type" - }, - "updated_at": { - "description": "ISO 8601 last-updated timestamp.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "description", - "created_at", - "updated_at" - ], - "title": "AgentSummaryResponse", - "type": "object" - }, - "AgentTraceMatchResponse": { - "properties": { - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent ID.", - "title": "Agent Id" - }, - "agent_run_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent run ID.", - "title": "Agent Run Id" - }, - "agent_run_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Status of the agent run.", - "title": "Agent Run Status" - }, - "agent_step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step identifier.", - "title": "Agent Step Id" - }, - "agent_step_run_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent step run ID.", - "title": "Agent Step Run Id" - }, - "agent_step_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Type of the step.", - "title": "Agent Step Type" - }, - "score": { - "description": "Similarity score (0-1, higher is better).", - "title": "Score", - "type": "number" - }, - "text": { - "description": "Matching text chunk.", - "title": "Text", - "type": "string" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title of the indexed entry.", - "title": "Title" - } - }, - "required": [ - "agent_run_id", - "agent_step_run_id", - "agent_id", - "agent_step_id", - "agent_step_type", - "agent_run_status", - "title", - "text", - "score" - ], - "title": "AgentTraceMatchResponse", - "type": "object" - }, - "AgentTraceSearchResponse": { - "properties": { - "matches": { - "description": "List of matching entries.", - "items": { - "$ref": "#/components/schemas/AgentTraceMatchResponse" - }, - "title": "Matches", - "type": "array" - }, - "total": { - "description": "Number of matches returned.", - "title": "Total", - "type": "integer" - } - }, - "required": [ - "matches", - "total" - ], - "title": "AgentTraceSearchResponse", - "type": "object" - }, - "AgentUsingCloudDriveResponseModel": { - "properties": { - "agent_id": { - "description": "Agent identifier.", - "title": "Agent Id", - "type": "string" - }, - "agent_name": { - "description": "Agent name.", - "title": "Agent Name", - "type": "string" - }, - "trigger_types": { - "description": "File-change trigger types bound to this drive.", - "items": { - "type": "string" - }, - "title": "Trigger Types", - "type": "array" - }, - "via_prompt_tool": { - "description": "Uses a prompt_call cloud-drive tool.", - "title": "Via Prompt Tool", - "type": "boolean" - }, - "via_step": { - "description": "Uses a list/read/write cloud-drive step.", - "title": "Via Step", - "type": "boolean" - } - }, - "required": [ - "agent_id", - "agent_name", - "via_step", - "via_prompt_tool", - "trigger_types" - ], - "title": "AgentUsingCloudDriveResponseModel", - "type": "object" - }, - "AiAssistantAcceptResponse": { - "description": "Response from accepting and executing a plan.", - "properties": { - "conversation_id": { - "description": "Conversation ID.", - "format": "uuid", - "title": "Conversation Id", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if failed.", - "title": "Error" - }, - "executed_actions": { - "description": "Results of each executed action.", - "items": { - "$ref": "#/components/schemas/ExecutedActionResponse" - }, - "title": "Executed Actions", - "type": "array" - }, - "solution_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Solution ID when a new solution was auto-created.", - "title": "Solution Id" - }, - "success": { - "default": true, - "description": "Whether execution succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "executed_actions" - ], - "title": "AiAssistantAcceptResponse", - "type": "object" - }, - "AiAssistantFeedbackResponse": { - "description": "Response after submitting feedback.", - "properties": { - "feedback_id": { - "format": "uuid", - "title": "Feedback Id", - "type": "string" - }, - "flag_reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Flag Reason" - }, - "flagged": { - "title": "Flagged", - "type": "boolean" - } - }, - "required": [ - "feedback_id", - "flagged" - ], - "title": "AiAssistantFeedbackResponse", - "type": "object" - }, - "AiAssistantGenerateResponse": { - "description": "Response from an AI assistant generate endpoint.", - "properties": { - "conversation_id": { - "description": "Conversation ID for accept/decline.", - "format": "uuid", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of this AI assistant.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI-generated note about the plan.", - "title": "Note", - "type": "string" - }, - "proposed_actions": { - "description": "List of proposed actions.", - "items": { - "$ref": "#/components/schemas/ProposedActionResponse" - }, - "title": "Proposed Actions", - "type": "array" - }, - "requires_delete_confirmation": { - "default": false, - "description": "Whether destructive actions require explicit confirmation.", - "title": "Requires Delete Confirmation", - "type": "boolean" - }, - "success": { - "default": false, - "description": "Whether plan generation succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "note", - "proposed_actions" - ], - "title": "AiAssistantGenerateResponse", - "type": "object" - }, - "AiConversationHistoryResponse": { - "properties": { - "total": { - "description": "Total number of conversation turns available.", - "title": "Total", - "type": "integer" - }, - "turns": { - "description": "Conversation turns, ordered oldest first.", - "items": { - "$ref": "#/components/schemas/AiConversationTurnResponse" - }, - "title": "Turns", - "type": "array" - } - }, - "required": [ - "turns", - "total" - ], - "title": "AiConversationHistoryResponse", - "type": "object" - }, - "AiConversationTurnResponse": { - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the user accepted this proposal (null if pending).", - "title": "Accepted" - }, - "ai_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI explanation from this turn.", - "title": "Ai Note" - }, - "conversation_id": { - "description": "Unique conversation turn ID.", - "title": "Conversation Id", - "type": "string" - }, - "resulting_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "The proposed configuration from this turn.", - "title": "Resulting Config" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step ID for this conversation.", - "title": "Step Id" - }, - "step_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step type for this conversation.", - "title": "Step Type" - }, - "user_input": { - "description": "User input for this turn.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "conversation_id", - "user_input", - "ai_note", - "accepted", - "resulting_config", - "step_type", - "step_id" - ], - "title": "AiConversationTurnResponse", - "type": "object" - }, - "AlertConfigListResponse": { - "description": "``GET /alerts/configs`` legacy/default shape (header-less clients).\n\n``Seclai-Version: 2026-07-27+`` clients receive the canonical\n``{data, pagination}`` envelope instead (the handler returns a ``JSONResponse``\nthat bypasses this ``response_model``); this documents the default shape.", - "properties": { - "configs": { - "items": { - "$ref": "#/components/schemas/AlertConfigResponse" - }, - "title": "Configs", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "configs", - "total" - ], - "title": "AlertConfigListResponse", - "type": "object" - }, - "AlertConfigResponse": { - "properties": { - "account_id": { - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "cooldown_minutes": { - "title": "Cooldown Minutes", - "type": "integer" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "distribution_type": { - "title": "Distribution Type", - "type": "string" - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "id": { - "title": "Id", - "type": "string" - }, - "last_alerted_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Alerted At" - }, - "recipient_user_ids": { - "items": { - "type": "string" - }, - "title": "Recipient User Ids", - "type": "array" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Connection Id" - }, - "threshold": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Threshold" - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Updated At" - } - }, - "required": [ - "id", - "agent_id", - "source_connection_id", - "account_id", - "alert_type", - "enabled", - "threshold", - "cooldown_minutes", - "last_alerted_at", - "distribution_type", - "recipient_user_ids", - "created_at", - "updated_at" - ], - "title": "AlertConfigResponse", - "type": "object" - }, - "AlertHistoryEntryResponse": { - "properties": { - "changed_by_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Changed By Name" - }, - "changed_by_user_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Changed By User Id" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "id": { - "title": "Id", - "type": "string" - }, - "new_status": { - "title": "New Status", - "type": "string" - }, - "note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Note" - }, - "previous_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Previous Status" - } - }, - "required": [ - "id", - "previous_status", - "new_status", - "changed_by_user_id", - "changed_by_name", - "note", - "created_at" - ], - "title": "AlertHistoryEntryResponse", - "type": "object" - }, - "ApiVersionResponse": { - "properties": { - "default_version": { - "description": "Baseline for an unpinned, header-less caller.", - "title": "Default Version", - "type": "string" - }, - "effective_version": { - "description": "The version THIS request resolved to (header > pin > default).", - "title": "Effective Version", - "type": "string" - }, - "known_versions": { - "description": "All dated versions, oldest first.", - "items": { - "type": "string" - }, - "title": "Known Versions", - "type": "array" - }, - "latest_version": { - "description": "Newest version the server knows about.", - "title": "Latest Version", - "type": "string" - }, - "pinned_version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The account's sticky pinned version, or null when unpinned (the account resolves to the default). Applies to header-less requests.", - "title": "Pinned Version" - } - }, - "required": [ - "pinned_version", - "effective_version", - "default_version", - "latest_version", - "known_versions" - ], - "title": "ApiVersionResponse", - "type": "object" - }, - "AppliedActionResponse": { - "description": "Result of a single executed governance action.", - "properties": { - "action_type": { - "description": "Type of action that was executed.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description of the executed action.", - "title": "Description", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if this action failed, or null.", - "title": "Error" - }, - "policy_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the policy that was created or modified, or null.", - "title": "Policy Id" - }, - "success": { - "description": "Whether this individual action succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "action_type", - "description", - "success" - ], - "title": "AppliedActionResponse", - "type": "object" - }, - "AttachmentRefsSourceApiSummary": { - "description": "Per-source attachment-reference summary.", - "properties": { - "exact_names": { - "items": { - "type": "string" - }, - "title": "Exact Names", - "type": "array" - }, - "indexes_max": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Indexes Max" - }, - "kinds": { - "items": { - "type": "string" - }, - "title": "Kinds", - "type": "array" - }, - "patterns": { - "items": { - "type": "string" - }, - "title": "Patterns", - "type": "array" - } - }, - "title": "AttachmentRefsSourceApiSummary", - "type": "object" - }, - "BlockEmailSenderRequest": { - "description": "Add one sender/domain to the account blocklist (shared REST request).", - "properties": { - "match_type": { - "default": "address", - "title": "Match Type", - "type": "string" - }, - "note": { - "anyOf": [ - { - "maxLength": 500, - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Note" - }, - "sender_email": { - "maxLength": 320, - "minLength": 3, - "title": "Sender Email", - "type": "string" - } - }, - "required": [ - "sender_email" - ], - "title": "BlockEmailSenderRequest", - "type": "object" - }, - "BlockedEmailSenderListResponse": { - "description": "A page of blocked senders + the account's auto-block mode.", - "properties": { - "auto_block_mode": { - "title": "Auto Block Mode", - "type": "string" - }, - "items": { - "items": { - "$ref": "#/components/schemas/BlockedEmailSenderResponse" - }, - "title": "Items", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "items", - "total", - "auto_block_mode" - ], - "title": "BlockedEmailSenderListResponse", - "type": "object" - }, - "BlockedEmailSenderResponse": { - "description": "A single blocked inbound email sender.", - "properties": { - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "match_type": { - "title": "Match Type", - "type": "string" - }, - "note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Note" - }, - "sender_email": { - "title": "Sender Email", - "type": "string" - }, - "source": { - "title": "Source", - "type": "string" - } - }, - "required": [ - "id", - "created_at", - "sender_email", - "match_type", - "source", - "note" - ], - "title": "BlockedEmailSenderResponse", - "type": "object" - }, - "Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post": { - "properties": { - "file": { - "description": "File to upload", - "format": "binary", - "title": "File", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional JSON object string of metadata. Example: `{\"category\":\"docs\",\"author\":\"Ada\"}`. `title` will be merged into this dictionary as `metadata.title` if it is not already present.", - "title": "Metadata" - }, - "title": { - "description": "Optional title for the content", - "title": "Title", - "type": "string" - } - }, - "required": [ - "file" - ], - "title": "Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post", - "type": "object" - }, - "Body_upload_file_to_source_api_sources__source_connection_id__upload_post": { - "properties": { - "file": { - "description": "File to upload", - "format": "binary", - "title": "File", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional JSON object string of metadata. Example: `{\"author\":\"Ada\",\"category\":\"docs\"}`. `title` will be merged into this dictionary as `metadata.title` if it is not already present.", - "title": "Metadata" - }, - "title": { - "description": "Optional title for the content", - "title": "Title", - "type": "string" - } - }, - "required": [ - "file" - ], - "title": "Body_upload_file_to_source_api_sources__source_connection_id__upload_post", - "type": "object" - }, - "CancelExperimentResponse": { - "properties": { - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "status" - ], - "title": "CancelExperimentResponse", - "type": "object" - }, - "CancelQueuedRunsResponse": { - "properties": { - "cancelled": { - "title": "Cancelled", - "type": "integer" - } - }, - "required": [ - "cancelled" - ], - "title": "CancelQueuedRunsResponse", - "type": "object" - }, - "ChangeStatusRequest": { - "properties": { - "note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional note", - "title": "Note" - }, - "status": { - "description": "New alert status", - "title": "Status", - "type": "string" - } - }, - "required": [ - "status" - ], - "title": "ChangeStatusRequest", - "type": "object" - }, - "CloudDriveAccessLevelResponseModel": { - "properties": { - "default": { - "description": "Whether connecting without a choice uses it.", - "title": "Default", - "type": "boolean" - }, - "description": { - "description": "What agents can do at this level.", - "title": "Description", - "type": "string" - }, - "key": { - "description": "Level identifier, e.g. `read_write`/`read_only`.", - "title": "Key", - "type": "string" - }, - "label": { - "description": "Short human-readable name.", - "title": "Label", - "type": "string" - } - }, - "required": [ - "key", - "label", - "description", - "default" - ], - "title": "CloudDriveAccessLevelResponseModel", - "type": "object" - }, - "CloudDriveProviderResponseModel": { - "properties": { - "access_levels": { - "description": "Mutually-exclusive permission bundles offered when connecting. Connecting happens in the app, so this is informational here \u2014 it explains what a connection's `access_level` can be.", - "items": { - "$ref": "#/components/schemas/CloudDriveAccessLevelResponseModel" - }, - "title": "Access Levels", - "type": "array" - }, - "display_name": { - "description": "Human-readable provider name.", - "title": "Display Name", - "type": "string" - }, - "key": { - "description": "Provider key used as `provider` on a connection.", - "title": "Key", - "type": "string" - }, - "scopes": { - "description": "OAuth permissions this provider can request.", - "items": { - "$ref": "#/components/schemas/CloudDriveScopeResponseModel" - }, - "title": "Scopes", - "type": "array" - } - }, - "required": [ - "key", - "display_name", - "scopes", - "access_levels" - ], - "title": "CloudDriveProviderResponseModel", - "type": "object" - }, - "CloudDriveRejectionResponseModel": { - "description": "One file the connection deliberately did not process.", - "properties": { - "created_at": { - "description": "When the file was skipped.", - "title": "Created At", - "type": "string" - }, - "detail": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Extra context, e.g. the cap that was hit.", - "title": "Detail" - }, - "file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The provider's file id, when the file was known.", - "title": "File Id" - }, - "file_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Path of the skipped file, when known.", - "title": "File Path" - }, - "id": { - "description": "Rejection identifier.", - "title": "Id", - "type": "string" - }, - "reason": { - "description": "`too_large`, `download_failed`, or `flood`.", - "title": "Reason", - "type": "string" - } - }, - "required": [ - "id", - "reason", - "created_at" - ], - "title": "CloudDriveRejectionResponseModel", - "type": "object" - }, - "CloudDriveResponseModel": { - "description": "A cloud-drive connection, without any secret material.", - "properties": { - "access_level": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The permission bundle the granted scopes correspond to \u2014 `read_write` or `read_only`. Null when the grant matches no level the provider currently offers; treat that as unknown rather than assuming write access.", - "title": "Access Level" - }, - "connected": { - "description": "True when the connection is usable.", - "title": "Connected", - "type": "boolean" - }, - "created_at": { - "description": "When the connection was created.", - "title": "Created At", - "type": "string" - }, - "drive_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Opaque id of the shared drive the folder resolves to, or null for the user's own drive. Stable across renames \u2014 compare on this rather than on the name in `folder_path`.", - "title": "Drive Id" - }, - "drive_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Display name the shared drive last resolved to. Presentation only; never match on it.", - "title": "Drive Name" - }, - "drive_name_stale": { - "description": "True when `drive_name` could not be re-confirmed (the drive was deleted, access was lost, or the provider was unreachable). The last known name is still reported \u2014 treat it as possibly out of date rather than current.", - "title": "Drive Name Stale", - "type": "boolean" - }, - "external_account_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The provider's own opaque account identifier (never an email).", - "title": "External Account Id" - }, - "folder_path": { - "description": "Watched folder; empty string means the drive root. A folder on a shared drive is written `/Shared drives//`.", - "title": "Folder Path", - "type": "string" - }, - "id": { - "description": "Connection identifier.", - "title": "Id", - "type": "string" - }, - "last_error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Most recent sync or authorization error, if any.", - "title": "Last Error" - }, - "last_synced_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "When the connection last synced successfully.", - "title": "Last Synced At" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human-readable name.", - "title": "Name" - }, - "oauth_scopes": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Space-separated OAuth scopes granted to this connection.", - "title": "Oauth Scopes" - }, - "provider": { - "description": "Provider key, e.g. `dropbox` or `google_drive`.", - "title": "Provider", - "type": "string" - }, - "realtime_updates": { - "description": "True when changes arrive via the provider's push notifications. False means the drive still syncs, but only on the scheduled backstop sweep rather than within seconds of a change.", - "title": "Realtime Updates", - "type": "boolean" - }, - "status": { - "description": "One of `active`, `pending_auth`, `error`, `disconnected`.", - "title": "Status", - "type": "string" - }, - "updated_at": { - "description": "When the connection was last modified.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "provider", - "status", - "folder_path", - "drive_name_stale", - "connected", - "realtime_updates", - "created_at", - "updated_at" - ], - "title": "CloudDriveResponseModel", - "type": "object" - }, - "CloudDriveScopeResponseModel": { - "properties": { - "description": { - "description": "What the scope allows.", - "title": "Description", - "type": "string" - }, - "key": { - "description": "The OAuth scope string sent to the provider.", - "title": "Key", - "type": "string" - }, - "label": { - "description": "Short human-readable name.", - "title": "Label", - "type": "string" - }, - "recommended": { - "description": "Whether this scope is requested by default on connect.", - "title": "Recommended", - "type": "boolean" - } - }, - "required": [ - "key", - "label", - "description", - "recommended" - ], - "title": "CloudDriveScopeResponseModel", - "type": "object" - }, - "CloudDriveUpdateRequest": { - "properties": { - "folder_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New watched folder; empty means the whole drive. A folder on a shared drive is written `/Shared drives//`. Changing it resets the sync cursor, so files already in the new folder are NOT replayed as triggers \u2014 only subsequent changes fire, matching connect-time behaviour. Rejected when the new folder would make an agent that writes there re-trigger itself.", - "title": "Folder Path" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New display name for the connection.", - "title": "Name" - } - }, - "title": "CloudDriveUpdateRequest", - "type": "object" - }, - "CompactionEvaluationModel": { - "description": "Structured LLM-as-judge evaluation result.", - "properties": { - "reasoning": { - "description": "Explanation of the evaluation.", - "title": "Reasoning", - "type": "string" - }, - "score": { - "description": "Quality score from 1 to 5.", - "title": "Score", - "type": "integer" - }, - "verdict": { - "description": "'pass' or 'fail'.", - "title": "Verdict", - "type": "string" - } - }, - "required": [ - "verdict", - "score", - "reasoning" - ], - "title": "CompactionEvaluationModel", - "type": "object" - }, - "CompactionScheduledResponse": { - "description": "Acknowledgement that an on-demand compaction run was scheduled.", - "properties": { - "memory_bank_id": { - "title": "Memory Bank Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "memory_bank_id", - "status" - ], - "title": "CompactionScheduledResponse", - "type": "object" - }, - "CompactionTestResponseModel": { - "description": "Response from a compaction prompt test.", - "properties": { - "compaction_summary": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The generated compaction summary.", - "title": "Compaction Summary" - }, - "evaluation": { - "$ref": "#/components/schemas/CompactionEvaluationModel", - "description": "LLM-as-judge quality evaluation." - }, - "generated": { - "description": "True when entries were LLM-generated rather than real.", - "title": "Generated", - "type": "boolean" - }, - "original_entries": { - "description": "Entries fed into the compactor.", - "items": { - "type": "string" - }, - "title": "Original Entries", - "type": "array" - }, - "surviving_entries": { - "description": "Entries that survived after compaction.", - "items": { - "type": "string" - }, - "title": "Surviving Entries", - "type": "array" - } - }, - "required": [ - "original_entries", - "compaction_summary", - "surviving_entries", - "evaluation", - "generated" - ], - "title": "CompactionTestResponseModel", - "type": "object" - }, - "CompatibleRunListResponse": { - "description": "Paginated list of compatible runs.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/CompatibleRunResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "CompatibleRunListResponse", - "type": "object" - }, - "CompatibleRunResponse": { - "description": "A run that has a completed step matching a criteria's step_id.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "format": "uuid", - "title": "Agent Step Run Id", - "type": "string" - }, - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Completed At" - }, - "input_preview": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Input Preview" - }, - "output_storage_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Output Storage Key" - }, - "run_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Run Status" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started At" - } - }, - "required": [ - "agent_run_id", - "agent_step_run_id", - "completed_at", - "output_storage_key" - ], - "title": "CompatibleRunResponse", - "type": "object" - }, - "ContentEmbeddingResponse": { - "description": "Response model for content embedding.", - "properties": { - "batch_duration": { - "title": "Batch Duration", - "type": "number" - }, - "batch_size": { - "title": "Batch Size", - "type": "integer" - }, - "id": { - "title": "Id", - "type": "string" - }, - "media_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Media Name" - }, - "page_number": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Page Number" - }, - "source_mime": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Mime" - }, - "source_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Url" - }, - "text": { - "title": "Text", - "type": "string" - }, - "text_end": { - "title": "Text End", - "type": "integer" - }, - "text_start": { - "title": "Text Start", - "type": "integer" - }, - "vector": { - "items": { - "type": "number" - }, - "title": "Vector", - "type": "array" - } - }, - "required": [ - "id", - "text_start", - "text_end", - "text", - "vector", - "batch_size", - "batch_duration" - ], - "title": "ContentEmbeddingResponse", - "type": "object" - }, - "CreateAlertConfigRequest": { - "properties": { - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent ID (for agent alerts)", - "title": "Agent Id" - }, - "alert_type": { - "description": "Alert type", - "title": "Alert Type", - "type": "string" - }, - "cooldown_minutes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cooldown period in minutes. Omit to use the per-alert-type default (1440 for credit alerts, 60 otherwise).", - "title": "Cooldown Minutes" - }, - "distribution_type": { - "default": "owner", - "description": "Distribution type (owner, owner_admins, selected_members)", - "title": "Distribution Type", - "type": "string" - }, - "enabled": { - "default": true, - "description": "Whether the alert config is enabled", - "title": "Enabled", - "type": "boolean" - }, - "recipient_user_ids": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "User IDs for selected_members distribution", - "title": "Recipient User Ids" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source connection ID (for source alerts)", - "title": "Source Connection Id" - }, - "threshold": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Threshold configuration", - "title": "Threshold" - } - }, - "required": [ - "alert_type" - ], - "title": "CreateAlertConfigRequest", - "type": "object" - }, - "CreateEvaluationCriteriaRequest": { - "description": "Request body for creating an evaluation criteria.\n\nThe evaluation mode, retry settings, and sample frequency are set at the\nagent level, not per-criteria.", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "enabled": { - "default": true, - "title": "Enabled", - "type": "boolean" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "pass_threshold": { - "default": 0.5, - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" - }, - "step_id": { - "maxLength": 255, - "minLength": 1, - "title": "Step Id", - "type": "string" - } - }, - "required": [ - "step_id" - ], - "title": "CreateEvaluationCriteriaRequest", - "type": "object" - }, - "CreateEvaluationResultRequest": { - "description": "Request body for recording an evaluation result.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Step Run Id" - }, - "details": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Details" - }, - "flagged": { - "default": false, - "title": "Flagged", - "type": "boolean" - }, - "retry_count": { - "default": 0, - "minimum": 0.0, - "title": "Retry Count", - "type": "integer" - }, - "retry_triggered": { - "default": false, - "title": "Retry Triggered", - "type": "boolean" - }, - "score": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Score" - }, - "status": { - "$ref": "#/components/schemas/EvaluationStatus" - } - }, - "required": [ - "agent_run_id", - "status" - ], - "title": "CreateEvaluationResultRequest", - "type": "object" - }, - "CreateExperimentResponse": { - "properties": { - "experiment_id": { - "title": "Experiment Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "experiment_id", - "status" - ], - "title": "CreateExperimentResponse", - "type": "object" - }, - "CreateKnowledgeBaseBody": { - "description": "Request body for creating a knowledge base.", - "properties": { - "default_score_threshold": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Minimum Rerank Score on a new retrieval step in the editor. Not applied at retrieval time \u2014 the step's own value is used.", - "title": "Default Score Threshold" - }, - "default_top_k": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "maximum": 200.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Top K on a new retrieval step in the editor. Not applied at retrieval time.", - "title": "Default Top K" - }, - "default_top_n": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "maximum": 200.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Top N on a new retrieval step in the editor. Not applied at retrieval time \u2014 the step's own value is used.", - "title": "Default Top N" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description.", - "title": "Description" - }, - "name": { - "description": "Knowledge base name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" - }, - "reranker_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Reranker model to use \u2014 a `model_type` from `GET /models/rerankers`. Pass \"none\" to disable reranking (not a value from that list). Omit it for a default chosen from the sources (\"none\" when every source embeds media natively, whose chunks carry no text for a reranker to score). \"\" is accepted as a synonym for \"none\".", - "title": "Reranker Model" - }, - "source_ids": { - "description": "List of source connection IDs to link.", - "items": { - "type": "string" - }, - "minItems": 1, - "title": "Source Ids", - "type": "array" - } - }, - "required": [ - "name", - "source_ids" - ], - "title": "CreateKnowledgeBaseBody", - "type": "object" - }, - "CreateMemoryBankBody": { - "description": "Request body for creating a memory bank.", - "properties": { - "chunk_overlap": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk overlap (custom mode only).", - "title": "Chunk Overlap" - }, - "chunk_size": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk size (custom mode only).", - "title": "Chunk Size" - }, - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted.", - "title": "Compaction Prompt" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description of the bank's purpose.", - "title": "Description" - }, - "dimensions": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Embedding dimensions (custom mode only).", - "title": "Dimensions" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom embedding model (custom mode only).", - "title": "Embedding Model" - }, - "max_age_days": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "DEPRECATED and no longer applied. Age used to trigger compaction, which duplicated retention_days \u2014 both removed the same entries at the same age. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending Seclai-Version 2026-08-03 or later; accepted and stored but inert for older clients.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max total tokens (per partition) before compaction. Checked inline after each write and by the hourly background sweep.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep.", - "title": "Max Turns" - }, - "mode": { - "default": "fast_and_cheap", - "description": "Embedding quality / cost trade-off. One of: fast_and_cheap, balanced, slow_and_thorough, custom.", - "title": "Mode", - "type": "string" - }, - "name": { - "description": "Memory bank name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" - }, - "retention_days": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention in days \u2014 when entries are deleted outright, text and embeddings. This is the only age-based control; compaction triggers on max_size_tokens and max_turns. For clients sending Seclai-Version 2026-08-03 or later, omitting the field resolves per bank type: 90 days for a conversation bank, indefinite for a general bank. Older clients keep the previous default of 30 days for a conversation bank \u2014 unless a longer max_age_days was sent, which wins, since the window is never lowered beneath the only age the caller expressed \u2014 while a general bank keeps entries indefinitely. Send an explicit value (or null for indefinite) to be unambiguous on every version.", - "title": "Retention Days" - }, - "strip_quoted_reply_chains": { - "default": false, - "description": "Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation.", - "title": "Strip Quoted Reply Chains", - "type": "boolean" - }, - "type": { - "default": "conversation", - "description": "Bank type. 'conversation' for chat-turn data with conversation_key + speaker; 'general' for flat entries with optional group_key.", - "title": "Type", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "CreateMemoryBankBody", - "type": "object" - }, - "CreateSolutionRequest": { - "description": "Request model for creating a new solution", - "properties": { - "description": { - "default": "", - "description": "Description of the solution", - "title": "Description", - "type": "string" - }, - "name": { - "description": "Name of the solution", - "title": "Name", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "CreateSolutionRequest", - "type": "object" - }, - "CreateSourceBody": { - "description": "Request body for creating a content source.", - "properties": { - "chunk_overlap": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk overlap for content processing.", - "title": "Chunk Overlap" - }, - "chunk_size": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk size for content processing.", - "title": "Chunk Size" - }, - "content_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Content filter type.", - "title": "Content Filter" - }, - "dimensions": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Embedding dimensions override.", - "title": "Dimensions" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model override \u2014 a `model_type` from `GET /models/embedders`, which also reports each embedder's `supported_input_media`. Defaults to the platform embedder (`default_model_type` on that endpoint) when omitted. Indexing images or video requires an embedder that lists that modality.", - "title": "Embedding Model" - }, - "index_mode": { - "anyOf": [ - { - "$ref": "#/components/schemas/SourceIndexMode" - }, - { - "type": "null" - } - ], - "description": "Index mode for custom_index sources: fast_and_cheap (default), balanced, slow_and_thorough, or custom." - }, - "media_types": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Media kinds to extract from indexed content and embed as multi-modal KB chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored (see `supported_input_media` on GET /models/embedders); unsupported values are dropped. Omit / [] for text-only.", - "title": "Media Types" - }, - "name": { - "description": "Source name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling interval (e.g. hourly, daily).", - "title": "Polling" - }, - "polling_action": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling action.", - "title": "Polling Action" - }, - "polling_max_items": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max items per poll.", - "title": "Polling Max Items" - }, - "retention": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention period in days.", - "title": "Retention" - }, - "source_type": { - "description": "Source type: rss, website, or custom_index. The legacy value 'file_uploads' is accepted as an alias for custom_index.", - "title": "Source Type", - "type": "string" - }, - "url_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "URL record ID (required for rss/website sources).", - "title": "Url Id" - } - }, - "required": [ - "name", - "source_type" - ], - "title": "CreateSourceBody", - "type": "object" - }, - "DmarcFailingSourceResponse": { - "properties": { - "failed_count": { - "title": "Failed Count", - "type": "integer" - }, - "header_from": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Header From" - }, - "source_ip": { - "title": "Source Ip", - "type": "string" - } - }, - "required": [ - "source_ip", - "failed_count" - ], - "title": "DmarcFailingSourceResponse", - "type": "object" - }, - "DmarcSummaryResponse": { - "properties": { - "dispositions": { - "additionalProperties": { - "type": "integer" - }, - "title": "Dispositions", - "type": "object" - }, - "failed_messages": { - "title": "Failed Messages", - "type": "integer" - }, - "monitored": { - "default": true, - "title": "Monitored", - "type": "boolean" - }, - "pass_rate": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Pass Rate" - }, - "passed_messages": { - "title": "Passed Messages", - "type": "integer" - }, - "report_count": { - "title": "Report Count", - "type": "integer" - }, - "top_failing_sources": { - "items": { - "$ref": "#/components/schemas/DmarcFailingSourceResponse" - }, - "title": "Top Failing Sources", - "type": "array" - }, - "total_messages": { - "title": "Total Messages", - "type": "integer" - }, - "window_days": { - "title": "Window Days", - "type": "integer" - } - }, - "required": [ - "window_days", - "report_count", - "total_messages", - "passed_messages", - "failed_messages" - ], - "title": "DmarcSummaryResponse", - "type": "object" - }, - "DnsProviderResponse": { - "properties": { - "dashboard_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Dashboard Url" - }, - "key": { - "title": "Key", - "type": "string" - }, - "mx_priority_separate": { - "default": true, - "title": "Mx Priority Separate", - "type": "boolean" - }, - "name": { - "title": "Name", - "type": "string" - }, - "tips": { - "items": { - "type": "string" - }, - "title": "Tips", - "type": "array" - }, - "txt_quotes": { - "default": "strip", - "title": "Txt Quotes", - "type": "string" - } - }, - "required": [ - "key", - "name" - ], - "title": "DnsProviderResponse", - "type": "object" - }, - "DnsRecordResponse": { - "properties": { - "detail": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Detail" - }, - "key": { - "title": "Key", - "type": "string" - }, - "mx_host": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mx Host" - }, - "mx_priority": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Mx Priority" - }, - "name": { - "title": "Name", - "type": "string" - }, - "ok": { - "title": "Ok", - "type": "boolean" - }, - "relative_name": { - "title": "Relative Name", - "type": "string" - }, - "type": { - "title": "Type", - "type": "string" - }, - "value": { - "title": "Value", - "type": "string" - } - }, - "required": [ - "key", - "type", - "name", - "relative_name", - "value", - "ok" - ], - "title": "DnsRecordResponse", - "type": "object" - }, - "DocsSearchResultResponse": { - "properties": { - "anchor": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Anchor" - }, - "doc_slug": { - "title": "Doc Slug", - "type": "string" - }, - "highlight": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Highlight" - }, - "score": { - "title": "Score", - "type": "number" - }, - "snippet": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Snippet" - }, - "title": { - "title": "Title", - "type": "string" - } - }, - "required": [ - "doc_slug", - "title", - "snippet", - "score", - "anchor", - "highlight" - ], - "title": "DocsSearchResultResponse", - "type": "object" - }, - "EffortOptionsResponse": { - "description": "The reasoning-effort values a model accepts.", - "properties": { - "default": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The vendor's default level, when known.", - "title": "Default" - }, - "kind": { - "description": "`levels` today: `values` lists them.", - "title": "Kind", - "type": "string" - }, - "values": { - "description": "Accepted values, weakest first.", - "items": { - "type": "string" - }, - "title": "Values", - "type": "array" - } - }, - "required": [ - "kind" - ], - "title": "EffortOptionsResponse", - "type": "object" - }, - "EmailDomainResponse": { - "properties": { - "delegated": { - "default": false, - "title": "Delegated", - "type": "boolean" - }, - "dns_records": { - "items": { - "$ref": "#/components/schemas/DnsRecordResponse" - }, - "title": "Dns Records", - "type": "array" - }, - "domain": { - "title": "Domain", - "type": "string" - }, - "error_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error Message" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "is_primary": { - "title": "Is Primary", - "type": "boolean" - }, - "kind": { - "title": "Kind", - "type": "string" - }, - "last_checked_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Checked At" - }, - "provider": { - "anyOf": [ - { - "$ref": "#/components/schemas/DnsProviderResponse" - }, - { - "type": "null" - } - ] - }, - "regressing": { - "default": false, - "title": "Regressing", - "type": "boolean" - }, - "status": { - "title": "Status", - "type": "string" - }, - "verified": { - "default": false, - "title": "Verified", - "type": "boolean" - }, - "verified_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Verified At" - }, - "zone_apex": { - "default": "", - "title": "Zone Apex", - "type": "string" - } - }, - "required": [ - "id", - "domain", - "kind", - "status", - "is_primary" - ], - "title": "EmailDomainResponse", - "type": "object" - }, - "EmailDomainsListResponse": { - "properties": { - "can_add_custom": { - "default": false, - "title": "Can Add Custom", - "type": "boolean" - }, - "can_add_vanity": { - "default": false, - "title": "Can Add Vanity", - "type": "boolean" - }, - "custom_plan_names": { - "items": { - "type": "string" - }, - "title": "Custom Plan Names", - "type": "array" - }, - "domains": { - "items": { - "$ref": "#/components/schemas/EmailDomainResponse" - }, - "title": "Domains", - "type": "array" - }, - "has_custom": { - "default": false, - "title": "Has Custom", - "type": "boolean" - }, - "has_vanity": { - "default": false, - "title": "Has Vanity", - "type": "boolean" - }, - "vanity_plan_names": { - "items": { - "type": "string" - }, - "title": "Vanity Plan Names", - "type": "array" - } - }, - "title": "EmailDomainsListResponse", - "type": "object" - }, - "EmailTriggerConfigResponse": { - "description": "An EMAIL_RECEIVED trigger's resolved address(es) and config.", - "properties": { - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" - }, - "email_addresses": { - "items": { - "type": "string" - }, - "title": "Email Addresses", - "type": "array" - }, - "email_alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Email Alias" - }, - "email_allowed_senders": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Email Allowed Senders" - }, - "email_ignore_auto_generated": { - "default": true, - "title": "Email Ignore Auto Generated", - "type": "boolean" - }, - "email_queue_on_quota": { - "default": false, - "title": "Email Queue On Quota", - "type": "boolean" - }, - "email_require_sender_auth": { - "default": true, - "title": "Email Require Sender Auth", - "type": "boolean" - }, - "trigger_id": { - "format": "uuid", - "title": "Trigger Id", - "type": "string" - }, - "trigger_type": { - "title": "Trigger Type", - "type": "string" - } - }, - "required": [ - "trigger_id", - "agent_id", - "trigger_type" - ], - "title": "EmailTriggerConfigResponse", - "type": "object" - }, - "EmbeddingModalityRateResponse": { - "description": "Per-modality rate for a multi-modal embedder.\n\nThe default ``credits`` field on :class:`EmbeddingModelResponse` is the\ntext rate (credits per ~1k English words). Embedders that index image or\nvideo chunks natively charge those modalities at a different rate and unit\n\u2014 e.g. Cohere Embed v4 prices images per record; Nova 2 Multimodal prices\nvideo per second. Surfacing the modality and unit lets a caller render an\nhonest cost breakdown alongside the text rate.", - "properties": { - "credits": { - "description": "Rate value in the unit below", - "title": "Credits", - "type": "number" - }, - "modality": { - "description": "Modality kind, e.g. image / video", - "title": "Modality", - "type": "string" - }, - "unit": { - "description": "Billing unit for this rate (credit_per_record / credit_per_second / credit_per_1000_tokens).", - "title": "Unit", - "type": "string" - } - }, - "required": [ - "modality", - "credits", - "unit" - ], - "title": "EmbeddingModalityRateResponse", - "type": "object" - }, - "EmbeddingModelListResponse": { - "description": "Legacy (header-less) response shape for the embedder catalog.", - "properties": { - "default_dimension": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Dimensions used with the default embedding model", - "title": "Default Dimension" - }, - "default_model_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model used when a source does not override it", - "title": "Default Model Type" - }, - "file_processing_credits_per_mb": { - "description": "Credits per MB for file processing at ingest", - "title": "File Processing Credits Per Mb", - "type": "number" - }, - "models": { - "description": "Available embedding models", - "items": { - "$ref": "#/components/schemas/EmbeddingModelResponse" - }, - "title": "Models", - "type": "array" - }, - "storage_credits": { - "description": "Monthly storage credits per dimension count", - "items": { - "$ref": "#/components/schemas/EmbeddingStorageCreditsResponse" - }, - "title": "Storage Credits", - "type": "array" - } - }, - "required": [ - "models", - "storage_credits", - "file_processing_credits_per_mb" - ], - "title": "EmbeddingModelListResponse", - "type": "object" - }, - "EmbeddingModelResponse": { - "description": "Information about an embedding model.", - "properties": { - "credits": { - "description": "Estimated credits per 1,000 English words", - "title": "Credits", - "type": "number" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model description", - "title": "Description" - }, - "dimensions": { - "description": "Dimensions options", - "items": { - "type": "integer" - }, - "title": "Dimensions", - "type": "array" - }, - "is_new": { - "default": false, - "description": "Whether the model is newly released", - "title": "Is New", - "type": "boolean" - }, - "max_input_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max input tokens per request", - "title": "Max Input Tokens" - }, - "model_id": { - "description": "Model identifier", - "title": "Model Id", - "type": "string" - }, - "model_type": { - "description": "Full model type identifier (enum value). This is the value to send as embedding_model when creating a source.", - "title": "Model Type", - "type": "string" - }, - "mteb_retrieval_score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "MTEB retrieval score", - "title": "Mteb Retrieval Score" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human-readable model name", - "title": "Name" - }, - "per_modality_rates": { - "description": "Non-text rates the vendor charges for this embedder (image, video, audio). Empty for text-only embedders.", - "items": { - "$ref": "#/components/schemas/EmbeddingModalityRateResponse" - }, - "title": "Per Modality Rates", - "type": "array" - }, - "provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model provider identifier", - "title": "Provider" - }, - "speed": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model processing speed", - "title": "Speed" - }, - "supported_input_media": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Modalities the embedder accepts on input (short kinds like text / image / video, or full MIMEs). null means text-only. A source only honours a media_types entry its embedder lists here.", - "title": "Supported Input Media" - }, - "supported_languages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Supported languages", - "title": "Supported Languages" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model documentation URL", - "title": "Url" - } - }, - "required": [ - "model_id", - "model_type", - "dimensions", - "credits" - ], - "title": "EmbeddingModelResponse", - "type": "object" - }, - "EmbeddingStorageCreditsResponse": { - "description": "Monthly storage credits per stored record at a dimension count.", - "properties": { - "credits": { - "description": "Credits per record per month", - "title": "Credits", - "type": "integer" - }, - "dimensions": { - "description": "Number of embedding dimensions", - "title": "Dimensions", - "type": "integer" - } - }, - "required": [ - "dimensions", - "credits" - ], - "title": "EmbeddingStorageCreditsResponse", - "type": "object" - }, - "EvaluationCriteriaResponse": { - "description": "Response schema for evaluation criteria.", - "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "evaluation_mode": { - "description": "Runtime behavior mode. output_expectation (manual validation), eval_and_retry (every run + retry), sample_and_flag (sampled monitoring).", - "title": "Evaluation Mode", - "type": "string" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Tier" - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "max_retries": { - "title": "Max Retries", - "type": "integer" - }, - "pass_threshold": { - "description": "Score cutoff for pass/fail, inclusive (0.0 to 1.0).", - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" - }, - "result_summary": { - "additionalProperties": { - "type": "integer" - }, - "title": "Result Summary", - "type": "object" - }, - "retry_on_failure": { - "title": "Retry On Failure", - "type": "boolean" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step Id" - }, - "updated_at": { - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "agent_id", - "account_id", - "description", - "evaluation_mode", - "enabled", - "step_id", - "expectation_config", - "max_retries", - "retry_on_failure", - "evaluation_prompt", - "pass_threshold", - "evaluation_tier", - "created_at", - "updated_at", - "result_summary" - ], - "title": "EvaluationCriteriaResponse", - "type": "object" - }, - "EvaluationResultListResponse": { - "description": "Paginated list of evaluation results.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EvaluationResultResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "EvaluationResultListResponse", - "type": "object" - }, - "EvaluationResultResponse": { - "description": "Response schema for a single evaluation result.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Step Run Id" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "criteria_id": { - "format": "uuid", - "title": "Criteria Id", - "type": "string" - }, - "details": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Evaluation details including explanation and raw LLM response.", - "title": "Details" - }, - "evaluated_at": { - "title": "Evaluated At", - "type": "string" - }, - "flagged": { - "description": "True when the result was flagged for human review.", - "title": "Flagged", - "type": "boolean" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "retry_count": { - "title": "Retry Count", - "type": "integer" - }, - "retry_triggered": { - "title": "Retry Triggered", - "type": "boolean" - }, - "score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "LLM-assigned quality score between 0.0 (worst) and 1.0 (best).", - "title": "Score" - }, - "status": { - "description": "Outcome status: pending, passed, failed, skipped, or error.", - "title": "Status", - "type": "string" - } - }, - "required": [ - "id", - "criteria_id", - "agent_run_id", - "agent_step_run_id", - "status", - "retry_triggered", - "retry_count", - "flagged", - "evaluated_at", - "created_at" - ], - "title": "EvaluationResultResponse", - "type": "object" - }, - "EvaluationResultSummaryResponse": { - "description": "Aggregated pass/fail/error counts and average score for a criteria.", - "properties": { - "average_score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Mean score across all evaluated results, or null if none.", - "title": "Average Score" - }, - "error": { - "title": "Error", - "type": "integer" - }, - "failed": { - "title": "Failed", - "type": "integer" - }, - "flagged": { - "title": "Flagged", - "type": "integer" - }, - "passed": { - "title": "Passed", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "total", - "passed", - "failed", - "error", - "flagged" - ], - "title": "EvaluationResultSummaryResponse", - "type": "object" - }, - "EvaluationResultWithCriteriaListResponse": { - "description": "Paginated list of evaluation results with criteria context.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "EvaluationResultWithCriteriaListResponse", - "type": "object" - }, - "EvaluationResultWithCriteriaResponse": { - "description": "Evaluation result including criteria context for aggregated listing.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Step Run Id" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "criteria_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Criteria Description" - }, - "criteria_id": { - "format": "uuid", - "title": "Criteria Id", - "type": "string" - }, - "details": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Evaluation details including explanation and raw LLM response.", - "title": "Details" - }, - "evaluated_at": { - "title": "Evaluated At", - "type": "string" - }, - "flagged": { - "description": "True when the result was flagged for human review.", - "title": "Flagged", - "type": "boolean" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "retry_count": { - "title": "Retry Count", - "type": "integer" - }, - "retry_triggered": { - "title": "Retry Triggered", - "type": "boolean" - }, - "score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "LLM-assigned quality score between 0.0 (worst) and 1.0 (best).", - "title": "Score" - }, - "status": { - "description": "Outcome status: pending, passed, failed, skipped, or error.", - "title": "Status", - "type": "string" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step Id" - } - }, - "required": [ - "id", - "criteria_id", - "agent_run_id", - "agent_step_run_id", - "status", - "retry_triggered", - "retry_count", - "flagged", - "evaluated_at", - "created_at", - "step_id", - "criteria_description" - ], - "title": "EvaluationResultWithCriteriaResponse", - "type": "object" - }, - "EvaluationRunSummaryListResponse": { - "description": "Paginated list of per-run evaluation summaries.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EvaluationRunSummaryResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "EvaluationRunSummaryListResponse", - "type": "object" - }, - "EvaluationRunSummaryResponse": { - "description": "Per-run evaluation summary with pass/fail/error breakdown.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "error_count": { - "title": "Error Count", - "type": "integer" - }, - "failed_count": { - "title": "Failed Count", - "type": "integer" - }, - "flagged_count": { - "title": "Flagged Count", - "type": "integer" - }, - "passed_count": { - "title": "Passed Count", - "type": "integer" - }, - "run_created_at": { - "title": "Run Created At", - "type": "string" - }, - "run_status": { - "description": "Status of the agent run (processing, completed, failed).", - "title": "Run Status", - "type": "string" - }, - "skipped_count": { - "title": "Skipped Count", - "type": "integer" - }, - "total_evaluations": { - "title": "Total Evaluations", - "type": "integer" - } - }, - "required": [ - "agent_run_id", - "run_status", - "run_created_at", - "total_evaluations", - "passed_count", - "failed_count", - "error_count", - "skipped_count", - "flagged_count" - ], - "title": "EvaluationRunSummaryResponse", - "type": "object" - }, - "EvaluationStatus": { - "description": "Result status of a single evaluation run.", - "enum": [ - "pending", - "passed", - "failed", - "skipped", - "error" - ], - "title": "EvaluationStatus", - "type": "string" - }, - "ExamplePrompt": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "ExecutedActionResponse": { - "description": "A single executed action result.", - "properties": { - "action_type": { - "description": "Type of the executed action.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description.", - "title": "Description", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if failed.", - "title": "Error" - }, - "needs_clarification": { - "default": false, - "description": "True when the action paused for a clarifying question rather than failing. The created resource is kept and the question is in ``description``/``error``.", - "title": "Needs Clarification", - "type": "boolean" - }, - "resource_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the affected resource.", - "title": "Resource Id" - }, - "resource_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Type of the affected resource.", - "title": "Resource Type" - }, - "success": { - "default": true, - "description": "Whether the action succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "action_type", - "description" - ], - "title": "ExecutedActionResponse", - "type": "object" - }, - "ExperimentDetailResponse": { - "properties": { - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Completed At" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "effort": { - "additionalProperties": { - "type": "string" - }, - "description": "The reasoning effort each model was run at, by model ID.", - "title": "Effort", - "type": "object" - }, - "error_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error Message" - }, - "evaluation_complexity": { - "title": "Evaluation Complexity", - "type": "string" - }, - "evaluation_mode": { - "title": "Evaluation Mode", - "type": "string" - }, - "evaluator_model_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluator Model Id" - }, - "id": { - "title": "Id", - "type": "string" - }, - "include_step_output_in_evaluation": { - "title": "Include Step Output In Evaluation", - "type": "boolean" - }, - "json_template": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Json Template" - }, - "progress_current": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Progress Current" - }, - "progress_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Progress Message" - }, - "progress_total": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Progress Total" - }, - "prompt": { - "title": "Prompt", - "type": "string" - }, - "result_data": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Result Data" - }, - "selected_model_ids": { - "items": { - "type": "string" - }, - "title": "Selected Model Ids", - "type": "array" - }, - "selected_step_output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Selected Step Output" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started At" - }, - "status": { - "title": "Status", - "type": "string" - }, - "system_prompt": { - "title": "System Prompt", - "type": "string" - } - }, - "required": [ - "id", - "status", - "created_at", - "selected_model_ids", - "evaluation_mode", - "evaluation_complexity", - "prompt", - "system_prompt", - "evaluator_model_id", - "include_step_output_in_evaluation", - "selected_step_output", - "json_template", - "started_at", - "completed_at", - "error_message", - "progress_current", - "progress_total", - "progress_message", - "result_data" - ], - "title": "ExperimentDetailResponse", - "type": "object" - }, - "ExperimentListResponse": { - "description": "``GET /models/playground/experiments`` legacy/default shape; 2026-07-27+\nclients get the canonical ``{data, pagination}`` envelope.", - "properties": { - "experiments": { - "items": { - "$ref": "#/components/schemas/ExperimentSummaryResponse" - }, - "title": "Experiments", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "experiments", - "total" - ], - "title": "ExperimentListResponse", - "type": "object" - }, - "ExperimentSummaryResponse": { - "properties": { - "created_at": { - "title": "Created At", - "type": "string" - }, - "evaluation_complexity": { - "title": "Evaluation Complexity", - "type": "string" - }, - "evaluation_mode": { - "title": "Evaluation Mode", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string" - }, - "selected_model_ids": { - "items": { - "type": "string" - }, - "title": "Selected Model Ids", - "type": "array" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "id", - "status", - "created_at", - "selected_model_ids", - "evaluation_mode", - "evaluation_complexity" - ], - "title": "ExperimentSummaryResponse", - "type": "object" - }, - "ExportFormat": { - "description": "Supported export file formats.", - "enum": [ - "jsonl", - "csv", - "parquet", - "zip" - ], - "title": "ExportFormat", - "type": "string" - }, - "ExportListResponse": { - "description": "Paginated list of export jobs.", - "properties": { - "data": { - "items": {}, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "ExportListResponse", - "type": "object" - }, - "GenerateAgentStepsRequest": { - "properties": { - "agent_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent description for additional AI context.", - "title": "Agent Description" - }, - "agent_steps": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Current agent step hierarchy for context when modifying.", - "title": "Agent Steps" - }, - "mode": { - "default": "generate_full", - "description": "'generate_full' to create from scratch, 'modify_workflow' to refine.", - "title": "Mode", - "type": "string" - }, - "trigger_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent trigger type for context (e.g. 'dynamic_input', 'content_added').", - "title": "Trigger Type" - }, - "user_input": { - "description": "Natural language description of the desired agent workflow.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "GenerateAgentStepsRequest", - "type": "object" - }, - "GenerateAgentStepsResponse": { - "properties": { - "agent_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Suggested agent-level configuration, if any.", - "title": "Agent Config" - }, - "conversation_id": { - "description": "Conversation turn ID for tracking.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given mode.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "intent_assessment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "How the assistant interpreted the request: 'clear' when steps were generated, or an ask-path value (e.g. 'ambiguous_output', 'cannot_build') when it returned no steps and put a clarifying question or blocker in `note`. Mirrors the MCP surface so callers can distinguish a clarification pause from a hard failure.", - "title": "Intent Assessment" - }, - "note": { - "description": "AI explanation of the proposed workflow.", - "title": "Note", - "type": "string" - }, - "steps": { - "description": "Generated agent steps.", - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Steps", - "type": "array" - }, - "success": { - "description": "Whether steps were successfully generated.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "steps", - "note", - "success" - ], - "title": "GenerateAgentStepsResponse", - "type": "object" - }, - "GenerateStepConfigRequest": { - "properties": { - "agent_steps": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Current agent step hierarchy for context.", - "title": "Agent Steps" - }, - "current_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Current step configuration to refine, if any.", - "title": "Current Config" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the specific step to refine. Omit for new steps.", - "title": "Step Id" - }, - "step_type": { - "description": "The step type to generate config for (e.g. 'regex_replace', 'gate', 'text', 'prompt_call', 'retrieval').", - "title": "Step Type", - "type": "string" - }, - "user_input": { - "description": "Natural language description of what the step should do.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "step_type", - "user_input" - ], - "title": "GenerateStepConfigRequest", - "type": "object" - }, - "GenerateStepConfigResponse": { - "properties": { - "conversation_id": { - "description": "Conversation turn ID for tracking.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given step type.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI explanation of the proposed configuration.", - "title": "Note", - "type": "string" - }, - "resulting_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "The proposed step configuration.", - "title": "Resulting Config" - }, - "step_type": { - "description": "The step type that was generated.", - "title": "Step Type", - "type": "string" - }, - "success": { - "description": "Whether a valid configuration was generated.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "step_type", - "note", - "success" - ], - "title": "GenerateStepConfigResponse", - "type": "object" - }, - "GenerationTierListResponse": { - "description": "``GET /models/generation-tiers`` legacy/default shape; 2026-07-27+ clients\nget the canonical ``{data, pagination}`` envelope.", - "properties": { - "tiers": { - "items": { - "$ref": "#/components/schemas/GenerationTierResponse" - }, - "title": "Tiers", - "type": "array" - } - }, - "required": [ - "tiers" - ], - "title": "GenerationTierListResponse", - "type": "object" - }, - "GenerationTierResponse": { - "properties": { - "credits_per_unit": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Credits Per Unit" - }, - "modality": { - "title": "Modality", - "type": "string" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "model_name": { - "title": "Model Name", - "type": "string" - }, - "price_label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Price Label" - }, - "tier": { - "title": "Tier", - "type": "string" - }, - "unit_label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Unit Label" - } - }, - "required": [ - "modality", - "tier", - "model_id", - "model_name", - "credits_per_unit", - "unit_label", - "price_label" - ], - "title": "GenerationTierResponse", - "type": "object" - }, - "GovernanceAiAcceptResponse": { - "description": "Response from accepting a governance AI assistant plan.", - "properties": { - "actions_applied": { - "description": "Results of each action that was executed.", - "items": { - "$ref": "#/components/schemas/AppliedActionResponse" - }, - "title": "Actions Applied", - "type": "array" - }, - "conversation_id": { - "description": "Conversation ID that was accepted.", - "title": "Conversation Id", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Overall error message if the plan failed, or null.", - "title": "Error" - }, - "success": { - "description": "Whether all actions were applied successfully.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "actions_applied", - "success" - ], - "title": "GovernanceAiAcceptResponse", - "type": "object" - }, - "GovernanceAiAssistantResponse": { - "description": "Response from the governance AI assistant generate endpoint.", - "properties": { - "conversation_id": { - "description": "Conversation ID to accept or decline this plan.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of the governance AI assistant.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI-generated summary of the proposed changes.", - "title": "Note", - "type": "string" - }, - "prompt_call_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Prompt call ID for credit tracking, or null.", - "title": "Prompt Call Id" - }, - "proposed_actions": { - "description": "Ordered list of policy actions the AI proposes to execute.", - "items": { - "$ref": "#/components/schemas/ProposedPolicyActionResponse" - }, - "title": "Proposed Actions", - "type": "array" - }, - "success": { - "description": "Whether the plan was generated successfully.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "note", - "proposed_actions", - "success" - ], - "title": "GovernanceAiAssistantResponse", - "type": "object" - }, - "HTTPValidationError": { - "properties": { - "detail": { - "items": { - "$ref": "#/components/schemas/ValidationError" - }, - "title": "Detail", - "type": "array" - } - }, - "title": "HTTPValidationError", - "type": "object" - }, - "ImportFieldErrorModel": { - "description": "Single agent_definition validation error with source position.", - "properties": { - "column": { - "description": "1-indexed column in `source`.", - "title": "Column", - "type": "integer" - }, - "line": { - "description": "1-indexed line in `source`.", - "title": "Line", - "type": "integer" - }, - "message": { - "description": "Human-readable description of the problem.", - "title": "Message", - "type": "string" - }, - "path": { - "description": "Dotted path of the offending field, e.g. `agent.definition.child_steps[0].step_type`.", - "title": "Path", - "type": "string" - } - }, - "required": [ - "line", - "column", - "path", - "message" - ], - "title": "ImportFieldErrorModel", - "type": "object" - }, - "ImportSkipResponse": { - "description": "One item that was not applied during an agent import.\n\nUsed as the element type for ``import_warnings`` on every\nresponse model that accepts an ``agent_definition`` payload.\nSee ``services.agent_definition_import.AgentImportSkip`` for the\nfull category list.\n\nLives here (not on each router) so the authenticated and public\nAPI responses share one definition \u2014 keeping the shape that\nclients (UI modal, MCP, OpenAPI consumers) depend on aligned.", - "properties": { - "category": { - "description": "The kind of item that was skipped or substituted: 'schedule', 'evaluation_criteria', 'alert_config', 'alert_recipient', 'governance_policy', 'governance_kb_link', 'solution_link'.", - "title": "Category", - "type": "string" - }, - "details": { - "additionalProperties": true, - "description": "Category-specific identifiers for the skipped item (step_id, alert_type, kb_name, etc.). Stable keys per category; absent keys are simply not applicable.", - "title": "Details", - "type": "object" - }, - "message": { - "description": "Human-readable explanation of what was skipped and why.", - "title": "Message", - "type": "string" - } - }, - "required": [ - "category", - "message" - ], - "title": "ImportSkipResponse", - "type": "object" - }, - "InboundEmailRejectionResponse": { - "description": "An inbound email that was discarded without running an agent.", - "properties": { - "agent_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "message_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Message Id" - }, - "reason": { - "title": "Reason", - "type": "string" - }, - "recipient": { - "title": "Recipient", - "type": "string" - }, - "sender": { - "title": "Sender", - "type": "string" - }, - "sender_ip": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Sender Ip" - }, - "subject": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Subject" - } - }, - "required": [ - "id", - "created_at", - "recipient", - "sender", - "sender_ip", - "reason", - "message_id", - "agent_id", - "subject" - ], - "title": "InboundEmailRejectionResponse", - "type": "object" - }, - "InboundEmailStatusResponse": { - "properties": { - "paused": { - "title": "Paused", - "type": "boolean" - }, - "queued_backlog": { - "title": "Queued Backlog", - "type": "integer" - } - }, - "required": [ - "paused", - "queued_backlog" - ], - "title": "InboundEmailStatusResponse", - "type": "object" - }, - "InlineTextReplaceRequest": { - "description": "Request model for inline text content replacement.", - "properties": { - "content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "text/plain", - "description": "MIME type for the text content", - "title": "Content Type" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional metadata object", - "title": "Metadata" - }, - "text": { - "description": "Text content to upload", - "title": "Text", - "type": "string" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional title", - "title": "Title" - } - }, - "required": [ - "text" - ], - "title": "InlineTextReplaceRequest", - "type": "object" - }, - "InlineTextUploadRequest": { - "description": "Request model for inline text uploads.", - "properties": { - "content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "text/plain", - "description": "MIME type for the text content", - "title": "Content Type" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional metadata object", - "title": "Metadata" - }, - "text": { - "description": "Text content to upload", - "title": "Text", - "type": "string" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional title", - "title": "Title" - } - }, - "required": [ - "text" - ], - "title": "InlineTextUploadRequest", - "type": "object" - }, - "InsufficientCreditsDetail": { - "description": "``detail`` body for a 402 ``insufficient_credits`` response.", - "properties": { - "account_id": { - "description": "UUID of the account that ran out of credits.", - "title": "Account Id", - "type": "string" - }, - "error": { - "const": "insufficient_credits", - "description": "Stable machine-readable error code.", - "title": "Error", - "type": "string" - }, - "message": { - "description": "Human-readable explanation.", - "title": "Message", - "type": "string" - } - }, - "required": [ - "error", - "message", - "account_id" - ], - "title": "InsufficientCreditsDetail", - "type": "object" - }, - "InsufficientCreditsResponse": { - "description": "402 envelope returned when the account has exhausted its credits.", - "properties": { - "detail": { - "$ref": "#/components/schemas/InsufficientCreditsDetail" - } - }, - "required": [ - "detail" - ], - "title": "InsufficientCreditsResponse", - "type": "object" - }, - "JsonValue": {}, - "KnowledgeBaseListResponseModel": { - "description": "Paginated list of knowledge bases.", - "properties": { - "knowledge_bases": { - "description": "List of knowledge bases on this page.", - "items": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - }, - "title": "Knowledge Bases", - "type": "array" - }, - "limit": { - "description": "Items per page.", - "title": "Limit", - "type": "integer" - }, - "page": { - "description": "Current page number (1-based).", - "title": "Page", - "type": "integer" - }, - "total": { - "description": "Total number of knowledge bases.", - "title": "Total", - "type": "integer" - } - }, - "required": [ - "knowledge_bases", - "page", - "limit", - "total" - ], - "title": "KnowledgeBaseListResponseModel", - "type": "object" - }, - "KnowledgeBaseResponseModel": { - "description": "Response model for a single knowledge base.", - "properties": { - "created_at": { - "description": "ISO-8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "default_score_threshold": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Editor default for a new retrieval step's Minimum Rerank Score.", - "title": "Default Score Threshold" - }, - "default_top_k": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Editor default for a new retrieval step's Top K.", - "title": "Default Top K" - }, - "default_top_n": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Editor default for a new retrieval step's Top N.", - "title": "Default Top N" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description.", - "title": "Description" - }, - "id": { - "description": "Unique knowledge base identifier.", - "title": "Id", - "type": "string" - }, - "name": { - "description": "Human-readable name.", - "title": "Name", - "type": "string" - }, - "readonly": { - "default": false, - "description": "Whether the knowledge base is read-only.", - "title": "Readonly", - "type": "boolean" - }, - "reranker_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Reranker model in use.", - "title": "Reranker Model" - }, - "sources": { - "description": "Linked source connections.", - "items": { - "$ref": "#/components/schemas/SourceConnectionResponseModel" - }, - "title": "Sources", - "type": "array" - }, - "updated_at": { - "description": "ISO-8601 last-update timestamp.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "created_at", - "updated_at" - ], - "title": "KnowledgeBase", - "type": "object" - }, - "LinkResourcesRequest": { - "properties": { - "ids": { - "description": "Resource IDs to link", - "items": { - "format": "uuid", - "type": "string" - }, - "minItems": 1, - "title": "Ids", - "type": "array" - } - }, - "required": [ - "ids" - ], - "title": "LinkResourcesRequest", - "type": "object" - }, - "MarkAiSuggestionRequest": { - "properties": { - "accepted": { - "description": "True to accept the suggestion, false to decline it.", - "title": "Accepted", - "type": "boolean" - } - }, - "required": [ - "accepted" - ], - "title": "MarkAiSuggestionRequest", - "type": "object" - }, - "MarkConversationTurnRequest": { - "properties": { - "accepted": { - "description": "Whether the suggestion was accepted", - "title": "Accepted", - "type": "boolean" - } - }, - "required": [ - "accepted" - ], - "title": "MarkConversationTurnRequest", - "type": "object" - }, - "MeResponse": { - "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "organizations": { - "items": { - "$ref": "#/components/schemas/OrganizationInfoResponse" - }, - "title": "Organizations", - "type": "array" - } - }, - "required": [ - "account_id", - "organizations" - ], - "title": "MeResponse", - "type": "object" - }, - "MemoryBankAiAssistantResponse": { - "description": "Response from the memory bank AI assistant.", - "properties": { - "config": { - "anyOf": [ - { - "$ref": "#/components/schemas/MemoryBankConfigResponse" - }, - { - "type": "null" - } - ], - "description": "Proposed configuration, or null." - }, - "conversation_id": { - "description": "Conversation ID for follow-up.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of the memory bank AI assistant.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI-generated explanation.", - "title": "Note", - "type": "string" - }, - "prompt_call_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Prompt call ID for credit tracking.", - "title": "Prompt Call Id" - }, - "success": { - "default": false, - "description": "Whether generation succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "note" - ], - "title": "MemoryBankAiAssistantResponse", - "type": "object" - }, - "MemoryBankConfigResponse": { - "description": "Suggested memory bank configuration from the AI assistant.", - "properties": { - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Suggested compaction prompt.", - "title": "Compaction Prompt" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Suggested description.", - "title": "Description" - }, - "max_age_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Always null. Age-based compaction is retired \u2014 the assistant never suggests it. Kept so an SDK generated before the change still validates this response.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max size in tokens.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns.", - "title": "Max Turns" - }, - "mode": { - "description": "Memory bank mode.", - "title": "Mode", - "type": "string" - }, - "name": { - "description": "Suggested name.", - "title": "Name", - "type": "string" - }, - "retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention in days.", - "title": "Retention Days" - }, - "type": { - "description": "Memory bank type: conversation or general.", - "title": "Type", - "type": "string" - } - }, - "required": [ - "name", - "type", - "mode" - ], - "title": "MemoryBankConfigResponse", - "type": "object" - }, - "MemoryBankListResponseModel": { - "description": "Paginated list of memory banks.", - "properties": { - "limit": { - "description": "Items per page.", - "title": "Limit", - "type": "integer" - }, - "memory_banks": { - "description": "List of memory banks on this page.", - "items": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - }, - "title": "Memory Banks", - "type": "array" - }, - "page": { - "description": "Current page number (1-based).", - "title": "Page", - "type": "integer" - }, - "total": { - "description": "Total number of memory banks.", - "title": "Total", - "type": "integer" - } - }, - "required": [ - "memory_banks", - "page", - "limit", - "total" - ], - "title": "MemoryBankListResponseModel", - "type": "object" - }, - "MemoryBankResponseModel": { - "description": "Response model for a single memory bank.", - "properties": { - "chunk_overlap": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Character overlap between chunks.", - "title": "Chunk Overlap" - }, - "chunk_size": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Characters per chunk.", - "title": "Chunk Size" - }, - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted.", - "title": "Compaction Prompt" - }, - "created_at": { - "description": "ISO-8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description of the memory bank's purpose.", - "title": "Description" - }, - "dimensions": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Vector embedding dimensions.", - "title": "Dimensions" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model identifier.", - "title": "Embedding Model" - }, - "id": { - "description": "Unique memory bank identifier.", - "title": "Id", - "type": "string" - }, - "max_age_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "DEPRECATED and no longer applied. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Always null for clients sending Seclai-Version 2026-08-03 or later; older clients keep reading whatever value was stored.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max total tokens (per partition) before compaction. Checked both inline after each write and by the hourly background sweep.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns (per partition) before compaction. Checked both inline after each write and by the hourly background sweep.", - "title": "Max Turns" - }, - "mode": { - "description": "Embedding mode: fast_and_cheap, balanced, slow_and_thorough, or custom.", - "title": "Mode", - "type": "string" - }, - "name": { - "description": "Human-readable name.", - "title": "Name", - "type": "string" - }, - "retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Content retention period in days (null = indefinite).", - "title": "Retention Days" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Linked content source ID (null if not yet provisioned).", - "title": "Source Connection Id" - }, - "strip_quoted_reply_chains": { - "default": false, - "description": "Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation.", - "title": "Strip Quoted Reply Chains", - "type": "boolean" - }, - "type": { - "description": "Bank type: conversation (chat-turn with speaker) or general (flat entries).", - "title": "Type", - "type": "string" - }, - "updated_at": { - "description": "ISO-8601 last-update timestamp.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "type", - "mode", - "created_at", - "updated_at" - ], - "title": "MemoryBank", - "type": "object" - }, - "ModalityRateResponse": { - "description": "Per-modality rate for an LLM that prices image/audio/video output\n(or input) at a rate distinct from the default text rate.\n\nExample: Gemini 3.1 Flash Image charges $3/1M output tokens for\ntext but $60/1M output tokens for generated images. The image rate\nsurfaces here with ``modality=\"image\"`` and ``output_credits_per_1000_tokens``\nset; the default text rate stays on the parent model fields.", - "properties": { - "input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Credits Per 1000 Tokens" - }, - "modality": { - "title": "Modality", - "type": "string" - }, - "output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Output Credits Per 1000 Tokens" - } - }, - "required": [ - "modality" - ], - "title": "ModalityRateResponse", - "type": "object" - }, - "OkResponse": { - "description": "A minimal ``{\"ok\": true}`` acknowledgement for state-mutating actions\nthat have no richer resource to return (e.g. accept/decline a suggestion).", - "properties": { - "ok": { - "title": "Ok", - "type": "boolean" - } - }, - "required": [ - "ok" - ], - "title": "OkResponse", - "type": "object" - }, - "OrganizationAlertPreferenceListResponse": { - "properties": { - "preferences": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__OrganizationAlertPreferenceResponse" - }, - "title": "Preferences", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "preferences", - "total" - ], - "title": "OrganizationAlertPreferenceListResponse", - "type": "object" - }, - "OrganizationInfoResponse": { - "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name", - "account_id" - ], - "title": "OrganizationInfoResponse", - "type": "object" - }, - "PaginationResponse": { - "description": "Pagination information.", - "properties": { - "has_next": { - "title": "Has Next", - "type": "boolean" - }, - "has_prev": { - "title": "Has Prev", - "type": "boolean" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "pages": { - "title": "Pages", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "page", - "limit", - "total", - "pages", - "has_next", - "has_prev" - ], - "title": "PaginationResponse", - "type": "object" - }, - "PendingProcessingCompletedFailedStatus": { - "enum": [ - "pending", - "processing", - "completed", - "failed", - "queued", - "waiting_human", - "waiting_scheduled" - ], - "title": "PendingProcessingCompletedFailedStatus", - "type": "string" - }, - "PlaygroundCreateRequest": { - "description": "Create a model playground experiment via the public API.", - "properties": { - "effort": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Reasoning effort per model id, each one of that model's `effort_options` values. Not combinable with `json_template`.", - "title": "Effort" - }, - "evaluation_complexity": { - "default": "medium", - "description": "simple, medium, or complex", - "enum": [ - "simple", - "medium", - "complex" - ], - "title": "Evaluation Complexity", - "type": "string" - }, - "evaluation_mode": { - "default": "manual", - "description": "manual or prompt", - "enum": [ - "manual", - "prompt" - ], - "title": "Evaluation Mode", - "type": "string" - }, - "evaluator_model_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Evaluator model ID when evaluation_mode is prompt.", - "title": "Evaluator Model Id" - }, - "include_step_output_in_evaluation": { - "default": false, - "description": "Whether to include selected step output as evaluator context.", - "title": "Include Step Output In Evaluation", - "type": "boolean" - }, - "json_template": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional JSON template for advanced mode.", - "title": "Json Template" - }, - "model_ids": { - "description": "Selected model IDs (1-10).", - "items": { - "type": "string" - }, - "maxItems": 10, - "minItems": 1, - "title": "Model Ids", - "type": "array" - }, - "prompt": { - "description": "Prompt text for the experiment.", - "title": "Prompt", - "type": "string" - }, - "selected_step_output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional step output text for evaluator context.", - "title": "Selected Step Output" - }, - "system_prompt": { - "default": "", - "description": "Optional system prompt.", - "title": "System Prompt", - "type": "string" - } - }, - "required": [ - "model_ids", - "prompt" - ], - "title": "PlaygroundCreateRequest", - "type": "object" - }, - "PromptModelAutoUpgradeStrategy": { - "enum": [ - "none", - "early_adopter", - "middle_of_road", - "cautious_adopter" - ], - "title": "PromptModelAutoUpgradeStrategy", - "type": "string" - }, - "PromptToolResponse": { - "description": "Response model for a prompt tool.", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "documentation_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Documentation Url" - }, - "example": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Example" - }, - "headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Headers" - }, - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "notes": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Notes" - }, - "tool_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Tool Name" - }, - "tool_type": { - "title": "Tool Type", - "type": "string" - }, - "tool_type_pattern": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Tool Type Pattern" - } - }, - "required": [ - "id", - "tool_type", - "name" - ], - "title": "PromptToolResponse", - "type": "object" - }, - "ProposedActionResponse": { - "description": "A single proposed action.", - "properties": { - "action_type": { - "description": "Type of the proposed action.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description of the action.", - "title": "Description", - "type": "string" - }, - "is_destructive": { - "default": false, - "description": "Whether the action is destructive.", - "title": "Is Destructive", - "type": "boolean" - }, - "params": { - "additionalProperties": true, - "description": "Parameters for the action.", - "title": "Params", - "type": "object" - }, - "preview": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Planning-time dry-run preview attached by the solution AI assistant for create_agent / update_agent actions. Contains ``steps`` (the generated step tree), ``step_count``, ``warnings`` (a mix of heuristic structural issues \u2014 e.g. brittle JSONPath, pass-through ``regex_replace``, ``prompt_call`` missing a model \u2014 and deterministic resource-usage issues: every pre-bound knowledge base / memory bank must be referenced by at least one step, and no step may reference an unknown id), and ``skipped`` / ``skipped_reason`` when preview couldn't run (e.g. the action depends on resources created earlier in the same plan). ``None`` for non-agent actions or when generation failed.", - "title": "Preview" - } - }, - "required": [ - "action_type", - "params", - "description" - ], - "title": "ProposedActionResponse", - "type": "object" - }, - "ProposedPolicyActionResponse": { - "description": "A single proposed governance policy action.", - "properties": { - "action_type": { - "description": "Type of action: create, update, delete, enable, or disable.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description of what this action will do.", - "title": "Description", - "type": "string" - }, - "params": { - "additionalProperties": true, - "description": "Parameters for the action (e.g. policy_document_id, thresholds).", - "title": "Params", - "type": "object" - } - }, - "required": [ - "action_type", - "description", - "params" - ], - "title": "ProposedPolicyActionResponse", - "type": "object" - }, - "RemoveEmailDomainResponse": { - "properties": { - "cleanup_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Cleanup Note" - }, - "removed": { - "default": true, - "title": "Removed", - "type": "boolean" - } - }, - "title": "RemoveEmailDomainResponse", - "type": "object" - }, - "RerankerModelListResponse": { - "description": "Legacy (header-less) response shape for the reranker catalog.", - "properties": { - "default_model_type": { - "description": "Reranker used when a knowledge base does not choose one", - "title": "Default Model Type", - "type": "string" - }, - "models": { - "description": "Available reranker models", - "items": { - "$ref": "#/components/schemas/RerankerModelResponse" - }, - "title": "Models", - "type": "array" - }, - "search_processing_credits": { - "description": "Credits charged for processing a search request", - "title": "Search Processing Credits", - "type": "number" - } - }, - "required": [ - "models", - "default_model_type", - "search_processing_credits" - ], - "title": "RerankerModelListResponse", - "type": "object" - }, - "RerankerModelResponse": { - "description": "Information about a reranker model.", - "properties": { - "credits_per_action": { - "description": "Credits charged per rerank action", - "title": "Credits Per Action", - "type": "number" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model description", - "title": "Description" - }, - "is_default": { - "description": "Whether this is the platform default reranker", - "title": "Is Default", - "type": "boolean" - }, - "is_new": { - "default": false, - "description": "Whether the model is newly released", - "title": "Is New", - "type": "boolean" - }, - "max_input_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max input tokens per request", - "title": "Max Input Tokens" - }, - "model_type": { - "description": "Full model type identifier. This is the value to send as reranker_model on a knowledge base; send \"none\" or an empty string to disable reranking.", - "title": "Model Type", - "type": "string" - }, - "name": { - "description": "Human-readable model name", - "title": "Name", - "type": "string" - }, - "provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model provider identifier", - "title": "Provider" - }, - "supported_languages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Supported languages", - "title": "Supported Languages" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model documentation URL", - "title": "Url" - } - }, - "required": [ - "model_type", - "name", - "credits_per_action", - "is_default" - ], - "title": "RerankerModelResponse", - "type": "object" - }, - "ResumeInboundResponse": { - "properties": { - "resumed": { - "title": "Resumed", - "type": "boolean" - } - }, - "required": [ - "resumed" - ], - "title": "ResumeInboundResponse", - "type": "object" - }, - "SendTestEmailResponse": { - "properties": { - "sent": { - "default": true, - "title": "Sent", - "type": "boolean" - } - }, - "title": "SendTestEmailResponse", - "type": "object" - }, - "ServiceUnavailableError": { - "properties": { - "error": { - "properties": { - "code": { - "enum": [ - "database_unavailable", - "vector_store_unavailable" - ], - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - } - }, - "required": [ - "error" - ], - "title": "ServiceUnavailableError", - "type": "object" - }, - "SetAutoBlockModeRequest": { - "description": "Set the account's governance auto-block mode (shared REST request).", - "properties": { - "mode": { - "title": "Mode", - "type": "string" - } - }, - "required": [ - "mode" - ], - "title": "SetAutoBlockModeRequest", - "type": "object" - }, - "SolutionSourceConnectionResponse": { - "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "title": "SolutionSourceConnectionResponse", - "type": "object" - }, - "SolutionSummaryResponse": { - "description": "Response model for solution summary.", - "properties": { - "agent_count": { - "description": "Number of linked agents.", - "title": "Agent Count", - "type": "integer" - }, - "created_at": { - "description": "Timestamp when the solution was created.", - "title": "Created At", - "type": "string" - }, - "description": { - "description": "Description of the solution.", - "title": "Description", - "type": "string" - }, - "id": { - "description": "Unique identifier for the solution.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "knowledge_base_count": { - "description": "Number of linked knowledge bases.", - "title": "Knowledge Base Count", - "type": "integer" - }, - "memory_bank_count": { - "description": "Number of linked memory banks.", - "title": "Memory Bank Count", - "type": "integer" - }, - "name": { - "description": "Name of the solution.", - "title": "Name", - "type": "string" - }, - "source_connection_count": { - "description": "Number of linked source connections.", - "title": "Source Connection Count", - "type": "integer" - }, - "updated_at": { - "description": "Timestamp when the solution was last updated.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "description", - "agent_count", - "knowledge_base_count", - "source_connection_count", - "memory_bank_count", - "created_at", - "updated_at" - ], - "title": "SolutionSummaryResponse", - "type": "object" - }, - "SourceConnectionResponseModel": { - "description": "Nested source connection summary within a knowledge base response.", - "properties": { - "id": { - "description": "Source connection identifier.", - "title": "Id", - "type": "string" - }, - "name": { - "description": "Source connection name.", - "title": "Name", - "type": "string" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling configuration.", - "title": "Polling" - }, - "source_type": { - "description": "Type of source (rss, website, etc.).", - "title": "Source Type", - "type": "string" - }, - "url": { - "description": "Source URL.", - "title": "Url", - "type": "string" - } - }, - "required": [ - "id", - "name", - "url", - "source_type" - ], - "title": "SourceConnectionResponseModel", - "type": "object" - }, - "SourceContentStatusListResponse": { - "description": "Response model for a paginated per-item indexing status list.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/SourceContentStatusResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "SourceContentStatusListResponse", - "type": "object" - }, - "SourceContentStatusResponse": { - "description": "Response model for one content item's indexing status.", - "properties": { - "awaiting_reindex": { - "default": false, - "description": "True when the item is linked and reports completed but its content is not yet embedded under the index the source connection currently uses, because it still sits under the index that connection used before an embedding migration switched it. Anything ingested while a migration ran can land in this state. Semantic and content search will not match it until it is re-embedded; a title keyword match can still return it, so the item may appear in results while its body is unsearchable. It clears on its own \u2014 a reconciliation pass re-embeds the item under the current index, typically within minutes of the migration finishing, and a daily sweep retries whatever is still outstanding, so a large backlog can take more than one sweep to drain. The re-embedding is not charged to your account: nothing you did caused it, so Seclai absorbs the cost. Never true for an item that is simply still indexing; content_status covers that.", - "title": "Awaiting Reindex", - "type": "boolean" - }, - "content_status": { - "description": "Indexing status: pending, fetching, transcribing, scanning, indexing, completed, or failed.", - "title": "Content Status", - "type": "string" - }, - "content_token_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Extracted token count.", - "title": "Content Token Count" - }, - "content_type": { - "description": "Content type group: text, audio, video, image, or document.", - "title": "Content Type", - "type": "string" - }, - "content_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Internal URL identifying the item. Uploaded files use a `file-upload://` URL.", - "title": "Content Url" - }, - "content_version_id": { - "description": "ID of the content version. This is the `content_version_id` returned by the upload endpoints, so it is what you match an upload against.", - "title": "Content Version Id", - "type": "string" - }, - "content_word_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Extracted word count.", - "title": "Content Word Count" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Why the item failed, when `content_status` is `failed`.", - "title": "Error" - }, - "extracted_media_capped": { - "default": false, - "description": "True when extraction stopped with media still unread, so the item references more media than was indexed and media search will not match anything past the cut. Two causes: a web page that ran out of the budget for fetching remote assets, or a container that could not be read to the end (a truncated or hostile archive). An uploaded document that reads cleanly is never capped, however much media it holds \u2014 there is no limit on that.", - "title": "Extracted Media Capped", - "type": "boolean" - }, - "extracted_media_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Number of embedded images / videos extracted from inside this item and indexed as their own chunks. There is no limit on this \u2014 a document contributes as many as it holds. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container, or found nothing. Treat null as 'unknown', never as zero.", - "title": "Extracted Media Count" - }, - "extracted_media_limit": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "The bound that was reached, when extracted_media_capped is true and the stop was a bound \u2014 a number of fetch attempts, or a number of seconds. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired.", - "title": "Extracted Media Limit" - }, - "indexed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the item finished indexing and became retrievable. `null` until then.", - "title": "Indexed At" - }, - "mime_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "MIME type the item was ingested as, when known.", - "title": "Mime Type" - }, - "published_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Publication timestamp of the item, when known.", - "title": "Published At" - }, - "pulled_at": { - "description": "Timestamp when the item was uploaded or pulled.", - "title": "Pulled At", - "type": "string" - }, - "source_connection_content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID to pass to `GET /contents/{id}`. `null` until the item has finished indexing \u2014 an item that is still processing, or that failed, has no retrievable content and keeps this `null`.", - "title": "Source Connection Content Version Id" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title of the content item.", - "title": "Title" - } - }, - "required": [ - "content_version_id", - "source_connection_content_version_id", - "title", - "content_url", - "content_type", - "mime_type", - "content_status", - "error", - "content_word_count", - "content_token_count", - "pulled_at", - "published_at", - "indexed_at" - ], - "title": "SourceContentStatusResponse", - "type": "object" - }, - "SourceEmbeddingMigrationResponse": { - "description": "Response model for source embedding migration status.", - "properties": { - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Completed At" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "failure_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Failure Message" - }, - "id": { - "title": "Id", - "type": "string" - }, - "notification_recipients": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Notification Recipients" - }, - "phase": { - "title": "Phase", - "type": "string" - }, - "progress_current": { - "title": "Progress Current", - "type": "integer" - }, - "progress_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Progress Message" - }, - "progress_total": { - "title": "Progress Total", - "type": "integer" - }, - "source_connection_id": { - "title": "Source Connection Id", - "type": "string" - }, - "source_id_new": { - "title": "Source Id New", - "type": "string" - }, - "source_id_old": { - "title": "Source Id Old", - "type": "string" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started At" - }, - "status": { - "title": "Status", - "type": "string" - }, - "target_dimensions": { - "title": "Target Dimensions", - "type": "integer" - }, - "target_embedding_model": { - "title": "Target Embedding Model", - "type": "string" - }, - "task_execution_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Task Execution Id" - }, - "updated_at": { - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "source_connection_id", - "source_id_old", - "source_id_new", - "target_embedding_model", - "target_dimensions", - "status", - "phase", - "progress_current", - "progress_total", - "progress_message", - "failure_message", - "notification_recipients", - "task_execution_id", - "started_at", - "completed_at", - "created_at", - "updated_at" - ], - "title": "SourceEmbeddingMigrationResponse", - "type": "object" - }, - "SourceIndexMode": { - "description": "Embedding quality / cost trade-off preset for custom_index sources.\n\nEach preset controls the default embedding dimensions, chunk size, and\nchunk overlap. The embedding model is always the account-level default\n(currently ``AWS_BEDROCK_AMAZON_NOVA_2_MULTIMODAL``).\n\nPresets:\n FAST_AND_CHEAP: 256 dimensions, 3 000 char chunks, 500 char overlap.\n BALANCED: 384 dimensions, 1 500 char chunks, 300 char overlap.\n SLOW_AND_THOROUGH: 1 024 dimensions, 1 000 char chunks, 200 char overlap.\n CUSTOM: Caller supplies embedding model, dimensions, and chunk config.", - "enum": [ - "fast_and_cheap", - "balanced", - "slow_and_thorough", - "custom" - ], - "title": "SourceIndexMode", - "type": "string" - }, - "SourceResponse": { - "description": "Response model for source data.", - "properties": { - "account_id": { - "description": "Account ID associated with the source.", - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "avg_episodes_per_month": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Average number of episodes per month.", - "title": "Avg Episodes Per Month" - }, - "avg_words_per_episode": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Average number of words per episode.", - "title": "Avg Words Per Episode" - }, - "chunk_language": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Language used for chunking content.", - "title": "Chunk Language" - }, - "chunk_overlap": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk overlap for content processing.", - "title": "Chunk Overlap" - }, - "chunk_regex_separators": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Indicates if chunk separators are regex patterns.", - "title": "Chunk Regex Separators" - }, - "chunk_separators": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Chunk separators used for content processing.", - "title": "Chunk Separators" - }, - "chunk_size": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk size for content processing.", - "title": "Chunk Size" - }, - "content_count": { - "default": 0, - "description": "Number of content items associated with the source connection.", - "title": "Content Count", - "type": "integer" - }, - "content_filter": { - "description": "Content filter for the source connection.", - "title": "Content Filter", - "type": "string" - }, - "created_at": { - "description": "Timestamp when the source connection was created.", - "title": "Created At", - "type": "string" - }, - "dimensions": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Dimensions of the embedding model.", - "title": "Dimensions" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model used for the source connection.", - "title": "Embedding Model" - }, - "embedding_model_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Type of the embedding model.", - "title": "Embedding Model Type" - }, - "free_retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Number of days content is stored for free before billing applies.", - "title": "Free Retention Days" - }, - "has_historical_data": { - "default": false, - "description": "Indicates if the source connection has historical data.", - "title": "Has Historical Data", - "type": "boolean" - }, - "id": { - "description": "Unique identifier for the source connection.", - "title": "Id", - "type": "string" - }, - "index_mode": { - "anyOf": [ - { - "$ref": "#/components/schemas/SourceIndexMode" - }, - { - "type": "null" - } - ], - "description": "Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom." - }, - "media_types": { - "description": "Media kinds extracted from indexed content and embedded as multi-modal KB chunks (subset of ['images', 'video']). Empty = text-only.", - "items": { - "type": "string" - }, - "title": "Media Types", - "type": "array" - }, - "name": { - "description": "Name of the source connection.", - "title": "Name", - "type": "string" - }, - "next_poll_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp for the next scheduled poll.", - "title": "Next Poll At" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling configuration for the source connection.", - "title": "Polling" - }, - "polling_action": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling action for the source connection.", - "title": "Polling Action" - }, - "polling_max_items": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Maximum items to poll for the source connection.", - "title": "Polling Max Items" - }, - "pulled_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when content was last pulled.", - "title": "Pulled At" - }, - "readonly": { - "default": false, - "description": "Indicates if the source connection is read-only.", - "title": "Readonly", - "type": "boolean" - }, - "retention": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention period for the source connection.", - "title": "Retention" - }, - "source_type": { - "description": "Type of the source connection.", - "title": "Source Type", - "type": "string" - }, - "system_managed": { - "default": false, - "description": "Indicates if this source is automatically managed by the system (e.g., agent traces).", - "title": "System Managed", - "type": "boolean" - }, - "updated_at": { - "description": "Timestamp when the source connection was last updated.", - "title": "Updated At", - "type": "string" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "URL of the source connection.", - "title": "Url" - } - }, - "required": [ - "id", - "account_id", - "name", - "url", - "source_type", - "polling", - "polling_action", - "polling_max_items", - "content_filter", - "retention", - "pulled_at", - "next_poll_at", - "created_at", - "updated_at" - ], - "title": "SourceResponse", - "type": "object" - }, - "StandaloneTestCompactionRequest": { - "description": "Request body for testing a compaction prompt *without* an existing bank.\n\nUsed on the create-memory-bank page where no bank ID exists yet.\n``compaction_prompt`` is required (no bank to fall back to).\nContent must come from ``sample_entries`` or ``generate_direction``\n(no existing entries to fetch).", - "properties": { - "bank_type": { - "default": "conversation", - "description": "Memory bank type ('conversation' or 'general') \u2014 controls the style of generated entries.", - "title": "Bank Type", - "type": "string" - }, - "compaction_prompt": { - "description": "Compaction prompt to test.", - "minLength": 1, - "title": "Compaction Prompt", - "type": "string" - }, - "entry_count": { - "default": 5, - "description": "Number of entries to generate when using generate_direction.", - "maximum": 20.0, - "minimum": 2.0, - "title": "Entry Count", - "type": "integer" - }, - "generate_direction": { - "anyOf": [ - { - "maxLength": 2000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Direction for the LLM to generate sample entries.", - "title": "Generate Direction" - }, - "sample_entries": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "maxItems": 20, - "minItems": 1, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Explicit sample entries to compact.", - "title": "Sample Entries" - } - }, - "required": [ - "compaction_prompt" - ], - "title": "StandaloneTestCompactionRequest", - "type": "object" - }, - "StartSourceEmbeddingMigrationRequest": { - "description": "Request payload to start a source embedding migration.", - "properties": { - "chunk_language": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Language-specific chunking language code", - "title": "Chunk Language" - }, - "chunk_overlap": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Override chunk overlap (characters)", - "title": "Chunk Overlap" - }, - "chunk_regex_separators": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether chunk separators are regex patterns", - "title": "Chunk Regex Separators" - }, - "chunk_separators": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom chunk separators (JSON-encoded list)", - "title": "Chunk Separators" - }, - "chunk_size": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Override chunk size (characters per chunk)", - "title": "Chunk Size" - }, - "notification_recipients": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Optional notification recipient emails", - "title": "Notification Recipients" - }, - "target_dimensions": { - "description": "Target embedding dimensions", - "exclusiveMinimum": 0.0, - "title": "Target Dimensions", - "type": "integer" - }, - "target_embedding_model": { - "description": "Target embedding model \u2014 a `model_type` from `GET /models/embedders`, which also reports the `dimensions` each embedder supports and the modalities it can index.", - "title": "Target Embedding Model", - "type": "string" - } - }, - "required": [ - "target_embedding_model", - "target_dimensions" - ], - "title": "StartSourceEmbeddingMigrationRequest", - "type": "object" - }, - "TestCompactionRequest": { - "description": "Request body for testing a compaction prompt against an existing bank.\n\nThe user may supply a ``compaction_prompt`` to override (or provide when\nthe bank has none). Content can come from three sources:\n\n1. Existing entries in the bank (default when neither field is set).\n2. ``sample_entries`` \u2013 caller-provided list of strings.\n3. ``generate_direction`` \u2013 an instruction to the LLM to generate sample\n memory entries. Useful for trying a prompt before any real data\n exists.\n\nAt most one of ``sample_entries`` / ``generate_direction`` may be given.", - "properties": { - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Compaction prompt to test. Falls back to the bank's current prompt when omitted.", - "title": "Compaction Prompt" - }, - "entry_count": { - "default": 5, - "description": "Number of entries to generate when using generate_direction.", - "maximum": 20.0, - "minimum": 2.0, - "title": "Entry Count", - "type": "integer" - }, - "generate_direction": { - "anyOf": [ - { - "maxLength": 2000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Direction for the LLM to generate sample entries (e.g. 'Generate 5 entries about a customer support interaction').", - "title": "Generate Direction" - }, - "sample_entries": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "maxItems": 20, - "minItems": 1, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Explicit sample entries to compact.", - "title": "Sample Entries" - } - }, - "title": "TestCompactionRequest", - "type": "object" - }, - "TestDraftEvaluationRequest": { - "description": "Request body for ephemeral (non-persisted) evaluation testing.\n\nProvide either ``step_output`` (raw text) **or** ``agent_step_run_id``\n(to load output from storage). Exactly one must be supplied.", - "properties": { - "agent_input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The original agent run input for context. When agent_step_run_id is supplied this is loaded automatically from the parent run if omitted.", - "title": "Agent Input" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Load step output from this completed step run instead of supplying text.", - "title": "Agent Step Run Id" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "pass_threshold": { - "default": 0.5, - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" - }, - "step_output": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The step output text to evaluate. Omit if agent_step_run_id is supplied.", - "title": "Step Output" - } - }, - "title": "TestDraftEvaluationRequest", - "type": "object" - }, - "TestDraftEvaluationResponse": { - "description": "Response for an ephemeral evaluation test.", - "properties": { - "explanation": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Explanation" - }, - "passed": { - "title": "Passed", - "type": "boolean" - }, - "score": { - "title": "Score", - "type": "number" - } - }, - "required": [ - "score", - "passed", - "explanation" - ], - "title": "TestDraftEvaluationResponse", - "type": "object" - }, - "UnlinkResourcesRequest": { - "properties": { - "ids": { - "description": "Resource IDs to unlink", - "items": { - "format": "uuid", - "type": "string" - }, - "minItems": 1, - "title": "Ids", - "type": "array" - } - }, - "required": [ - "ids" - ], - "title": "UnlinkResourcesRequest", - "type": "object" - }, - "UnreadCountResponse": { - "properties": { - "count": { - "title": "Count", - "type": "integer" - } - }, - "required": [ - "count" - ], - "title": "UnreadCountResponse", - "type": "object" - }, - "UpdateAgentDefinitionRequest": { - "properties": { - "definition": { - "additionalProperties": true, - "description": "The full agent definition (name, description, tags, steps). Steps form a tree workflow. Each step has a `step_type`, `id`, `name`, and type-specific config. Content enrichment steps (write_metadata, write_content_attachment, load_content_attachment, load_content) require content-triggered agents.", - "title": "Definition", - "type": "object" - }, - "expected_change_id": { - "description": "The change_id from the last GET, for optimistic locking.", - "title": "Expected Change Id", - "type": "string" - } - }, - "required": [ - "expected_change_id", - "definition" - ], - "title": "UpdateAgentDefinitionRequest", - "type": "object" - }, - "UpdateAlertConfigRequest": { - "properties": { - "cooldown_minutes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cooldown period in minutes", - "title": "Cooldown Minutes" - }, - "distribution_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Distribution type", - "title": "Distribution Type" - }, - "enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the alert config is enabled", - "title": "Enabled" - }, - "recipient_user_ids": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "User IDs for selected_members distribution", - "title": "Recipient User Ids" - }, - "threshold": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Threshold configuration", - "title": "Threshold" - } - }, - "title": "UpdateAlertConfigRequest", - "type": "object" - }, - "UpdateApiVersionRequest": { - "properties": { - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "A YYYY-MM-DD date to pin the account to, or null to clear the pin (revert to the default baseline).", - "title": "Version" - } - }, - "title": "UpdateApiVersionRequest", - "type": "object" - }, - "UpdateEvaluationCriteriaRequest": { - "description": "Request body for updating an evaluation criteria.\n\nRetry settings and sample frequency are set at the agent level.", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "Enabled" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "pass_threshold": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Pass Threshold" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step Id" - } - }, - "title": "UpdateEvaluationCriteriaRequest", - "type": "object" - }, - "UpdateKnowledgeBaseBody": { - "description": "Request body for updating a knowledge base.", - "properties": { - "default_score_threshold": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": -1.0, - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Minimum Rerank Score on a new retrieval step (-1 to clear).", - "title": "Default Score Threshold" - }, - "default_top_k": { - "anyOf": [ - { - "maximum": 200.0, - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Top K on a new retrieval step (0 to clear).", - "title": "Default Top K" - }, - "default_top_n": { - "anyOf": [ - { - "maximum": 200.0, - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Top N on a new retrieval step (0 to clear).", - "title": "Default Top N" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New description.", - "title": "Description" - }, - "name": { - "anyOf": [ - { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name.", - "title": "Name" - }, - "reranker_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New reranker model \u2014 a `model_type` from `GET /models/rerankers`. Pass \"none\" to turn reranking off (not a value from that list). Omitting the field (or sending null) leaves the current reranker in place \u2014 it does NOT turn it off. \"\" is accepted as a synonym for \"none\", but prefer \"none\": an empty string does not survive every client's serialization.", - "title": "Reranker Model" - }, - "source_ids": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "New list of source connection IDs.", - "title": "Source Ids" - } - }, - "title": "UpdateKnowledgeBaseBody", - "type": "object" - }, - "UpdateMemoryBankBody": { - "description": "Request body for updating a memory bank.\n\nOmitted fields are left unchanged. To **clear** a field back to null,\nsend a zero-value sentinel: ``0`` for integers, ``\"\"`` for strings.", - "properties": { - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted. Send empty string \"\" to clear and disable summarisation.", - "title": "Compaction Prompt" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description. Send empty string \"\" to clear.", - "title": "Description" - }, - "max_age_days": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "DEPRECATED and no longer applied. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending Seclai-Version 2026-08-03 or later, except 0, which clears a value stored earlier. Accepted and stored but inert for older clients.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max total tokens (per partition) before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable.", - "title": "Max Turns" - }, - "name": { - "anyOf": [ - { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name.", - "title": "Name" - }, - "retention_days": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Content source retention in days. Send 0 to clear (indefinite).", - "title": "Retention Days" - }, - "strip_quoted_reply_chains": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation.", - "title": "Strip Quoted Reply Chains" - } - }, - "title": "UpdateMemoryBankBody", - "type": "object" - }, - "UpdateSolutionRequest": { - "description": "Request model for updating a solution", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Description of the solution", - "title": "Description" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Name of the solution", - "title": "Name" - } - }, - "title": "UpdateSolutionRequest", - "type": "object" - }, - "UpdateSourceBody": { - "description": "Request body for updating a content source.", - "properties": { - "media_types": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Media kinds to extract from indexed content and embed as multi-modal KB chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored (see `supported_input_media` on GET /models/embedders); unsupported values are dropped. [] disables media extraction (text-only).", - "title": "Media Types" - }, - "name": { - "anyOf": [ - { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name.", - "title": "Name" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New polling interval.", - "title": "Polling" - }, - "retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "New retention period in days \u2014 content older than this is deleted permanently. Send null to clear the window: content is then kept indefinitely. Omit the field to leave it unchanged.", - "title": "Retention Days" - } - }, - "title": "UpdateSourceBody", - "type": "object" - }, - "UploadAgentInputApiResponse": { - "properties": { - "content_type": { - "description": "Resolved MIME type.", - "title": "Content Type", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if status is failed.", - "title": "Error" - }, - "file_size": { - "description": "Size in bytes.", - "title": "File Size", - "type": "integer" - }, - "filename": { - "description": "Original filename.", - "title": "Filename", - "type": "string" - }, - "id": { - "description": "Unique identifier for the upload.", - "title": "Id", - "type": "string" - }, - "status": { - "description": "processing, ready, or failed.", - "title": "Status", - "type": "string" - } - }, - "required": [ - "id", - "status", - "filename", - "content_type", - "file_size" - ], - "title": "UploadAgentInputApiResponse", - "type": "object" - }, - "ValidationError": { - "properties": { - "loc": { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - }, - "title": "Location", - "type": "array" - }, - "msg": { - "title": "Message", - "type": "string" - }, - "type": { - "title": "Error Type", - "type": "string" - } - }, - "required": [ - "loc", - "msg", - "type" - ], - "title": "ValidationError", - "type": "object" - }, - "VariantCategoryResponse": { - "description": "Response model for a variant category", - "properties": { - "category": { - "title": "Category", - "type": "string" - }, - "configurable": { - "title": "Configurable", - "type": "boolean" - }, - "description": { - "title": "Description", - "type": "string" - }, - "options": { - "items": { - "$ref": "#/components/schemas/VariantOptionResponse" - }, - "title": "Options", - "type": "array" - }, - "title": { - "title": "Title", - "type": "string" - } - }, - "required": [ - "category", - "title", - "description", - "configurable", - "options" - ], - "title": "VariantCategoryResponse", - "type": "object" - }, - "VariantOptionResponse": { - "description": "Response model for a variant option", - "properties": { - "default": { - "title": "Default", - "type": "boolean" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "input_1h_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 1-hour prompt cache.", - "title": "Input 1H Cache Write Credits Per 1000 Tokens" - }, - "input_30m_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 30-minute prompt cache.", - "title": "Input 30M Cache Write Credits Per 1000 Tokens" - }, - "input_5m_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 5-minute prompt cache.", - "title": "Input 5M Cache Write Credits Per 1000 Tokens" - }, - "input_cache_hit_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens read from a prompt cache.", - "title": "Input Cache Hit Credits Per 1000 Tokens" - }, - "input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Credits Per 1000 Tokens" - }, - "long_context_input_cache_hit_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens read from a prompt cache, on a call whose input exceeds `long_context_threshold` tokens.", - "title": "Long Context Input Cache Hit Credits Per 1000 Tokens" - }, - "long_context_input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Long Context Input Credits Per 1000 Tokens" - }, - "long_context_output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Long Context Output Credits Per 1000 Tokens" - }, - "long_context_threshold": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Long Context Threshold" - }, - "output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Output Credits Per 1000 Tokens" - }, - "title": { - "title": "Title", - "type": "string" - }, - "value": { - "title": "Value", - "type": "string" - } - }, - "required": [ - "value", - "title", - "default" - ], - "title": "VariantOptionResponse", - "type": "object" - }, - "routers__api__agents__AgentImportPreviewRequest": { - "description": "Dry-run import request \u2014 same payload shape as the export endpoint.", - "properties": { - "agent_definition": { - "additionalProperties": true, - "description": "Payload in the same shape as GET /agents/{agent_id}/export.", - "title": "Agent Definition", - "type": "object" - } - }, - "required": [ - "agent_definition" - ], - "title": "AgentImportPreviewRequest", - "type": "object" - }, - "routers__api__agents__AgentImportPreviewResponse": { - "description": "Summary of a successfully validated import payload (no DB writes).\n\nCounts are derived from the validated payload as supplied \u2014 they\nreflect what was requested, not what would eventually be persisted\n(cross-account skips for recipients and KB names happen later, only\non commit).", - "properties": { - "agent_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Imported agent name, if any.", - "title": "Agent Name" - }, - "alert_configs": { - "description": "Number of alert configs in the payload.", - "title": "Alert Configs", - "type": "integer" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Imported agent description, if any.", - "title": "Description" - }, - "evaluation_criteria": { - "description": "Number of evaluation criteria in the payload.", - "title": "Evaluation Criteria", - "type": "integer" - }, - "governance_policies": { - "description": "Number of agent-scoped governance policies in the payload.", - "title": "Governance Policies", - "type": "integer" - }, - "ok": { - "description": "Always true on a 200 response; failures use HTTP 422.", - "title": "Ok", - "type": "boolean" - }, - "payload_export_version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Export-format version the payload claims (or ``null`` for legacy payloads). When this differs from ``supported_export_version``, fields may have been silently dropped or defaulted on import.", - "title": "Payload Export Version" - }, - "schedules": { - "description": "Number of trigger schedules in the payload.", - "title": "Schedules", - "type": "integer" - }, - "solutions": { - "default": 0, - "description": "Number of solutions the source agent belonged to. On import these are matched by name in the target account; unmatched names are silently skipped.", - "title": "Solutions", - "type": "integer" - }, - "step_count": { - "description": "Total number of steps in the workflow tree (recursive).", - "title": "Step Count", - "type": "integer" - }, - "supported_export_version": { - "default": "2", - "description": "Export-format version this server understands. Compare against ``payload_export_version`` to detect cross-version imports.", - "title": "Supported Export Version", - "type": "string" - }, - "unresolved_refs": { - "description": "Entity references in the imported workflow that don't exist in the target account. Each entry: {category, ref_id, ref_name?, locations:[step:], alternatives:[{id, name, description?}]}. Pass {source_uuid: target_uuid} as ``entity_remap`` on the create/update call to substitute these references before save.", - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Unresolved Refs", - "type": "array" - } - }, - "required": [ - "ok", - "agent_name", - "description", - "step_count", - "schedules", - "alert_configs", - "evaluation_criteria", - "governance_policies" - ], - "title": "AgentImportPreviewResponse", - "type": "object" - }, - "routers__api__agents__AgentListResponse": { - "properties": { - "data": { - "description": "List of agents.", - "items": { - "$ref": "#/components/schemas/AgentSummaryResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AgentListResponse", - "type": "object" - }, - "routers__api__agents__AgentRunListResponse": { - "properties": { - "data": { - "description": "List of agent runs.", - "items": { - "$ref": "#/components/schemas/AgentRunResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AgentRunListResponse", - "type": "object" - }, - "routers__api__agents__AgentTraceSearchRequest": { - "properties": { - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by agent ID.", - "title": "Agent Id" - }, - "query": { - "description": "Search query text.", - "title": "Query", - "type": "string" - }, - "run_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by run status.", - "title": "Run Status" - }, - "step_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by step type.", - "title": "Step Type" - }, - "top_n": { - "default": 10, - "description": "Maximum number of results.", - "maximum": 100.0, - "minimum": 1.0, - "title": "Top N", - "type": "integer" - } - }, - "required": [ - "query" - ], - "title": "AgentTraceSearchRequest", - "type": "object" - }, - "routers__api__agents__CreateAgentRequest": { - "properties": { - "agent_definition": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional payload in the same format produced by GET /agents/{id}/export. When provided, replaces any template-derived workflow and pre-fills metadata/trigger fields the request does not specify explicitly. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload.", - "title": "Agent Definition" - }, - "agent_template": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Template to initialize the agent from. Values: blank, retrieval_example, simple_qa, summarizer, json_extractor, content_change_notifier, scheduled_report, webhook_pipeline.", - "title": "Agent Template" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description.", - "title": "Description" - }, - "entity_remap": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional UUID-substitution map applied to the imported workflow before save. Each key is a source-account UUID (as returned by /agents/preview-import's ``unresolved_refs``); each value is the target-account UUID to substitute. Used to relink knowledge bases, memory banks, source connections, and sub-agents on cross-account imports.", - "title": "Entity Remap" - }, - "name": { - "description": "Name for the new agent.", - "title": "Name", - "type": "string" - }, - "trigger_type": { - "default": "dynamic_input", - "description": "Trigger type: dynamic_input, template_input, schedule, new_content, email_received.", - "title": "Trigger Type", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "CreateAgentRequest", - "type": "object" - }, - "routers__api__agents__GovernancePolicyRefResponse": { - "description": "Reference to a governance policy by id and name.", - "properties": { - "policy_id": { - "description": "Governance policy identifier.", - "title": "Policy Id", - "type": "string" - }, - "policy_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Display name of the policy at evaluation time. May be null when the policy has been deleted.", - "title": "Policy Name" - } - }, - "required": [ - "policy_id" - ], - "title": "GovernancePolicyRefResponse", - "type": "object" - }, - "routers__api__agents__SetEmailTriggerConfigRequest": { - "description": "Alias and/or sender allowlist for an EMAIL_RECEIVED trigger.\n\nA field omitted is left unchanged; passing ``null`` (or ``\"\"`` for\n``alias``) clears it.", - "properties": { - "alias": { - "anyOf": [ - { - "maxLength": 32, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom alias, unique per account, answering as `.@agent.seclai.com` and as `@` on each verified account email domain (alphanumeric plus '+', '.', '-'; 1\u201332 chars; not starting/ending with '+', '.', '-'; not UUID-shaped). Pass null/empty to clear.", - "title": "Alias" - }, - "allowed_senders": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Allowlist of full sender addresses and/or bare domains (a bare domain also matches sub-domains). Empty/null accepts any sender.", - "title": "Allowed Senders" - }, - "ignore_auto_generated": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "When true (default for new triggers), machine-generated inbound mail (auto-replies, bulk/list mail, bounces) is dropped before a run to prevent auto-reply loops. Set false to process automated mail.", - "title": "Ignore Auto Generated" - }, - "queue_on_quota": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "When true (default false), inbound mail that exceeds the account's hourly email-trigger rate is parked in a QUEUED run and drained later by the catch-up sweep instead of being failed; when false, over-rate mail fails immediately.", - "title": "Queue On Quota" - }, - "require_sender_auth": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "When true (default for new triggers), the envelope sender must pass SPF or DMARC even on an open inbox (no allowlist); unauthenticated, spoofable mail is rejected. Set false to accept fully unauthenticated mail on an open inbox.", - "title": "Require Sender Auth" - } - }, - "title": "SetEmailTriggerConfigRequest", - "type": "object" - }, - "routers__api__agents__UpdateAgentRequest": { - "properties": { - "agent_definition": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional payload in the same format produced by GET /agents/{id}/export. When provided, agent metadata fields the request does not set explicitly are taken from the payload, and the agent's workflow is replaced from `agent.definition`. The previous version is preserved in history. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload.", - "title": "Agent Definition" - }, - "default_evaluation_tier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Default evaluation tier: 'fast', 'balanced', or 'thorough'.", - "title": "Default Evaluation Tier" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New description for the agent.", - "title": "Description" - }, - "entity_remap": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional UUID-substitution map applied to the imported workflow before save (same shape as on POST /agents).", - "title": "Entity Remap" - }, - "evaluation_mode": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'.", - "title": "Evaluation Mode" - }, - "max_retries": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max retries for eval_and_retry mode (1-10).", - "title": "Max Retries" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name for the agent.", - "title": "Name" - }, - "prompt_model_auto_rollback_enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Enable or disable automatic rollback for upgraded models.", - "title": "Prompt Model Auto Rollback Enabled" - }, - "prompt_model_auto_rollback_triggers": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Failure signals that trigger rollback: agent_eval_fail, governance_flag, governance_block, agent_run_failed.", - "title": "Prompt Model Auto Rollback Triggers" - }, - "prompt_model_auto_upgrade_strategy": { - "anyOf": [ - { - "$ref": "#/components/schemas/PromptModelAutoUpgradeStrategy" - }, - { - "type": "null" - } - ], - "description": "Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter." - }, - "retry_on_failure": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether to retry on evaluation failure.", - "title": "Retry On Failure" - }, - "sampling_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Sampling configuration for sample_and_flag mode. Format: {combinator: 'and'|'or', rules: [...]}.", - "title": "Sampling Config" - }, - "set_default_evaluation_tier": { - "default": false, - "description": "When true and default_evaluation_tier is omitted, clears the tier to null (system default).", - "title": "Set Default Evaluation Tier", - "type": "boolean" - }, - "set_prompt_model_auto_rollback_triggers": { - "default": false, - "description": "When true and prompt_model_auto_rollback_triggers is omitted, clears the list to null (revert to system defaults).", - "title": "Set Prompt Model Auto Rollback Triggers", - "type": "boolean" - }, - "set_sampling_config": { - "default": false, - "description": "When true and sampling_config is omitted, clears the config to null.", - "title": "Set Sampling Config", - "type": "boolean" - } - }, - "title": "UpdateAgentRequest", - "type": "object" - }, - "routers__api__ai_assistant__AiAssistantFeedbackRequest": { - "description": "Request body for submitting AI assistant feedback.", - "properties": { - "agent_conversation_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent conversation ID, if applicable.", - "title": "Agent Conversation Id" - }, - "comment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional comment.", - "title": "Comment" - }, - "context": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Additional context.", - "title": "Context" - }, - "conversation_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Conversation ID for the interaction.", - "title": "Conversation Id" - }, - "feature": { - "description": "Feature name (e.g. 'source', 'solution').", - "title": "Feature", - "type": "string" - }, - "governance_conversation_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Governance conversation ID, if applicable.", - "title": "Governance Conversation Id" - }, - "prompt_call_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Prompt call ID for credit tracking.", - "title": "Prompt Call Id" - }, - "rating": { - "description": "Rating: 'thumbs_up' or 'thumbs_down'.", - "title": "Rating", - "type": "string" - } - }, - "required": [ - "feature", - "rating" - ], - "title": "AiAssistantFeedbackRequest", - "type": "object" - }, - "routers__api__alerts__AddCommentRequest": { - "properties": { - "body": { - "description": "Comment text", - "title": "Body", - "type": "string" - } - }, - "required": [ - "body" - ], - "title": "AddCommentRequest", - "type": "object" - }, - "routers__api__alerts__AlertCommentResponse": { - "properties": { - "body": { - "title": "Body", - "type": "string" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "id": { - "title": "Id", - "type": "string" - }, - "user_id": { - "title": "User Id", - "type": "string" - }, - "user_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "User Name" - } - }, - "required": [ - "id", - "user_id", - "user_name", - "body", - "created_at" - ], - "title": "AlertCommentResponse", - "type": "object" - }, - "routers__api__alerts__AlertDetailResponse": { - "properties": { - "alert": { - "$ref": "#/components/schemas/routers__api__alerts__AlertResponse" - }, - "comments": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__AlertCommentResponse" - }, - "title": "Comments", - "type": "array" - }, - "history": { - "items": { - "$ref": "#/components/schemas/AlertHistoryEntryResponse" - }, - "title": "History", - "type": "array" - }, - "subscribers": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__AlertSubscriberResponse" - }, - "title": "Subscribers", - "type": "array" - } - }, - "required": [ - "alert", - "history", - "comments", - "subscribers" - ], - "title": "AlertDetailResponse", - "type": "object" - }, - "routers__api__alerts__AlertListResponse": { - "description": "``GET /alerts`` \u2014 always the canonical ``{data, pagination}`` envelope.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__AlertResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AlertListResponse", - "type": "object" - }, - "routers__api__alerts__AlertResponse": { - "properties": { - "account_id": { - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "agent_run_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Run Id" - }, - "alert_config_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Alert Config Id" - }, - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "comment_count": { - "title": "Comment Count", - "type": "integer" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "details": { - "title": "Details" - }, - "id": { - "title": "Id", - "type": "string" - }, - "is_subscribed": { - "title": "Is Subscribed", - "type": "boolean" - }, - "mcp_client_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mcp Client Id" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Connection Id" - }, - "source_connection_pull_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Connection Pull Id" - }, - "status": { - "title": "Status", - "type": "string" - }, - "subscriber_count": { - "title": "Subscriber Count", - "type": "integer" - }, - "title": { - "title": "Title", - "type": "string" - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Updated At" - } - }, - "required": [ - "id", - "account_id", - "alert_config_id", - "alert_type", - "title", - "description", - "status", - "agent_id", - "agent_run_id", - "source_connection_id", - "source_connection_pull_id", - "mcp_client_id", - "subscriber_count", - "comment_count", - "is_subscribed", - "created_at", - "updated_at" - ], - "title": "AlertResponse", - "type": "object" - }, - "routers__api__alerts__AlertSubscriberResponse": { - "properties": { - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "id": { - "title": "Id", - "type": "string" - }, - "user_id": { - "title": "User Id", - "type": "string" - }, - "user_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "User Name" - } - }, - "required": [ - "id", - "user_id", - "user_name", - "created_at" - ], - "title": "AlertSubscriberResponse", - "type": "object" - }, - "routers__api__alerts__OrganizationAlertPreferenceResponse": { - "properties": { - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "is_override": { - "title": "Is Override", - "type": "boolean" - }, - "organization_id": { - "title": "Organization Id", - "type": "string" - }, - "subscribed": { - "title": "Subscribed", - "type": "boolean" - } - }, - "required": [ - "organization_id", - "alert_type", - "subscribed", - "is_override" - ], - "title": "OrganizationAlertPreferenceResponse", - "type": "object" - }, - "routers__api__alerts__UpdateOrganizationAlertPreferenceRequest": { - "properties": { - "subscribed": { - "description": "Whether the user should receive this alert for the organization", - "title": "Subscribed", - "type": "boolean" - } - }, - "required": [ - "subscribed" - ], - "title": "UpdateOrganizationAlertPreferenceRequest", - "type": "object" - }, - "routers__api__contents__ContentDetailResponse": { - "description": "Response model for content detail.", - "properties": { - "content_duration": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Duration of the content in seconds.", - "title": "Content Duration" - }, - "content_duration_display": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Display string for content duration.", - "title": "Content Duration Display" - }, - "content_status": { - "description": "Status of the content.", - "title": "Content Status", - "type": "string" - }, - "content_type": { - "description": "Type of the content.", - "title": "Content Type", - "type": "string" - }, - "content_type_display": { - "description": "Display name of the content type.", - "title": "Content Type Display", - "type": "string" - }, - "content_url": { - "description": "URL of the content.", - "title": "Content Url", - "type": "string" - }, - "content_word_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Word count of the content.", - "title": "Content Word Count" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Description of the content.", - "title": "Description" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message, if any.", - "title": "Error" - }, - "extracted_media_capped": { - "default": false, - "description": "True when extraction stopped with media still unread, so the item references more media than was indexed and media search will not match anything past the cut. Two causes: a web page that ran out of the budget for fetching remote assets, or a container that could not be read to the end (a truncated or hostile archive). An uploaded document that reads cleanly is never capped, however much media it holds \u2014 there is no limit on that.", - "title": "Extracted Media Capped", - "type": "boolean" - }, - "extracted_media_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Number of embedded images / videos extracted from inside this item and indexed as their own chunks. There is no limit on this \u2014 a document contributes as many as it holds. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container, or found nothing. Treat null as 'unknown', never as zero.", - "title": "Extracted Media Count" - }, - "extracted_media_limit": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "The bound that was reached, when extracted_media_capped is true and the stop was a bound \u2014 a number of fetch attempts, or a number of seconds. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired.", - "title": "Extracted Media Limit" - }, - "id": { - "description": "Unique identifier for the content version.", - "title": "Id", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Metadata associated with the content.", - "title": "Metadata" - }, - "published_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the content was published.", - "title": "Published At" - }, - "pulled_at": { - "description": "Timestamp when the content was pulled.", - "title": "Pulled At", - "type": "string" - }, - "source_connection_content_version_id": { - "description": "ID of the source connection content version.", - "title": "Source Connection Content Version Id", - "type": "string" - }, - "source_connection_id": { - "description": "ID of the source connection.", - "title": "Source Connection Id", - "type": "string" - }, - "source_name": { - "description": "Name of the source.", - "title": "Source Name", - "type": "string" - }, - "source_type": { - "description": "Type of the source.", - "title": "Source Type", - "type": "string" - }, - "text_content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Text content.", - "title": "Text Content" - }, - "text_content_end": { - "description": "End position of the text content.", - "title": "Text Content End", - "type": "integer" - }, - "text_content_start": { - "description": "Start position of the text content.", - "title": "Text Content Start", - "type": "integer" - }, - "text_content_total_length": { - "description": "Total length of the text content.", - "title": "Text Content Total Length", - "type": "integer" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title of the content.", - "title": "Title" - } - }, - "required": [ - "id", - "source_connection_content_version_id", - "source_connection_id", - "source_name", - "source_type", - "title", - "content_url", - "content_type", - "content_type_display", - "content_status", - "content_word_count", - "content_duration", - "content_duration_display", - "pulled_at", - "published_at", - "description", - "text_content", - "text_content_start", - "text_content_end", - "text_content_total_length", - "metadata", - "error" - ], - "title": "ContentDetailResponse", - "type": "object" - }, - "routers__api__contents__ContentEmbeddingsListResponse": { - "description": "Response model for paginated content embeddings.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ContentEmbeddingResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "ContentEmbeddingsListResponse", - "type": "object" - }, - "routers__api__contents__FileUploadResponse": { - "description": "Response model for content file replacement upload.", - "properties": { - "content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the newly created content version. A replacement creates a new version rather than overwriting the previous one.", - "title": "Content Version Id" - }, - "embedder_warning": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Set when the file's type is not embedded directly on this source, so indexing relies on extracted text. Content with none (e.g. a photograph) will be marked FAILED.", - "title": "Embedder Warning" - }, - "filename": { - "description": "Original filename", - "title": "Filename", - "type": "string" - }, - "source_connection_content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the source connection content version. Unchanged by a replacement, so it stays a stable handle for the content.", - "title": "Source Connection Content Version Id" - }, - "status": { - "description": "Always `uploaded`. Unlike the create endpoints, a replacement is never rejected as a duplicate of another item.", - "title": "Status", - "type": "string" - } - }, - "required": [ - "content_version_id", - "source_connection_content_version_id", - "filename", - "status" - ], - "title": "FileUploadResponse", - "type": "object" - }, - "routers__api__docs_search__DocsSearchResponse": { - "description": "Ranked results, NOT a paginated collection \u2014 the ``{results}`` shape is a\ndeliberate carve-out matching the MCP ``search_docs`` tool.", - "properties": { - "results": { - "items": { - "$ref": "#/components/schemas/DocsSearchResultResponse" - }, - "title": "Results", - "type": "array" - } - }, - "required": [ - "results" - ], - "title": "DocsSearchResponse", - "type": "object" - }, - "routers__api__governance__GovernanceAiAssistantRequest": { - "description": "Request body for the governance AI assistant.", - "properties": { - "user_input": { - "description": "Natural-language request for the governance AI assistant.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "GovernanceAiAssistantRequest", - "type": "object" - }, - "routers__api__governance__GovernanceConversationResponse": { - "description": "A governance AI assistant conversation entry.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "True if accepted, false if declined, null if pending.", - "title": "Accepted" - }, - "ai_response": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The AI assistant's response note, or null.", - "title": "Ai Response" - }, - "created_at": { - "description": "ISO 8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "id": { - "description": "Conversation ID.", - "title": "Id", - "type": "string" - }, - "proposed_actions": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "JSON of proposed actions, or null.", - "title": "Proposed Actions" - }, - "user_input": { - "description": "The original user request.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "id", - "user_input", - "ai_response", - "proposed_actions", - "accepted", - "created_at" - ], - "title": "GovernanceConversationResponse", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankAcceptRequest": { - "description": "Accept or decline a memory bank AI suggestion.", - "properties": { - "accepted": { - "description": "Whether the user accepted the proposed configuration.", - "title": "Accepted", - "type": "boolean" - } - }, - "required": [ - "accepted" - ], - "title": "MemoryBankAcceptRequest", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankAiAssistantRequest": { - "description": "Request body for the memory bank AI assistant.", - "properties": { - "current_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Current configuration to refine, if any.", - "title": "Current Config" - }, - "history_since": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional ISO 8601 timestamp. When set, only conversation turns created at or after this timestamp are loaded as context, scoping history to the current session so the assistant remembers earlier turns in a multi-turn refinement.", - "title": "History Since" - }, - "user_input": { - "description": "Natural-language description of the memory bank.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "MemoryBankAiAssistantRequest", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankConversationTurnResponse": { - "description": "A single turn of memory bank AI assistant conversation.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the user accepted this proposal.", - "title": "Accepted" - }, - "ai_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI note from this turn.", - "title": "Ai Note" - }, - "conversation_id": { - "description": "Unique ID for this conversation turn.", - "title": "Conversation Id", - "type": "string" - }, - "resulting_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "The proposed configuration from this turn.", - "title": "Resulting Config" - }, - "user_input": { - "description": "User input for this turn.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input", - "conversation_id" - ], - "title": "MemoryBankConversationTurnResponse", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankLastConversationResponse": { - "description": "Response for fetching memory bank conversation history.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the user accepted the last proposal.", - "title": "Accepted" - }, - "ai_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI note from the most recent turn.", - "title": "Ai Note" - }, - "total": { - "default": 0, - "description": "Total conversation turns.", - "title": "Total", - "type": "integer" - }, - "turns": { - "description": "Recent conversation turns (oldest first).", - "items": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankConversationTurnResponse" - }, - "title": "Turns", - "type": "array" - }, - "user_input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Most recent user input.", - "title": "User Input" - } - }, - "title": "MemoryBankLastConversationResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelAlertListResponse": { - "description": "``GET /models/alerts`` legacy/default shape; 2026-07-27+ clients get the\ncanonical ``{data, pagination}`` envelope (bypasses this ``response_model``).", - "properties": { - "alerts": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelAlertResponse" - }, - "title": "Alerts", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "alerts", - "total" - ], - "title": "ModelAlertListResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelAlertResponse": { - "properties": { - "account_id": { - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string" - }, - "message": { - "title": "Message", - "type": "string" - }, - "model_name": { - "title": "Model Name", - "type": "string" - }, - "prompt_model_id": { - "title": "Prompt Model Id", - "type": "string" - }, - "read_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Read At" - }, - "successor_model_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Successor Model Name" - } - }, - "required": [ - "id", - "account_id", - "agent_id", - "prompt_model_id", - "model_name", - "alert_type", - "message", - "read_at", - "successor_model_name", - "created_at" - ], - "title": "ModelAlertResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelRecommendationResponse": { - "properties": { - "deprecated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Deprecated At" - }, - "description": { - "title": "Description", - "type": "string" - }, - "effort_options": { - "anyOf": [ - { - "$ref": "#/components/schemas/EffortOptionsResponse" - }, - { - "type": "null" - } - ] - }, - "family": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Family" - }, - "family_generation": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Family Generation" - }, - "id": { - "title": "Id", - "type": "string" - }, - "max_context_tokens": { - "title": "Max Context Tokens", - "type": "integer" - }, - "max_output_tokens": { - "title": "Max Output Tokens", - "type": "integer" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "provider": { - "title": "Provider", - "type": "string" - }, - "reason": { - "title": "Reason", - "type": "string" - }, - "recommendation_type": { - "title": "Recommendation Type", - "type": "string" - }, - "released_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Released At" - }, - "sunset_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Sunset At" - }, - "supports_openai_arguments": { - "title": "Supports Openai Arguments", - "type": "boolean" - }, - "supports_streaming": { - "title": "Supports Streaming", - "type": "boolean" - }, - "supports_structured_output": { - "title": "Supports Structured Output", - "type": "boolean" - }, - "supports_thinking": { - "title": "Supports Thinking", - "type": "boolean" - }, - "supports_tool_use": { - "title": "Supports Tool Use", - "type": "boolean" - } - }, - "required": [ - "id", - "model_id", - "name", - "provider", - "description", - "max_context_tokens", - "max_output_tokens", - "supports_tool_use", - "supports_structured_output", - "supports_thinking", - "supports_openai_arguments", - "supports_streaming", - "recommendation_type", - "reason" - ], - "title": "ModelRecommendationResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelRecommendationsResponse": { - "properties": { - "alternatives": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - "title": "Alternatives", - "type": "array" - }, - "current_model_id": { - "title": "Current Model Id", - "type": "string" - }, - "current_model_name": { - "title": "Current Model Name", - "type": "string" - }, - "same_provider": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - "title": "Same Provider", - "type": "array" - }, - "successor": { - "anyOf": [ - { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - { - "type": "null" - } - ] - }, - "upgrades": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - "title": "Upgrades", - "type": "array" - } - }, - "required": [ - "current_model_id", - "current_model_name", - "upgrades", - "same_provider", - "alternatives" - ], - "title": "ModelRecommendationsResponse", - "type": "object" - }, - "routers__api__search__SearchResponse": { - "description": "Ranked results, NOT a paginated collection \u2014 the ``{results}`` shape is a\ndeliberate carve-out matching the MCP ``search_resources`` tool.", - "properties": { - "results": { - "items": { - "$ref": "#/components/schemas/routers__api__search__SearchResultResponse" - }, - "title": "Results", - "type": "array" - } - }, - "required": [ - "results" - ], - "title": "SearchResponse", - "type": "object" - }, - "routers__api__search__SearchResultResponse": { - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "entity_type": { - "title": "Entity Type", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "entity_type", - "name", - "description" - ], - "title": "SearchResultResponse", - "type": "object" - }, - "routers__api__solutions__AiAssistantAcceptRequest": { - "description": "Request body for accepting a proposed plan.", - "properties": { - "confirm_deletions": { - "default": false, - "description": "Must be true when the plan contains destructive actions", - "title": "Confirm Deletions", - "type": "boolean" - }, - "solution_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "When running in standalone mode (no pre-existing solution), provide a description for the auto-created solution.", - "title": "Solution Description" - }, - "solution_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "When running in standalone mode (no pre-existing solution), provide a name to auto-create a solution and link resources.", - "title": "Solution Name" - } - }, - "title": "AiAssistantAcceptRequest", - "type": "object" - }, - "routers__api__solutions__AiAssistantGenerateRequest": { - "description": "Request body for AI assistant generate endpoints.", - "properties": { - "history_since": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional ISO 8601 timestamp. When set, only conversation turns created at or after this timestamp are loaded as context, scoping history to the current session so the assistant remembers earlier turns in a create flow.", - "title": "History Since" - }, - "user_input": { - "description": "User input describing what to do", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "AiAssistantGenerateRequest", - "type": "object" - }, - "routers__api__solutions__SolutionAgentResponse": { - "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "knowledge_base_ids": { - "description": "Knowledge base IDs connected to this agent via triggers.", - "items": { - "format": "uuid", - "type": "string" - }, - "title": "Knowledge Base Ids", - "type": "array" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "title": "SolutionAgentResponse", - "type": "object" - }, - "routers__api__solutions__SolutionConversationResponse": { - "description": "Response model for a conversation turn.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the suggestion was accepted or declined.", - "title": "Accepted" - }, - "actions_taken": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Actions taken by the AI.", - "title": "Actions Taken" - }, - "ai_response": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI response text.", - "title": "Ai Response" - }, - "created_at": { - "description": "Timestamp when the conversation was created.", - "title": "Created At", - "type": "string" - }, - "id": { - "description": "Unique identifier for the conversation turn.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "user_input": { - "description": "User input text.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "id", - "user_input", - "ai_response", - "actions_taken", - "accepted", - "created_at" - ], - "title": "SolutionConversationResponse", - "type": "object" - }, - "routers__api__solutions__SolutionKnowledgeBaseResponse": { - "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "source_connection_ids": { - "description": "Source connection IDs linked to this knowledge base.", - "items": { - "format": "uuid", - "type": "string" - }, - "title": "Source Connection Ids", - "type": "array" - } - }, - "required": [ - "id", - "name" - ], - "title": "SolutionKnowledgeBaseResponse", - "type": "object" - }, - "routers__api__solutions__SolutionListResponse": { - "description": "Response model for paginated solution list.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/SolutionSummaryResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "SolutionListResponse", - "type": "object" - }, - "routers__api__solutions__SolutionResponse": { - "description": "Response model for solution data.", - "properties": { - "agents": { - "description": "Agents linked to the solution.", - "items": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionAgentResponse" - }, - "title": "Agents", - "type": "array" - }, - "created_at": { - "description": "Timestamp when the solution was created.", - "title": "Created At", - "type": "string" - }, - "description": { - "description": "Description of the solution.", - "title": "Description", - "type": "string" - }, - "id": { - "description": "Unique identifier for the solution.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "knowledge_bases": { - "description": "Knowledge bases linked to the solution.", - "items": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionKnowledgeBaseResponse" - }, - "title": "Knowledge Bases", - "type": "array" - }, - "name": { - "description": "Name of the solution.", - "title": "Name", - "type": "string" - }, - "source_connections": { - "description": "Source connections linked to the solution.", - "items": { - "$ref": "#/components/schemas/SolutionSourceConnectionResponse" - }, - "title": "Source Connections", - "type": "array" - }, - "updated_at": { - "description": "Timestamp when the solution was last updated.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "description", - "agents", - "knowledge_bases", - "source_connections", - "created_at", - "updated_at" - ], - "title": "SolutionResponse", - "type": "object" - }, - "routers__api__source_exports__CreateExportRequest": { - "description": "Parameters for creating a new export job.", - "properties": { - "date_from": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or after this timestamp.", - "title": "Date From" - }, - "date_to": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or before this timestamp.", - "title": "Date To" - }, - "format": { - "$ref": "#/components/schemas/ExportFormat", - "description": "Output file format (jsonl, csv, parquet, zip)." - }, - "metadata_filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "JSONB containment filter applied to content metadata.", - "title": "Metadata Filter" - }, - "query_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title substring filter (case-insensitive ILIKE).", - "title": "Query Filter" - } - }, - "required": [ - "format" - ], - "title": "CreateExportRequest", - "type": "object" - }, - "routers__api__source_exports__EstimateExportRequest": { - "description": "Parameters for estimating export size.", - "properties": { - "date_from": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or after this timestamp.", - "title": "Date From" - }, - "date_to": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or before this timestamp.", - "title": "Date To" - }, - "format": { - "$ref": "#/components/schemas/ExportFormat", - "description": "Output file format." - }, - "metadata_filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "JSONB containment filter applied to content metadata.", - "title": "Metadata Filter" - }, - "query_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title substring filter (case-insensitive ILIKE).", - "title": "Query Filter" - } - }, - "required": [ - "format" - ], - "title": "EstimateExportRequest", - "type": "object" - }, - "routers__api__source_exports__EstimateExportResponse": { - "description": "Rough size estimate for a potential export.", - "properties": { - "estimated_size_bytes": { - "description": "Estimated export file size in bytes.", - "title": "Estimated Size Bytes", - "type": "integer" - }, - "source_connection_id": { - "description": "Source connection ID.", - "title": "Source Connection Id", - "type": "string" - } - }, - "required": [ - "estimated_size_bytes", - "source_connection_id" - ], - "title": "EstimateExportResponse", - "type": "object" - }, - "routers__api__source_exports__ExportResponse": { - "description": "Status and metadata for a content source export job.", - "properties": { - "account_id": { - "description": "Owning account ID.", - "title": "Account Id", - "type": "string" - }, - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Completion time.", - "title": "Completed At" - }, - "created_at": { - "description": "Creation time.", - "title": "Created At", - "type": "string" - }, - "date_from": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Date-from filter applied to this export.", - "title": "Date From" - }, - "date_to": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Date-to filter applied to this export.", - "title": "Date To" - }, - "destination": { - "description": "Storage destination.", - "title": "Destination", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if failed.", - "title": "Error" - }, - "estimated_size_bytes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Pre-run size estimate.", - "title": "Estimated Size Bytes" - }, - "expires_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Download expiry time.", - "title": "Expires At" - }, - "file_size_bytes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "File size in bytes.", - "title": "File Size Bytes" - }, - "format": { - "description": "Output format.", - "title": "Format", - "type": "string" - }, - "id": { - "description": "Export job ID.", - "title": "Id", - "type": "string" - }, - "item_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Items exported.", - "title": "Item Count" - }, - "metadata_filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Metadata filter applied to this export.", - "title": "Metadata Filter" - }, - "progress_current": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Items processed so far.", - "title": "Progress Current" - }, - "progress_total": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Total items to process.", - "title": "Progress Total" - }, - "query_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Query filter applied to this export.", - "title": "Query Filter" - }, - "requested_by_user_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the user who requested this export.", - "title": "Requested By User Id" - }, - "requested_by_user_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Name of the user who requested this export.", - "title": "Requested By User Name" - }, - "source_connection_id": { - "description": "Source connection ID.", - "title": "Source Connection Id", - "type": "string" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Processing start time.", - "title": "Started At" - }, - "status": { - "description": "Job status.", - "title": "Status", - "type": "string" - }, - "storage_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "S3 key of exported file.", - "title": "Storage Key" - }, - "updated_at": { - "description": "Last update time.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "source_connection_id", - "account_id", - "format", - "destination", - "status", - "created_at", - "updated_at" - ], - "title": "ExportResponse", - "type": "object" - }, - "routers__api__sources__FileUploadResponse": { - "description": "Response model for file upload", - "properties": { - "content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the created content version, and what the source content status endpoints take. Set when `status` is `uploaded`; `null` when `status` is `duplicate`, because no new version was created.", - "title": "Content Version Id" - }, - "embedder_warning": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Set when the file is non-text but the source's embedder is text-only \u2014 indexing will rely on OCR / transcription and may produce a FAILED row if no text can be extracted.", - "title": "Embedder Warning" - }, - "filename": { - "description": "Original filename", - "title": "Filename", - "type": "string" - }, - "source_connection_content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the existing, already-indexed item this file duplicates, and what `GET /contents/{id}` takes. Set only when `status` is `duplicate`; `null` on a new upload, which has no such id until it finishes indexing.", - "title": "Source Connection Content Version Id" - }, - "status": { - "description": "`uploaded` for a new item, or `duplicate` when this exact file is already on the source.", - "title": "Status", - "type": "string" - } - }, - "required": [ - "content_version_id", - "source_connection_content_version_id", - "filename", - "status" - ], - "title": "FileUploadResponse", - "type": "object" - }, - "routers__api__sources__SourceListResponse": { - "description": "Response model for paginated source list", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/SourceResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "SourceListResponse", - "type": "object" - }, - "schemas__model_responses__PromptModelResponse": { - "description": "Response model for prompt model data", - "properties": { - "chat_capable": { - "default": true, - "description": "Whether this model can serve a chat request (`prompt_call`, `extract_data`). True for every plain text LLM, and for a dual-capability model that generates media AND holds a conversation; false for a dedicated generator (Imagen, Veo, a TTS voice), which bills per produced unit and has no chat interface. Authoritative: consumers must read this rather than inferring it from `generation_params` or `supported_output_media`, because the answer also depends on which inference interface serves the model \u2014 something no response field exposes.", - "title": "Chat Capable", - "type": "boolean" - }, - "default": { - "title": "Default", - "type": "boolean" - }, - "deprecated_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Deprecated At" - }, - "description": { - "title": "Description", - "type": "string" - }, - "effort_options": { - "anyOf": [ - { - "$ref": "#/components/schemas/EffortOptionsResponse" - }, - { - "type": "null" - } - ], - "description": "The reasoning-effort values a prompt_call or extract_data step may set as `effort` with this model. Null when the model takes none." - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "family": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Family" - }, - "family_generation": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Family Generation" - }, - "generation_credits_per_unit": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Per-unit credit cost for a dedicated media-generation model, in the unit named by ``generation_params.pricing_unit`` (per image / per second / per character / per output token). Multiply by the produced unit count (images, seconds, characters) for the run cost. None for models with no generation descriptor. This rate applies when the model is used in a generate_image/audio/video step; a model that also serves the chat path is billed per token there instead, using the input/output token rates on this same record. When `generation_params.price_varies_by` is set the model has one rate per value of that option and this is the **highest** of them \u2014 read `generation_credits_per_variant` for the real spread rather than presenting this as the price.", - "title": "Generation Credits Per Unit" - }, - "generation_credits_per_variant": { - "anyOf": [ - { - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Per-unit credit cost keyed by the value of the option named in `generation_params.price_varies_by` (e.g. `{'720p': 1330, '1080p': 1995}`). None for a model with a single rate, where `generation_credits_per_unit` already describes it exactly.", - "title": "Generation Credits Per Variant" - }, - "generation_params": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Media-generation descriptor (modality, pricing_unit, and modality-specific constraints). NULL for text LLMs; present for image/audio/video generation models. See schemas.generation_params. A present descriptor does NOT imply the model is generation-only: some models serve both paths (they generate media AND hold a chat conversation). Read `chat_capable` to tell whether a model with a descriptor can also be used as a chat model \u2014 do not branch on this field being non-null alone, and do not re-derive the answer from `supported_output_media`.", - "title": "Generation Params" - }, - "generation_unit_label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human suffix for the per-unit generation rate (e.g. ``/image``, ``/second``, ``/1k chars``, ``/1k tokens``) \u2014 single-sourced from the pricing unit so clients render cost without re-deriving the mapping. None for non-generation models. Char/token rates are shown per 1,000 (the ``/1k \u2026`` suffix), so scale ``generation_credits_per_unit`` accordingly for those units.", - "title": "Generation Unit Label" - }, - "id": { - "title": "Id", - "type": "string" - }, - "image_generation_tool_credits_per_image": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Per-image credit cost of using the built-in image_generation tool (it runs gpt-image-1). Set only for models that actually support the tool (tool-use capable); None otherwise.", - "title": "Image Generation Tool Credits Per Image" - }, - "input_1h_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 1-hour prompt cache.", - "title": "Input 1H Cache Write Credits Per 1000 Tokens" - }, - "input_30m_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 30-minute prompt cache.", - "title": "Input 30M Cache Write Credits Per 1000 Tokens" - }, - "input_5m_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 5-minute prompt cache.", - "title": "Input 5M Cache Write Credits Per 1000 Tokens" - }, - "input_cache_hit_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens read from a prompt cache.", - "title": "Input Cache Hit Credits Per 1000 Tokens" - }, - "input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Credits Per 1000 Tokens" - }, - "is_new": { - "default": false, - "title": "Is New", - "type": "boolean" - }, - "last_used": { - "default": false, - "title": "Last Used", - "type": "boolean" - }, - "max_context_tokens": { - "title": "Max Context Tokens", - "type": "integer" - }, - "max_conversation_length": { - "title": "Max Conversation Length", - "type": "integer" - }, - "max_output_tokens": { - "title": "Max Output Tokens", - "type": "integer" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Output Credits Per 1000 Tokens" - }, - "payload_schema": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Model-specific JSON schema for advanced prompt_call json_template payloads.", - "title": "Payload Schema" - }, - "payload_schema_source_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source URL used to derive payload_schema guidance for this model.", - "title": "Payload Schema Source Url" - }, - "per_modality_rates": { - "items": { - "$ref": "#/components/schemas/ModalityRateResponse" - }, - "title": "Per Modality Rates", - "type": "array" - }, - "provider": { - "title": "Provider", - "type": "string" - }, - "released_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Released At" - }, - "schema_documentation_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model documentation URL with request/response payload details.", - "title": "Schema Documentation Url" - }, - "schema_notes": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human-readable notes about request payload compatibility.", - "title": "Schema Notes" - }, - "successor_model_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Successor Model Id" - }, - "sunset_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Sunset At" - }, - "supported_input_media": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Supported Input Media" - }, - "supported_languages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Supported Languages" - }, - "supported_output_media": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Supported Output Media" - }, - "supports_openai_arguments": { - "default": false, - "title": "Supports Openai Arguments", - "type": "boolean" - }, - "supports_streaming": { - "default": false, - "title": "Supports Streaming", - "type": "boolean" - }, - "supports_structured_output": { - "default": true, - "title": "Supports Structured Output", - "type": "boolean" - }, - "supports_thinking": { - "default": false, - "title": "Supports Thinking", - "type": "boolean" - }, - "supports_tool_use": { - "default": true, - "title": "Supports Tool Use", - "type": "boolean" - }, - "tools_disabled": { - "items": { - "$ref": "#/components/schemas/PromptToolResponse" - }, - "title": "Tools Disabled", - "type": "array" - }, - "tools_enabled": { - "items": { - "$ref": "#/components/schemas/PromptToolResponse" - }, - "title": "Tools Enabled", - "type": "array" - }, - "training_cutoff_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Training Cutoff At" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Url" - }, - "variants": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/VariantCategoryResponse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Variants" - } - }, - "required": [ - "id", - "model_id", - "name", - "description", - "enabled", - "default", - "provider", - "max_context_tokens", - "max_output_tokens", - "max_conversation_length" - ], - "title": "PromptModelResponse", - "type": "object" - }, - "schemas__model_responses__ProviderGroupResponse": { - "description": "Response model for provider group with models", - "properties": { - "models": { - "items": { - "$ref": "#/components/schemas/schemas__model_responses__PromptModelResponse" - }, - "title": "Models", - "type": "array" - }, - "provider": { - "title": "Provider", - "type": "string" - } - }, - "required": [ - "provider", - "models" - ], - "title": "ProviderGroupResponse", - "type": "object" - }, - "schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse": { - "description": "Per-mode rollup for evaluation activity.", - "properties": { - "failed": { - "title": "Failed", - "type": "integer" - }, - "failure_rate": { - "title": "Failure Rate", - "type": "number" - }, - "flagged": { - "title": "Flagged", - "type": "integer" - }, - "mode": { - "title": "Mode", - "type": "string" - }, - "pass_rate": { - "title": "Pass Rate", - "type": "number" - }, - "passed": { - "title": "Passed", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "mode", - "total", - "passed", - "failed", - "flagged", - "pass_rate", - "failure_rate" - ], - "title": "NonManualEvaluationModeStatResponse", - "type": "object" - }, - "schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse": { - "description": "Account-level summary for evaluations.", - "properties": { - "by_mode": { - "items": { - "$ref": "#/components/schemas/schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse" - }, - "title": "By Mode", - "type": "array" - }, - "failed": { - "title": "Failed", - "type": "integer" - }, - "failure_rate": { - "title": "Failure Rate", - "type": "number" - }, - "flagged": { - "title": "Flagged", - "type": "integer" - }, - "pass_rate": { - "title": "Pass Rate", - "type": "number" - }, - "passed": { - "title": "Passed", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "total", - "passed", - "failed", - "flagged", - "pass_rate", - "failure_rate", - "by_mode" - ], - "title": "NonManualEvaluationSummaryResponse", - "type": "object" - } - }, - "securitySchemes": { - "ApiKeyAuth": { - "description": "API key issued from the Seclai dashboard.", - "in": "header", - "name": "X-API-Key", - "type": "apiKey" - }, - "BearerAuth": { - "bearerFormat": "JWT", - "description": "OAuth2 access token from AWS Cognito.", - "scheme": "bearer", - "type": "http" - } - } - }, - "info": { - "description": "Main API service for Seclai", - "title": "Seclai API", - "version": "local" - }, - "openapi": "3.1.0", - "paths": { - "/agents": { - "get": { - "description": "List agents for the account with pagination.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "list_agents_api_agents_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List agents", - "tags": [ - "agents" - ] - }, - "post": { - "description": "Create a new agent.\n\nTrigger types:\n- `dynamic_input`: triggered via API with user-provided input\n- `template_input`: triggered via API with a predefined template\n- `schedule`: triggered on a schedule\n- `new_content`: triggered when new content arrives\n- `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`.\n\nTemplates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline`\n\nImporting an existing agent:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; items that don't resolve in this account are reported in the response's `import_warnings` array.\n- Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: target_uuid}` on this call to substitute them before save.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account.", - "operationId": "create_agent_api_agents_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__CreateAgentRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "Plan limit exceeded \u2014 the account has reached the maximum number of agents allowed by its subscription plan." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" - } - } - }, - "description": "The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`)." - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create an agent", - "tags": [ - "agents" - ] - } - }, - "/agents/agent-email-optouts": { - "get": { - "description": "List recipients who have opted out of this account's agent emails (filter to one agent via `agent_id`; account-wide opt-outs always apply). Paginated via `limit`/`offset`; returns the page plus the `total` count.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "list_agent_email_optouts_api_api_agents_agent_email_optouts_get", - "parameters": [ - { - "description": "Filter to one agent (account-wide opt-outs still apply)", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to one agent (account-wide opt-outs still apply)", - "title": "Agent Id" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentEmailOptOutListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List agent-email opt-outs", - "tags": [ - "agents" - ] - } - }, - "/agents/agent-email-optouts/{optout_id}": { - "delete": { - "description": "Revoke an opt-out (opt the recipient back in to agent emails).\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the opt-out must belong to the key's account.", - "operationId": "remove_agent_email_optout_api_api_agents_agent_email_optouts__optout_id__delete", - "parameters": [ - { - "in": "path", - "name": "optout_id", - "required": true, - "schema": { - "title": "Optout Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Revoke an agent-email opt-out", - "tags": [ - "agents" - ] - } - }, - "/agents/blocked-email-senders": { - "get": { - "description": "List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus the governance `auto_block_mode`.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "list_blocked_email_senders_api_api_agents_blocked_email_senders_get", - "parameters": [ - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List blocked inbound email senders + the auto-block mode", - "tags": [ - "agents" - ] - }, - "post": { - "description": "Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is `address` (default) or `domain`).\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "block_email_sender_api_api_agents_blocked_email_senders_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockEmailSenderRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Block an inbound email sender or domain", - "tags": [ - "agents" - ] - } - }, - "/agents/blocked-email-senders/mode": { - "put": { - "description": "Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the blocklist (`disabled`, `input`, or `input_and_output`); returns the updated list.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SetAutoBlockModeRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Set the governance auto-block mode", - "tags": [ - "agents" - ] - } - }, - "/agents/blocked-email-senders/{blocked_id}": { - "delete": { - "description": "Remove a blocked sender by id.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; the blocked sender must belong to the key's account.", - "operationId": "unblock_email_sender_api_api_agents_blocked_email_senders__blocked_id__delete", - "parameters": [ - { - "in": "path", - "name": "blocked_id", - "required": true, - "schema": { - "title": "Blocked Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Unblock an inbound email sender", - "tags": [ - "agents" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}": { - "delete": { - "description": "Delete an evaluation criteria and all associated evaluation results.\n\nThis action is permanent and cannot be undone. All historical result\nrecords tied to the criteria are removed as well.", - "operationId": "delete_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__delete", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - }, - "get": { - "description": "Get a single evaluation criteria by ID.\n\nReturns the full criteria configuration including type-specific fields,\ncurrent enabled state, and a summary of recent evaluation results.", - "operationId": "get_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - }, - "patch": { - "description": "Update an evaluation criteria.\n\nAccepts a partial update \u2013 only the fields included in the request body\nare modified. Use this to toggle enabled/disabled, change the\nevaluation prompt, adjust retries, or rename the criteria.", - "operationId": "update_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__patch", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateEvaluationCriteriaRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}/compatible-runs": { - "get": { - "description": "List agent runs that have a completed step matching the criteria's target step.\n\nReturns runs whose step output can be used for testing or replaying the\nevaluation criteria. Results are ordered newest-first and paginated.", - "operationId": "list_compatible_runs_api_agents_evaluation_criteria__criteria_id__compatible_runs_get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "in": "query", - "name": "started_after", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started After" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompatibleRunListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Compatible Runs", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}/results": { - "get": { - "description": "List evaluation results for a criteria with optional filtering.\n\nSupports filtering by status (pending, passed, failed, skipped, error),\nflagged-only mode, and an optional time range. Results are paginated\nwith configurable page size.", - "operationId": "list_evaluation_results_api_agents_evaluation_criteria__criteria_id__results_get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status" - } - }, - { - "in": "query", - "name": "flagged_only", - "required": false, - "schema": { - "default": false, - "title": "Flagged Only", - "type": "boolean" - } - }, - { - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time From" - } - }, - { - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time To" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Evaluation Results", - "tags": [ - "agent-evaluations" - ] - }, - "post": { - "description": "Record an evaluation result for a criteria.\n\nUse this endpoint to push results from external test harnesses, CI/CD\npipelines, or custom evaluation logic. Each result is linked to an\nagent run and optionally a specific step run.", - "operationId": "create_evaluation_result_api_agents_evaluation_criteria__criteria_id__results_post", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateEvaluationResultRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Evaluation Result", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}/summary": { - "get": { - "description": "Get an aggregated summary of evaluation results for a criteria.\n\nReturns total, passed, failed, error, and flagged counts alongside the\naverage score, giving a quick overview of how the criteria is performing.", - "operationId": "get_evaluation_summary_api_agents_evaluation_criteria__criteria_id__summary_get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Evaluation Summary", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-results/non-manual-summary": { - "get": { - "description": "Get an evaluation summary for API key clients.\n\nReturns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag).\n\nThe ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset\n(opt in via the ``Seclai-Version`` header). Clients on the legacy baseline\nalways receive the account-wide rollup; ``agent_id`` is ignored for them so\nthe endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary\nis scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist).", - "operationId": "get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get", - "parameters": [ - { - "description": "Scope the summary to a single agent. Omit for account-wide.", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Scope the summary to a single agent. Omit for account-wide.", - "title": "Agent Id" - } - }, - { - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "maximum": 730, - "minimum": 1, - "title": "Days", - "type": "integer" - } - }, - { - "in": "query", - "name": "start_date", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Start Date" - } - }, - { - "in": "query", - "name": "end_date", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "End Date" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Non Manual Evaluation Summary", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/inbound-email-rejections": { - "get": { - "description": "List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, unknown alias, spam/virus, flood-shed) for this account's agents.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get", - "parameters": [ - { - "description": "Filter to a single agent's rejections", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to a single agent's rejections", - "title": "Agent Id" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/InboundEmailRejectionResponse" - }, - "title": "Response List Inbound Email Rejections Api Api Agents Inbound Email Rejections Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List discarded inbound emails", - "tags": [ - "agents" - ] - } - }, - "/agents/inbound-email-status": { - "get": { - "description": "Whether the account-wide overload circuit breaker has currently paused new inbound email (all inbound turned away until the queued backlog drains), plus the size of the QUEUED (over-quota parked) run backlog.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "get_inbound_email_status_api_api_agents_inbound_email_status_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InboundEmailStatusResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Account inbound-email overload status", - "tags": [ - "agents" - ] - } - }, - "/agents/inbound-email-status/cancel-queued": { - "post": { - "description": "Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run has consumed no quota, so this merely fails them. Returns the count cancelled.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CancelQueuedRunsResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Cancel all queued inbound-email runs", - "tags": [ - "agents" - ] - } - }, - "/agents/inbound-email-status/resume": { - "post": { - "description": "Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the breaker re-arms on the next evaluation \u2014 this is a one-shot override, not a permanent disable.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "resume_inbound_email_api_api_agents_inbound_email_status_resume_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResumeInboundResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Manually resume paused inbound email", - "tags": [ - "agents" - ] - } - }, - "/agents/preview-import": { - "post": { - "description": "Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) without creating or modifying any agent. On success returns a summary the client can show before commit (counts of steps, schedules, alert configs, evaluation criteria, governance policies). On failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can render line/column-anchored errors.\n\nCoverage: everything decidable from the payload itself \u2014 schema, step ids, nesting depth, text lengths, attachment references, prompt-tool declarations, step-graph cycles, racing step references, and `for_each` aggregation. Rules that depend on account state (email recipients, memory-bank types, cloud-drive connections, the agent's own trigger) can only run at save time, so `POST /agents` may still reject a payload this endpoint accepts.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. No DB writes.", - "operationId": "preview_import_agent_api_agents_preview_import_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentImportPreviewRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentImportPreviewResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" - } - } - }, - "description": "The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`)." - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Preview an agent_definition import", - "tags": [ - "agents" - ] - } - }, - "/agents/runs/search": { - "post": { - "description": "Search agent traces using semantic similarity.\n\nFinds step-run outputs that are most semantically similar to the query.\nResults include the matching text, agent/step metadata, and a similarity score.\n\nAgent traces are automatically indexed when runs complete. The first 7 days of storage are free; extended retention is billed.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Searches only within your account's traces.", - "operationId": "search_agent_runs_api_agents_runs_search_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentTraceSearchRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentTraceSearchResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Search agent traces", - "tags": [ - "agents" - ] - } - }, - "/agents/runs/{run_id}": { - "delete": { - "description": "Cancel an in-flight (`processing`) or queued (`queued`) agent run.\n\nA `queued` run is an inbound-email run parked by the per-plan rate quota that has not yet been dispatched; it has consumed no quota.\n\nIf the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only cancel runs belonging to your account.", - "operationId": "delete_agent_run_api_agents_runs__run_id__delete", - "parameters": [ - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "title": "Run Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Cancel an agent run", - "tags": [ - "agents" - ] - }, - "get": { - "description": "Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST /agents/{agent_id}/runs/stream`.\n\nThe response includes `status`, `error_count`, and `output` once the run completes. Use `include_step_outputs=true` to include per-step outputs, timing, durations, and credits.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access runs belonging to your account.", - "operationId": "get_agent_run_api_agents_runs__run_id__get", - "parameters": [ - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "title": "Run Id", - "type": "string" - } - }, - { - "description": "If true, include per-step outputs with timing, durations, and credits.", - "in": "query", - "name": "include_step_outputs", - "required": false, - "schema": { - "default": false, - "description": "If true, include per-step outputs with timing, durations, and credits.", - "title": "Include Step Outputs", - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get an agent run", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}": { - "delete": { - "description": "Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only delete agents belonging to your account.", - "operationId": "delete_agent_api_agents__agent_id__delete", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete an agent", - "tags": [ - "agents" - ] - }, - "get": { - "description": "Fetch an agent's metadata (name, description, trigger type, timestamps).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account.", - "operationId": "get_agent_metadata_api_agents__agent_id__get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get an agent", - "tags": [ - "agents" - ] - }, - "put": { - "description": "Update an agent's name, description, evaluation settings, and model lifecycle settings.\n\nEvaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, `sampling_config`.\n\nModel lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', 'governance_block', 'agent_run_failed').\n\nReplacing the workflow from an export:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only touches the workflow + agent metadata \u2014 alert_configs, evaluation_criteria, governance_policies, schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints for those, or `POST /agents` to import as a new agent).\n- `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same shape as `POST /agents`).\n\nAt least one field must be provided.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account.", - "operationId": "update_agent_api_agents__agent_id__put", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__UpdateAgentRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" - } - } - }, - "description": "The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`)." - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update agent metadata", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/conversations": { - "get": { - "description": "Fetch the AI assistant conversation history for a specific step of an agent.\n\nReturns past conversation turns (user inputs, AI responses, accept/decline status) ordered oldest first. Use `step_type` to filter by step type, and optionally `step_id` to narrow to a specific step instance.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be queried.", - "operationId": "get_ai_conversation_history_api_agents__agent_id__ai_assistant_conversations_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "description": "Step type to look up.", - "in": "query", - "name": "step_type", - "required": true, - "schema": { - "description": "Step type to look up.", - "title": "Step Type", - "type": "string" - } - }, - { - "description": "Step ID to filter by.", - "in": "query", - "name": "step_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step ID to filter by.", - "title": "Step Id" - } - }, - { - "description": "Max turns to return.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 10, - "description": "Max turns to return.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Number of recent turns to skip.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Number of recent turns to skip.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiConversationHistoryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get AI conversation history", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/generate-steps": { - "post": { - "description": "Use the AI assistant to generate a full agent step workflow from a natural language description.\n\nProvide a description of what the agent should do, along with optional context (current steps, trigger type). The AI produces a complete set of agent steps.\nUse mode 'generate_full' for new workflows or 'modify_workflow' to refine existing ones.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used.", - "operationId": "generate_agent_steps_api_agents__agent_id__ai_assistant_generate_steps_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateAgentStepsRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateAgentStepsResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate agent workflow", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/step-config": { - "post": { - "description": "Use the AI assistant to generate or refine a single step's configuration.\n\nProvide the step type, a natural language instruction, and optionally the current configuration. The AI will produce a proposed configuration along with an explanation. The suggestion is stored as a conversation turn that can be accepted or declined separately via the mark endpoint.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used.", - "operationId": "generate_step_config_api_agents__agent_id__ai_assistant_step_config_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateStepConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateStepConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate step configuration", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/{conversation_id}": { - "patch": { - "description": "Accept or decline a proposed AI assistant configuration for a conversation turn.\n\nThis only updates the tracking status on the conversation record. To actually apply the proposed configuration, use the agent definition update endpoint separately.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The conversation must belong to one of your agents.", - "operationId": "mark_ai_suggestion_api_agents__agent_id__ai_assistant__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MarkAiSuggestionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept or decline suggestion", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/attachment-references": { - "get": { - "description": "Return the static attachment-reference contract for an agent \u2014 what files the agent's definition expects on a run.\n\nCall this BEFORE staging uploads so you know whether the agent accepts files at all (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. Mismatched batches are rejected at run time with HTTP 400.", - "operationId": "api_get_agent_attachment_references_api_agents__agent_id__attachment_references_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentAttachmentRefsApiResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get agent attachment-reference contract", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/callers": { - "get": { - "description": "List the live agents that call this agent via a `call_agent` step. They must be disabled before this agent can be paused.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the agent must belong to the key's account.", - "operationId": "get_agent_callers_api_api_agents__agent_id__callers_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/AgentCallerApiResponse" - }, - "title": "Response Get Agent Callers Api Api Agents Agent Id Callers Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List agents that call this agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/definition": { - "get": { - "description": "Fetch the current agent definition from the main branch.\n\nThe response includes `change_id` which must be provided when updating the definition (optimistic locking).\n\nThe definition contains the agent's step workflow. Available step types:\n- `prompt_call`: Call an LLM with a prompt template\n- `retrieval`: Search a knowledge base\n- `regex_replace`: Reshape text via ordered regex find/replace rules\n- `gate`: Evaluate conditions, stop or continue child execution\n- `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1\u201310))\n- `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional `evaluation_tier`, optional `expectation_config`)\n- `extract_data`: Progressively read and analyze large input\n- `extract_content`: Extract structured data (JSON, HTML, XML)\n- `add_chat_turn` / `load_chat_history`: Record a turn or load running history from a conversation memory bank\n- `add_memory` / `search_memory` / `load_memory`: Write, semantic-search, or load entries on a general memory bank\n- `send_email`: Send email with step output\n- `webhook_call`: POST data to an external URL\n- `write_aws_s3_object`: Write output to S3\n- `call_agent`: Invoke another agent\n- `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents only. Fields: `metadata_key`, `content`)\n- `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, `indexed`)\n- `load_content_attachment`: Load a previously written attachment (content-triggered agents only. Fields: `attachment_key`)\n- `load_content`: Load the full text body of a source document (typically used with content-triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` optional)\n- `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of `prompt_call`; requires `dynamic_input` or `template_input` trigger; `priority: true` enables real-time streaming). To stream **and** return a schema-validated payload, add a sibling branch `extract_content` (`expected_format: \"json\"` + `json_schema`) \u2192 `display_result` under the same `prompt_call` \u2014 a `display_result` takes precedence over the stream regardless of which finishes first, so its validated output becomes the run's result while the tokens act as a progress channel\n- `display_result`: Show output to the user\n- `join`: Merge parallel branches\n- `merge`: Combine multiple inputs into a single templated output\n- `text`: Static text literal\n- `for_each`: Iterate a body over a list of items (body lives in `body[]`)\n- `if_else`: Conditional dispatch. Evaluates `conditions` (same shape as `gate`) and runs `then_steps` on match, otherwise the optional `else_steps`. The chosen branch's output flows to the if_else step's own `child_steps` (post-branch continuation chain). **`display_result` and `streaming_result` are not allowed inside `then_steps` / `else_steps`** \u2014 end each branch with a content-producing step (e.g. `text`, `prompt_call`) and place the single `display_result` in `child_steps`.\n- `switch`: Single-discriminator dispatch. Renders `discriminator` (default `{{input}}`) and routes to the first matching `cases[]` entry (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when nothing matches. The chosen case's output flows to the switch step's own `child_steps`. **`display_result` and `streaming_result` are not allowed inside `cases[].steps` or `else_steps`** \u2014 end each case with a content-producing step and place the single `display_result` in `child_steps`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account.", - "operationId": "get_agent_definition_api_agents__agent_id__definition_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get agent definition", - "tags": [ - "agents" - ] - }, - "put": { - "description": "Update the agent's definition on the main branch.\n\nUses **optimistic locking**: provide `expected_change_id` from the last `GET /agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your last read.\n\nThe definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, `regex_replace`, `gate`, `retry`, `evaluate_step`, `extract_data`, `extract_content`, `add_chat_turn`, `load_chat_history`, `add_memory`, `search_memory`, `load_memory`, `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, `display_result`, `join`, `merge`, `text`, `for_each`, `if_else`, and `switch`. Non-composite step types (`display_result`, `join`, `retry`, `streaming_result`) cannot contain child steps.\n\n**Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with `target_step_id` (ancestor step ID) and `max_retries` (1\u201310). Best practice: place a `gate` step before the retry to make retries conditional.\n\n**if_else** runs `then_steps` when its `conditions` (same shape as `gate`) match, otherwise its optional `else_steps`. Either branch's output flows to the if_else step's own `child_steps` (the post-branch continuation chain).\n\n**switch** dispatches on a `discriminator` template (default `{{input}}`) to the first matching case (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when no case matches. Cases own their own `steps` subtrees; the chosen branch's output flows to the switch step's own `child_steps`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account.", - "operationId": "update_agent_definition_api_agents__agent_id__definition_put", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateAgentDefinitionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update agent definition", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/disable": { - "post": { - "description": "Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is turned away, scheduled/content triggers are skipped).\n\nReturns **409** with the blocking callers when other live agents still call this one via a `call_agent` step \u2014 disable those first.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user is recorded); the agent must belong to the key's account.", - "operationId": "disable_agent_api_api_agents__agent_id__disable_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Pause (disable) an agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/enable": { - "post": { - "description": "Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by the inbound-email overload safeguard).\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user is recorded); the agent must belong to the key's account.", - "operationId": "enable_agent_api_api_agents__agent_id__enable_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Resume (enable) a paused agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/evaluation-criteria": { - "get": { - "description": "List evaluation criteria configured for an agent.\n\nResponse shape is version-gated by the ``Seclai-Version`` header:\n\n- **Default / legacy** (no header, or a date before ``2026-07-27``): a bare\n JSON array of criteria (unpaginated \u2014 every criterion for the agent).\n- **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated\n envelope ``{data, pagination: {page, limit, total, pages, has_next,\n has_prev}}``.\n\nEach criterion carries its type, configuration, and a summary of results\n(pass / fail counts). Criteria can be filtered client-side by type or\nenabled status.", - "operationId": "list_evaluation_criteria_api_agents__agent_id__evaluation_criteria_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - }, - "title": "Response List Evaluation Criteria Api Agents Agent Id Evaluation Criteria Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - }, - "post": { - "description": "Create new step evaluation settings for an agent.\n\nThe evaluation mode, retry settings, and sample frequency are inherited\nfrom the agent and stored on the criteria row for historical reference.", - "operationId": "create_evaluation_criteria_api_agents__agent_id__evaluation_criteria_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateEvaluationCriteriaRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/evaluation-criteria/test-draft": { - "post": { - "description": "Run an ephemeral evaluation against provided step output without persisting results.\n\nUse this to interactively test evaluation prompts and expectation\nconfigurations while editing criteria. The evaluation is a billed LLM\ncall; only its result goes unrecorded.", - "operationId": "test_draft_evaluation_api_agents__agent_id__evaluation_criteria_test_draft_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestDraftEvaluationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestDraftEvaluationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Test Draft Evaluation", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/evaluation-results": { - "get": { - "description": "List evaluation results across all criteria configured on an agent.\n\nReturns a paginated list of evaluation results with optional filtering by status, criteria, and date range. Results include score, pass/fail status, and details.", - "operationId": "list_agent_evaluation_results_api_agents__agent_id__evaluation_results_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status" - } - }, - { - "in": "query", - "name": "step", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step" - } - }, - { - "in": "query", - "name": "flagged_only", - "required": false, - "schema": { - "default": false, - "title": "Flagged Only", - "type": "boolean" - } - }, - { - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time From" - } - }, - { - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time To" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Agent Evaluation Results", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/evaluation-runs": { - "get": { - "description": "List evaluation results grouped by agent run.\n\nReturns paginated per-run summaries with pass/fail counts and optional\nfiltering by evaluation outcome, step, or date range.", - "operationId": "list_evaluation_runs_api_agents__agent_id__evaluation_runs_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status" - } - }, - { - "in": "query", - "name": "step", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step" - } - }, - { - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time From" - } - }, - { - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time To" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationRunSummaryListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Evaluation Runs", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/export": { - "get": { - "description": "Export an agent definition as a portable JSON snapshot.\n\nThe response contains the full definition, trigger configuration with schedules, alert configs, evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps every referenced external entity UUID to its human-readable name.\n\nResponse shape:\n- `export_version`: schema version (currently `\"5\"`)\n- `exported_at`: ISO-8601 timestamp\n- `agent`: name, description, schema_version, definition, timestamps\n- `trigger`: trigger type, input template, schedules\n- `alert_configs`: alert type, thresholds, recipients\n- `evaluation_criteria`: evaluation settings per step\n- `governance_policies`: agent-scoped governance policies\n- `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users\n\nQuery params:\n- `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the response as a file download.\n\nAuth & scoping:\n- Requires `X-API-Key`. You can only export agents belonging to your account.", - "operationId": "export_agent_api_agents__agent_id__export_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "description": "Return as file download", - "in": "query", - "name": "download", - "required": false, - "schema": { - "default": true, - "description": "Return as file download", - "title": "Download", - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Export agent definition", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/input-uploads/{upload_id}": { - "get": { - "description": "Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`.\n\nPossible `status` values: `processing`, `ready`, `failed`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "api_get_agent_input_upload_status_api_agents__agent_id__input_uploads__upload_id__get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "upload_id", - "required": true, - "schema": { - "title": "Upload Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UploadAgentInputApiResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get upload status", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/runs": { - "get": { - "description": "List runs for a specific agent (most recent first), with pagination.\n\nTypical use cases:\n- Build a traces UI for an agent.\n- Debug recent executions and inspect terminal statuses.\n\nNotes:\n- This endpoint returns a summary list. Fetch full details with `GET /agents/runs/{run_id}`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only list runs for agents in your account.", - "operationId": "list_agent_runs_api_agents__agent_id__runs_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Filter runs by status", - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus" - }, - { - "type": "null" - } - ], - "description": "Filter runs by status", - "title": "Status" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentRunListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List agent runs", - "tags": [ - "agents" - ] - }, - "post": { - "description": "Start an agent run.\n\nAn *agent* is an automated workflow that can monitor content from your sources, process it with AI, and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve status and output.\n\nWhen to use:\n- Use this endpoint for request/response style integrations where polling is acceptable.\n- Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE.\n\nKey fields:\n- `input`: text input for agents with a `dynamic_input` trigger.\n- `input_upload_id` / `input_upload_ids`: reference one or more files previously uploaded via `POST /agents/{agent_id}/upload-input`. Send them **with** `input` to pair prompt text with the files (the text leads, each file's extracted text follows); only the two upload fields are mutually exclusive with each other.\n- `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but without live token streaming.\n- `metadata`: a JSON object that becomes available to agent steps for string substitution.\n\nAfter starting:\n- Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`.\n- Use `include_step_outputs=true` to include per-step outputs, timing, and credits.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "run_agent_api_agents__agent_id__runs_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InsufficientCreditsResponse" - } - } - }, - "description": "Insufficient credits \u2014 the account has exhausted its credits." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Run an agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/runs/stream": { - "post": { - "description": "Start a **priority** agent run and stream run events using Server-Sent Events (SSE).\n\nThis is the best option for interactive UIs where you want progress updates as the run executes.\n\nHow it works:\n- The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`.\n- Subsequent events are forwarded from the run event stream (status changes, step events, etc).\n- If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion.\n- The final `done` event contains the terminal snapshot (including `output` and `credits` when available).\n\nInput options (for `dynamic_input` triggers):\n- `input`: text input passed directly.\n- `input_upload_id` / `input_upload_ids`: reference one or more files uploaded via `POST /agents/{agent_id}/upload-input`. Combine either with `input` to send prompt text alongside the files; only the two upload fields are mutually exclusive with each other.\n\nClient guidance:\n- Keep the connection open and handle keepalive comments.\n- On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET /agents/runs/{run_id}`.\n- `stream_token` events carry the model's raw output. When the agent pairs `streaming_result` with a sibling `extract_content`/`display_result` branch, that branch's `display_result` takes precedence over the stream, so the `done` snapshot's `output` is the validated payload and the tokens are a progress channel \u2014 render tokens live, but read the result from `done`. Check `done.status` first: the streamed text is already the run's output when the stream ends, so a run that FAILED its validation step still carries that raw text in `output`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "run_streaming_agent_api_agents__agent_id__runs_stream_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunStreamRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": {} - }, - "text/event-stream": { - "example": ": keepalive\n\nevent: init\ndata: {\"run_id\":\"...\",\"status\":\"pending\",\"error_count\":0,\"credits\":0.0,\"priority\":true,\"input\":\"...\",\"output\":null,\"attempts\":[]}\n\nevent: done\ndata: {\"run_id\":\"...\",\"status\":\"completed\",\"error_count\":0,\"credits\":0.0,\"priority\":true,\"input\":\"...\",\"output\":\"...\",\"attempts\":[]}\n\n", - "schema": { - "type": "string" - } - } - }, - "description": "Streams agent run events via Server-Sent Events (SSE); run is always created as priority.\n\nSSE events:\n- `event: init` \u2014 `data` is an `AgentRunResponse` snapshot (includes `run_id`).\n- `event: done` \u2014 `data` is the final `AgentRunResponse` snapshot (includes `output`, `credits`, etc).\n- Other events (e.g. `status`, step events) are forwarded from the run event stream.\n- On `timeout` / `error`, the payload includes `run_id` so clients can fetch status via `GET /agents/runs/{run_id}`." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InsufficientCreditsResponse" - } - } - }, - "description": "Insufficient credits \u2014 the account has exhausted its credits." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Run an agent (stream events)", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/runs/{run_id}/evaluation-results": { - "get": { - "description": "List evaluation results recorded for a specific agent run.\n\nResponse shape is version-gated by the ``Seclai-Version`` header:\n\n- **Default / legacy** (no header, or a date before ``2026-07-27``): a bare\n JSON array of results (unpaginated \u2014 every result for the run).\n- **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated\n envelope ``{data, pagination: {page, limit, total, pages, has_next,\n has_prev}}``.\n\nResults span all evaluation criteria for the given run, useful for getting a\ncomplete quality snapshot of a single execution.", - "operationId": "list_run_evaluation_results_api_agents__agent_id__runs__run_id__evaluation_results_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "title": "Run Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaResponse" - }, - "title": "Response List Run Evaluation Results Api Agents Agent Id Runs Run Id Evaluation Results Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Run Evaluation Results", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/triggers/{trigger_id}/email-config": { - "put": { - "description": "Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its computed email address(es). Omitted fields are left unchanged.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account.", - "operationId": "set_email_trigger_config_api_api_agents__agent_id__triggers__trigger_id__email_config_put", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "trigger_id", - "required": true, - "schema": { - "title": "Trigger Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__SetEmailTriggerConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailTriggerConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Configure an EMAIL_RECEIVED trigger", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/upload-input": { - "post": { - "description": "Upload a file to use as input for a `dynamic_input` agent run.\n\nSupports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. Text and document files are processed synchronously; audio/video are submitted for asynchronous transcription.\n\n**Size limit:** 200 MB per file.\n\n**Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi.\n\nAfter uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, then pass `input_upload_id` to `POST /agents/{agent_id}/runs`.\n\n**Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi-modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) read them directly; the agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention (the agent-traces source's retention period; free default 7 days).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "api_upload_agent_input_api_agents__agent_id__upload_input_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UploadAgentInputApiResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Upload file input", - "tags": [ - "agents" - ] - } - }, - "/ai-assistant/feedback": { - "post": { - "description": "Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is analyzed for concerning issues.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_feedback_api_ai_assistant_feedback_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__ai_assistant__AiAssistantFeedbackRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantFeedbackResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Submit AI assistant feedback", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/knowledge-base": { - "post": { - "description": "Generate a knowledge base creation/modification plan without requiring an existing solution. May also propose prerequisite source creation actions.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_knowledge_base_api_ai_assistant_knowledge_base_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a knowledge base plan (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/memory-bank": { - "post": { - "description": "Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_memory_bank_api_ai_assistant_memory_bank_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAiAssistantRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankAiAssistantResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a memory bank configuration (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/memory-bank/last-conversation": { - "get": { - "description": "Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. Returns turns in oldest-first order with a total count for pagination via limit/offset query parameters.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get", - "parameters": [ - { - "description": "Max turns.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 5, - "description": "Max turns.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Skip count.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Skip count.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankLastConversationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Fetch memory bank AI conversation history", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/memory-bank/{conversation_id}": { - "patch": { - "description": "Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_memory_bank_accept_api_ai_assistant_memory_bank__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept or decline a memory bank AI suggestion", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/solution": { - "post": { - "description": "Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an existing solution. Supports SSE streaming when ``Accept: text/event-stream`` is set.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_solution_api_ai_assistant_solution_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a solution plan (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/source": { - "post": { - "description": "Generate a content source creation/modification plan without requiring an existing solution. The AI proposes actions for the user to review before any changes are made.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_source_api_ai_assistant_source_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a source plan (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/{conversation_id}/accept": { - "post": { - "description": "Accept and execute a previously proposed standalone plan. If the plan contains destructive actions (deletions), ``confirm_deletions`` must be set to true.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_accept_api_ai_assistant__conversation_id__accept_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantAcceptResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept and execute a standalone plan", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/{conversation_id}/decline": { - "post": { - "description": "Decline a previously proposed standalone plan. No resources are modified. The conversation is marked as declined.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_decline_api_ai_assistant__conversation_id__decline_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Decline a standalone plan", - "tags": [ - "ai-assistant" - ] - } - }, - "/alerts": { - "get": { - "description": "List alerts for the account with optional filters.\n\nFilters:\n- `status`: triggered, acknowledged, resolved, dismissed\n- `agent_id`: filter by agent\n- `source_connection_id`: filter by source\n- `time_from` / `time_to`: ISO 8601 date range\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.", - "operationId": "list_alerts_api_alerts_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Filter by alert status", - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by alert status", - "title": "Status" - } - }, - { - "description": "Filter by agent ID", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by agent ID", - "title": "Agent Id" - } - }, - { - "description": "Filter by source connection ID", - "in": "query", - "name": "source_connection_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by source connection ID", - "title": "Source Connection Id" - } - }, - { - "description": "From (ISO 8601)", - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "From (ISO 8601)", - "title": "Time From" - } - }, - { - "description": "To (ISO 8601)", - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "To (ISO 8601)", - "title": "Time To" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List alerts", - "tags": [ - "alerts" - ] - } - }, - "/alerts/configs": { - "get": { - "description": "List alert configurations.\n\nFilters:\n- `agent_id`: list configs for a specific agent\n- `source_connection_id`: list configs for a specific source\n- Neither: list account-level agent alert configs\n- `scope=source`: list account-level source alert configs\n\nCredits alerts (`credits_low_threshold`, `credits_runout_prediction`, `credits_usage_spike`) are account-level alert configs. They are evaluated by the credits alert sweep and default-enabled configs may be auto-created for active accounts at runtime.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "list_alert_configs_api_alerts_configs_get", - "parameters": [ - { - "description": "Filter by agent ID", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by agent ID", - "title": "Agent Id" - } - }, - { - "description": "Filter by source connection ID", - "in": "query", - "name": "source_connection_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by source connection ID", - "title": "Source Connection Id" - } - }, - { - "description": "Set to 'source' to list account-level source alert configs", - "in": "query", - "name": "scope", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Set to 'source' to list account-level source alert configs", - "title": "Scope" - } - }, - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List alert configs", - "tags": [ - "alerts" - ] - }, - "post": { - "description": "Create a new alert configuration.\n\nAgent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, model_deprecated, model_sunset.\nSource alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike.\n\nDistribution types: owner, owner_admins, selected_members. Organization accounts are normalized to owner_admins.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "create_alert_config_api_alerts_configs_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateAlertConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create alert config", - "tags": [ - "alerts" - ] - } - }, - "/alerts/configs/{config_id}": { - "delete": { - "description": "Delete an alert configuration. This permanently removes the config and stops any future alerts of this type from being triggered.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "delete_alert_config_api_alerts_configs__config_id__delete", - "parameters": [ - { - "in": "path", - "name": "config_id", - "required": true, - "schema": { - "title": "Config Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete alert config", - "tags": [ - "alerts" - ] - }, - "get": { - "description": "Get a specific alert configuration by ID.\n\nReturns all fields including type, enabled state, threshold, cooldown, distribution type, and recipient list.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_alert_config_api_alerts_configs__config_id__get", - "parameters": [ - { - "in": "path", - "name": "config_id", - "required": true, - "schema": { - "title": "Config Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get alert config", - "tags": [ - "alerts" - ] - }, - "patch": { - "description": "Update an alert configuration. Only provided fields are updated.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "update_alert_config_api_alerts_configs__config_id__patch", - "parameters": [ - { - "in": "path", - "name": "config_id", - "required": true, - "schema": { - "title": "Config Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateAlertConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update alert config", - "tags": [ - "alerts" - ] - } - }, - "/alerts/organization-preferences/list": { - "get": { - "description": "List per-organization alert delivery preferences for the authenticated user.\n\nBy default, only explicit override rows are returned. Set `include_defaults=true` to return the effective subscribed state for every alert type in every organization the user can manage.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- Only organizations where the user is an owner or administrator are included.", - "operationId": "list_organization_preferences_api_alerts_organization_preferences_list_get", - "parameters": [ - { - "description": "Optional organization filter", - "in": "query", - "name": "organization_id", - "required": false, - "schema": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional organization filter", - "title": "Organization Id" - } - }, - { - "description": "Include default subscribed entries for all alert types", - "in": "query", - "name": "include_defaults", - "required": false, - "schema": { - "default": false, - "description": "Include default subscribed entries for all alert types", - "title": "Include Defaults", - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OrganizationAlertPreferenceListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List organization alert delivery preferences", - "tags": [ - "alerts" - ] - } - }, - "/alerts/organization-preferences/{organization_id}/{alert_type}": { - "patch": { - "description": "Update the authenticated user's personal delivery preference for one alert type in one organization.\n\nSetting `subscribed=false` stores an explicit opt-out override. Setting `subscribed=true` removes the override and restores the default subscribed behavior.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- Only owners and administrators can update preferences for an organization.", - "operationId": "update_organization_preference_api_alerts_organization_preferences__organization_id___alert_type__patch", - "parameters": [ - { - "in": "path", - "name": "organization_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Organization Id", - "type": "string" - } - }, - { - "in": "path", - "name": "alert_type", - "required": true, - "schema": { - "title": "Alert Type", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__UpdateOrganizationAlertPreferenceRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__OrganizationAlertPreferenceResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update organization alert delivery preference", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}": { - "get": { - "description": "Get full alert detail including history, comments, and subscribers.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_alert_detail_api_alerts__alert_id__get", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get alert detail", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/comments": { - "post": { - "description": "Add a comment to an alert. Comments are visible to all subscribers and are included in the alert detail response.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "add_alert_comment_api_alerts__alert_id__comments_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AddCommentRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Add alert comment", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/status": { - "post": { - "description": "Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "change_alert_status_api_alerts__alert_id__status_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChangeStatusRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Change alert status", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/subscribe": { - "post": { - "description": "Subscribe the current user to an alert. Subscribed users receive email notifications when the alert status changes or new comments are added, for as long as they remain an owner or administrator of the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "subscribe_to_alert_api_alerts__alert_id__subscribe_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Subscribe to alert", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/unsubscribe": { - "post": { - "description": "Unsubscribe the current user from an alert. The user will no longer receive email notifications for status changes or new comments on this alert.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "unsubscribe_from_alert_api_alerts__alert_id__unsubscribe_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Unsubscribe from alert", - "tags": [ - "alerts" - ] - } - }, - "/cloud-drives": { - "get": { - "description": "List the account's cloud-drive connections. Use a connection's `id` as `cloud_drive_connection_id` when creating a `cloud_drive` content source or binding a file-change agent trigger. `realtime_updates` reports whether changes arrive within seconds or on the scheduled backstop sweep.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "list_cloud_drives_api_api_cloud_drives_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/CloudDriveResponseModel" - }, - "title": "Response List Cloud Drives Api Api Cloud Drives Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List the account's cloud-drive connections", - "tags": [ - "cloud_drives" - ] - } - }, - "/cloud-drives/providers": { - "get": { - "description": "List the cloud-drive providers whose OAuth app is configured on this deployment (e.g. Dropbox, Google Drive), with the permissions each requests. A provider missing from this list cannot be connected here.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "list_cloud_drive_providers_api_api_cloud_drives_providers_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/CloudDriveProviderResponseModel" - }, - "title": "Response List Cloud Drive Providers Api Api Cloud Drives Providers Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List configured cloud-drive providers", - "tags": [ - "cloud_drives" - ] - } - }, - "/cloud-drives/{connection_id}": { - "delete": { - "description": "Soft-delete a connection and clear its tokens. Refused with **409** while anything still depends on it \u2014 a live agent trigger, or a `cloud_drive` content source ingesting into a knowledge base. `GET /{connection_id}/agents` shows which agents reference it, but does NOT list content sources, so treat the 409 as the authoritative check rather than a clean /agents response.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "delete_cloud_drive_api_api_cloud_drives__connection_id__delete", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete a cloud-drive connection", - "tags": [ - "cloud_drives" - ] - }, - "get": { - "description": "Fetch a single cloud-drive connection by id.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "get_cloud_drive_api_api_cloud_drives__connection_id__get", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CloudDriveResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get a cloud-drive connection", - "tags": [ - "cloud_drives" - ] - }, - "patch": { - "description": "Rename a connection and/or change the folder it watches. Changing the folder resets the sync cursor, so existing files in the new folder are not replayed as triggers.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "update_cloud_drive_api_api_cloud_drives__connection_id__patch", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CloudDriveUpdateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CloudDriveResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update a cloud-drive connection", - "tags": [ - "cloud_drives" - ] - } - }, - "/cloud-drives/{connection_id}/agents": { - "get": { - "description": "Agents that reference this connection \u2014 via a cloud-drive step, a `prompt_call` cloud-drive tool, or a file-change trigger. Check this before disconnecting or deleting a connection.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "get_agents_using_cloud_drive_api_api_cloud_drives__connection_id__agents_get", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/AgentUsingCloudDriveResponseModel" - }, - "title": "Response Get Agents Using Cloud Drive Api Api Cloud Drives Connection Id Agents Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List agents using a cloud-drive connection", - "tags": [ - "cloud_drives" - ] - } - }, - "/cloud-drives/{connection_id}/disconnect": { - "post": { - "description": "Revoke and clear the stored tokens and stop change notifications, keeping the connection row so it can be reconnected from the app. Agents bound to it stop firing until it is reconnected.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "disconnect_cloud_drive_api_api_cloud_drives__connection_id__disconnect_post", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CloudDriveResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Disconnect a cloud-drive connection", - "tags": [ - "cloud_drives" - ] - } - }, - "/cloud-drives/{connection_id}/rejections": { - "get": { - "description": "Recent files the connection deliberately skipped, newest first, with the reason: `too_large` (above the size cap), `download_failed` (the provider would not serve the bytes), or `flood` (the per-sync or per-account run cap was hit, so remaining changes were dropped).\n\nThis is the answer to \"why didn't my agent run for that file?\" \u2014 a skipped file fires no trigger and appears nowhere else.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "list_cloud_drive_rejections_api_api_cloud_drives__connection_id__rejections_get", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/CloudDriveRejectionResponseModel" - }, - "title": "Response List Cloud Drive Rejections Api Api Cloud Drives Connection Id Rejections Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List files this connection did not process", - "tags": [ - "cloud_drives" - ] - } - }, - "/contents/{source_connection_content_version}": { - "delete": { - "description": "Delete a content item (a `SourceConnectionContentVersion`).\n\nUse this to remove an uploaded or indexed item from your account. Deleting content can affect agents and knowledge base workflows that reference this item.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account.\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.", - "operationId": "delete_content_api_contents__source_connection_content_version__delete", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "403": { - "description": "The key's user is a member of the account but not an owner or administrator (`error.code` is `permission_denied`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete content", - "tags": [ - "contents" - ] - }, - "get": { - "description": "Get detailed information about a specific content item (a `SourceConnectionContentVersion`).\n\nThis is useful when you want to:\n- Inspect the extracted text for debugging or review.\n- Display content details in a UI.\n\nText range:\n- `start` and `end` control the character range returned in `text_content` so clients can page through large documents.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account.", - "operationId": "get_content_detail_api_contents__source_connection_content_version__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "in": "query", - "name": "start", - "required": false, - "schema": { - "default": 0, - "title": "Start", - "type": "integer" - } - }, - { - "in": "query", - "name": "end", - "required": false, - "schema": { - "default": 5000, - "title": "End", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__ContentDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get content details", - "tags": [ - "contents" - ] - }, - "put": { - "description": "Replace a content version using a small inline text payload.\n\n**Maximum payload size:** 8192 bytes (UTF-8).\n\n**Supported content types:**\n- `application/json`\n- `application/xml`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.\n- The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version.", - "operationId": "replace_content_with_inline_text_api_contents__source_connection_content_version__put", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InlineTextReplaceRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Replace a content version with inline text", - "tags": [ - "contents" - ] - } - }, - "/contents/{source_connection_content_version}/embeddings": { - "get": { - "description": "List the embeddings (chunk vectors) for a content item, with pagination.\n\nEmbeddings are used for semantic search and retrieval in knowledge base workflows. This endpoint is primarily useful for debugging chunking, indexing, and vector contents.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access embeddings for content belonging to your account.", - "operationId": "list_content_embeddings_api_contents__source_connection_content_version__embeddings_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__ContentEmbeddingsListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List content embeddings", - "tags": [ - "contents" - ] - } - }, - "/contents/{source_connection_content_version}/upload": { - "post": { - "description": "Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`.\n\nThis behaves like a source file upload, but it targets an existing content version ID. This is useful when you want to correct or update an uploaded document while keeping references stable.\n\n**Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored).\n\n**Supported MIME types:**\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/xml`\n- `application/zip`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/wav`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/svg+xml`\n- `image/tiff`\n- `image/webp`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n- `video/mp4`\n- `video/quicktime`\n- `video/x-msvideo`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version.\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your account.", - "operationId": "upload_file_to_content_api_contents__source_connection_content_version__upload_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Replace a content version with a new upload", - "tags": [ - "contents" - ] - } - }, - "/docs-search": { - "get": { - "description": "Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page titles and summaries (fast, no AI cost); `mode=semantic` matches page body content by meaning (uses an embedding). Each result carries a `doc_slug` and an optional section `anchor` for building a `https://seclai.com/docs/[#]` link, a `score` (relevance; not comparable across modes), and \u2014 in semantic mode \u2014 a `highlight` (best matching verbatim sentence; `null` for keyword). Documentation is global, so results are not account-scoped.", - "operationId": "docs_search_api_docs_search_get", - "parameters": [ - { - "description": "Search query", - "in": "query", - "name": "q", - "required": true, - "schema": { - "description": "Search query", - "maxLength": 200, - "minLength": 1, - "title": "Q", - "type": "string" - } - }, - { - "description": "Search strategy", - "in": "query", - "name": "mode", - "required": false, - "schema": { - "default": "keyword", - "description": "Search strategy", - "enum": [ - "keyword", - "semantic" - ], - "title": "Mode", - "type": "string" - } - }, - { - "description": "Maximum results", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 8, - "description": "Maximum results", - "maximum": 20, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__docs_search__DocsSearchResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Search documentation", - "tags": [ - "search" - ] - } - }, - "/email-domains": { - "get": { - "description": "List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email domains with their verification status, the DNS records the customer must publish, and the plan capabilities (`can_add_vanity`/`can_add_custom`) plus whether one of each kind already exists (`has_vanity`/`has_custom` \u2014 the per-kind limit is 1).\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "list_email_domains_api_api_email_domains_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainsListResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List the account's email domains + plan capabilities", - "tags": [ - "email-domains" - ] - }, - "post": { - "description": "Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, `value=agent.mycompany.com`; optional `delegated=true` to let Seclai manage a dedicated Route53 zone). Stands up the SES identity + DNS and returns the records the customer must publish. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "add_email_domain_api_api_email_domains_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddEmailDomainRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Add + provision an email domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/use-shared-domain": { - "post": { - "description": "Clear the account's primary domain so agent email reverts to the shared `agent.seclai.com` sending domain, WITHOUT removing the configured domain(s) \u2014 they stay verified and can be promoted again later. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "use_shared_domain_api_api_email_domains_use_shared_domain_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Revert to the shared agent.seclai.com sending domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}": { - "delete": { - "description": "Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a `cleanup_note` when the removed domain was Seclai-managed (delegated), reminding the caller to delete the registrar NS delegation record (dangling-delegation / subdomain-takeover guard). Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "remove_email_domain_api_api_email_domains__domain_id__delete", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RemoveEmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Remove an email domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/dmarc": { - "get": { - "description": "Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the DMARC `rua` aggregate reports over the last `days` (clamped by the service). Populated for domains whose DNS zone Seclai controls (vanity + delegated custom); a self-managed custom domain keeps its own DMARC reporting and returns an all-zero summary.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "get_dmarc_summary_api_api_email_domains__domain_id__dmarc_get", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "title": "Days", - "type": "integer" - } - }, - { - "in": "query", - "name": "top_sources", - "required": false, - "schema": { - "default": 10, - "title": "Top Sources", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DmarcSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "DMARC aggregate-report summary for a domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/primary": { - "post": { - "description": "Promote a verified domain to the account's primary domain \u2014 agent email then sends FROM this domain and shows its addresses on it (`@`, `@`) instead of the shared `agent.seclai.com`; addresses keep resolving on the account's other verified domains and the shared form. The domain must be verified. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "set_primary_email_domain_api_api_email_domains__domain_id__primary_post", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Make a verified domain the account's primary sending domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/test-email": { - "post": { - "description": "Send a test message FROM the verified domain (`noreply@`) TO the account owner's email, to confirm end-to-end that the domain actually sends (SES verified, DKIM/SPF aligned). Never sends to any other address, so it can't be used as an open relay. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "send_test_email_api_api_email_domains__domain_id__test_email_post", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SendTestEmailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Send a test email from a verified domain to the account owner", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/verify": { - "post": { - "description": "Re-poll SES + DNS for this domain right now instead of waiting for the background verification sweep, and return its updated status + DNS-record check results. Useful right after publishing the required records. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "verify_email_domain_api_api_email_domains__domain_id__verify_post", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Run a verification check immediately ('Check now')", - "tags": [ - "email-domains" - ] - } - }, - "/governance/ai-assistant": { - "post": { - "description": "Send a natural-language request to the governance AI assistant to generate a plan of policy changes. Returns a conversation with proposed actions that can be accepted or declined.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "governance_ai_generate_api_governance_ai_assistant_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__governance__GovernanceAiAssistantRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GovernanceAiAssistantResponse" - } - } - }, - "description": "Successful Response" - }, - "400": { - "description": "AI assistant error." - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a governance plan", - "tags": [ - "governance" - ] - } - }, - "/governance/ai-assistant/conversations": { - "get": { - "description": "Return recent governance AI assistant conversations for the account, ordered by most recent first.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "list_governance_ai_conversations_api_governance_ai_assistant_conversations_get", - "parameters": [ - { - "description": "Number of conversations.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Number of conversations.", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/routers__api__governance__GovernanceConversationResponse" - }, - "title": "Response List Governance Ai Conversations Api Governance Ai Assistant Conversations Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List AI assistant conversations", - "tags": [ - "governance" - ] - } - }, - "/governance/ai-assistant/{conversation_id}/accept": { - "post": { - "description": "Execute the proposed policy changes from a governance AI assistant conversation. Each action is applied in order and results are returned.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "governance_ai_accept_api_governance_ai_assistant__conversation_id__accept_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GovernanceAiAcceptResponse" - } - } - }, - "description": "Successful Response" - }, - "400": { - "description": "Plan already accepted/declined or AI error." - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept a governance plan", - "tags": [ - "governance" - ] - } - }, - "/governance/ai-assistant/{conversation_id}/decline": { - "post": { - "description": "Reject a previously proposed governance AI assistant plan without applying any changes. The conversation is marked as declined and no policy modifications are made.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "governance_ai_decline_api_governance_ai_assistant__conversation_id__decline_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "400": { - "description": "Plan already accepted/declined or AI error." - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Decline a governance plan", - "tags": [ - "governance" - ] - } - }, - "/knowledge_bases": { - "get": { - "description": "List knowledge bases for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "list_knowledge_bases_api_knowledge_bases_get", - "parameters": [ - { - "description": "Page number (1-based).", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number (1-based).", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page.", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field. One of: created_at, updated_at, name.", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field. One of: created_at, updated_at, name.", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort direction: asc or desc.", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort direction: asc or desc.", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseListResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Knowledge Bases", - "tags": [ - "knowledge_bases" - ] - }, - "post": { - "description": "Create a new knowledge base.\n\nAt least one `source_id` is required. The source connections must belong to the same account.", - "operationId": "create_knowledge_base_api_knowledge_bases_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateKnowledgeBaseBody" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "Insufficient credits or no active subscription \u2014 the account has exhausted its credits or does not have a valid subscription." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Knowledge Base", - "tags": [ - "knowledge_bases" - ] - } - }, - "/knowledge_bases/{knowledge_base_id}": { - "delete": { - "description": "Soft-delete a knowledge base. This action cannot be undone.\n\nFails if the knowledge base is referenced by any agent definitions. Remove the knowledge base from agents first.", - "operationId": "delete_knowledge_base_api_knowledge_bases__knowledge_base_id__delete", - "parameters": [ - { - "in": "path", - "name": "knowledge_base_id", - "required": true, - "schema": { - "title": "Knowledge Base Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Knowledge Base", - "tags": [ - "knowledge_bases" - ] - }, - "get": { - "description": "Fetch a knowledge base by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access knowledge bases belonging to your account.", - "operationId": "get_knowledge_base_api_knowledge_bases__knowledge_base_id__get", - "parameters": [ - { - "in": "path", - "name": "knowledge_base_id", - "required": true, - "schema": { - "title": "Knowledge Base Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Knowledge Base", - "tags": [ - "knowledge_bases" - ] - }, - "put": { - "description": "Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update knowledge bases belonging to your account.", - "operationId": "update_knowledge_base_api_knowledge_bases__knowledge_base_id__put", - "parameters": [ - { - "in": "path", - "name": "knowledge_base_id", - "required": true, - "schema": { - "title": "Knowledge Base Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateKnowledgeBaseBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update Knowledge Base", - "tags": [ - "knowledge_bases" - ] - } - }, - "/me": { - "get": { - "description": "Returns the authenticated user's personal account ID and a list of organisations they belong to. Each organisation entry includes the organisation's own id, display name, and account_id. Useful for CLI tooling that needs to let the user pick an org context.", - "operationId": "get_me_api_me_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MeResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get current user identity", - "tags": [ - "identity" - ] - } - }, - "/memory_banks": { - "get": { - "description": "List memory banks for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "list_memory_banks_api_memory_banks_get", - "parameters": [ - { - "description": "Page number (1-based).", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number (1-based).", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page.", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field. One of: created_at, updated_at, name.", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field. One of: created_at, updated_at, name.", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort direction: asc or desc.", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort direction: asc or desc.", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "Filter by bank type: conversation or general.", - "in": "query", - "name": "type", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by bank type: conversation or general.", - "title": "Type" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankListResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Memory Banks", - "tags": [ - "memory_banks" - ] - }, - "post": { - "description": "Create a new memory bank.\n\nModes: `fast_and_cheap` (256-dim), `balanced` (512-dim), `slow_and_thorough` (1024-dim), or `custom` (supply your own embedding params).", - "operationId": "create_memory_bank_api_memory_banks_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateMemoryBankBody" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Memory Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/ai-assistant": { - "post": { - "description": "Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings based on the user's description.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "memory_bank_ai_generate_api_memory_banks_ai_assistant_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAiAssistantRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankAiAssistantResponse" - } - } - }, - "description": "Successful Response" - }, - "400": { - "description": "AI assistant error." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a memory bank configuration", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/ai-assistant/last-conversation": { - "get": { - "description": "Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports pagination via limit/offset.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get", - "parameters": [ - { - "description": "Max turns to return.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 5, - "description": "Max turns to return.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Number of most-recent turns to skip.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Number of most-recent turns to skip.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankLastConversationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Fetch memory bank AI conversation history", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/ai-assistant/{conversation_id}": { - "patch": { - "description": "Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "memory_bank_ai_accept_api_memory_banks_ai_assistant__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept or decline a memory bank AI suggestion", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/templates": { - "get": { - "description": "Return pre-built template configurations for common memory bank use cases.\n\nEach template includes a name, description, suggested use case, and full default settings that can be used directly with the create endpoint.", - "operationId": "list_templates_api_memory_banks_templates_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "title": "Response List Templates Api Memory Banks Templates Get" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Templates", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/test-compaction": { - "post": { - "description": "Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning.", - "operationId": "test_compaction_prompt_standalone_api_memory_banks_test_compaction_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StandaloneTestCompactionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompactionTestResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Test Compaction Prompt Standalone", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}": { - "delete": { - "description": "Soft-delete a memory bank. This action is permanent and cannot be undone.\n\nThe linked content source and all stored conversation memory entries will also be removed.", - "operationId": "delete_memory_bank_api_memory_banks__memory_bank_id__delete", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Memory Bank", - "tags": [ - "memory_banks" - ] - }, - "get": { - "description": "Fetch a memory bank by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to your account.", - "operationId": "get_memory_bank_api_memory_banks__memory_bank_id__get", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Memory Bank", - "tags": [ - "memory_banks" - ] - }, - "put": { - "description": "Update a memory bank's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nNote: the embedding `mode` cannot be changed after creation because it determines the vector dimensions used to store entries.", - "operationId": "update_memory_bank_api_memory_banks__memory_bank_id__put", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateMemoryBankBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update Memory Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/agents": { - "get": { - "description": "List agents whose current definition references this memory bank.\n\nReturns an array of `{agent_id, agent_name}` objects.", - "operationId": "get_agents_using_bank_api_memory_banks__memory_bank_id__agents_get", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "title": "Response Get Agents Using Bank Api Memory Banks Memory Bank Id Agents Get" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Agents Using Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/compact": { - "post": { - "description": "Trigger an on-demand compaction run for a memory bank.\n\nThe bank must have at least one compaction threshold configured (max_turns or max_size_tokens). Age no longer triggers compaction \u2014 use retention_days to remove entries by age. Compaction runs asynchronously \u2014 the response confirms scheduling, not completion.", - "operationId": "compact_memory_bank_api_memory_banks__memory_bank_id__compact_post", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompactionScheduledResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Compact Memory Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/source": { - "delete": { - "description": "Delete the content source linked to a memory bank, removing all stored memory entries.\n\nA new content source is automatically created on the next write. Use this to reset a bank's data without deleting the bank itself.", - "operationId": "delete_memory_bank_source_api_memory_banks__memory_bank_id__source_delete", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Memory Bank Source", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/stats": { - "get": { - "description": "Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per-key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters.", - "operationId": "get_memory_bank_entry_stats_api_memory_banks__memory_bank_id__stats_get", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "maximum": 730, - "minimum": 1, - "title": "Days", - "type": "integer" - } - }, - { - "in": "query", - "name": "start_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Start Date" - } - }, - { - "in": "query", - "name": "end_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "End Date" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "additionalProperties": true, - "title": "Response Get Memory Bank Entry Stats Api Memory Banks Memory Bank Id Stats Get", - "type": "object" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Memory Bank Entry Stats", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/test-compaction": { - "post": { - "description": "Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning.", - "operationId": "test_compaction_prompt_api_memory_banks__memory_bank_id__test_compaction_post", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestCompactionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompactionTestResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Test Compaction Prompt", - "tags": [ - "memory_banks" - ] - } - }, - "/models": { - "get": { - "description": "List the enabled LLM models with full details.\n\nReturns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status.\n\nA model whose credit rate has not been published yet is omitted, so you are never offered a model that cannot be billed and therefore cannot be run. Such a model may appear later without any other change.\n\nOptional query parameters:\n- `provider`: filter by provider (e.g. 'anthropic', 'openai')\n- `supports_tool_use`: filter to models with tool calling support\n- `supports_thinking`: filter to models with extended thinking support\n- `supports_input_media`: filter to models accepting an input modality (`image`/`audio`/`video`/`pdf` or a full MIME)\n- `supports_output_media`: filter to models producing an output modality (`image`/`audio`/`video`) \u2014 e.g. to find generation models\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "list_models_api_models_get", - "parameters": [ - { - "description": "Filter by provider name", - "in": "query", - "name": "provider", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by provider name", - "title": "Provider" - } - }, - { - "description": "Filter to models that support tool use", - "in": "query", - "name": "supports_tool_use", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Filter to models that support tool use", - "title": "Supports Tool Use" - } - }, - { - "description": "Filter to models that support extended thinking", - "in": "query", - "name": "supports_thinking", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Filter to models that support extended thinking", - "title": "Supports Thinking" - } - }, - { - "description": "Filter to models that accept this input modality \u2014 a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME.", - "in": "query", - "name": "supports_input_media", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to models that accept this input modality \u2014 a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME.", - "title": "Supports Input Media" - } - }, - { - "description": "Filter to models that produce this output modality \u2014 a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find image/audio/video generation models.", - "in": "query", - "name": "supports_output_media", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to models that produce this output modality \u2014 a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find image/audio/video generation models.", - "title": "Supports Output Media" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/schemas__model_responses__ProviderGroupResponse" - }, - "title": "Response List Models Api Models Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Models", - "tags": [ - "models" - ] - } - }, - "/models/alerts": { - "get": { - "description": "List model lifecycle alerts for the account.\n\nReturns in-app notifications about model deprecations, sunsets, and newer model availability. Supports filtering by agent, unread-only, and pagination.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account.", - "operationId": "list_alerts_api_models_alerts_get", - "parameters": [ - { - "description": "Filter alerts to a specific agent UUID.", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter alerts to a specific agent UUID.", - "title": "Agent Id" - } - }, - { - "description": "When true, only return unread alerts.", - "in": "query", - "name": "unread_only", - "required": false, - "schema": { - "default": false, - "description": "When true, only return unread alerts.", - "title": "Unread Only", - "type": "boolean" - } - }, - { - "description": "Maximum number of alerts to return (1-100).", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "description": "Maximum number of alerts to return (1-100).", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Pagination offset.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Pagination offset.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelAlertListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Alerts", - "tags": [ - "models" - ] - } - }, - "/models/alerts/mark-all-read": { - "post": { - "description": "Mark all model lifecycle alerts as read for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Scoped to the caller's account.", - "operationId": "mark_all_read_api_models_alerts_mark_all_read_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Mark All Read", - "tags": [ - "models" - ] - } - }, - "/models/alerts/unread-count": { - "get": { - "description": "Get the count of unread model lifecycle alerts.\n\nUseful for badge indicators in UIs and dashboards.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account.", - "operationId": "get_alert_unread_count_api_models_alerts_unread_count_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnreadCountResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Alert Unread Count", - "tags": [ - "models" - ] - } - }, - "/models/alerts/{alert_id}/read": { - "patch": { - "description": "Mark a single model lifecycle alert as read (dismissed).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account.", - "operationId": "mark_read_api_models_alerts__alert_id__read_patch", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Mark Read", - "tags": [ - "models" - ] - } - }, - "/models/embedders": { - "get": { - "description": "List the embedding models a source can be created with.\n\nEach entry carries the `model_type` to pass as `embedding_model` when creating a source, the `dimensions` it supports, and \u2014 most importantly for multi-modal indexing \u2014 `supported_input_media`: the modalities that embedder can actually index. A source only honours a `media_types` entry its embedder lists here; unsupported kinds are dropped at save time with an `embedder_warning`, so check this before choosing an embedder for a knowledge base of images or video.\n\nText-only embedders report `supported_input_media` as null. Pricing is reported as `credits` (per ~1,000 English words of text) plus `per_modality_rates` for the non-text modalities a multi-modal embedder bills differently.\n\nAn embedder whose credit rate has not been published yet is omitted, so you are never offered one that cannot be billed.\n\nOptional query parameters:\n- `supports_input_media`: keep only embedders that can index this modality (`text`/`image`/`video`/`audio` or a full MIME)\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical for every account.", - "operationId": "list_embedding_models_api_models_embedders_get", - "parameters": [ - { - "description": "Filter to embedders that can index this input modality \u2014 a coarse kind (text, image, video, audio) or a full MIME.", - "in": "query", - "name": "supports_input_media", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to embedders that can index this input modality \u2014 a coarse kind (text, image, video, audio) or a full MIME.", - "title": "Supports Input Media" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmbeddingModelListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Embedding Models", - "tags": [ - "models" - ] - } - }, - "/models/generation-tiers": { - "get": { - "description": "List the media-generation quality tiers and the model + cost each resolves to.\n\nOn a prompt_call's `media_generation` tool \u2014 and the dedicated generate_* steps via tier routing \u2014 the author/LLM chooses a *tier* (fast/balanced/thorough), never a model. This is the surface that maps each `(modality, tier)` to its concrete generator, raw `credits_per_unit`, `unit_label`, and a human-readable scaled `price_label`. Global routing/pricing (the same for every account); read-only. REST parity with the `list_generation_tiers` MCP tool.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_generation_tiers_api_models_generation_tiers_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationTierListResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Generation Tiers", - "tags": [ - "models" - ] - } - }, - "/models/playground/experiments": { - "get": { - "description": "List model playground experiments for the account.\n\nReturns a paginated, time-filtered list of experiments ordered by creation date descending.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account and, when the credential is bound to a user, to that user.", - "operationId": "list_experiments_api_models_playground_experiments_get", - "parameters": [ - { - "description": "Look-back window in days.", - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "description": "Look-back window in days.", - "maximum": 730, - "minimum": 1, - "title": "Days", - "type": "integer" - } - }, - { - "description": "Explicit start date (overrides days).", - "in": "query", - "name": "start_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Explicit start date (overrides days).", - "title": "Start Date" - } - }, - { - "description": "Explicit end date (overrides days).", - "in": "query", - "name": "end_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Explicit end date (overrides days).", - "title": "End Date" - } - }, - { - "description": "Page size.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Page size.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Pagination offset.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Pagination offset.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExperimentListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Experiments", - "tags": [ - "models" - ] - }, - "post": { - "description": "Create and schedule a model playground experiment.\n\nRuns the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an LLM judge.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- When the credential is bound to a user, the experiment belongs to that user; only that user or an account-scoped key can cancel or delete it.", - "operationId": "create_experiment_api_models_playground_experiments_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PlaygroundCreateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateExperimentResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Experiment", - "tags": [ - "models" - ] - } - }, - "/models/playground/experiments/{experiment_id}": { - "delete": { - "description": "Soft-delete a model playground experiment.\n\nRemoves the experiment from list/detail views while preserving audit history.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404.", - "operationId": "delete_experiment_endpoint_api_models_playground_experiments__experiment_id__delete", - "parameters": [ - { - "in": "path", - "name": "experiment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Experiment Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Experiment Endpoint", - "tags": [ - "models" - ] - }, - "get": { - "description": "Get details and results for a specific model playground experiment.\n\nReturns the full experiment payload including prompt, model outputs, and evaluation results (if available).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404.", - "operationId": "get_experiment_api_models_playground_experiments__experiment_id__get", - "parameters": [ - { - "in": "path", - "name": "experiment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Experiment Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExperimentDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Experiment", - "tags": [ - "models" - ] - } - }, - "/models/playground/experiments/{experiment_id}/cancel": { - "post": { - "description": "Cancel a running or pending model playground experiment.\n\nSignals running model calls to abort and marks the experiment as canceled.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404.", - "operationId": "cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post", - "parameters": [ - { - "in": "path", - "name": "experiment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Experiment Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CancelExperimentResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Cancel Experiment Endpoint", - "tags": [ - "models" - ] - } - }, - "/models/rerankers": { - "get": { - "description": "List the reranker models a knowledge base can be created with.\n\nA reranker re-scores the top results of a vector search for relevance. Each entry carries the `model_type` to pass as `reranker_model` on a knowledge base, its `credits_per_action`, and whether it is the platform default (`is_default`, used when you omit `reranker_model`).\n\nTo disable reranking, send `\"none\"` or an empty string as `reranker_model` rather than a value from this list. Reranking scores text, so a knowledge base whose sources all embed media natively \u2014 whose chunks carry no text \u2014 defaults to no reranker.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical for every account.", - "operationId": "list_reranker_models_api_models_rerankers_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RerankerModelListResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Reranker Models", - "tags": [ - "models" - ] - } - }, - "/models/{model_id}/details": { - "get": { - "description": "Get detailed information about a specific model.\n\nReturns full model details including capabilities, credit pricing, tool support, variant tiers, and lifecycle status.\n\nThe `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6').\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_model_api_models__model_id__details_get", - "parameters": [ - { - "in": "path", - "name": "model_id", - "required": true, - "schema": { - "title": "Model Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/schemas__model_responses__PromptModelResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Model", - "tags": [ - "models" - ] - } - }, - "/models/{model_id}/recommendations": { - "get": { - "description": "Get replacement/upgrade recommendations for a model.\n\nReturns a designated successor (if any), same-family upgrades, and cross-provider/cross-family alternatives.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_recommendations_api_models__model_id__recommendations_get", - "parameters": [ - { - "in": "path", - "name": "model_id", - "required": true, - "schema": { - "title": "Model Id", - "type": "string" - } - }, - { - "description": "Only recommend models that support tool use.", - "in": "query", - "name": "require_tool_use", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Only recommend models that support tool use.", - "title": "Require Tool Use" - } - }, - { - "description": "Only recommend models that support structured output.", - "in": "query", - "name": "require_structured_output", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Only recommend models that support structured output.", - "title": "Require Structured Output" - } - }, - { - "description": "Only recommend models that support thinking/reasoning.", - "in": "query", - "name": "require_thinking", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Only recommend models that support thinking/reasoning.", - "title": "Require Thinking" - } - }, - { - "description": "Minimum context window size in tokens.", - "in": "query", - "name": "min_context_tokens", - "required": false, - "schema": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Minimum context window size in tokens.", - "title": "Min Context Tokens" - } - }, - { - "description": "Minimum output token limit.", - "in": "query", - "name": "min_output_tokens", - "required": false, - "schema": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Minimum output token limit.", - "title": "Min Output Tokens" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationsResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Recommendations", - "tags": [ - "models" - ] - } - }, - "/search": { - "get": { - "description": "Search across all resource types in your account. Accepts a free-text keyword query or a UUID. UUIDs are matched exactly; keywords are matched by name and description (case-insensitive substring). Results are ranked: name-prefix > name-substring > description-substring. Searchable types: agent, knowledge_base, source_connection, solution, memory_bank, alert, api_key, governance_policy, mcp_client.", - "operationId": "search_api_search_get", - "parameters": [ - { - "description": "Search query", - "in": "query", - "name": "q", - "required": true, - "schema": { - "description": "Search query", - "maxLength": 200, - "minLength": 1, - "title": "Q", - "type": "string" - } - }, - { - "description": "Maximum results", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 10, - "description": "Maximum results", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Optional entity type filter (e.g. 'agent', 'knowledge_base')", - "in": "query", - "name": "entity_type", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional entity type filter (e.g. 'agent', 'knowledge_base')", - "title": "Entity Type" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__search__SearchResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Search resources", - "tags": [ - "search" - ] - } - }, - "/solutions": { - "get": { - "description": "List solutions for your account.\n\nA *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Use solutions to organise related resources and leverage AI assistants for automated setup.\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc).\n- Filtering: `search` to filter by solution name (case-insensitive partial match).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.", - "operationId": "list_solutions_api_solutions_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort order", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort order", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "Filter by solution name (case-insensitive partial match)", - "in": "query", - "name": "search", - "required": false, - "schema": { - "anyOf": [ - { - "maxLength": 200, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by solution name (case-insensitive partial match)", - "title": "Search" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List solutions", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Create a new solution for the caller's account.\n\nA *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a `name` and optional `description` in the request body.", - "operationId": "create_solution_api_solutions_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSolutionRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create a solution", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}": { - "delete": { - "description": "Delete a solution by its ID.\n\nThis permanently removes the solution and all its resource associations (agent links, knowledge base links, source connection links). The underlying resources themselves are not deleted.", - "operationId": "delete_solution_api_solutions__solution_id__delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete a solution", - "tags": [ - "solutions" - ] - }, - "get": { - "description": "Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections.\n\nReturns the full solution detail with nested resource information.", - "operationId": "get_solution_api_solutions__solution_id__get", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get a solution", - "tags": [ - "solutions" - ] - }, - "patch": { - "description": "Update an existing solution's name or description.\n\nPass the fields you wish to change in the request body. Fields not included remain unchanged.", - "operationId": "update_solution_api_solutions__solution_id__patch", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateSolutionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update a solution", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/agents": { - "delete": { - "description": "Unlink one or more agents from a solution by their IDs.\n\nPass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are silently ignored. Returns the updated solution with remaining linked resources.", - "operationId": "unlink_agents_api_solutions__solution_id__agents_delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnlinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Unlink agents", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Link one or more agents to a solution by their IDs.\n\nPass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. Returns the updated solution with all linked resources.", - "operationId": "link_agents_api_solutions__solution_id__agents_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Link agents", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/generate": { - "post": { - "description": "Generate a comprehensive solution management plan via the solution AI assistant.\n\nThis is the most powerful assistant \u2014 it can propose changes across sources, knowledge bases, and agents. Describe your goal in natural language and the assistant will create a multi-step plan. Review the proposed actions and use the accept or decline endpoint.\n\nSupports SSE streaming when `Accept: text/event-stream` is set.", - "operationId": "ai_assistant_generate_api_solutions__solution_id__ai_assistant_generate_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate solution plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/knowledge-base": { - "post": { - "description": "Generate a knowledge base plan via the KB AI assistant.\n\nDescribe what knowledge bases you need in natural language and the assistant will propose a plan with create, update, or delete actions. The assistant may also propose creating new sources if needed. Review the proposed actions and use the accept or decline endpoint.", - "operationId": "ai_assistant_knowledge_base_api_solutions__solution_id__ai_assistant_knowledge_base_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate knowledge base plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/source": { - "post": { - "description": "Generate a content source plan via the source AI assistant.\n\nDescribe what sources you need in natural language and the assistant will propose a plan with create, update, or delete actions. Review the proposed actions and use the accept or decline endpoint to execute or discard the plan.", - "operationId": "ai_assistant_source_api_solutions__solution_id__ai_assistant_source_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate source plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/{conversation_id}/accept": { - "post": { - "description": "Accept and execute a proposed plan generated by one of the AI assistant endpoints.\n\nExecutes all proposed actions in the plan and returns the results of each action. If the plan contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the request body. Returns a summary of executed actions with success/failure status.", - "operationId": "ai_assistant_accept_api_solutions__solution_id__ai_assistant__conversation_id__accept_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantAcceptResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/{conversation_id}/decline": { - "post": { - "description": "Decline a proposed plan generated by one of the AI assistant endpoints.\n\nMarks the conversation as declined without executing any actions. The conversation history is preserved for reference. You can generate a new plan afterwards if needed.", - "operationId": "ai_assistant_decline_api_solutions__solution_id__ai_assistant__conversation_id__decline_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Decline plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/conversations": { - "get": { - "description": "List AI assistant conversation history for a solution.\n\nReturns all conversation turns for the given solution, including user inputs, AI responses, proposed actions, and acceptance status.", - "operationId": "list_conversations_api_solutions__solution_id__conversations_get", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionConversationResponse" - }, - "title": "Response List Conversations Api Solutions Solution Id Conversations Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List conversations", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Add a conversation turn to a solution's AI assistant history.\n\nRecords a user input and optional AI response and actions taken. This is typically called internally by AI assistant endpoints, but can also be used to manually log interactions.", - "operationId": "add_conversation_turn_api_solutions__solution_id__conversations_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddConversationTurnRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionConversationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Add conversation turn", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/conversations/{conversation_id}": { - "patch": { - "description": "Mark a conversation turn as accepted or declined.\n\nUpdates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed plan to record whether it was accepted or declined by the user.", - "operationId": "mark_conversation_turn_api_solutions__solution_id__conversations__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MarkConversationTurnRequest" - } - } - }, - "required": true - }, - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Mark conversation turn", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/knowledge-bases": { - "delete": { - "description": "Unlink one or more knowledge bases from a solution by their IDs.\n\nPass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not currently linked are silently ignored. Returns the updated solution.", - "operationId": "unlink_knowledge_bases_api_solutions__solution_id__knowledge_bases_delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnlinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Unlink knowledge bases", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Link one or more knowledge bases to a solution by their IDs.\n\nPass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are silently ignored. Returns the updated solution with all linked resources.", - "operationId": "link_knowledge_bases_api_solutions__solution_id__knowledge_bases_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Link knowledge bases", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/source-connections": { - "delete": { - "description": "Unlink one or more source connections from a solution by their IDs.\n\nPass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently linked are silently ignored. Returns the updated solution.", - "operationId": "unlink_source_connections_api_solutions__solution_id__source_connections_delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnlinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Unlink source connections", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Link one or more source connections to a solution by their IDs.\n\nPass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently ignored. Returns the updated solution with all linked resources.", - "operationId": "link_source_connections_api_solutions__solution_id__source_connections_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Link source connections", - "tags": [ - "solutions" - ] - } - }, - "/sources": { - "get": { - "description": "List content sources for your account.\n\nA *source* is where Seclai pulls or receives content from \u2014 RSS feeds, websites, or content stores (``custom_index``). Content stores support file uploads and API-driven content ingestion with configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``).\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.\n- The optional `account_id` query param is only allowed when it matches the caller's account.", - "operationId": "list_sources_api_sources_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort order", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort order", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "List sources for the given account. Defaults to the caller's account.", - "in": "query", - "name": "account_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "List sources for the given account. Defaults to the caller's account.", - "title": "Account Id" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__sources__SourceListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List sources", - "tags": [ - "sources" - ] - }, - "post": { - "description": "Create a new content source.\n\nSource types: `rss`, `website`, `custom_index`.\n\nFor RSS and website sources, provide the URL. For custom index sources, the URL is created automatically.\n\nFor custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`.", - "operationId": "create_source_api_sources_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSourceBody" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "Insufficient credits or no active subscription \u2014 the account has exhausted its credits or does not have a valid subscription." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Source", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}": { - "delete": { - "description": "Soft-delete a content source. This action cannot be undone.\n\nSystem-managed sources (such as agent history or conversation memory) cannot be deleted through this endpoint.", - "operationId": "delete_source_api_sources__source_connection_id__delete", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Source", - "tags": [ - "sources" - ] - }, - "get": { - "description": "Fetch a content source by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access sources belonging to your account.", - "operationId": "get_source_api_sources__source_connection_id__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Source", - "tags": [ - "sources" - ] - }, - "post": { - "description": "Upload a small text payload to a content source (no multipart/form-data required).\n\n**Maximum payload size:** 8192 bytes (UTF-8).\n\n**Supported content types:**\n- `application/json`\n- `application/xml`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.\n\nTracking indexing progress:\n- **Which id you get back depends on `status`, and they are not interchangeable:**\n - `uploaded` \u2014 a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns.\n - `duplicate` \u2014 this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll.\n- For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=\u2026&content_version_id=\u2026` for a whole batch, to follow each item through to `completed` or `failed`.\n- On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes.", - "operationId": "upload_inline_text_to_source_api_sources__source_connection_id__post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InlineTextUploadRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__sources__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Upload inline text to a content source", - "tags": [ - "sources" - ] - }, - "put": { - "description": "Update a content source's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nSystem-managed sources only allow `retention_days` updates.", - "operationId": "update_source_api_sources__source_connection_id__put", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateSourceBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update Source", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/contents": { - "get": { - "description": "List every content item this source has attempted to index, with the status of each.\n\nUnlike the source's `content_count`, which only counts finished items, this listing includes items that are still processing and items that failed \u2014 so a bulk upload can report per-item progress and point at the specific items that did not make it.\n\nCorrelating with an upload:\n- Each item is keyed by `content_version_id`, which is what the upload endpoints return. Pass those ids as repeated `content_version_id` query parameters to poll exactly the items you uploaded.\n- `source_connection_content_version_id` is `null` until an item finishes indexing; once set, it is the id `GET /contents/{id}` takes.\n- `content_status` reaches `completed` on success and `failed` on error, with the reason in `error`. The intermediate values are `pending`, `fetching`, `transcribing`, `scanning`, and `indexing`.\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/title/status) and `order` (asc/desc). `created_at` sorts on when the item was uploaded or pulled.\n- Filtering: `status` and repeatable `content_version_id`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only list content for sources belonging to your account.", - "operationId": "list_source_contents_api_sources__source_connection_id__contents_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field (created_at/title/status)", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field (created_at/title/status)", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort order", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort order", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "Filter to one status: pending, fetching, transcribing, scanning, indexing, completed, or failed. Use `failed` to list only the items that could not be indexed.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to one status: pending, fetching, transcribing, scanning, indexing, completed, or failed. Use `failed` to list only the items that could not be indexed.", - "title": "Status" - } - }, - { - "description": "Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. The ids travel in the query string, so keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches the API. The API itself accepts at most 500 \u2014 beyond either limit, split the poll or page through the unfiltered listing.", - "in": "query", - "name": "content_version_id", - "required": false, - "schema": { - "anyOf": [ - { - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. The ids travel in the query string, so keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches the API. The API itself accepts at most 500 \u2014 beyond either limit, split the poll or page through the unfiltered listing.", - "title": "Content Version Id" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceContentStatusListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List content items and their indexing status", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/contents/{content_version_id}": { - "get": { - "description": "Get the indexing status of a single content item, addressed by the `content_version_id` the upload endpoints return.\n\nUse this to follow one uploaded file through indexing. To follow many at once, use `GET /sources/{id}/contents` with repeated `content_version_id` parameters instead of polling this endpoint per item.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account.", - "operationId": "get_source_content_status_endpoint_api_sources__source_connection_id__contents__content_version_id__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "content_version_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Content Version Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceContentStatusResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get one content item's indexing status", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/embedding-migration": { - "get": { - "description": "Get the latest embedding migration status for a custom-index source.\n\nReturns `null` when no migration has ever been started for this source.", - "operationId": "get_source_embedding_migration_api_sources__source_connection_id__embedding_migration_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SourceEmbeddingMigrationResponse" - }, - { - "type": "null" - } - ], - "title": "Response Get Source Embedding Migration Api Sources Source Connection Id Embedding Migration Get" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Source Embedding Migration", - "tags": [ - "sources" - ] - }, - "post": { - "description": "Start an embedding model migration for a custom-index source.\n\nThe migration runs asynchronously in the background. Poll `GET /sources/{id}/embedding-migration` to track progress.\n\nOptionally override chunking configuration (`chunk_size`, `chunk_overlap`, `chunk_language`, `chunk_separators`, `chunk_regex_separators`). When a chunking field is omitted (null), the current source's value is preserved.\n\nConstraints:\n- Only `custom_index` source types support migration.\n- A migration cannot be started while another is already active.\n- The target model + dimensions must differ from the source's current settings.", - "operationId": "start_source_embedding_migration_api_sources__source_connection_id__embedding_migration_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StartSourceEmbeddingMigrationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceEmbeddingMigrationResponse" - } - } - }, - "description": "Successful Response" - }, - "409": { - "description": "A migration is already active for this source, or the target matches the current settings." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Start Source Embedding Migration", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/embedding-migration/cancel": { - "post": { - "description": "Cancel an active embedding migration for a custom-index source.\n\nOnly pending and running migrations can be cancelled. A migration that has reached the switching phase is committing its switch-over in a single transaction, so there is no half-applied state to back out of and cancel is refused.", - "operationId": "cancel_source_embedding_migration_api_sources__source_connection_id__embedding_migration_cancel_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceEmbeddingMigrationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Cancel Source Embedding Migration", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/exports": { - "get": { - "description": "List all export jobs for a source connection, ordered newest first. Supports pagination via ``page`` and ``limit`` query parameters. Returns status, progress, and file metadata for each export.", - "operationId": "list_source_exports_api_sources__source_connection_id__exports_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExportListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List exports", - "tags": [ - "source-exports" - ] - }, - "post": { - "description": "Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, then use /download to retrieve the file. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected.", - "operationId": "create_source_export_api_sources__source_connection_id__exports_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__CreateExportRequest" - } - } - }, - "required": true - }, - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__ExportResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create export", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/estimate": { - "post": { - "description": "Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use this to show users how large the download will be before they commit to running the export.", - "operationId": "estimate_source_export_api_sources__source_connection_id__exports_estimate_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__EstimateExportRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__EstimateExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Estimate export size", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/{export_id}": { - "delete": { - "description": "Delete an export job and remove the associated file from S3. This is a soft-delete: the database record is retained for audit purposes but the backing file is permanently removed. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected.", - "operationId": "delete_source_export_api_sources__source_connection_id__exports__export_id__delete", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete export", - "tags": [ - "source-exports" - ] - }, - "get": { - "description": "Retrieve the current status and progress of an export job. Returns all metadata including progress counters, file size, item count, and expiration time once completed.", - "operationId": "get_source_export_api_sources__source_connection_id__exports__export_id__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__ExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get export status", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/{export_id}/cancel": { - "post": { - "description": "Cancel a pending or running export. The background task will stop at the next chunk boundary. Completed, failed, expired, or already-cancelled exports cannot be cancelled. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected.", - "operationId": "cancel_source_export_api_sources__source_connection_id__exports__export_id__cancel_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__ExportResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Cancel export", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/{export_id}/download": { - "get": { - "description": "Stream the completed export file. Returns the file content with appropriate Content-Type and Content-Disposition headers. Returns 409 if the export is not yet completed and 410 if it has expired.", - "operationId": "download_source_export_api_sources__source_connection_id__exports__export_id__download_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": {} - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Download export", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/upload": { - "post": { - "description": "Upload a file to a content source.\n\n**Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored).\n\n**Supported MIME types:**\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/xml`\n- `application/zip`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/wav`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/svg+xml`\n- `image/tiff`\n- `image/webp`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n- `video/mp4`\n- `video/quicktime`\n- `video/x-msvideo`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nResponse:\n- `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source.\n\nTracking indexing progress:\n- **Which id you get back depends on `status`, and they are not interchangeable:**\n - `uploaded` \u2014 a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns.\n - `duplicate` \u2014 this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll.\n- For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=\u2026&content_version_id=\u2026` for a whole batch, to follow each item through to `completed` or `failed`.\n- On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes.", - "operationId": "upload_file_to_source_api_sources__source_connection_id__upload_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_upload_file_to_source_api_sources__source_connection_id__upload_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__sources__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Upload a file to a content source", - "tags": [ - "sources" - ] - } - }, - "/v2/agent-runs/{run_id}/attachments/{attachment_id}": { - "get": { - "description": "Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is the ``id`` of an entry in the run's or a step's ``attachments``, or the URL-safe-base64-encoded storage key, which webhook and email links carry.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft-deleted agent, a run whose trace was purged, a file not in the run) all collapse to a single 404 to prevent cross-tenant existence enumeration.\n\nMIME handling:\n- Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, application/vnd.seclai.manifest+json) are served with their declared type.\n- Everything else is served as ``application/octet-stream`` with an attachment disposition to prevent stored-XSS.", - "operationId": "serve_agent_run_attachment_api_v2_agent_runs__run_id__attachments__attachment_id__get", - "parameters": [ - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Run Id", - "type": "string" - } - }, - { - "in": "path", - "name": "attachment_id", - "required": true, - "schema": { - "title": "Attachment Id", - "type": "string" - } - }, - { - "in": "query", - "name": "download_name", - "required": false, - "schema": { - "anyOf": [ - { - "maxLength": 255, - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Download Name" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "application/pdf": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "application/vnd.seclai.manifest+json": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "audio/*": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "image/*": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "text/plain": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "video/*": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "Attachment bytes streamed with the resolved MIME type (inline-safe types keep their declared type; everything else is ``application/octet-stream``)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Download an agent-run attachment", - "tags": [ - "agent_run_attachments" - ] - } - }, - "/version": { - "get": { - "description": "Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request resolved to, and the default/latest/known versions. Pin your account with `PUT /version` or override per request with the `Seclai-Version` header.", - "operationId": "get_api_version_api_version_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiVersionResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get the account's API version", - "tags": [ - "version" - ] - }, - "put": { - "description": "Sets the account's sticky `Seclai-Version` to the given `YYYY-MM-DD` date, or clears it with `null`. The new pin applies to subsequent header-less requests; a `Seclai-Version` request header still overrides it. Owner/admin only. `effective_version` in the response reflects the current request, not the new pin.", - "operationId": "update_api_version_api_version_put", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateApiVersionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiVersionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Pin (or clear) the account's API version", - "tags": [ - "version" - ] - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "BearerAuth": [] - } - ], - "x-seclai-versions": { - "default": "2026-07-01", - "known": [ - "2026-07-01", - "2026-07-27", - "2026-08-03", - "2026-08-21", - "2026-09-28", - "2026-09-30", - "2026-10-03" - ], - "latest": "2026-10-03" - } -} diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 98ce96b..0000000 --- a/package-lock.json +++ /dev/null @@ -1,2937 +0,0 @@ -{ - "name": "@seclai/sdk", - "version": "0.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@seclai/sdk", - "version": "0.0.0", - "license": "MIT", - "devDependencies": { - "openapi-typescript": "^7.9.1", - "tsup": "^8.5.0", - "typedoc": "^0.27.6", - "typescript": "^5.7.3", - "vitest": "^2.1.9" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", - "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.27.1", - "js-tokens": "^4.0.0", - "picocolors": "^1.1.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", - "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz", - "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz", - "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz", - "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz", - "integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz", - "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz", - "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz", - "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz", - "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz", - "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz", - "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz", - "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz", - "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz", - "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz", - "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz", - "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz", - "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz", - "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz", - "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz", - "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz", - "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz", - "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz", - "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz", - "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz", - "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz", - "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@gerrit0/mini-shiki": { - "version": "1.27.2", - "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.27.2.tgz", - "integrity": "sha512-GeWyHz8ao2gBiUW4OJnQDxXQnFgZQwwQk05t/CVVgNBN7/rK8XZ7xY6YhLVv9tH3VppWWmr9DCl3MwemB/i+Og==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/engine-oniguruma": "^1.27.2", - "@shikijs/types": "^1.27.2", - "@shikijs/vscode-textmate": "^10.0.1" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@redocly/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-EDtsGZS964mf9zAUXAl9Ew16eYbeyAFWhsPr0fX6oaJxgd8rApYlPBf0joyhnUHz88WxrigyFtTaqqzXNzPgqw==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/@redocly/config": { - "version": "0.22.2", - "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.22.2.tgz", - "integrity": "sha512-roRDai8/zr2S9YfmzUfNhKjOF0NdcOIqF7bhf4MVC5UxpjIysDjyudvlAiVbpPHp3eDRWbdzUgtkK1a7YiDNyQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@redocly/openapi-core": { - "version": "1.34.6", - "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.34.6.tgz", - "integrity": "sha512-2+O+riuIUgVSuLl3Lyh5AplWZyVMNuG2F98/o6NrutKJfW4/GTZdPpZlIphS0HGgcOHgmWcCSHj+dWFlZaGSHw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@redocly/ajv": "^8.11.2", - "@redocly/config": "^0.22.0", - "colorette": "^1.2.0", - "https-proxy-agent": "^7.0.5", - "js-levenshtein": "^1.1.6", - "js-yaml": "^4.1.0", - "minimatch": "^5.0.1", - "pluralize": "^8.0.0", - "yaml-ast-parser": "0.0.43" - }, - "engines": { - "node": ">=18.17.0", - "npm": ">=9.5.0" - } - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.55.1.tgz", - "integrity": "sha512-9R0DM/ykwfGIlNu6+2U09ga0WXeZ9MRC2Ter8jnz8415VbuIykVuc6bhdrbORFZANDmTDvq26mJrEVTl8TdnDg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.55.1.tgz", - "integrity": "sha512-eFZCb1YUqhTysgW3sj/55du5cG57S7UTNtdMjCW7LwVcj3dTTcowCsC8p7uBdzKsZYa8J7IDE8lhMI+HX1vQvg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.55.1.tgz", - "integrity": "sha512-p3grE2PHcQm2e8PSGZdzIhCKbMCw/xi9XvMPErPhwO17vxtvCN5FEA2mSLgmKlCjHGMQTP6phuQTYWUnKewwGg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.55.1.tgz", - "integrity": "sha512-rDUjG25C9qoTm+e02Esi+aqTKSBYwVTaoS1wxcN47/Luqef57Vgp96xNANwt5npq9GDxsH7kXxNkJVEsWEOEaQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.55.1.tgz", - "integrity": "sha512-+JiU7Jbp5cdxekIgdte0jfcu5oqw4GCKr6i3PJTlXTCU5H5Fvtkpbs4XJHRmWNXF+hKmn4v7ogI5OQPaupJgOg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.55.1.tgz", - "integrity": "sha512-V5xC1tOVWtLLmr3YUk2f6EJK4qksksOYiz/TCsFHu/R+woubcLWdC9nZQmwjOAbmExBIVKsm1/wKmEy4z4u4Bw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.55.1.tgz", - "integrity": "sha512-Rn3n+FUk2J5VWx+ywrG/HGPTD9jXNbicRtTM11e/uorplArnXZYsVifnPPqNNP5BsO3roI4n8332ukpY/zN7rQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.55.1.tgz", - "integrity": "sha512-grPNWydeKtc1aEdrJDWk4opD7nFtQbMmV7769hiAaYyUKCT1faPRm2av8CX1YJsZ4TLAZcg9gTR1KvEzoLjXkg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.55.1.tgz", - "integrity": "sha512-a59mwd1k6x8tXKcUxSyISiquLwB5pX+fJW9TkWU46lCqD/GRDe9uDN31jrMmVP3feI3mhAdvcCClhV8V5MhJFQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.55.1.tgz", - "integrity": "sha512-puS1MEgWX5GsHSoiAsF0TYrpomdvkaXm0CofIMG5uVkP6IBV+ZO9xhC5YEN49nsgYo1DuuMquF9+7EDBVYu4uA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.55.1.tgz", - "integrity": "sha512-r3Wv40in+lTsULSb6nnoudVbARdOwb2u5fpeoOAZjFLznp6tDU8kd+GTHmJoqZ9lt6/Sys33KdIHUaQihFcu7g==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.55.1.tgz", - "integrity": "sha512-MR8c0+UxAlB22Fq4R+aQSPBayvYa3+9DrwG/i1TKQXFYEaoW3B5b/rkSRIypcZDdWjWnpcvxbNaAJDcSbJU3Lw==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.55.1.tgz", - "integrity": "sha512-3KhoECe1BRlSYpMTeVrD4sh2Pw2xgt4jzNSZIIPLFEsnQn9gAnZagW9+VqDqAHgm1Xc77LzJOo2LdigS5qZ+gw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.55.1.tgz", - "integrity": "sha512-ziR1OuZx0vdYZZ30vueNZTg73alF59DicYrPViG0NEgDVN8/Jl87zkAPu4u6VjZST2llgEUjaiNl9JM6HH1Vdw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.55.1.tgz", - "integrity": "sha512-uW0Y12ih2XJRERZ4jAfKamTyIHVMPQnTZcQjme2HMVDAHY4amf5u414OqNYC+x+LzRdRcnIG1YodLrrtA8xsxw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.55.1.tgz", - "integrity": "sha512-u9yZ0jUkOED1BFrqu3BwMQoixvGHGZ+JhJNkNKY/hyoEgOwlqKb62qu+7UjbPSHYjiVy8kKJHvXKv5coH4wDeg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.55.1.tgz", - "integrity": "sha512-/0PenBCmqM4ZUd0190j7J0UsQ/1nsi735iPRakO8iPciE7BQ495Y6msPzaOmvx0/pn+eJVVlZrNrSh4WSYLxNg==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.55.1.tgz", - "integrity": "sha512-a8G4wiQxQG2BAvo+gU6XrReRRqj+pLS2NGXKm8io19goR+K8lw269eTrPkSdDTALwMmJp4th2Uh0D8J9bEV1vg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.55.1.tgz", - "integrity": "sha512-bD+zjpFrMpP/hqkfEcnjXWHMw5BIghGisOKPj+2NaNDuVT+8Ds4mPf3XcPHuat1tz89WRL+1wbcxKY3WSbiT7w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.55.1.tgz", - "integrity": "sha512-eLXw0dOiqE4QmvikfQ6yjgkg/xDM+MdU9YJuP4ySTibXU0oAvnEWXt7UDJmD4UkYialMfOGFPJnIHSe/kdzPxg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ] - }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.55.1.tgz", - "integrity": "sha512-xzm44KgEP11te3S2HCSyYf5zIzWmx3n8HDCc7EE59+lTcswEWNpvMLfd9uJvVX8LCg9QWG67Xt75AuHn4vgsXw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.55.1.tgz", - "integrity": "sha512-yR6Bl3tMC/gBok5cz/Qi0xYnVbIxGx5Fcf/ca0eB6/6JwOY+SRUcJfI0OpeTpPls7f194as62thCt/2BjxYN8g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.55.1.tgz", - "integrity": "sha512-3fZBidchE0eY0oFZBnekYCfg+5wAB0mbpCBuofh5mZuzIU/4jIVkbESmd2dOsFNS78b53CYv3OAtwqkZZmU5nA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.55.1.tgz", - "integrity": "sha512-xGGY5pXj69IxKb4yv/POoocPy/qmEGhimy/FoTpTSVju3FYXUQQMFCaZZXJVidsmGxRioZAwpThl/4zX41gRKg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.55.1.tgz", - "integrity": "sha512-SPEpaL6DX4rmcXtnhdrQYgzQ5W2uW3SCJch88lB2zImhJRhIIK44fkUrgIV/Q8yUNfw5oyZ5vkeQsZLhCb06lw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@shikijs/engine-oniguruma": { - "version": "1.29.2", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.29.2.tgz", - "integrity": "sha512-7iiOx3SG8+g1MnlzZVDYiaeHe7Ez2Kf2HrJzdmGwkRisT7r4rak0e655AcM/tF9JG/kg5fMNYlLLKglbN7gBqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/types": "1.29.2", - "@shikijs/vscode-textmate": "^10.0.1" - } - }, - "node_modules/@shikijs/types": { - "version": "1.29.2", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.29.2.tgz", - "integrity": "sha512-VJjK0eIijTZf0QSTODEXCqinjBn0joAHQ+aPSBzrv4O2d/QSbsMw+ZeSRx03kV34Hy7NzUvV/7NqfYGRLrASmw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/vscode-textmate": "^10.0.1", - "@types/hast": "^3.0.4" - } - }, - "node_modules/@shikijs/vscode-textmate": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", - "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@vitest/expect": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", - "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "2.1.9", - "@vitest/utils": "2.1.9", - "chai": "^5.1.2", - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/mocker": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz", - "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "2.1.9", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.12" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^5.0.0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } - }, - "node_modules/@vitest/pretty-format": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz", - "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz", - "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/utils": "2.1.9", - "pathe": "^1.1.2" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner/node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@vitest/snapshot": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz", - "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "2.1.9", - "magic-string": "^0.30.12", - "pathe": "^1.1.2" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot/node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@vitest/spy": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz", - "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyspy": "^3.0.2" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/utils": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz", - "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "2.1.9", - "loupe": "^3.1.2", - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/acorn": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", - "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "dev": true, - "license": "MIT" - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/bundle-require": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", - "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", - "dev": true, - "license": "MIT", - "dependencies": { - "load-tsconfig": "^0.2.3" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "peerDependencies": { - "esbuild": ">=0.18" - } - }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/chai": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", - "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "assertion-error": "^2.0.1", - "check-error": "^2.1.1", - "deep-eql": "^5.0.1", - "loupe": "^3.1.0", - "pathval": "^2.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/change-case": { - "version": "5.4.4", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", - "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", - "dev": true, - "license": "MIT" - }, - "node_modules/check-error": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", - "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 16" - } - }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/colorette": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", - "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", - "dev": true, - "license": "MIT" - }, - "node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/confbox": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", - "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/consola": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", - "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.18.0 || >=16.10.0" - } - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-eql": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", - "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/es-module-lexer": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", - "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", - "dev": true, - "license": "MIT" - }, - "node_modules/esbuild": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz", - "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.2", - "@esbuild/android-arm": "0.27.2", - "@esbuild/android-arm64": "0.27.2", - "@esbuild/android-x64": "0.27.2", - "@esbuild/darwin-arm64": "0.27.2", - "@esbuild/darwin-x64": "0.27.2", - "@esbuild/freebsd-arm64": "0.27.2", - "@esbuild/freebsd-x64": "0.27.2", - "@esbuild/linux-arm": "0.27.2", - "@esbuild/linux-arm64": "0.27.2", - "@esbuild/linux-ia32": "0.27.2", - "@esbuild/linux-loong64": "0.27.2", - "@esbuild/linux-mips64el": "0.27.2", - "@esbuild/linux-ppc64": "0.27.2", - "@esbuild/linux-riscv64": "0.27.2", - "@esbuild/linux-s390x": "0.27.2", - "@esbuild/linux-x64": "0.27.2", - "@esbuild/netbsd-arm64": "0.27.2", - "@esbuild/netbsd-x64": "0.27.2", - "@esbuild/openbsd-arm64": "0.27.2", - "@esbuild/openbsd-x64": "0.27.2", - "@esbuild/openharmony-arm64": "0.27.2", - "@esbuild/sunos-x64": "0.27.2", - "@esbuild/win32-arm64": "0.27.2", - "@esbuild/win32-ia32": "0.27.2", - "@esbuild/win32-x64": "0.27.2" - } - }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/expect-type": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", - "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", - "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/fix-dts-default-cjs-exports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", - "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "magic-string": "^0.30.17", - "mlly": "^1.7.4", - "rollup": "^4.34.8" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/index-to-position": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.2.0.tgz", - "integrity": "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/joycon": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", - "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/js-levenshtein": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", - "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "license": "MIT" - }, - "node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true, - "license": "MIT" - }, - "node_modules/linkify-it": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", - "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "uc.micro": "^2.0.0" - } - }, - "node_modules/load-tsconfig": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", - "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/loupe": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", - "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true, - "license": "MIT" - }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, - "node_modules/markdown-it": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", - "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1", - "entities": "^4.4.0", - "linkify-it": "^5.0.0", - "mdurl": "^2.0.0", - "punycode.js": "^2.3.1", - "uc.micro": "^2.1.0" - }, - "bin": { - "markdown-it": "bin/markdown-it.mjs" - } - }, - "node_modules/mdurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", - "dev": true, - "license": "MIT" - }, - "node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mlly": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", - "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.15.0", - "pathe": "^2.0.3", - "pkg-types": "^1.3.1", - "ufo": "^1.6.1" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/openapi-typescript": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-7.10.1.tgz", - "integrity": "sha512-rBcU8bjKGGZQT4K2ekSTY2Q5veOQbVG/lTKZ49DeCyT9z62hM2Vj/LLHjDHC9W7LJG8YMHcdXpRZDqC1ojB/lw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@redocly/openapi-core": "^1.34.5", - "ansi-colors": "^4.1.3", - "change-case": "^5.4.4", - "parse-json": "^8.3.0", - "supports-color": "^10.2.2", - "yargs-parser": "^21.1.1" - }, - "bin": { - "openapi-typescript": "bin/cli.js" - }, - "peerDependencies": { - "typescript": "^5.x" - } - }, - "node_modules/parse-json": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", - "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.26.2", - "index-to-position": "^1.1.0", - "type-fest": "^4.39.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, - "node_modules/pathval": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", - "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.16" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pirates": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", - "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/pkg-types": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", - "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "confbox": "^0.1.8", - "mlly": "^1.7.4", - "pathe": "^2.0.1" - } - }, - "node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.11", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-load-config": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", - "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "lilconfig": "^3.1.1" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "jiti": ">=1.21.0", - "postcss": ">=8.0.9", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - }, - "postcss": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/punycode.js": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", - "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/rollup": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.55.1.tgz", - "integrity": "sha512-wDv/Ht1BNHB4upNbK74s9usvl7hObDnvVzknxqY/E/O3X6rW1U1rV1aENEfJ54eFZDTNo7zv1f5N4edCluH7+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.8" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.55.1", - "@rollup/rollup-android-arm64": "4.55.1", - "@rollup/rollup-darwin-arm64": "4.55.1", - "@rollup/rollup-darwin-x64": "4.55.1", - "@rollup/rollup-freebsd-arm64": "4.55.1", - "@rollup/rollup-freebsd-x64": "4.55.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.55.1", - "@rollup/rollup-linux-arm-musleabihf": "4.55.1", - "@rollup/rollup-linux-arm64-gnu": "4.55.1", - "@rollup/rollup-linux-arm64-musl": "4.55.1", - "@rollup/rollup-linux-loong64-gnu": "4.55.1", - "@rollup/rollup-linux-loong64-musl": "4.55.1", - "@rollup/rollup-linux-ppc64-gnu": "4.55.1", - "@rollup/rollup-linux-ppc64-musl": "4.55.1", - "@rollup/rollup-linux-riscv64-gnu": "4.55.1", - "@rollup/rollup-linux-riscv64-musl": "4.55.1", - "@rollup/rollup-linux-s390x-gnu": "4.55.1", - "@rollup/rollup-linux-x64-gnu": "4.55.1", - "@rollup/rollup-linux-x64-musl": "4.55.1", - "@rollup/rollup-openbsd-x64": "4.55.1", - "@rollup/rollup-openharmony-arm64": "4.55.1", - "@rollup/rollup-win32-arm64-msvc": "4.55.1", - "@rollup/rollup-win32-ia32-msvc": "4.55.1", - "@rollup/rollup-win32-x64-gnu": "4.55.1", - "@rollup/rollup-win32-x64-msvc": "4.55.1", - "fsevents": "~2.3.2" - } - }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true, - "license": "ISC" - }, - "node_modules/source-map": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", - "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">= 12" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true, - "license": "MIT" - }, - "node_modules/std-env": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", - "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", - "dev": true, - "license": "MIT" - }, - "node_modules/sucrase": { - "version": "3.35.1", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", - "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.2", - "commander": "^4.0.0", - "lines-and-columns": "^1.1.6", - "mz": "^2.7.0", - "pirates": "^4.0.1", - "tinyglobby": "^0.2.11", - "ts-interface-checker": "^0.1.9" - }, - "bin": { - "sucrase": "bin/sucrase", - "sucrase-node": "bin/sucrase-node" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/supports-color": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", - "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tinybench": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", - "dev": true, - "license": "MIT" - }, - "node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", - "dev": true, - "license": "MIT" - }, - "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.3" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/tinypool": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", - "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.0.0 || >=20.0.0" - } - }, - "node_modules/tinyrainbow": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", - "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", - "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true, - "license": "MIT", - "bin": { - "tree-kill": "cli.js" - } - }, - "node_modules/ts-interface-checker": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/tsup": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", - "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", - "dev": true, - "license": "MIT", - "dependencies": { - "bundle-require": "^5.1.0", - "cac": "^6.7.14", - "chokidar": "^4.0.3", - "consola": "^3.4.0", - "debug": "^4.4.0", - "esbuild": "^0.27.0", - "fix-dts-default-cjs-exports": "^1.0.0", - "joycon": "^3.1.1", - "picocolors": "^1.1.1", - "postcss-load-config": "^6.0.1", - "resolve-from": "^5.0.0", - "rollup": "^4.34.8", - "source-map": "^0.7.6", - "sucrase": "^3.35.0", - "tinyexec": "^0.3.2", - "tinyglobby": "^0.2.11", - "tree-kill": "^1.2.2" - }, - "bin": { - "tsup": "dist/cli-default.js", - "tsup-node": "dist/cli-node.js" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@microsoft/api-extractor": "^7.36.0", - "@swc/core": "^1", - "postcss": "^8.4.12", - "typescript": ">=4.5.0" - }, - "peerDependenciesMeta": { - "@microsoft/api-extractor": { - "optional": true - }, - "@swc/core": { - "optional": true - }, - "postcss": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/type-fest": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", - "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typedoc": { - "version": "0.27.9", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.9.tgz", - "integrity": "sha512-/z585740YHURLl9DN2jCWe6OW7zKYm6VoQ93H0sxZ1cwHQEQrUn5BJrEnkWhfzUdyO+BLGjnKUZ9iz9hKloFDw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@gerrit0/mini-shiki": "^1.24.0", - "lunr": "^2.3.9", - "markdown-it": "^14.1.0", - "minimatch": "^9.0.5", - "yaml": "^2.6.1" - }, - "bin": { - "typedoc": "bin/typedoc" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x" - } - }, - "node_modules/typedoc/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/uc.micro": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", - "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", - "dev": true, - "license": "MIT" - }, - "node_modules/ufo": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.2.tgz", - "integrity": "sha512-heMioaxBcG9+Znsda5Q8sQbWnLJSl98AFDXTO80wELWEzX3hordXsTdxrIfMQoO9IY1MEnoGoPjpoKpMj+Yx0Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/vite": { - "version": "5.4.21", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", - "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "^0.21.3", - "postcss": "^8.4.43", - "rollup": "^4.20.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "sass-embedded": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } - } - }, - "node_modules/vite-node": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz", - "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.7", - "es-module-lexer": "^1.5.4", - "pathe": "^1.1.2", - "vite": "^5.0.0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/vite-node/node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/vite/node_modules/@esbuild/aix-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", - "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/android-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", - "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/android-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", - "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/android-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", - "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/darwin-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", - "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/darwin-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", - "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", - "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/freebsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", - "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", - "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", - "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", - "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-loong64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", - "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-mips64el": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", - "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", - "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-riscv64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", - "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-s390x": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", - "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", - "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/netbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", - "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/openbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", - "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/sunos-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", - "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/win32-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", - "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/win32-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", - "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/win32-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", - "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" - } - }, - "node_modules/vitest": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz", - "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/expect": "2.1.9", - "@vitest/mocker": "2.1.9", - "@vitest/pretty-format": "^2.1.9", - "@vitest/runner": "2.1.9", - "@vitest/snapshot": "2.1.9", - "@vitest/spy": "2.1.9", - "@vitest/utils": "2.1.9", - "chai": "^5.1.2", - "debug": "^4.3.7", - "expect-type": "^1.1.0", - "magic-string": "^0.30.12", - "pathe": "^1.1.2", - "std-env": "^3.8.0", - "tinybench": "^2.9.0", - "tinyexec": "^0.3.1", - "tinypool": "^1.0.1", - "tinyrainbow": "^1.2.0", - "vite": "^5.0.0", - "vite-node": "2.1.9", - "why-is-node-running": "^2.3.0" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.9", - "@vitest/ui": "2.1.9", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } - } - }, - "node_modules/vitest/node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/why-is-node-running": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", - "dev": true, - "license": "MIT", - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yaml": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", - "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - }, - "node_modules/yaml-ast-parser": { - "version": "0.0.43", - "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", - "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index 2f7ddc1..0000000 --- a/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "@seclai/sdk", - "version": "0.0.0", - "description": "Seclai JavaScript SDK", - "keywords": ["Seclai", "ai", "agent", "vector", "knowledge base", "cloud"], - "license": "MIT", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" - } - }, - "files": [ - "dist", - "LICENSE", - "README.md", - "CHANGELOG.md" - ], - "homepage": "https://seclai.github.io/seclai-javascript/latest/", - "bugs": { - "url": "https://github.com/seclai/seclai-javascript/issues", - "email": "support@seclai.com" - }, - "repository": "github:seclai/seclai-javascript", - "scripts": { - "version:apply": "node scripts/set-version.mjs apply && node scripts/set-readme-version.mjs apply", - "version:restore": "node scripts/set-readme-version.mjs restore && node scripts/set-version.mjs restore", - "generate": "openapi-typescript openapi/seclai.openapi.json -o src/openapi.ts", - "build": "npm run generate && tsup src/index.ts --format esm,cjs --dts", - "build:versioned": "npm run version:apply && npm run build && npm run version:restore", - "publish:ci": "npm run version:apply && npm run build && npm publish --provenance --access public --ignore-scripts && npm run version:restore", - "docs": "npm run generate && typedoc", - "test": "vitest run", - "test:watch": "vitest", - "typecheck": "tsc -p tsconfig.json --noEmit" - }, - "devDependencies": { - "openapi-typescript": "^7.9.1", - "typedoc": "^0.27.6", - "tsup": "^8.5.0", - "vitest": "^2.1.9", - "typescript": "^5.7.3" - } -} diff --git a/scripts/set-readme-version.mjs b/scripts/set-readme-version.mjs deleted file mode 100644 index 456a336..0000000 --- a/scripts/set-readme-version.mjs +++ /dev/null @@ -1,44 +0,0 @@ -import fs from "node:fs"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; - -const mode = process.argv[2]; -if (mode !== "apply" && mode !== "restore") { - console.error("Usage: node scripts/set-readme-version.mjs "); - process.exit(2); -} - -const repoRoot = path.resolve(fileURLToPath(new URL("..", import.meta.url))); -const readmePath = path.join(repoRoot, "README.md"); -const backupPath = path.join(repoRoot, ".README.md.bak"); - -const DOCS_LATEST = "https://seclai.github.io/seclai-javascript/latest/"; - -if (mode === "apply") { - const version = process.env.VERSION; - if (!version) { - console.error("Missing VERSION env var."); - process.exit(2); - } - - if (!fs.existsSync(backupPath)) { - fs.copyFileSync(readmePath, backupPath); - } - - const original = fs.readFileSync(readmePath, "utf8"); - const versioned = `https://seclai.github.io/seclai-javascript/${version}/`; - - // Replace only the canonical docs link. Keep other "latest" mentions untouched. - const updated = original.includes(DOCS_LATEST) - ? original.replaceAll(DOCS_LATEST, versioned) - : original; - - fs.writeFileSync(readmePath, updated); -} - -if (mode === "restore") { - if (fs.existsSync(backupPath)) { - fs.copyFileSync(backupPath, readmePath); - fs.rmSync(backupPath); - } -} diff --git a/scripts/set-version.mjs b/scripts/set-version.mjs deleted file mode 100644 index 49dcd75..0000000 --- a/scripts/set-version.mjs +++ /dev/null @@ -1,56 +0,0 @@ -import fs from "node:fs"; -import path from "node:path"; - -const ROOT = path.resolve(process.cwd()); -const PACKAGE_JSON = path.join(ROOT, "package.json"); -const BACKUP = path.join(ROOT, ".version-backup.json"); - -function readJson(filePath) { - return JSON.parse(fs.readFileSync(filePath, "utf8")); -} - -function writeJson(filePath, value) { - fs.writeFileSync(filePath, JSON.stringify(value, null, 2) + "\n", "utf8"); -} - -function normalizeVersion(v) { - if (typeof v !== "string") return undefined; - const trimmed = v.trim(); - if (!trimmed) return undefined; - return trimmed.startsWith("v") ? trimmed.slice(1) : trimmed; -} - -const command = process.argv[2]; - -if (command === "apply") { - const envVersion = normalizeVersion(process.env.VERSION); - if (!envVersion) process.exit(0); - - const pkg = readJson(PACKAGE_JSON); - - if (!fs.existsSync(BACKUP)) { - writeJson(BACKUP, { version: pkg.version }); - } - - pkg.version = envVersion; - writeJson(PACKAGE_JSON, pkg); - process.exit(0); -} - -if (command === "restore") { - if (!fs.existsSync(BACKUP)) process.exit(0); - - const backup = readJson(BACKUP); - const pkg = readJson(PACKAGE_JSON); - - if (typeof backup.version === "string") { - pkg.version = backup.version; - writeJson(PACKAGE_JSON, pkg); - } - - fs.unlinkSync(BACKUP); - process.exit(0); -} - -console.error('Usage: node scripts/set-version.mjs '); -process.exit(2); diff --git a/src/auth.ts b/src/auth.ts deleted file mode 100644 index 47aaf8f..0000000 --- a/src/auth.ts +++ /dev/null @@ -1,602 +0,0 @@ -/** - * @module - * - * SSO credential resolution: config file parsing, token caching, and automatic - * token refresh against AWS Cognito. - * - * @internal — not part of the public API surface. Consumed by {@link Seclai}. - */ -import type { FetchLike } from "./client"; - -// ─── Types ─────────────────────────────────────────────────────────────────── - -/** Resolved SSO profile settings. */ -export interface SsoProfile { - ssoAccountId?: string | undefined; - ssoRegion: string; - ssoClientId: string; - ssoDomain: string; -} - -/** Contents of a single SSO cache file. */ -export interface SsoCacheEntry { - accessToken: string; - refreshToken?: string; - idToken?: string | undefined; - expiresAt: string; // ISO-8601 - clientId: string; - region: string; - cognitoDomain: string; -} - -// ─── Constants ─────────────────────────────────────────────────────────────── - -const DEFAULT_CONFIG_DIR = ".seclai"; -const SSO_CACHE_DIR = "sso/cache"; -const CONFIG_FILE = "config"; -const EXPIRY_BUFFER_MS = 30_000; // 30 seconds -const DEFAULT_API_KEY_HEADER = "x-api-key"; - -/** Default SSO domain (production Cognito). Override with `SECLAI_SSO_DOMAIN` or config file. */ -export const DEFAULT_SSO_DOMAIN = "auth.seclai.com"; -/** Default SSO client ID (production public client). Override with `SECLAI_SSO_CLIENT_ID` or config file. */ -export const DEFAULT_SSO_CLIENT_ID = "4bgf8v9qmc5puivbaqon9n5lmr"; -/** Default SSO region. Override with `SECLAI_SSO_REGION` or config file. */ -export const DEFAULT_SSO_REGION = "us-west-2"; - -// ─── Environment helpers ───────────────────────────────────────────────────── - -function getEnv(name: string): string | undefined { - const p = (globalThis as any)?.process; - return p?.env?.[name]; -} - -function getHomeDir(): string | undefined { - const p = (globalThis as any)?.process; - return p?.env?.HOME ?? p?.env?.USERPROFILE; -} - -// ─── SHA-1 hash ────────────────────────────────────────────────────────────── - -async function sha1Hex(input: string): Promise { - // Prefer Node.js crypto when available - try { - // @ts-expect-error -- resolved at runtime; no @types/node in this package - const { createHash } = await import("node:crypto"); - return createHash("sha1").update(input).digest("hex"); - } catch { - // Fall back to Web Crypto API - const encoded = new TextEncoder().encode(input); - const buffer = await crypto.subtle.digest("SHA-1", encoded); - return Array.from(new Uint8Array(buffer)) - .map((b) => b.toString(16).padStart(2, "0")) - .join(""); - } -} - -/** - * Compute the cache filename for a given domain + clientId. - * - * @param domain - The Cognito domain (e.g. `"auth.example.com"`). - * @param clientId - The Cognito app client ID. - * @returns SHA-1 hex digest of `"domain|clientId"`. - */ -export async function cacheFileName(domain: string, clientId: string): Promise { - return sha1Hex(`${domain}|${clientId}`); -} - -// ─── INI parser ────────────────────────────────────────────────────────────── - -/** - * Minimal INI parser matching AWS config format: - * - `[default]` section - * - `[profile ]` sections - * - `key = value` pairs - * - Lines starting with `#` or `;` are comments - * - * @param content - Raw INI file content. - * @returns Map of section names to key-value pairs. - */ -export function parseIni(content: string): Record> { - const sections: Record> = {}; - let currentSection: string | null = null; - - for (const rawLine of content.split(/\r?\n/)) { - const line = rawLine.trim(); - - if (!line || line.startsWith("#") || line.startsWith(";")) continue; - - const sectionMatch = line.match(/^\[(.+)\]$/); - if (sectionMatch) { - const raw = sectionMatch[1]!.trim(); - // `[default]` stays as "default", `[profile foo]` becomes "foo" - currentSection = raw.startsWith("profile ") - ? raw.slice("profile ".length).trim() - : raw; - sections[currentSection] ??= {}; - continue; - } - - if (currentSection !== null) { - const eqIdx = line.indexOf("="); - if (eqIdx > 0) { - const key = line.slice(0, eqIdx).trim(); - const value = line.slice(eqIdx + 1).trim(); - sections[currentSection]![key] = value; - } - } - } - - return sections; -} - -// ─── File system (Node.js only) ────────────────────────────────────────────── - -interface FsModule { - readFileSync(path: string, encoding: string): string; - writeFileSync(path: string, data: string, options?: { mode?: number }): void; - mkdirSync(path: string, options?: { recursive?: boolean; mode?: number }): void; - existsSync(path: string): boolean; - unlinkSync(path: string): void; - renameSync(oldPath: string, newPath: string): void; -} - -interface PathModule { - join(...parts: string[]): string; -} - -let _fs: FsModule | null = null; -let _path: PathModule | null = null; - -async function getFs(): Promise { - if (!_fs) { - // @ts-expect-error -- resolved at runtime; no @types/node in this package - _fs = (await import("node:fs")) as unknown as FsModule; - } - return _fs; -} - -async function getPath(): Promise { - if (!_path) { - // @ts-expect-error -- resolved at runtime; no @types/node in this package - _path = (await import("node:path")) as unknown as PathModule; - } - return _path; -} - -// ─── Config dir resolution ─────────────────────────────────────────────────── - -/** - * Resolve the config directory path. - * - * @param override - Explicit directory path (highest priority). - * @returns Resolved absolute path to the config directory. - * @throws {Error} If the home directory cannot be determined and no override is provided. - */ -export async function resolveConfigDir(override?: string): Promise { - if (override) return override; - - const envDir = getEnv("SECLAI_CONFIG_DIR"); - if (envDir) return envDir; - - const home = getHomeDir(); - if (!home) { - throw new Error("Cannot determine home directory. Set SECLAI_CONFIG_DIR."); - } - - const pathMod = await getPath(); - return pathMod.join(home, DEFAULT_CONFIG_DIR); -} - -// ─── Profile resolution ───────────────────────────────────────────────────── - -/** - * Load and resolve an SSO profile from the config file. - * Non-default profiles inherit unset keys from `[default]`. - * All profiles fall back to built-in defaults and environment variable overrides. - * - * **Node.js only** — this function uses `node:fs` and `node:path` internally - * and will throw in browser/edge-worker runtimes. - * - * @param configDir - Resolved config directory path. - * @param profileName - Profile name to look up (`"default"` or a named profile). - * @returns The resolved profile. Always returns a valid profile using built-in defaults. - */ -export async function loadSsoProfile( - configDir: string, - profileName: string, -): Promise { - const fs = await getFs(); - const pathMod = await getPath(); - - let merged: Record = {}; - - const configPath = pathMod.join(configDir, CONFIG_FILE); - if (fs.existsSync(configPath)) { - const content = fs.readFileSync(configPath, "utf-8"); - const sections = parseIni(content); - - const defaultSection = sections["default"] ?? {}; - const profileSection = profileName === "default" ? defaultSection : sections[profileName]; - - if (profileSection) { - merged = profileName === "default" ? profileSection : { ...defaultSection, ...profileSection }; - } - } - - // Environment variables override config file values - const ssoDomain = getEnv("SECLAI_SSO_DOMAIN") ?? merged["sso_domain"] ?? DEFAULT_SSO_DOMAIN; - const ssoClientId = getEnv("SECLAI_SSO_CLIENT_ID") ?? merged["sso_client_id"] ?? DEFAULT_SSO_CLIENT_ID; - const ssoRegion = getEnv("SECLAI_SSO_REGION") ?? merged["sso_region"] ?? DEFAULT_SSO_REGION; - const ssoAccountId = merged["sso_account_id"] || undefined; - - return { ssoAccountId, ssoRegion, ssoClientId, ssoDomain }; -} - -// ─── Cache I/O ─────────────────────────────────────────────────────────────── - -/** - * Read a cached SSO token from disk. - * - * @param configDir - Resolved config directory path. - * @param profile - SSO profile (used to derive the cache filename). - * @returns The cached entry, or `null` if not found or unreadable. - */ -/** Resolve the full path to a profile's SSO cache file. */ -async function resolveCachePath( - configDir: string, - profile: SsoProfile, -): Promise { - const pathMod = await getPath(); - const hash = await cacheFileName(profile.ssoDomain, profile.ssoClientId); - return pathMod.join(configDir, SSO_CACHE_DIR, `${hash}.json`); -} - -export async function readSsoCache( - configDir: string, - profile: SsoProfile, -): Promise { - const fs = await getFs(); - - const cachePath = await resolveCachePath(configDir, profile); - - if (!fs.existsSync(cachePath)) return null; - - try { - const raw = fs.readFileSync(cachePath, "utf-8"); - return JSON.parse(raw) as SsoCacheEntry; - } catch { - return null; - } -} - -/** - * Write a cached SSO token to disk atomically. - * Creates the cache directory if it doesn't exist. - * - * @param configDir - Resolved config directory path. - * @param profile - SSO profile (used to derive the cache filename). - * @param entry - Token data to persist. - */ -export async function writeSsoCache( - configDir: string, - profile: SsoProfile, - entry: SsoCacheEntry, -): Promise { - const fs = await getFs(); - const pathMod = await getPath(); - - const cacheDir = pathMod.join(configDir, SSO_CACHE_DIR); - fs.mkdirSync(cacheDir, { recursive: true, mode: 0o700 }); - - const cachePath = await resolveCachePath(configDir, profile); - const tmpPath = `${cachePath}.tmp`; - - fs.writeFileSync(tmpPath, JSON.stringify(entry, null, 2), { mode: 0o600 }); - // On Windows, renameSync fails if destination exists — delete first (best-effort) - if (fs.existsSync(cachePath)) { - try { fs.unlinkSync(cachePath); } catch { /* let renameSync throw if needed */ } - } - fs.renameSync(tmpPath, cachePath); -} - -/** - * Delete a cached SSO token file. - * - * @param configDir - Resolved config directory path. - * @param profile - SSO profile (used to derive the cache filename). - */ -export async function deleteSsoCache( - configDir: string, - profile: SsoProfile, -): Promise { - const fs = await getFs(); - - const cachePath = await resolveCachePath(configDir, profile); - - if (fs.existsSync(cachePath)) { - fs.unlinkSync(cachePath); - } -} - -// ─── Token validation ──────────────────────────────────────────────────────── - -/** - * Check if a cached token is still valid (with 30s buffer). - * - * @param entry - The cached token entry to check. - * @returns `true` if the token expires more than 30 seconds in the future. - */ -export function isTokenValid(entry: SsoCacheEntry): boolean { - const expiresAt = new Date(entry.expiresAt).getTime(); - return Date.now() + EXPIRY_BUFFER_MS < expiresAt; -} - -// ─── Token refresh ─────────────────────────────────────────────────────────── - -/** - * Refresh an access token using a Cognito refresh_token grant. - * - * @param profile - SSO profile with Cognito domain and client ID. - * @param refreshTokenValue - The refresh token to exchange. - * @param fetcher - A `fetch`-compatible function for making HTTP requests. - * @returns A fresh {@link SsoCacheEntry} with the new tokens. - * @throws {Error} If the Cognito token endpoint returns a non-OK status. - */ -export async function refreshToken( - profile: SsoProfile, - refreshTokenValue: string, - fetcher: FetchLike, -): Promise { - const tokenUrl = `https://${profile.ssoDomain}/oauth2/token`; - - const body = new URLSearchParams({ - grant_type: "refresh_token", - client_id: profile.ssoClientId, - refresh_token: refreshTokenValue, - }); - - const response = await fetcher(tokenUrl, { - method: "POST", - headers: { "content-type": "application/x-www-form-urlencoded" }, - body: body.toString(), - }); - - if (!response.ok) { - const text = await response.text().catch(() => ""); - throw new Error(`Token refresh failed (HTTP ${response.status}): ${text}`); - } - - const data = (await response.json()) as { - access_token: string; - id_token?: string; - refresh_token?: string; - expires_in: number; - }; - - const expiresAt = new Date(Date.now() + data.expires_in * 1000).toISOString(); - - return { - accessToken: data.access_token, - refreshToken: data.refresh_token ?? refreshTokenValue, - idToken: data.id_token ?? undefined, - expiresAt, - clientId: profile.ssoClientId, - region: profile.ssoRegion, - cognitoDomain: profile.ssoDomain, - }; -} - -// ─── Credential chain resolver ─────────────────────────────────────────────── - -/** Options for resolving the credential chain. */ -export interface CredentialChainOptions { - /** Explicit API key (highest priority). */ - apiKey?: string | undefined; - /** Explicit static bearer token. */ - accessToken?: string | undefined; - /** Dynamic bearer token provider. */ - accessTokenProvider?: (() => string | Promise) | undefined; - /** Name of the profile from ~/.seclai/config. */ - profile?: string | undefined; - /** Override config directory path. */ - configDir?: string | undefined; - /** Whether to auto-refresh expired SSO tokens. Defaults to true. */ - autoRefresh?: boolean | undefined; - /** Account ID override (takes precedence over profile's sso_account_id). */ - accountId?: string | undefined; - /** Header name for API key auth. */ - apiKeyHeader?: string | undefined; - /** fetch implementation for token refresh. */ - fetch?: FetchLike | undefined; -} - -/** - * Resolved authentication state used throughout the client lifecycle. - * Created once by {@link resolveCredentialChain} and passed to - * {@link resolveAuthHeaders} on every request. - */ -export interface AuthState { - mode: "apiKey" | "bearerStatic" | "bearerProvider" | "sso"; - apiKey?: string; - apiKeyHeader: string; - accessToken?: string; - accessTokenProvider?: () => string | Promise; - accountId?: string | undefined; - ssoProfile?: SsoProfile; - configDir?: string; - autoRefresh: boolean; - fetcher?: FetchLike | undefined; - /** @internal Coalesces concurrent SSO token refresh attempts. */ - _refreshPromise?: Promise | undefined; -} - -/** - * Resolve the credential chain and return an AuthState. - * This is called once at client construction time. - * - * Resolution order: - * 1. Explicit `apiKey` option - * 2. Explicit `accessToken` option - * 3. Explicit `accessTokenProvider` option - * 4. `SECLAI_API_KEY` environment variable - * 5. SSO profile from `~/.seclai/config` - * - * @param opts - Credential chain options. - * @returns Resolved authentication state. - * @throws {Error} If no credentials are found. - */ -export async function resolveCredentialChain( - opts: CredentialChainOptions, -): Promise { - const apiKeyHeader = opts.apiKeyHeader ?? DEFAULT_API_KEY_HEADER; - - // 1. Explicit apiKey option - if (opts.apiKey) { - return { - mode: "apiKey", - apiKey: opts.apiKey, - apiKeyHeader, - accountId: opts.accountId, - autoRefresh: false, - }; - } - - // 2. Explicit accessToken (mutual exclusion already checked by caller) - if (opts.accessToken) { - return { - mode: "bearerStatic", - accessToken: opts.accessToken, - apiKeyHeader, - accountId: opts.accountId, - autoRefresh: false, - }; - } - - // 3. Explicit accessTokenProvider - if (opts.accessTokenProvider) { - return { - mode: "bearerProvider", - accessTokenProvider: opts.accessTokenProvider, - apiKeyHeader, - accountId: opts.accountId, - autoRefresh: false, - }; - } - - // 4. SECLAI_API_KEY env var - const envApiKey = getEnv("SECLAI_API_KEY"); - if (envApiKey) { - return { - mode: "apiKey", - apiKey: envApiKey, - apiKeyHeader, - accountId: opts.accountId, - autoRefresh: false, - }; - } - - // 5. Profile-based SSO resolution - try { - const configDir = await resolveConfigDir(opts.configDir); - const profileName = opts.profile ?? getEnv("SECLAI_PROFILE") ?? "default"; - const ssoProfile = await loadSsoProfile(configDir, profileName); - - return { - mode: "sso", - apiKeyHeader, - accountId: opts.accountId ?? ssoProfile.ssoAccountId, - ssoProfile, - configDir, - autoRefresh: opts.autoRefresh !== false, - fetcher: opts.fetch, - }; - } catch { - // Config dir not found — fall through - } - - // 6. Nothing found - throw new Error( - "Missing credentials. Provide apiKey, accessToken, set SECLAI_API_KEY, or run `seclai auth login`.", - ); -} - -/** - * Resolve authentication headers from the current AuthState. - * Called per-request to handle dynamic token providers and SSO cache refresh. - * - * @param state - The resolved authentication state. - * @returns Headers object with the appropriate auth header(s) set. - */ -export async function resolveAuthHeaders( - state: AuthState, -): Promise> { - const headers: Record = {}; - - switch (state.mode) { - case "apiKey": - headers[state.apiKeyHeader] = state.apiKey!; - break; - - case "bearerStatic": - headers["authorization"] = `Bearer ${state.accessToken!}`; - break; - - case "bearerProvider": { - const token = await Promise.resolve(state.accessTokenProvider!()); - headers["authorization"] = `Bearer ${token}`; - break; - } - - case "sso": { - const token = await resolveSsoToken(state); - headers["authorization"] = `Bearer ${token}`; - break; - } - } - - if (state.accountId) { - headers["x-account-id"] = state.accountId; - } - - return headers; -} - -/** Resolve a valid SSO token, refreshing from cache if needed. */ -async function resolveSsoToken(state: AuthState): Promise { - const profile = state.ssoProfile!; - const configDir = state.configDir!; - - const cached = await readSsoCache(configDir, profile); - - if (cached && isTokenValid(cached)) { - return cached.accessToken; - } - - if (cached?.refreshToken && state.autoRefresh) { - // Coalesce concurrent refresh attempts - if (state._refreshPromise) { - return state._refreshPromise; - } - - const fetcher = state.fetcher ?? (globalThis.fetch as FetchLike | undefined); - if (!fetcher) { - throw new Error("No fetch implementation available for token refresh."); - } - - state._refreshPromise = (async () => { - try { - const refreshed = await refreshToken(profile, cached.refreshToken!, fetcher); - await writeSsoCache(configDir, profile, refreshed); - return refreshed.accessToken; - } finally { - state._refreshPromise = undefined; - } - })(); - return state._refreshPromise; - } - - throw new Error( - `SSO token expired. Run \`seclai auth login\` to re-authenticate.`, - ); -} diff --git a/src/client.ts b/src/client.ts deleted file mode 100644 index 3b67f62..0000000 --- a/src/client.ts +++ /dev/null @@ -1,3462 +0,0 @@ -/** - * @module - * - * Main SDK client for the Seclai API. - * - * Exports the {@link Seclai} class which provides typed convenience methods for - * every API endpoint, plus low-level {@link Seclai.request | request()} and - * {@link Seclai.requestRaw | requestRaw()} escape hatches, streaming helpers, - * and automatic pagination. - */ -import { - SeclaiAPIStatusError, - SeclaiAPIValidationError, - SeclaiConfigurationError, - SeclaiError, - SeclaiStreamingError, -} from "./errors"; -import type { ApiVersion } from "./versions"; -import { KNOWN_API_VERSIONS } from "./versions"; -import type { AuthState } from "./auth"; -import { resolveCredentialChain, resolveAuthHeaders } from "./auth"; -import type { - AgentRunEvent, - AddEmailDomainInput, - AgentAttachmentRefsApiResponse, - AgentCallerApiResponse, - AgentDefinitionImportErrorResponse, - AgentDefinitionResponse, - AgentEmailOptOutListResponse, - AgentExportResponse, - AgentImportPreviewRequest, - AgentImportPreviewResponse, - AgentListResponse, - AgentRunListResponse, - AgentRunRequest, - AgentRunResponse, - AgentRunStreamRequest, - AgentSummaryResponse, - AgentUsingCloudDriveResponse, - CloudDriveProviderResponse, - CloudDriveRejectionResponse, - CloudDriveResponse, - CloudDriveUpdateRequest, - EmbeddingModelListResponse, - ListSourceContentsOptions, - RerankerModelListResponse, - SourceContentStatusListResponse, - SourceContentStatusResponse, - AgentTraceSearchRequest, - AgentTraceSearchResponse, - AiAssistantAcceptRequest, - AiAssistantAcceptResponse, - AiAssistantFeedbackRequest, - AiAssistantFeedbackResponse, - AiAssistantGenerateRequest, - AiAssistantGenerateResponse, - AiConversationHistoryResponse, - AddCommentRequest, - AddConversationTurnRequest, - BlockEmailSenderRequest, - BlockedEmailSenderListResponse, - BlockedEmailSenderResponse, - CancelQueuedRunsResponse, - ChangeStatusRequest, - CompatibleRunListResponse, - CompactionTestResponse, - ContentDetailResponse, - ContentEmbeddingsListResponse, - ContentFileUploadResponse, - CreateAgentRequest, - CreateAlertConfigRequest, - CreateEvaluationCriteriaRequest, - CreateEvaluationResultRequest, - CreateExportRequest, - CreateKnowledgeBaseBody, - CreateMemoryBankBody, - CreateSolutionRequest, - CreateSourceBody, - DmarcSummaryResponse, - EmailDomainResponse, - EmailDomainsListResponse, - EmailTriggerConfigResponse, - EstimateExportRequest, - EstimateExportResponse, - EvaluationCriteriaResponse, - EvaluationCriteriaListResponse, - ApiVersionResponse, - AlertDetailResponse, - AlertCommentResponse, - AlertSubscriberResponse, - UnreadCountResponse, - ModelRecommendationsResponse, - ModelRecommendationResponse, - ExperimentListResponse, - ExperimentSummaryResponse, - ExperimentDetailResponse, - CreateExperimentResponse, - CancelExperimentResponse, - SearchResponse, - SearchResultResponse, - OkResponse, - AlertResponse, - AlertConfigResponse, - ModelAlertResponse, - AlertListResponse, - AlertConfigListResponse, - ModelAlertListResponse, - EvaluationResultListResponse, - EvaluationResultResponse, - EvaluationResultSummaryResponse, - EvaluationResultWithCriteriaListResponse, - EvaluationRunSummaryListResponse, - ExportListResponse, - ExportResponse, - FileUploadResponse, - GenerateAgentStepsRequest, - GenerateAgentStepsResponse, - GenerateStepConfigRequest, - GenerateStepConfigResponse, - GovernanceAiAcceptResponse, - GovernanceAiAssistantRequest, - GovernanceAiAssistantResponse, - GovernanceConversationResponse, - InboundEmailRejectionResponse, - InboundEmailStatusResponse, - InlineTextReplaceRequest, - InlineTextUploadRequest, - KnowledgeBaseListResponse, - KnowledgeBaseResponse, - LinkResourcesRequest, - ListOptions, - MarkAiSuggestionRequest, - MarkConversationTurnRequest, - MemoryBankAcceptRequest, - MemoryBankAiAssistantRequest, - MemoryBankAiAssistantResponse, - MemoryBankLastConversationResponse, - MeResponse, - MemoryBankListResponse, - MemoryBankResponse, - NonManualEvaluationSummaryResponse, - OrganizationAlertPreferenceListResponse, - OrganizationAlertPreferenceResponse, - PlaygroundCreateRequest, - CreateExperimentInput, - PromptModelResponse, - ProviderGroupResponse, - RemoveEmailDomainResponse, - ResumeInboundResponse, - SendTestEmailResponse, - SetAutoBlockModeRequest, - SetEmailTriggerConfigRequest, - SolutionConversationResponse, - SolutionListResponse, - SolutionResponse, - SortableListOptions, - SourceEmbeddingMigrationResponse, - SourceListResponse, - SourceResponse, - StandaloneTestCompactionRequest, - StartSourceEmbeddingMigrationRequest, - TestCompactionRequest, - TestDraftEvaluationRequest, - TestDraftEvaluationResponse, - UnlinkResourcesRequest, - UpdateAgentDefinitionRequest, - UpdateAgentRequest, - UpdateAlertConfigRequest, - UpdateEvaluationCriteriaRequest, - UpdateKnowledgeBaseBody, - UpdateMemoryBankBody, - UpdateOrganizationAlertPreferenceRequest, - UpdateSolutionRequest, - UpdateSourceBody, - UploadAgentInputApiResponse, -} from "./types"; - -/** Default API base URL (can be overridden with `baseUrl` or `SECLAI_API_URL`). */ -export const SECLAI_API_URL = "https://api.seclai.com"; - -/** A `fetch`-compatible function (e.g. `globalThis.fetch` or `undici.fetch`). */ -export type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise; - -/** - * Token provider: a synchronous or asynchronous function that returns an - * access token string. Called on every request to allow automatic refresh. - */ -export type AccessTokenProvider = () => string | Promise; - -/** Configuration for the {@link Seclai} client. */ -export interface SeclaiOptions { - /** API key used for authentication. Defaults to `process.env.SECLAI_API_KEY` when available. */ - apiKey?: string; - /** - * Static bearer access token **or** a provider function that returns one. - * Mutually exclusive with `apiKey`. - */ - accessToken?: string | AccessTokenProvider; - /** API base URL. Defaults to `process.env.SECLAI_API_URL` when available, else {@link SECLAI_API_URL}. */ - baseUrl?: string; - /** Header name to use for the API key. Defaults to `x-api-key`. */ - apiKeyHeader?: string; - /** Extra headers to include on every request. */ - defaultHeaders?: Record; - /** Optional `fetch` implementation for environments without a global `fetch`. */ - fetch?: FetchLike; - /** - * SSO profile name to load from `~/.seclai/config`. - * Defaults to `process.env.SECLAI_PROFILE`, then `"default"`. - */ - profile?: string; - /** - * Override the config directory path (default: `SECLAI_CONFIG_DIR` env var or `~/.seclai/`). - */ - configDir?: string; - /** - * Whether to auto-refresh expired SSO tokens. Defaults to `true`. - * Set to `false` in environments that should not write to disk. - */ - autoRefresh?: boolean; - /** - * Target organization account ID. Sent as `X-Account-Id` header. - * Overrides the profile's `sso_account_id` when using SSO auth. - */ - accountId?: string; - /** - * Dated API version (`YYYY-MM-DD`) sent as the `Seclai-Version` header, opting - * this client into backward-incompatible API changes released on or before - * that date. - * - * Left unset the header is omitted and the account's pinned baseline applies, - * so responses keep their current shapes and upgrading the SDK alone never - * changes the wire contract. Pin the account instead with - * {@link Seclai.updateApiVersion}, and read what a request resolves to with - * {@link Seclai.getApiVersion}. - * - * From `2026-07-27` the API rejects undeclared query parameters with a 422 - * rather than ignoring them, and list endpoints return the canonical - * `{data, pagination}` envelope. - */ - apiVersion?: ApiVersion; - /** - * Permit an {@link apiVersion} this release was not built against. - * - * Off by default. A newer API version can change response shapes, and this - * client would decode them incorrectly rather than reject them — a - * request-side mistake answers 422, but a reshaped response just mis-decodes, - * silently. Prefer upgrading the package. - */ - allowUnknownApiVersion?: boolean; -} - -// ─── Internal Helpers ──────────────────────────────────────────────────────── - -function getEnv(name: string): string | undefined { - const p = (globalThis as any)?.process; - return p?.env?.[name]; -} - -function buildURL(baseUrl: string, path: string, query?: Record): URL { - // Ensure baseUrl ends with "/" so new URL() preserves its path component. - const base = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`; - // Strip leading "/" from path so it's treated as relative to base. - const relative = path.startsWith("/") ? path.slice(1) : path; - const url = new URL(relative, base); - if (query) { - for (const [key, value] of Object.entries(query)) { - if (value === undefined || value === null) continue; - if (Array.isArray(value)) { - // A repeatable parameter: one `key=value` pair per element. - for (const item of value) url.searchParams.append(key, String(item)); - continue; - } - url.searchParams.set(key, String(value)); - } - } - return url; -} - -/** - * One page as a fetcher handed to {@link Seclai.paginate} may return it: a list - * method's `{data, pagination}` envelope or flat `{data, total, page, limit}`, - * a bare array, or `{items, pagination}` with a `total_pages` count. - */ -export type PaginatedPage = - | T[] - | { - data?: T[] | null; - pagination?: { pages?: number; has_next?: boolean } | null; - total?: number; - limit?: number; - } - | { items: T[]; pagination?: { page: number; total_pages: number } }; - -/** The items of a list that is a bare array by default and `{data, pagination}` from 2026-07-27. */ -function listItems(res: unknown): T[] { - if (Array.isArray(res)) return res as T[]; - return (res as { data?: T[] | null } | null)?.data ?? []; -} - -/** Restore `models` on a model listing, which arrives under `data` from 2026-07-27. */ -function withModels(res: unknown): T { - const body = res as T & { data?: T["models"] }; - return Array.isArray(body.models) || !Array.isArray(body.data) - ? body - : { ...body, models: body.data }; -} - -async function safeText(response: Response): Promise { - try { - return await response.clone().text(); - } catch { - return undefined; - } -} - -async function safeJson(response: Response): Promise { - try { - return await response.clone().json(); - } catch { - return undefined; - } -} - -type SseMessage = { event?: string; data?: string }; - -function createSseParser(onMessage: (msg: SseMessage) => void) { - let buffer = ""; - let eventName: string | undefined; - let dataLines: string[] = []; - - function dispatch() { - if (!eventName && dataLines.length === 0) return; - const msg: SseMessage = { data: dataLines.join("\n") }; - if (eventName !== undefined) msg.event = eventName; - onMessage(msg); - eventName = undefined; - dataLines = []; - } - - function feed(textChunk: string) { - buffer += textChunk; - while (true) { - const newlineIdx = buffer.indexOf("\n"); - if (newlineIdx === -1) return; - - let line = buffer.slice(0, newlineIdx); - buffer = buffer.slice(newlineIdx + 1); - - if (line.endsWith("\r")) line = line.slice(0, -1); - - if (line === "") { - dispatch(); - continue; - } - - if (line.startsWith(":")) continue; - - const colon = line.indexOf(":"); - const field = colon === -1 ? line : line.slice(0, colon); - let value = colon === -1 ? "" : line.slice(colon + 1); - if (value.startsWith(" ")) value = value.slice(1); - - if (field === "event") { - eventName = value; - } else if (field === "data") { - dataLines.push(value); - } - } - } - - return { feed, end: dispatch }; -} - -function anySignal(signals: Array): AbortSignal | undefined { - const present = signals.filter(Boolean) as AbortSignal[]; - if (present.length === 0) return undefined; - if (present.length === 1) return present[0]; - const controller = new AbortController(); - const onAbort = () => controller.abort(); - for (const s of present) { - if (s.aborted) { - controller.abort(); - break; - } - s.addEventListener("abort", onAbort, { once: true }); - } - return controller.signal; -} - -function toBlob( - file: Blob | Uint8Array | ArrayBuffer | BufferSource, - mimeType?: string, -): Blob { - if (file instanceof Blob) return file; - const opts = mimeType ? { type: mimeType } : undefined; - if (file instanceof ArrayBuffer) return new Blob([new Uint8Array(file)], opts); - return new Blob([file as unknown as BlobPart], opts); -} - -const MIME_TYPES: Record = { - txt: "text/plain", html: "text/html", htm: "text/html", md: "text/markdown", - csv: "text/csv", xml: "text/xml", json: "application/json", - pdf: "application/pdf", doc: "application/msword", - docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - ppt: "application/vnd.ms-powerpoint", - pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation", - xls: "application/vnd.ms-excel", - xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - msg: "application/vnd.ms-outlook", zip: "application/zip", - epub: "application/epub+zip", - png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", gif: "image/gif", - bmp: "image/bmp", tiff: "image/tiff", webp: "image/webp", - mp3: "audio/mpeg", wav: "audio/wav", m4a: "audio/mp4", flac: "audio/flac", - ogg: "audio/ogg", mp4: "video/mp4", mov: "video/quicktime", avi: "video/x-msvideo", -}; - -function inferMimeType(fileName: string | undefined): string | undefined { - if (!fileName) return undefined; - const ext = fileName.split(".").pop()?.toLowerCase(); - return ext ? MIME_TYPES[ext] : undefined; -} - -// ─── Client ────────────────────────────────────────────────────────────────── - -/** - * Seclai JavaScript/TypeScript client. - * - * Provides typed methods for every Seclai API endpoint, plus higher-level - * abstractions for streaming, polling, and pagination. - * - * @example - * ```ts - * import { Seclai } from "@seclai/sdk"; - * - * const client = new Seclai({ apiKey: "sk-..." }); - * - * // List agents - * const { data: agents } = await client.listAgents(); - * - * // Run an agent - * const run = await client.runAgent("agent-id", { input: "Hello!" }); - * - * // Stream an agent run - * for await (const event of client.runStreamingAgent("agent-id", { input: "Hello!" })) { - * console.log(event.event, event.data); - * } - * ``` - */ -export class Seclai { - private readonly baseUrl: string; - private readonly defaultHeaders: Record; - private readonly fetcher: FetchLike; - private _authState: AuthState | null = null; - private _authInitPromise: Promise | null = null; - private _authInitError: SeclaiConfigurationError | null = null; - - /** - * Create a new Seclai client. - * - * Credentials are resolved via a chain (first match wins): - * 1. Explicit `apiKey` option - * 2. Explicit `accessToken` option (static string or provider function) - * 3. `SECLAI_API_KEY` environment variable - * 4. SSO profile from `~/.seclai/config` + cached tokens in `~/.seclai/sso/cache/` - * - * @param opts - Client configuration. - * @throws {@link SeclaiConfigurationError} If no `fetch` implementation is available. - * @throws {@link SeclaiConfigurationError} If both `apiKey` and `accessToken` are provided. - */ - constructor(opts: SeclaiOptions = {}) { - // Validate mutual exclusion - if (opts.apiKey && opts.accessToken) { - throw new SeclaiConfigurationError( - "Provide either apiKey or accessToken, not both." - ); - } - - const fetcher = opts.fetch ?? (globalThis.fetch as FetchLike | undefined); - if (!fetcher) { - throw new SeclaiConfigurationError( - "No fetch implementation available. Provide opts.fetch or run in an environment with global fetch." - ); - } - - this.baseUrl = opts.baseUrl ?? getEnv("SECLAI_API_URL") ?? SECLAI_API_URL; - - // Merge first, then validate what the merge produced. `defaultHeaders` is - // applied last so an explicit header wins, which means it can carry its own - // Seclai-Version — and it may carry several in differing cases. Inspecting - // the options instead would have to predict which one survives: picking the - // first match while the merge lets the last win is a guard that validates a - // value the client never sends. - // - // Keys are compared case-insensitively so a caller-supplied `seclai-version` - // replaces ours rather than adding a second wire header. - const merged: Record = opts.apiVersion - ? { "Seclai-Version": opts.apiVersion } - : {}; - let versionKey = opts.apiVersion ? "Seclai-Version" : undefined; - for (const [key, value] of Object.entries(opts.defaultHeaders ?? {})) { - for (const existing of Object.keys(merged)) { - if (existing.toLowerCase() === key.toLowerCase()) delete merged[existing]; - } - merged[key] = value; - if (key.toLowerCase() === "seclai-version") versionKey = key; - } - - const effectiveVersion = versionKey ? merged[versionKey] : undefined; - if ( - effectiveVersion && - !opts.allowUnknownApiVersion && - !KNOWN_API_VERSIONS.includes(effectiveVersion) - ) { - const via = - versionKey === "Seclai-Version" && merged[versionKey] === opts.apiVersion - ? "apiVersion" - : `defaultHeaders['${versionKey}']`; - throw new SeclaiConfigurationError( - `Unknown API version '${effectiveVersion}' (via ${via}). This release was ` + - `built against ${KNOWN_API_VERSIONS.join(", ")}. A newer API version can ` + - `change response shapes, which this client would decode incorrectly rather ` + - `than reject. Upgrade the package, or set allowUnknownApiVersion to ` + - `proceed anyway.`, - ); - } - this.defaultHeaders = merged; - this.fetcher = fetcher; - - // Resolve credential chain (may be async for SSO profile loading) - const accessTokenProvider = - typeof opts.accessToken === "function" ? opts.accessToken : undefined; - const accessTokenStatic = - typeof opts.accessToken === "string" ? opts.accessToken : undefined; - - this._authInitPromise = resolveCredentialChain({ - apiKey: opts.apiKey, - accessToken: accessTokenStatic, - accessTokenProvider, - profile: opts.profile, - configDir: opts.configDir, - autoRefresh: opts.autoRefresh, - accountId: opts.accountId, - apiKeyHeader: opts.apiKeyHeader, - fetch: fetcher, - }).then((state) => { - this._authState = state; - }).catch((err) => { - this._authInitError = new SeclaiConfigurationError( - err instanceof Error ? err.message : String(err) - ); - }); - } - - /** Ensure the credential chain has been resolved. */ - private async ensureAuth(): Promise { - if (this._authInitPromise) { - await this._authInitPromise; - this._authInitPromise = null; - } - if (this._authInitError) { - throw this._authInitError; - } - if (!this._authState) { - throw new SeclaiConfigurationError( - "Missing credentials. Provide apiKey, accessToken, set SECLAI_API_KEY, or run `seclai auth login`." - ); - } - return this._authState; - } - - /** Resolve auth headers for the current request. */ - private async authHeaders(): Promise> { - const state = await this.ensureAuth(); - return resolveAuthHeaders(state); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Low-level request - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Make a raw HTTP request to the Seclai API. - * - * This is a low-level escape hatch. For most operations, prefer the typed convenience methods. - * - * @param method - HTTP method (e.g. `"GET"`, `"POST"`). - * @param path - Request path relative to `baseUrl` (e.g. `"/sources/"`). - * @param opts - Query params, JSON body, per-request headers, and optional AbortSignal. - * @returns Parsed JSON for JSON responses, raw text for non-JSON responses, or `null` for empty bodies. - * @throws {@link SeclaiAPIValidationError} For validation errors (typically HTTP 422). - * @throws {@link SeclaiAPIStatusError} For other non-success HTTP status codes. - */ - async request( - method: string, - path: string, - opts?: { - query?: Record; - json?: unknown; - headers?: Record; - signal?: AbortSignal; - } - ): Promise { - const url = buildURL(this.baseUrl, path, opts?.query); - - const authHeaders = await this.authHeaders(); - const headers: Record = { - ...this.defaultHeaders, - ...(opts?.headers ?? {}), - ...authHeaders, - }; - - let body: BodyInit | undefined; - if (opts?.json !== undefined) { - headers["content-type"] = headers["content-type"] ?? "application/json"; - body = JSON.stringify(opts.json); - } - - const init: RequestInit = { method, headers }; - if (body !== undefined) { - init.body = body; - } - if (opts?.signal) { - init.signal = opts.signal; - } - const response = await this.fetcher(url, init); - - if (response.status === 204) return null; - - const contentType = response.headers.get("content-type") ?? ""; - const isJson = contentType.includes("application/json"); - - if (!response.ok) { - const responseText = await safeText(response); - if (response.status === 422) { - const validation = await safeJson(response); - throw new SeclaiAPIValidationError({ - message: "Validation error", - statusCode: response.status, - method, - url: url.toString(), - responseText, - validationError: validation, - }); - } - throw new SeclaiAPIStatusError({ - message: `Request failed with status ${response.status}`, - statusCode: response.status, - method, - url: url.toString(), - responseText, - }); - } - - if (!response.body) return null; - - if (isJson) { - return (await response.json()) as unknown; - } - return await response.text(); - } - - /** - * Make a raw HTTP request and return the raw `Response` object (for binary downloads, etc.). - * - * @param method - HTTP method. - * @param path - Request path relative to `baseUrl`. - * @param opts - Query params, JSON body, per-request headers, and optional AbortSignal. - * @returns The raw `Response` object. - * @throws {SeclaiAPIValidationError} On HTTP 422 responses. - * @throws {SeclaiAPIStatusError} On other non-2xx responses. - */ - async requestRaw( - method: string, - path: string, - opts?: { - query?: Record; - json?: unknown; - headers?: Record; - signal?: AbortSignal; - } - ): Promise { - const url = buildURL(this.baseUrl, path, opts?.query); - - const authHeaders = await this.authHeaders(); - const headers: Record = { - ...this.defaultHeaders, - ...(opts?.headers ?? {}), - ...authHeaders, - }; - - let body: BodyInit | undefined; - if (opts?.json !== undefined) { - headers["content-type"] = headers["content-type"] ?? "application/json"; - body = JSON.stringify(opts.json); - } - - const init: RequestInit = { method, headers }; - if (body !== undefined) init.body = body; - if (opts?.signal) init.signal = opts.signal; - - const response = await this.fetcher(url, init); - - if (!response.ok) { - const responseText = await safeText(response); - if (response.status === 422) { - const validation = await safeJson(response); - throw new SeclaiAPIValidationError({ - message: "Validation error", - statusCode: response.status, - method, - url: url.toString(), - responseText, - validationError: validation, - }); - } - throw new SeclaiAPIStatusError({ - message: `Request failed with status ${response.status}`, - statusCode: response.status, - method, - url: url.toString(), - responseText, - }); - } - - return response; - } - - /** Shared multipart upload helper. */ - private async uploadFile( - path: string, - opts: { - file: Blob | Uint8Array | ArrayBuffer | BufferSource; - title?: string; - metadata?: Record; - fileName?: string; - mimeType?: string; - signal?: AbortSignal; - }, - ): Promise { - const url = buildURL(this.baseUrl, path); - - const authHeaders = await this.authHeaders(); - const headers: Record = { - ...this.defaultHeaders, - ...authHeaders, - }; - // Let fetch set the correct multipart Content-Type with boundary - delete headers["content-type"]; - delete headers["Content-Type"]; - - const form = new FormData(); - const mimeType = opts.mimeType ?? inferMimeType(opts.fileName); - const blob = toBlob(opts.file, mimeType); - form.set("file", blob, opts.fileName ?? "upload"); - - if (opts.title !== undefined) form.set("title", opts.title); - if (opts.metadata !== undefined) form.set("metadata", JSON.stringify(opts.metadata)); - - const init: RequestInit = { method: "POST", headers, body: form }; - if (opts.signal) init.signal = opts.signal; - - const response = await this.fetcher(url, init); - - if (!response.ok) { - const responseText = await safeText(response); - if (response.status === 422) { - const validation = await safeJson(response); - throw new SeclaiAPIValidationError({ - message: "Validation error", - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - validationError: validation, - }); - } - throw new SeclaiAPIStatusError({ - message: `Request failed with status ${response.status}`, - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - }); - } - - return await response.json(); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Identity - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Get the authenticated user's identity. - * - * Returns the personal `account_id` plus every organization the user belongs - * to — each with its own `id`, display `name`, and `account_id`. Use it to - * discover the account IDs that can be passed as the client's `accountId` - * option (sent as the `X-Account-Id` header) to target an org context. - * - * @returns The current user's account ID and organization memberships. - */ - async getMe(): Promise { - return (await this.request("GET", "/me")) as MeResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // API Version - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Read the API version this request resolved to, and the versions available. - * - * Resolution order is the `Seclai-Version` header, then the account pin, then - * the default — so `effective_version` reflects the client's `apiVersion` - * option when that is set. - * - * @returns The pinned, effective, default and latest versions. - */ - async getApiVersion(): Promise { - return (await this.request("GET", "/version")) as ApiVersionResponse; - } - - /** - * Pin the account to a dated API version, or clear the pin. - * - * Owner/admin only. The pin applies to later header-less requests; a - * `Seclai-Version` header still overrides it, so `effective_version` in the - * response describes this request rather than the pin just written. - * - * @param version - A `YYYY-MM-DD` date to pin to, or `null` to clear the pin. - * @returns The updated version state. - */ - async updateApiVersion(version: string | null): Promise { - return (await this.request("PUT", "/version", { json: { version } })) as ApiVersionResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agents — CRUD - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List agents. - * - * @param opts - Pagination options. - * @returns Paginated list of agents. - */ - async listAgents(opts: ListOptions = {}): Promise { - return (await this.request("GET", "/agents", { - query: { page: opts.page, limit: opts.limit }, - })) as AgentListResponse; - } - - /** - * Create a new agent. - * - * @param body - Agent creation payload (name, trigger type, template, etc.). - * @returns Summary of the created agent. - */ - async createAgent(body: CreateAgentRequest): Promise { - return (await this.request("POST", "/agents", { json: body })) as AgentSummaryResponse; - } - - /** - * Get agent details including its definition. - * - * @param agentId - Agent identifier. - * @returns Full agent metadata. - */ - async getAgent(agentId: string): Promise { - return (await this.request("GET", `/agents/${agentId}`)) as AgentSummaryResponse; - } - - /** - * Update an agent. - * - * @param agentId - Agent identifier. - * @param body - Fields to update. - * @returns Updated agent summary. - */ - async updateAgent(agentId: string, body: UpdateAgentRequest): Promise { - return (await this.request("PUT", `/agents/${agentId}`, { json: body })) as AgentSummaryResponse; - } - - /** - * Delete an agent. - * - * @param agentId - Agent identifier. - */ - async deleteAgent(agentId: string): Promise { - await this.request("DELETE", `/agents/${agentId}`); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agents — Enable / Disable - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Pause (disable) an agent so it stops firing from every trigger path. - * - * API runs return HTTP 409, inbound email is turned away, and scheduled / - * content triggers are skipped. - * - * Fails with HTTP 409 when other live agents still call this one via a - * `call_agent` step — use {@link getAgentCallers} to list them, and disable - * those first. - * - * @param agentId - Agent identifier. - * @returns The updated agent summary. - */ - async disableAgent(agentId: string): Promise { - return (await this.request("POST", `/agents/${agentId}/disable`)) as AgentSummaryResponse; - } - - /** - * Resume (enable) a paused agent. - * - * Clears the disable state whether the agent was paused manually or - * auto-paused by the inbound-email overload safeguard. - * - * @param agentId - Agent identifier. - * @returns The updated agent summary. - */ - async enableAgent(agentId: string): Promise { - return (await this.request("POST", `/agents/${agentId}/enable`)) as AgentSummaryResponse; - } - - /** - * List the live agents that call this agent via a `call_agent` step. - * - * These must be disabled before this agent can be paused. - * - * @param agentId - Agent identifier. - * @returns The calling agents. - */ - async getAgentCallers(agentId: string): Promise { - return (await this.request("GET", `/agents/${agentId}/callers`)) as AgentCallerApiResponse[]; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Export / Import - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Export an agent definition as a portable JSON snapshot. - * - * @param agentId - Agent identifier. - * @param download - When true (default), the server sets Content-Disposition: attachment. - * @returns The exported agent snapshot. - */ - async exportAgent(agentId: string, download = true): Promise { - return (await this.request("GET", `/agents/${agentId}/export`, { - query: { download }, - })) as AgentExportResponse; - } - - /** - * Validate an `agent_definition` payload (same shape as {@link exportAgent}) - * without creating or modifying any agent. - * - * Use this before {@link createAgent} or {@link updateAgent} with an - * `agent_definition` to surface `unresolved_refs` — workflow references to - * knowledge bases, memory banks, source connections, or sub-agents that - * don't exist in the target account. Pass the returned ids back in - * `entity_remap` on the commit call to substitute them. - * - * @param body - The preview payload (`{ agent_definition: ... }`). - * @returns Summary of the validated payload (step counts, schedules, - * alert configs, evaluation criteria, governance policies, and any - * `unresolved_refs`). - * @throws {SeclaiAPIValidationError} On HTTP 422 — the body is an - * {@link AgentDefinitionImportErrorResponse} with 1-indexed - * line/column-anchored errors against a canonical `source` echo. - */ - async previewImportAgent(body: AgentImportPreviewRequest): Promise { - return (await this.request("POST", "/agents/preview-import", { json: body })) as AgentImportPreviewResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Definitions - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Get an agent's full definition (steps, model config, etc.). - * - * @param agentId - Agent identifier. - * @returns The agent definition. - */ - async getAgentDefinition(agentId: string): Promise { - return (await this.request("GET", `/agents/${agentId}/definition`)) as AgentDefinitionResponse; - } - - /** - * Update an agent's definition. - * - * @param agentId - Agent identifier. - * @param body - Updated definition payload. - * @returns Updated agent definition. - */ - async updateAgentDefinition(agentId: string, body: UpdateAgentDefinitionRequest): Promise { - return (await this.request("PUT", `/agents/${agentId}/definition`, { json: body })) as AgentDefinitionResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Runs - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Start an agent run. - * - * @param agentId - Agent identifier. - * @param body - Run request payload (`input`, `metadata`, `priority`, etc.). - * @returns The created agent run. - */ - async runAgent(agentId: string, body: AgentRunRequest): Promise { - return (await this.request("POST", `/agents/${agentId}/runs`, { json: body })) as AgentRunResponse; - } - - /** - * List runs for a specific agent. - * - * @param agentId - Agent identifier. - * @param opts - Pagination and filter options. - * @returns Paginated list of runs. - */ - async listAgentRuns( - agentId: string, - opts: ListOptions & { status?: string } = {}, - ): Promise { - return (await this.request("GET", `/agents/${agentId}/runs`, { - query: { page: opts.page, limit: opts.limit, status: opts.status }, - })) as AgentRunListResponse; - } - - /** - * Search agent runs (traces) across all agents. - * - * @param body - Search query and filters. - * @returns Search results with matching runs. - */ - async searchAgentRuns(body: AgentTraceSearchRequest): Promise { - return (await this.request("POST", "/agents/runs/search", { json: body })) as AgentTraceSearchResponse; - } - - /** - * Get details of a specific agent run. - * - * @param runId - Run identifier. - * @param opts - Optional flags. - * @returns Agent run details. - */ - async getAgentRun( - runId: string, - opts?: { includeStepOutputs?: boolean }, - ): Promise { - return (await this.request("GET", `/agents/runs/${runId}`, opts?.includeStepOutputs ? { - query: { include_step_outputs: true }, - } : undefined)) as AgentRunResponse; - } - - /** - * Cancel an agent run. - * - * @deprecated This never deleted anything — the endpoint it calls is documented - * as "Cancel an agent run", and the API has no delete-a-run operation. It also - * discards the returned run state. Use {@link cancelAgentRun} instead. - * - * @param runId - Run identifier. - */ - async deleteAgentRun(runId: string): Promise { - await this.cancelAgentRun(runId); - } - - /** - * Cancel a running agent run. - * - * Cancellation is `DELETE` on the run resource — the API exposes no - * `POST .../cancel` route, and no operation that deletes a run. Rejected when - * the run has already reached a terminal state. - * - * @param runId - Run identifier. - * @returns Updated run (with cancelled status). - */ - async cancelAgentRun(runId: string): Promise { - return (await this.request("DELETE", `/agents/runs/${runId}`)) as AgentRunResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Runs — Streaming - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Run an agent in streaming mode (SSE) and wait for the final result. - * - * Consumes the entire SSE stream and returns only the terminal `done` payload. - * For real-time event access, use {@link runStreamingAgent} instead. - * - * @param agentId - Agent identifier. - * @param body - Streaming run request payload. - * @param opts - Timeout and abort signal options. - * @returns Final agent run payload from the `done` event. - * @throws {@link SeclaiStreamingError} If the stream ends before a `done` event. - */ - async runStreamingAgentAndWait( - agentId: string, - body: AgentRunStreamRequest, - opts?: { timeoutMs?: number; signal?: AbortSignal }, - ): Promise { - const url = buildURL(this.baseUrl, `/agents/${agentId}/runs/stream`); - - const authHdrs = await this.authHeaders(); - const headers: Record = { - ...this.defaultHeaders, - ...authHdrs, - accept: "text/event-stream", - "content-type": "application/json", - }; - - const timeoutMs = opts?.timeoutMs ?? 60_000; - const timeoutController = new AbortController(); - let timedOut = false; - const timeoutId = setTimeout(() => { - timedOut = true; - timeoutController.abort(); - }, timeoutMs); - - const signal = anySignal([opts?.signal, timeoutController.signal]); - - let lastSeen: AgentRunResponse | undefined; - - try { - const init: RequestInit = { method: "POST", headers, body: JSON.stringify(body) }; - if (signal) init.signal = signal; - - const response = await this.fetcher(url, init); - - // Handle error responses - const contentType = response.headers.get("content-type") ?? ""; - const isJson = contentType.includes("application/json"); - - if (!response.ok) { - const responseText = await safeText(response); - if (response.status === 422) { - const validation = await safeJson(response); - throw new SeclaiAPIValidationError({ - message: "Validation error", - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - validationError: validation, - }); - } - throw new SeclaiAPIStatusError({ - message: `Request failed with status ${response.status}`, - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - }); - } - - // If server returned JSON instead of SSE - if (isJson) { - return (await response.json()) as AgentRunResponse; - } - - if (!response.body) { - throw new SeclaiConfigurationError( - "Streaming response body is not available in this environment. Provide a fetch implementation that supports ReadableStream bodies." - ); - } - - const reader = response.body.getReader(); - const decoder = new TextDecoder(); - - let final: AgentRunResponse | undefined; - - const parser = createSseParser((msg) => { - if (!msg.data) return; - if (msg.event === "init" || msg.event === "done") { - try { - const parsed = JSON.parse(msg.data) as AgentRunResponse; - lastSeen = parsed; - if (msg.event === "done") final = parsed; - } catch { /* ignore malformed JSON */ } - } - }); - - while (!final) { - const { value, done } = await reader.read(); - if (done) break; - if (value) parser.feed(decoder.decode(value, { stream: true })); - } - - parser.end(); - - if (final) return final; - if (lastSeen && (lastSeen as any).status && (lastSeen as any).status !== "pending") { - return lastSeen; - } - - throw new SeclaiStreamingError("Stream ended before receiving a 'done' event.", lastSeen?.run_id); - } catch (err) { - if (timedOut) { - throw new SeclaiStreamingError( - `Timed out after ${timeoutMs}ms waiting for streaming agent run to complete.`, - lastSeen?.run_id, - ); - } - throw err; - } finally { - clearTimeout(timeoutId); - } - } - - /** - * Run an agent in streaming mode and yield each SSE event as it arrives. - * - * This is an `AsyncGenerator` suitable for real-time UIs that want to render - * step progress as it happens. - * - * @param agentId - Agent identifier. - * @param body - Streaming run request payload. - * @param opts - Timeout and abort signal options. - * @yields {@link AgentRunEvent} for each SSE message. - * - * @example - * ```ts - * for await (const event of client.runStreamingAgent("agent-id", { input: "Hello!" })) { - * if (event.event === "done") { - * console.log("Final:", event.data); - * } - * } - * ``` - */ - async *runStreamingAgent( - agentId: string, - body: AgentRunStreamRequest, - opts?: { timeoutMs?: number; signal?: AbortSignal }, - ): AsyncGenerator { - const url = buildURL(this.baseUrl, `/agents/${agentId}/runs/stream`); - - const authHdrs = await this.authHeaders(); - const headers: Record = { - ...this.defaultHeaders, - ...authHdrs, - accept: "text/event-stream", - "content-type": "application/json", - }; - - const timeoutMs = opts?.timeoutMs ?? 60_000; - const timeoutController = new AbortController(); - let timedOut = false; - const timeoutId = setTimeout(() => { - timedOut = true; - timeoutController.abort(); - }, timeoutMs); - - const signal = anySignal([opts?.signal, timeoutController.signal]); - - try { - const init: RequestInit = { method: "POST", headers, body: JSON.stringify(body) }; - if (signal) init.signal = signal; - - const response = await this.fetcher(url, init); - - const contentType = response.headers.get("content-type") ?? ""; - const isJson = contentType.includes("application/json"); - - if (!response.ok) { - const responseText = await safeText(response); - if (response.status === 422) { - const validation = await safeJson(response); - throw new SeclaiAPIValidationError({ - message: "Validation error", - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - validationError: validation, - }); - } - throw new SeclaiAPIStatusError({ - message: `Request failed with status ${response.status}`, - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - }); - } - - // If server returned JSON instead of SSE, yield it as a single "done" event - if (isJson) { - const data = (await response.json()) as AgentRunResponse; - yield { event: "done", data }; - return; - } - - if (!response.body) { - throw new SeclaiConfigurationError( - "Streaming response body is not available in this environment." - ); - } - - const reader = response.body.getReader(); - const decoder = new TextDecoder(); - const events: AgentRunEvent[] = []; - - const parser = createSseParser((msg) => { - if (!msg.data) return; - let data: unknown; - try { - data = JSON.parse(msg.data); - } catch { - data = msg.data; - } - events.push({ event: msg.event ?? "message", data }); - }); - - while (true) { - const { value, done } = await reader.read(); - if (value) parser.feed(decoder.decode(value, { stream: true })); - - // Yield all events that were parsed from this chunk - while (events.length > 0) { - yield events.shift()!; - } - - if (done) break; - } - parser.end(); - - // Yield any remaining events from end() - while (events.length > 0) { - yield events.shift()!; - } - } catch (err) { - if (timedOut) { - throw new SeclaiStreamingError( - `Timed out after ${timeoutMs}ms waiting for streaming agent run to complete.` - ); - } - throw err; - } finally { - clearTimeout(timeoutId); - } - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Runs — Polling - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Run an agent and poll until it reaches a terminal status. - * - * This is useful in environments where SSE streaming is unavailable. - * - * @param agentId - Agent identifier. - * @param body - Run request payload. - * @param opts - Polling configuration and abort signal. - * @returns The terminal agent run. - * @throws {@link SeclaiStreamingError} On timeout. - */ - async runAgentAndPoll( - agentId: string, - body: AgentRunRequest, - opts?: { - /** Polling interval in ms (default: 2000). */ - pollIntervalMs?: number; - /** Maximum time to wait in ms (default: 300000 = 5 min). */ - timeoutMs?: number; - /** Include per-step outputs in the final result. */ - includeStepOutputs?: boolean; - signal?: AbortSignal; - }, - ): Promise { - const pollInterval = opts?.pollIntervalMs ?? 2_000; - const timeout = opts?.timeoutMs ?? 300_000; - const startTime = Date.now(); - - const run = await this.runAgent(agentId, body); - const runId = (run as any).id ?? (run as any).run_id; - if (!runId) throw new SeclaiError("Agent run response did not contain an id."); - - while (true) { - if (opts?.signal?.aborted) throw new SeclaiError("Polling aborted."); - if (Date.now() - startTime > timeout) { - throw new SeclaiStreamingError(`Polling timed out after ${timeout}ms.`, runId); - } - - await new Promise((r) => setTimeout(r, pollInterval)); - - const current = await this.getAgentRun(runId, - opts?.includeStepOutputs ? { includeStepOutputs: true } : undefined, - ); - const status = (current as any).status; - if (status === "completed" || status === "failed" || status === "cancelled") { - return current; - } - } - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Run Evaluation Results - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List evaluation results for a specific agent run. - * - * @param agentId - Agent identifier. - * @param runId - Run identifier. - * @param opts - Pagination options. - * @returns Paginated list of evaluation results. - */ - async listRunEvaluationResults( - agentId: string, - runId: string, - opts: ListOptions = {}, - ): Promise { - // Either wire shape: the endpoint returns a bare array by default and an - // envelope once the caller opts in with apiVersion 2026-07-27 or later. - const res = (await this.request("GET", `/agents/${agentId}/runs/${runId}/evaluation-results`, { - query: { page: opts.page, limit: opts.limit }, - })) as EvaluationResultWithCriteriaListResponse | EvaluationResultWithCriteriaListResponse["data"]; - return Array.isArray(res) - ? ({ data: res } as EvaluationResultWithCriteriaListResponse) - : res; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Input Uploads - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Upload a file to use as input for a `dynamic_input` agent run. - * - * After uploading, poll {@link getAgentInputUploadStatus} until `status` is `ready`, - * then pass `input_upload_id` to {@link runAgent}. - * - * @param agentId - Agent identifier. - * @param opts - File payload and optional metadata. - * @returns Upload response with the upload ID and status. - */ - async uploadAgentInput( - agentId: string, - opts: { - file: Blob | Uint8Array | ArrayBuffer | BufferSource; - fileName?: string; - mimeType?: string; - }, - ): Promise { - return (await this.uploadFile(`/agents/${agentId}/upload-input`, opts)) as UploadAgentInputApiResponse; - } - - /** - * Get the status of an agent input upload. - * - * @param agentId - Agent identifier. - * @param uploadId - Upload identifier. - * @returns Upload status and metadata. - */ - async getAgentInputUploadStatus(agentId: string, uploadId: string): Promise { - return (await this.request("GET", `/agents/${agentId}/input-uploads/${uploadId}`)) as UploadAgentInputApiResponse; - } - - /** - * Get the static attachment-reference contract for an agent — what files (if - * any) its definition expects on a run. - * - * Call this before staging uploads to learn whether the agent accepts files - * at all (`requires_uploads`) and which specific filenames, indexes, or glob - * patterns its templates reference. A run-time upload batch that doesn't - * satisfy every declared selector is rejected with HTTP 400. - * - * @param agentId - Agent identifier. - * @returns The agent's attachment-reference contract. - */ - async getAgentAttachmentReferences(agentId: string): Promise { - return (await this.request("GET", `/agents/${agentId}/attachment-references`)) as AgentAttachmentRefsApiResponse; - } - - /** - * Download a file attachment emitted by a step in an agent run. - * - * Returns the raw `Response` so you can stream or save the binary data. - * - * @param runId - Run identifier. - * @param attachmentId - URL-safe-base64-encoded `storage_key` of the attachment - * (as surfaced in run output manifests and webhook/email payloads). - * @param opts - Optional `downloadName` filename hint for the download disposition. - * @returns Raw response with the attachment bytes. - */ - async downloadAgentRunAttachment( - runId: string, - attachmentId: string, - opts: { downloadName?: string } = {}, - ): Promise { - return await this.requestRaw("GET", `/v2/agent-runs/${runId}/attachments/${attachmentId}`, { - query: { download_name: opts.downloadName }, - }); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent AI Assistant (Steps Generation) - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Generate agent workflow steps from natural language using AI. - * - * @param agentId - Agent identifier. - * @param body - Generation request with user instructions. - * @returns AI-generated step configuration. - */ - async generateAgentSteps(agentId: string, body: GenerateAgentStepsRequest): Promise { - return (await this.request("POST", `/agents/${agentId}/ai-assistant/generate-steps`, { json: body })) as GenerateAgentStepsResponse; - } - - /** - * Generate a single step configuration using AI. - * - * @param agentId - Agent identifier. - * @param body - Step config generation request. - * @returns AI-generated step config. - */ - async generateStepConfig(agentId: string, body: GenerateStepConfigRequest): Promise { - return (await this.request("POST", `/agents/${agentId}/ai-assistant/step-config`, { json: body })) as GenerateStepConfigResponse; - } - - /** - * Get AI conversation history for an agent. - * - * @param agentId - Agent identifier. - * @returns Conversation history. - */ - async getAgentAiConversationHistory( - agentId: string, - opts: { stepType?: string; stepId?: string; limit?: number; offset?: number } = {}, - ): Promise { - // `step_type` is required by the API. It stays optional in the type so the - // released one-argument call still compiles, but leaving it undefined only - // means buildURL drops it and the server answers 422 naming the wire - // parameter — so fail here instead, naming the option. - if (!opts.stepType) { - throw new SeclaiConfigurationError( - "getAgentAiConversationHistory requires opts.stepType; the API rejects the " + - "request without it. Pass e.g. { stepType: \"llm\" }.", - ); - } - return (await this.request("GET", `/agents/${agentId}/ai-assistant/conversations`, { - query: { - step_type: opts.stepType, - step_id: opts.stepId, - limit: opts.limit, - offset: opts.offset, - }, - })) as AiConversationHistoryResponse; - } - - /** - * Mark an AI suggestion as accepted or rejected. - * - * @param agentId - Agent identifier. - * @param conversationId - Conversation turn identifier. - * @param body - Mark request payload. - */ - async markAgentAiSuggestion(agentId: string, conversationId: string, body: MarkAiSuggestionRequest): Promise { - await this.request("PATCH", `/agents/${agentId}/ai-assistant/${conversationId}`, { json: body }); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Evaluation Criteria - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List evaluation criteria for an agent. - * - * @param agentId - Agent identifier. - * @param opts - Pagination options. - */ - async listEvaluationCriteria(agentId: string, opts: ListOptions = {}): Promise { - return (await this.listEvaluationCriteriaPage(agentId, opts)).data ?? []; - } - - /** - * List evaluation criteria for an agent, with pagination metadata. - * - * Accepts either wire shape. The endpoint answered with a bare array before - * 2026-07 and with a paginated envelope after, so a client that decodes only - * one breaks the day the other ships. `total`, `page` and `limit` are absent - * when the endpoint answers with a bare array. - * - * @param agentId - Agent identifier. - * @param opts - Pagination options. - * @returns The criteria under `data`, plus the page metadata when present. - */ - async listEvaluationCriteriaPage( - agentId: string, - opts: ListOptions = {}, - ): Promise { - const res = (await this.request("GET", `/agents/${agentId}/evaluation-criteria`, { - query: { page: opts.page, limit: opts.limit }, - })) as EvaluationCriteriaResponse[] | EvaluationCriteriaListResponse; - return Array.isArray(res) ? { data: res } : res; - } - - /** - * Create evaluation criteria for an agent. - * - * @param agentId - Agent identifier. - * @param body - Criteria definition. - * @returns Created evaluation criteria. - */ - async createEvaluationCriteria(agentId: string, body: CreateEvaluationCriteriaRequest): Promise { - return (await this.request("POST", `/agents/${agentId}/evaluation-criteria`, { json: body })) as EvaluationCriteriaResponse; - } - - /** - * Get a single evaluation criteria by ID. - * - * @param criteriaId - Criteria identifier. - * @returns Evaluation criteria details. - */ - async getEvaluationCriteria(criteriaId: string): Promise { - return (await this.request("GET", `/agents/evaluation-criteria/${criteriaId}`)) as EvaluationCriteriaResponse; - } - - /** - * Update an evaluation criteria. - * - * @param criteriaId - Criteria identifier. - * @param body - Fields to update. - * @returns Updated evaluation criteria. - */ - async updateEvaluationCriteria(criteriaId: string, body: UpdateEvaluationCriteriaRequest): Promise { - return (await this.request("PATCH", `/agents/evaluation-criteria/${criteriaId}`, { json: body })) as EvaluationCriteriaResponse; - } - - /** - * Delete an evaluation criteria and all associated results. - * - * @param criteriaId - Criteria identifier. - */ - async deleteEvaluationCriteria(criteriaId: string): Promise { - await this.request("DELETE", `/agents/evaluation-criteria/${criteriaId}`); - } - - /** - * Get the evaluation summary for a specific criteria. - * - * @param criteriaId - Criteria identifier. - * @returns Evaluation result summary. - */ - async getEvaluationCriteriaSummary(criteriaId: string): Promise { - return (await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/summary`)) as EvaluationResultSummaryResponse; - } - - /** - * List evaluation results for a specific criteria. - * - * @param criteriaId - Criteria identifier. - * @param opts - Pagination options. - */ - async listEvaluationResults(criteriaId: string, opts: ListOptions = {}): Promise { - return (await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/results`, { - query: { page: opts.page, limit: opts.limit }, - })) as EvaluationResultListResponse; - } - - /** - * Create a manual evaluation result for a criteria. - * - * @param criteriaId - Criteria identifier. - * @param body - Evaluation result payload. - * @returns Created evaluation result. - */ - async createEvaluationResult(criteriaId: string, body: CreateEvaluationResultRequest): Promise { - return (await this.request("POST", `/agents/evaluation-criteria/${criteriaId}/results`, { json: body })) as EvaluationResultResponse; - } - - /** - * List runs compatible with a specific evaluation criteria. - * - * @param criteriaId - Criteria identifier. - * @param opts - Pagination options. - */ - async listCompatibleRuns(criteriaId: string, opts: ListOptions = {}): Promise { - return (await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/compatible-runs`, { - query: { page: opts.page, limit: opts.limit }, - })) as CompatibleRunListResponse; - } - - /** - * Test a draft evaluation criteria without persisting it. - * - * @param agentId - Agent identifier. - * @param body - Draft evaluation to test. - * @returns Test evaluation response. - */ - async testDraftEvaluation(agentId: string, body: TestDraftEvaluationRequest): Promise { - return (await this.request("POST", `/agents/${agentId}/evaluation-criteria/test-draft`, { json: body })) as TestDraftEvaluationResponse; - } - - /** - * List all evaluation results for an agent. - * - * @param agentId - Agent identifier. - * @param opts - Pagination options. - */ - async listAgentEvaluationResults(agentId: string, opts: ListOptions = {}): Promise { - return (await this.request("GET", `/agents/${agentId}/evaluation-results`, { - query: { page: opts.page, limit: opts.limit }, - })) as EvaluationResultWithCriteriaListResponse; - } - - /** - * List evaluation run summaries for an agent. - * - * @param agentId - Agent identifier. - * @param opts - Pagination options. - */ - async listEvaluationRuns(agentId: string, opts: ListOptions = {}): Promise { - return (await this.request("GET", `/agents/${agentId}/evaluation-runs`, { - query: { page: opts.page, limit: opts.limit }, - })) as EvaluationRunSummaryListResponse; - } - - /** - * Get a summary of non-manual evaluations across an agent's runs. - * - * @param agentId - Agent identifier. - */ - async getNonManualEvaluationSummary(agentId: string): Promise { - return (await this.request("GET", "/agents/evaluation-results/non-manual-summary", { - query: { agent_id: agentId }, - })) as NonManualEvaluationSummaryResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Email Triggers - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Configure an agent's `EMAIL_RECEIVED` trigger and return its computed - * email address(es). - * - * Sets the custom alias, the sender allowlist, and the inbound-handling flags - * (`ignore_auto_generated`, `require_sender_auth`, `queue_on_quota`). Omitted - * fields are left unchanged; passing `null` (or `""` for `alias`) clears them. - * - * @param agentId - Agent identifier. - * @param triggerId - Trigger identifier. - * @param body - The fields to set. - * @returns The trigger's resolved addresses and config. - */ - async setEmailTriggerConfig( - agentId: string, - triggerId: string, - body: SetEmailTriggerConfigRequest, - ): Promise { - return (await this.request("PUT", `/agents/${agentId}/triggers/${triggerId}/email-config`, { - json: body, - })) as EmailTriggerConfigResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Email Governance - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List recipients who have opted out of this account's agent emails. - * - * @param opts - Optional agent filter and `limit`/`offset` pagination. - * @param opts.agentId - Filter to one agent (account-wide opt-outs still apply). - * @param opts.limit - Page size (1-200, default 50). - * @param opts.offset - Rows to skip (default 0). - * @returns The page of opt-outs plus the total count. - */ - async listAgentEmailOptOuts( - opts: { agentId?: string; limit?: number; offset?: number } = {}, - ): Promise { - return (await this.request("GET", "/agents/agent-email-optouts", { - query: { agent_id: opts.agentId, limit: opts.limit, offset: opts.offset }, - })) as AgentEmailOptOutListResponse; - } - - /** - * Revoke an opt-out, opting the recipient back in to agent emails. - * - * @param optoutId - Opt-out identifier. - */ - async removeAgentEmailOptOut(optoutId: string): Promise { - await this.request("DELETE", `/agents/agent-email-optouts/${optoutId}`); - } - - /** - * List the account's blocked inbound email senders (newest first), plus the - * governance `auto_block_mode`. - * - * @param opts - Optional `limit`/`offset` pagination. - * @param opts.limit - Page size (1-200, default 50). - * @param opts.offset - Rows to skip (default 0). - */ - async listBlockedEmailSenders( - opts: { limit?: number; offset?: number } = {}, - ): Promise { - return (await this.request("GET", "/agents/blocked-email-senders", { - query: { limit: opts.limit, offset: opts.offset }, - })) as BlockedEmailSenderListResponse; - } - - /** - * Add a sender address or a whole domain to the account blocklist. - * - * Idempotent. `match_type` is `"address"` (default) or `"domain"`. - * Requires an account owner/admin. - * - * @param body - The sender or domain to block. - * @returns The blocked-sender entry. - */ - async blockEmailSender(body: BlockEmailSenderRequest): Promise { - return (await this.request("POST", "/agents/blocked-email-senders", { - json: body, - })) as BlockedEmailSenderResponse; - } - - /** - * Remove a blocked sender by id. Requires an account owner/admin. - * - * @param blockedId - Blocked-sender identifier. - */ - async unblockEmailSender(blockedId: string): Promise { - await this.request("DELETE", `/agents/blocked-email-senders/${blockedId}`); - } - - /** - * Set whether a governance BLOCK on an authenticated inbound sender - * auto-adds them to the blocklist. - * - * `mode` is `"disabled"`, `"input"`, or `"input_and_output"`. - * Requires an account owner/admin. - * - * @param body - The mode to set. - * @returns The updated blocked-sender list. - */ - async setAutoBlockMode(body: SetAutoBlockModeRequest): Promise { - return (await this.request("PUT", "/agents/blocked-email-senders/mode", { - json: body, - })) as BlockedEmailSenderListResponse; - } - - /** - * List recent inbound emails that were quietly discarded before running an - * agent (unauthorized sender, unknown alias, spam/virus, flood-shed). - * - * @param opts - Optional agent filter and result limit. - * @param opts.agentId - Filter to a single agent's rejections. - * @param opts.limit - Maximum results (1-200, default 50). - */ - async listInboundEmailRejections( - opts: { agentId?: string; limit?: number } = {}, - ): Promise { - return (await this.request("GET", "/agents/inbound-email-rejections", { - query: { agent_id: opts.agentId, limit: opts.limit }, - })) as InboundEmailRejectionResponse[]; - } - - /** - * Get the account's inbound-email overload status — whether the circuit - * breaker has paused new inbound email, and the size of the QUEUED - * (over-quota parked) run backlog. - */ - async getInboundEmailStatus(): Promise { - return (await this.request("GET", "/agents/inbound-email-status")) as InboundEmailStatusResponse; - } - - /** - * Fail all of the account's QUEUED (over-quota parked) inbound-email runs at - * once. - * - * A queued run consumed no quota or credits at queue time, so this merely - * fails them. Requires an account owner/admin. - * - * @returns The count cancelled. - */ - async cancelQueuedEmailRuns(): Promise { - return (await this.request("POST", "/agents/inbound-email-status/cancel-queued")) as CancelQueuedRunsResponse; - } - - /** - * Manually lift the account-wide inbound-email pause. - * - * If the queued backlog is still above the ceiling the breaker re-arms on the - * next evaluation — this is a one-shot override, not a permanent disable. - * Requires an account owner/admin. - */ - async resumeInboundEmail(): Promise { - return (await this.request("POST", "/agents/inbound-email-status/resume")) as ResumeInboundResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Knowledge Bases - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List knowledge bases. - * - * @param opts - Pagination and sorting options. - * @returns Paginated list of knowledge bases. - */ - async listKnowledgeBases(opts: SortableListOptions = {}): Promise { - return (await this.request("GET", "/knowledge_bases", { - query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }, - })) as KnowledgeBaseListResponse; - } - - /** - * Create a new knowledge base. - * - * @param body - Knowledge base configuration. - * @returns The created knowledge base. - */ - async createKnowledgeBase(body: CreateKnowledgeBaseBody): Promise { - return (await this.request("POST", "/knowledge_bases", { json: body })) as KnowledgeBaseResponse; - } - - /** - * Get a knowledge base by ID. - * - * @param knowledgeBaseId - Knowledge base identifier. - * @returns Knowledge base details. - */ - async getKnowledgeBase(knowledgeBaseId: string): Promise { - return (await this.request("GET", `/knowledge_bases/${knowledgeBaseId}`)) as KnowledgeBaseResponse; - } - - /** - * Update a knowledge base. - * - * @param knowledgeBaseId - Knowledge base identifier. - * @param body - Fields to update. - * @returns Updated knowledge base. - */ - async updateKnowledgeBase(knowledgeBaseId: string, body: UpdateKnowledgeBaseBody): Promise { - return (await this.request("PUT", `/knowledge_bases/${knowledgeBaseId}`, { json: body })) as KnowledgeBaseResponse; - } - - /** - * Delete a knowledge base. - * - * @param knowledgeBaseId - Knowledge base identifier. - */ - async deleteKnowledgeBase(knowledgeBaseId: string): Promise { - await this.request("DELETE", `/knowledge_bases/${knowledgeBaseId}`); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Memory Banks - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List memory banks. - * - * @param opts - Pagination and sorting options. - * @returns Paginated list of memory banks. - */ - async listMemoryBanks(opts: SortableListOptions = {}): Promise { - return (await this.request("GET", "/memory_banks", { - query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }, - })) as MemoryBankListResponse; - } - - /** - * Create a new memory bank. - * - * Memory banks give agents persistent memory across conversations. - * Types: `conversation` (chat-style history) or `general` (flat factual entries). - * - * @param body - Memory bank configuration. - * @returns The created memory bank. - */ - async createMemoryBank(body: CreateMemoryBankBody): Promise { - return (await this.request("POST", "/memory_banks", { json: body })) as MemoryBankResponse; - } - - /** - * Get a memory bank by ID. - * - * @param memoryBankId - Memory bank identifier. - * @returns Memory bank details. - */ - async getMemoryBank(memoryBankId: string): Promise { - return (await this.request("GET", `/memory_banks/${memoryBankId}`)) as MemoryBankResponse; - } - - /** - * Update a memory bank. - * - * @param memoryBankId - Memory bank identifier. - * @param body - Fields to update. - * @returns Updated memory bank. - */ - async updateMemoryBank(memoryBankId: string, body: UpdateMemoryBankBody): Promise { - return (await this.request("PUT", `/memory_banks/${memoryBankId}`, { json: body })) as MemoryBankResponse; - } - - /** - * Delete a memory bank. - * - * @param memoryBankId - Memory bank identifier. - */ - async deleteMemoryBank(memoryBankId: string): Promise { - await this.request("DELETE", `/memory_banks/${memoryBankId}`); - } - - /** - * Get agents that are using a specific memory bank. - * - * @param memoryBankId - Memory bank identifier. - */ - async getAgentsUsingMemoryBank(memoryBankId: string): Promise { - return await this.request("GET", `/memory_banks/${memoryBankId}/agents`); - } - - /** - * Get stats for a memory bank. - * - * @param memoryBankId - Memory bank identifier. - */ - async getMemoryBankStats(memoryBankId: string): Promise { - return await this.request("GET", `/memory_banks/${memoryBankId}/stats`); - } - - /** - * Compact a memory bank (trigger compaction). - * - * @param memoryBankId - Memory bank identifier. - */ - async compactMemoryBank(memoryBankId: string): Promise { - await this.request("POST", `/memory_banks/${memoryBankId}/compact`); - } - - /** - * Delete a memory bank source. - * - * @param memoryBankId - Memory bank identifier. - */ - async deleteMemoryBankSource(memoryBankId: string): Promise { - await this.request("DELETE", `/memory_banks/${memoryBankId}/source`); - } - - /** - * Test compaction for a specific memory bank. - * - * @param memoryBankId - Memory bank identifier. - * @param body - Test compaction request. - */ - async testMemoryBankCompaction(memoryBankId: string, body: TestCompactionRequest): Promise { - return (await this.request("POST", `/memory_banks/${memoryBankId}/test-compaction`, { json: body })) as CompactionTestResponse; - } - - /** - * Test compaction prompt standalone (not tied to a specific memory bank). - * - * @param body - Standalone compaction test request. - */ - async testCompactionPromptStandalone(body: StandaloneTestCompactionRequest): Promise { - return (await this.request("POST", "/memory_banks/test-compaction", { json: body })) as CompactionTestResponse; - } - - /** - * List available memory bank templates. - */ - async listMemoryBankTemplates(): Promise { - return await this.request("GET", "/memory_banks/templates"); - } - - // ─── Memory Bank AI Assistant ────────────────────────────────────────────── - - /** - * Generate memory bank configuration using AI. - * - * @param body - AI assistant request with user instructions. - * @returns AI-generated memory bank config. - */ - async generateMemoryBankConfig(body: MemoryBankAiAssistantRequest): Promise { - return (await this.request("POST", "/memory_banks/ai-assistant", { json: body })) as MemoryBankAiAssistantResponse; - } - - /** - * Get the last AI conversation for memory banks. - */ - async getMemoryBankAiLastConversation(): Promise { - return (await this.request("GET", "/memory_banks/ai-assistant/last-conversation")) as MemoryBankLastConversationResponse; - } - - /** - * Accept a memory bank AI suggestion. - * - * @param conversationId - Conversation identifier. - * @param body - Accept request payload. - */ - async acceptMemoryBankAiSuggestion(conversationId: string, body: MemoryBankAcceptRequest): Promise { - return (await this.request("PATCH", `/memory_banks/ai-assistant/${conversationId}`, { json: body })) as OkResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Sources - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List sources. - * - * @param opts - Pagination, sorting, and filter options. - * @returns Paginated list of sources. - */ - async listSources( - opts: SortableListOptions & { accountId?: string } = {}, - ): Promise { - return (await this.request("GET", "/sources", { - query: { - page: opts.page, - limit: opts.limit, - sort: opts.sort, - order: opts.order, - account_id: opts.accountId, - }, - })) as SourceListResponse; - } - - /** - * Create a new content source. - * - * @param body - Source configuration (type, name, knowledge base link, etc.). - * @returns The created source. - */ - async createSource(body: CreateSourceBody): Promise { - return (await this.request("POST", "/sources", { json: body })) as SourceResponse; - } - - /** - * Get a source by ID. - * - * @param sourceId - Source connection identifier. - * @returns Source details. - */ - async getSource(sourceId: string): Promise { - return (await this.request("GET", `/sources/${sourceId}`)) as SourceResponse; - } - - /** - * Update a source. - * - * @param sourceId - Source connection identifier. - * @param body - Fields to update. - * @returns Updated source. - */ - async updateSource(sourceId: string, body: UpdateSourceBody): Promise { - return (await this.request("PUT", `/sources/${sourceId}`, { json: body })) as SourceResponse; - } - - /** - * Delete a source. - * - * @param sourceId - Source connection identifier. - */ - async deleteSource(sourceId: string): Promise { - await this.request("DELETE", `/sources/${sourceId}`); - } - - /** - * Upload a file to a source. - * - * Maximum file size: 200 MiB. Supports text, PDF, DOCX, audio, video, images, and more. - * If `mimeType` is omitted, it will be inferred from the `fileName` extension when possible. - * - * @param sourceId - Source connection identifier. - * @param opts - File payload and optional metadata. - * @returns Upload response details. - */ - async uploadFileToSource( - sourceId: string, - opts: { - file: Blob | Uint8Array | ArrayBuffer | BufferSource; - title?: string; - metadata?: Record; - fileName?: string; - mimeType?: string; - }, - ): Promise { - return (await this.uploadFile(`/sources/${sourceId}/upload`, opts)) as FileUploadResponse; - } - - /** - * Upload inline text to a source. - * - * @param sourceId - Source connection identifier. - * @param body - Inline text upload payload. - * @returns Upload response. - */ - async uploadInlineTextToSource(sourceId: string, body: InlineTextUploadRequest): Promise { - return (await this.request("POST", `/sources/${sourceId}`, { json: body })) as FileUploadResponse; - } - - /** - * List a source's content items and their indexing status. - * - * @param sourceId - Source connection identifier. - * @param opts - Pagination, sorting, and filters. Pass the `content_version_id` - * values the upload methods return as `contentVersionIds` to poll a batch of - * uploads in one request — about 100 at a time, since the ids travel in the - * query string and a URL over 8,192 bytes is rejected with a 414. An empty - * `contentVersionIds` matches nothing, so it returns an empty page without - * sending a request. - * @returns The items under `data` with `pagination`, on every API version. - */ - async listSourceContents( - sourceId: string, - opts: ListSourceContentsOptions = {}, - ): Promise { - if (opts.contentVersionIds?.length === 0) { - return { - data: [], - pagination: { - page: opts.page ?? 1, - limit: opts.limit ?? 20, - total: 0, - pages: 0, - has_next: false, - has_prev: false, - }, - }; - } - return (await this.request("GET", `/sources/${sourceId}/contents`, { - query: { - page: opts.page, - limit: opts.limit, - sort: opts.sort, - order: opts.order, - status: opts.status, - content_version_id: opts.contentVersionIds, - }, - })) as SourceContentStatusListResponse; - } - - /** - * Get one content item's indexing status. - * - * @param sourceId - Source connection identifier. - * @param contentVersionId - The `content_version_id` an upload returned. - */ - async getSourceContentStatus(sourceId: string, contentVersionId: string): Promise { - return (await this.request( - "GET", - `/sources/${sourceId}/contents/${contentVersionId}`, - )) as SourceContentStatusResponse; - } - - // ─── Source Exports ──────────────────────────────────────────────────────── - - /** - * List exports for a source. - * - * @param sourceId - Source connection identifier. - * @param opts - Pagination options. - * @returns Paginated list of exports. - */ - async listSourceExports(sourceId: string, opts: ListOptions = {}): Promise { - return (await this.request("GET", `/sources/${sourceId}/exports`, { - query: { page: opts.page, limit: opts.limit }, - })) as ExportListResponse; - } - - /** - * Create a source data export. - * - * @param sourceId - Source connection identifier. - * @param body - Export configuration (format, etc.). - * @returns Export response with job status. - */ - async createSourceExport(sourceId: string, body: CreateExportRequest): Promise { - return (await this.request("POST", `/sources/${sourceId}/exports`, { json: body })) as ExportResponse; - } - - /** - * Get a specific source export. - * - * @param sourceId - Source connection identifier. - * @param exportId - Export identifier. - * @returns Export details. - */ - async getSourceExport(sourceId: string, exportId: string): Promise { - return (await this.request("GET", `/sources/${sourceId}/exports/${exportId}`)) as ExportResponse; - } - - /** - * Cancel a source export. - * - * @param sourceId - Source connection identifier. - * @param exportId - Export identifier. - */ - async cancelSourceExport(sourceId: string, exportId: string): Promise { - return (await this.request("POST", `/sources/${sourceId}/exports/${exportId}/cancel`)) as ExportResponse; - } - - /** - * Download a source export file. - * - * Returns the raw `Response` so you can stream or save the binary data. - * - * @param sourceId - Source connection identifier. - * @param exportId - Export identifier. - * @returns Raw response with the export file. - */ - async downloadSourceExport(sourceId: string, exportId: string): Promise { - return await this.requestRaw("GET", `/sources/${sourceId}/exports/${exportId}/download`); - } - - /** - * Estimate a source export. - * - * @param sourceId - Source connection identifier. - * @param body - Estimate request. - * @returns Export estimate. - */ - async estimateSourceExport(sourceId: string, body: EstimateExportRequest): Promise { - return (await this.request("POST", `/sources/${sourceId}/exports/estimate`, { json: body })) as EstimateExportResponse; - } - - /** - * Delete a source export. - * - * @param sourceId - Source connection identifier. - * @param exportId - Export identifier. - */ - async deleteSourceExport(sourceId: string, exportId: string): Promise { - await this.request("DELETE", `/sources/${sourceId}/exports/${exportId}`); - } - - // ─── Source Embedding Migrations ─────────────────────────────────────────── - - /** - * Get the status of a source embedding migration. - * - * @param sourceId - Source connection identifier. - * @returns Migration status. - */ - async getSourceEmbeddingMigration(sourceId: string): Promise { - return (await this.request("GET", `/sources/${sourceId}/embedding-migration`)) as SourceEmbeddingMigrationResponse; - } - - /** - * Start a source embedding migration. - * - * @param sourceId - Source connection identifier. - * @param body - Migration configuration (target embedding model, etc.). - * @returns Migration status. - */ - async startSourceEmbeddingMigration(sourceId: string, body: StartSourceEmbeddingMigrationRequest): Promise { - return (await this.request("POST", `/sources/${sourceId}/embedding-migration`, { json: body })) as SourceEmbeddingMigrationResponse; - } - - /** - * Cancel a source embedding migration. - * - * @param sourceId - Source connection identifier. - * @returns Updated migration status. - */ - async cancelSourceEmbeddingMigration(sourceId: string): Promise { - return (await this.request("POST", `/sources/${sourceId}/embedding-migration/cancel`)) as SourceEmbeddingMigrationResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Content - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Get content detail for a specific content version. - * - * @param contentVersionId - Content version identifier. - * @param opts - Range options for slicing large content. - * @returns Content details for the requested range. - */ - async getContentDetail( - contentVersionId: string, - opts: { start?: number; end?: number } = {}, - ): Promise { - return (await this.request("GET", `/contents/${contentVersionId}`, { - query: { start: opts.start ?? 0, end: opts.end ?? 5000 }, - })) as ContentDetailResponse; - } - - /** - * Replace content with inline text. - * - * @param contentVersionId - Content version identifier. - * @param body - Inline text replacement payload. - */ - async replaceContentWithInlineText(contentVersionId: string, body: InlineTextReplaceRequest): Promise { - return (await this.request("PUT", `/contents/${contentVersionId}`, { json: body })) as ContentFileUploadResponse; - } - - /** - * Delete a specific content version. - * - * @param contentVersionId - Content version identifier. - */ - async deleteContent(contentVersionId: string): Promise { - await this.request("DELETE", `/contents/${contentVersionId}`); - } - - /** - * List embeddings for a content version. - * - * @param contentVersionId - Content version identifier. - * @param opts - Pagination options. - * @returns Paginated list of embeddings. - */ - async listContentEmbeddings( - contentVersionId: string, - opts: ListOptions = {}, - ): Promise { - return (await this.request("GET", `/contents/${contentVersionId}/embeddings`, { - query: { page: opts.page ?? 1, limit: opts.limit ?? 20 }, - })) as ContentEmbeddingsListResponse; - } - - /** - * Upload a file to replace content for an existing content version. - * - * @param contentVersionId - Content version identifier. - * @param opts - File payload and optional metadata. - * @returns Upload response. - */ - async uploadFileToContent( - contentVersionId: string, - opts: { - file: Blob | Uint8Array | ArrayBuffer | BufferSource; - title?: string; - metadata?: Record; - fileName?: string; - mimeType?: string; - }, - ): Promise { - return (await this.uploadFile(`/contents/${contentVersionId}/upload`, opts)) as ContentFileUploadResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Solutions - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List solutions. - * - * @param opts - Pagination and sorting options. - * @returns Paginated list of solutions. - */ - async listSolutions(opts: SortableListOptions = {}): Promise { - return (await this.request("GET", "/solutions", { - query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }, - })) as SolutionListResponse; - } - - /** - * Create a new solution. - * - * @param body - Solution configuration. - * @returns The created solution. - */ - async createSolution(body: CreateSolutionRequest): Promise { - return (await this.request("POST", "/solutions", { json: body })) as SolutionResponse; - } - - /** - * Get a solution by ID. - * - * @param solutionId - Solution identifier. - * @returns Solution details. - */ - async getSolution(solutionId: string): Promise { - return (await this.request("GET", `/solutions/${solutionId}`)) as SolutionResponse; - } - - /** - * Update a solution. - * - * @param solutionId - Solution identifier. - * @param body - Fields to update. - * @returns Updated solution. - */ - async updateSolution(solutionId: string, body: UpdateSolutionRequest): Promise { - return (await this.request("PATCH", `/solutions/${solutionId}`, { json: body })) as SolutionResponse; - } - - /** - * Delete a solution. - * - * @param solutionId - Solution identifier. - */ - async deleteSolution(solutionId: string): Promise { - await this.request("DELETE", `/solutions/${solutionId}`); - } - - // ─── Solution Resource Linking ───────────────────────────────────────────── - - /** - * Link agents to a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to link. - * @returns Updated solution. - */ - async linkAgentsToSolution(solutionId: string, body: LinkResourcesRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/agents`, { json: body })) as SolutionResponse; - } - - /** - * Unlink agents from a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to unlink. - * @returns Updated solution. - */ - async unlinkAgentsFromSolution(solutionId: string, body: UnlinkResourcesRequest): Promise { - return (await this.request("DELETE", `/solutions/${solutionId}/agents`, { json: body })) as SolutionResponse; - } - - /** - * Link knowledge bases to a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to link. - * @returns Updated solution. - */ - async linkKnowledgeBasesToSolution(solutionId: string, body: LinkResourcesRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/knowledge-bases`, { json: body })) as SolutionResponse; - } - - /** - * Unlink knowledge bases from a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to unlink. - * @returns Updated solution. - */ - async unlinkKnowledgeBasesFromSolution(solutionId: string, body: UnlinkResourcesRequest): Promise { - return (await this.request("DELETE", `/solutions/${solutionId}/knowledge-bases`, { json: body })) as SolutionResponse; - } - - /** - * Link source connections to a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to link. - * @returns Updated solution. - */ - async linkSourceConnectionsToSolution(solutionId: string, body: LinkResourcesRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/source-connections`, { json: body })) as SolutionResponse; - } - - /** - * Unlink source connections from a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to unlink. - * @returns Updated solution. - */ - async unlinkSourceConnectionsFromSolution(solutionId: string, body: UnlinkResourcesRequest): Promise { - return (await this.request("DELETE", `/solutions/${solutionId}/source-connections`, { json: body })) as SolutionResponse; - } - - // ─── Solution Conversations ──────────────────────────────────────────────── - - /** - * List conversations for a solution. - * - * @param solutionId - Solution identifier. - * @returns List of conversations. - */ - async listSolutionConversations(solutionId: string): Promise { - return (await this.request("GET", `/solutions/${solutionId}/conversations`)) as SolutionConversationResponse[]; - } - - /** - * Add a conversation turn to a solution. - * - * @param solutionId - Solution identifier. - * @param body - Conversation turn payload. - * @returns Updated conversation. - */ - async addSolutionConversationTurn(solutionId: string, body: AddConversationTurnRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/conversations`, { json: body })) as SolutionConversationResponse; - } - - /** - * Mark a conversation turn (e.g. accepted/rejected). - * - * @param solutionId - Solution identifier. - * @param conversationId - Conversation identifier. - * @param body - Mark payload. - */ - async markSolutionConversationTurn(solutionId: string, conversationId: string, body: MarkConversationTurnRequest): Promise { - await this.request("PATCH", `/solutions/${solutionId}/conversations/${conversationId}`, { json: body }); - } - - // ─── Solution AI Assistant ───────────────────────────────────────────────── - - /** - * Generate a solution AI plan. - * - * @param solutionId - Solution identifier. - * @param body - Generation request. - * @returns AI-generated plan. - */ - async generateSolutionAiPlan(solutionId: string, body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/ai-assistant/generate`, { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Generate a knowledge base configuration via solution AI. - * - * @param solutionId - Solution identifier. - * @param body - Generation request. - * @returns AI-generated knowledge base config. - */ - async generateSolutionAiKnowledgeBase(solutionId: string, body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/ai-assistant/knowledge-base`, { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Generate a source configuration via solution AI. - * - * @param solutionId - Solution identifier. - * @param body - Generation request. - * @returns AI-generated source config. - */ - async generateSolutionAiSource(solutionId: string, body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/ai-assistant/source`, { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Accept a solution AI plan. - * - * @param solutionId - Solution identifier. - * @param conversationId - Conversation identifier. - * @param body - Accept request. - * @returns Acceptance result with executed actions. - */ - async acceptSolutionAiPlan(solutionId: string, conversationId: string, body: AiAssistantAcceptRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/ai-assistant/${conversationId}/accept`, { json: body })) as AiAssistantAcceptResponse; - } - - /** - * Decline a solution AI plan. - * - * @param solutionId - Solution identifier. - * @param conversationId - Conversation identifier. - */ - async declineSolutionAiPlan(solutionId: string, conversationId: string): Promise { - await this.request("POST", `/solutions/${solutionId}/ai-assistant/${conversationId}/decline`); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Governance — AI Assistant - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Generate governance policy suggestions using AI. - * - * @param body - AI governance request. - * @returns AI-generated governance suggestions. - */ - async generateGovernanceAiPlan(body: GovernanceAiAssistantRequest): Promise { - return (await this.request("POST", "/governance/ai-assistant", { json: body })) as GovernanceAiAssistantResponse; - } - - /** - * List governance AI conversations. - */ - async listGovernanceAiConversations(): Promise { - return (await this.request("GET", "/governance/ai-assistant/conversations")) as GovernanceConversationResponse[]; - } - - /** - * Accept a governance AI plan. - * - * @param conversationId - Conversation identifier. - * @returns Acceptance result. - */ - async acceptGovernanceAiPlan(conversationId: string): Promise { - return (await this.request("POST", `/governance/ai-assistant/${conversationId}/accept`)) as GovernanceAiAcceptResponse; - } - - /** - * Decline a governance AI plan. - * - * @param conversationId - Conversation identifier. - */ - async declineGovernanceAiPlan(conversationId: string): Promise { - await this.request("POST", `/governance/ai-assistant/${conversationId}/decline`); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Alerts - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List alerts. - * - * @param opts - Pagination and filter options. - * @returns Paginated list of alerts. - */ - async listAlerts(opts: ListOptions & { status?: string; severity?: string } = {}): Promise { - // `severity` is deliberately not forwarded: GET /alerts declares no such - // filter, so it never filtered anything, and sending it is a 422 once - // `apiVersion` is 2026-07-27 or later. Accepted and dropped so existing - // call sites keep working. - return (await this.request("GET", "/alerts", { - query: { page: opts.page, limit: opts.limit, status: opts.status }, - })) as AlertListResponse; - } - - /** - * Get alert details by ID. - * - * @param alertId - Alert identifier. - * @returns Alert details. - */ - async getAlert(alertId: string): Promise { - return (await this.request("GET", `/alerts/${alertId}`)) as AlertDetailResponse; - } - - /** - * Change the status of an alert. - * - * @param alertId - Alert identifier. - * @param body - Status change request. - */ - async changeAlertStatus(alertId: string, body: ChangeStatusRequest): Promise { - return (await this.request("POST", `/alerts/${alertId}/status`, { json: body })) as AlertDetailResponse; - } - - /** - * Add a comment to an alert. - * - * @param alertId - Alert identifier. - * @param body - Comment payload. - */ - async addAlertComment(alertId: string, body: AddCommentRequest): Promise { - return (await this.request("POST", `/alerts/${alertId}/comments`, { json: body })) as AlertDetailResponse; - } - - /** - * Subscribe to an alert. - * - * @param alertId - Alert identifier. - */ - async subscribeToAlert(alertId: string): Promise { - return (await this.request("POST", `/alerts/${alertId}/subscribe`)) as AlertDetailResponse; - } - - /** - * Unsubscribe from an alert. - * - * @param alertId - Alert identifier. - */ - async unsubscribeFromAlert(alertId: string): Promise { - return (await this.request("POST", `/alerts/${alertId}/unsubscribe`)) as AlertDetailResponse; - } - - // ─── Alert Configs ───────────────────────────────────────────────────────── - - /** - * List alert configurations. - * - * @param opts - Pagination options. - * @returns Paginated list of alert configs. - */ - /** - * The configurations arrive under `configs` alongside `total` by default. - * Once the caller opts in with `apiVersion` 2026-07-27 or later the endpoint - * returns the canonical `{data, pagination}` envelope instead, so the - * top-level key changes. - */ - async listAlertConfigs(opts: ListOptions = {}): Promise { - return (await this.request("GET", "/alerts/configs", { - query: { page: opts.page, limit: opts.limit }, - })) as AlertConfigListResponse; - } - - /** - * Create an alert configuration. - * - * @param body - Alert config definition. - * @returns Created alert config. - */ - async createAlertConfig(body: CreateAlertConfigRequest): Promise { - return (await this.request("POST", "/alerts/configs", { json: body })) as AlertConfigResponse; - } - - /** - * Get an alert configuration by ID. - * - * @param configId - Alert config identifier. - * @returns Alert config details. - */ - async getAlertConfig(configId: string): Promise { - return (await this.request("GET", `/alerts/configs/${configId}`)) as AlertConfigResponse; - } - - /** - * Update an alert configuration. - * - * @param configId - Alert config identifier. - * @param body - Fields to update. - * @returns Updated alert config. - */ - async updateAlertConfig(configId: string, body: UpdateAlertConfigRequest): Promise { - return (await this.request("PATCH", `/alerts/configs/${configId}`, { json: body })) as AlertConfigResponse; - } - - /** - * Delete an alert configuration. - * - * @param configId - Alert config identifier. - */ - async deleteAlertConfig(configId: string): Promise { - await this.request("DELETE", `/alerts/configs/${configId}`); - } - - // ─── Organization Alert Preferences ──────────────────────────────────────── - - /** - * List organization alert preferences. - */ - async listOrganizationAlertPreferences(): Promise { - return (await this.request("GET", "/alerts/organization-preferences/list")) as OrganizationAlertPreferenceListResponse; - } - - /** - * Update an organization alert preference. - * - * @param organizationId - Organization identifier. - * @param alertType - Alert type. - * @param body - Preference update. - */ - async updateOrganizationAlertPreference( - organizationId: string, - alertType: string, - body: UpdateOrganizationAlertPreferenceRequest, - ): Promise { - return (await this.request( - "PATCH", - `/alerts/organization-preferences/${organizationId}/${alertType}`, - { json: body }, - )) as OrganizationAlertPreferenceResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Models & Model Alerts - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List model alerts. - * - * @param opts - Pagination options. - */ - async listModelAlerts(opts: ListOptions = {}): Promise { - // The endpoint declares limit/offset, not page, so `page` was ignored and - // every page after the first returned page 1. - const limit = opts.limit ?? 50; - const offset = opts.page && opts.page > 1 ? (opts.page - 1) * limit : undefined; - return (await this.request("GET", "/models/alerts", { - query: { offset, limit: opts.limit }, - })) as ModelAlertListResponse; - } - - /** - * Mark all model alerts as read. - */ - async markAllModelAlertsRead(): Promise { - await this.request("POST", "/models/alerts/mark-all-read"); - } - - /** - * Get unread model alert count. - */ - async getUnreadModelAlertCount(): Promise { - return (await this.request("GET", "/models/alerts/unread-count")) as UnreadCountResponse; - } - - /** - * Mark a specific model alert as read. - * - * @param alertId - Model alert identifier. - */ - async markModelAlertRead(alertId: string): Promise { - await this.request("PATCH", `/models/alerts/${alertId}/read`); - } - - /** - * Get model recommendations. - * - * @param modelId - Model identifier. - */ - async getModelRecommendations(modelId: string): Promise { - return (await this.request("GET", `/models/${modelId}/recommendations`)) as ModelRecommendationsResponse; - } - - /** - * List all enabled LLM models grouped by provider. - * - * @param opts - Optional filters. - */ - async listModels( - opts: { - provider?: string; - supportsToolUse?: boolean; - supportsThinking?: boolean; - supportsInputMedia?: string; - supportsOutputMedia?: string; - } = {}, - ): Promise { - return (await this.request("GET", "/models", { - query: { - provider: opts.provider, - supports_tool_use: opts.supportsToolUse, - supports_thinking: opts.supportsThinking, - supports_input_media: opts.supportsInputMedia, - supports_output_media: opts.supportsOutputMedia, - }, - })) as ProviderGroupResponse[]; - } - - /** - * Get full details for a specific model. - * - * @param modelId - Model identifier. - */ - async getModel(modelId: string): Promise { - return (await this.request("GET", `/models/${modelId}/details`)) as PromptModelResponse; - } - - /** - * List the media-generation quality tiers and the model + cost each resolves to. - * - * On a `prompt_call`'s `media_generation` tool — and the dedicated - * `generate_*` steps via tier routing — the author/LLM picks a *tier* - * (fast/balanced/thorough), never a model. This maps each - * `(modality, tier)` to its concrete generator, raw `credits_per_unit`, - * `unit_label`, and a human-readable scaled `price_label`. - * - * Global routing/pricing (the same for every account); read-only. - */ - async getGenerationTiers(): Promise> { - return (await this.request("GET", "/models/generation-tiers")) as Record; - } - - /** - * List the embedding models a source can index with, and their pricing. - * - * The endpoint lists the embedders under `models` by default and under `data` - * once the caller opts in with `apiVersion` 2026-07-27 or later; `models` is - * populated on either, with the defaults and pricing beside it. - * - * @param opts.supportsInputMedia - Keep only embedders that can index this - * input modality — a coarse kind (text, image, video, audio) or a full MIME. - */ - async listEmbeddingModels(opts: { supportsInputMedia?: string } = {}): Promise { - return withModels( - await this.request("GET", "/models/embedders", { - query: { supports_input_media: opts.supportsInputMedia }, - }), - ); - } - - /** - * List the reranker models a knowledge base can use, and their pricing. - * - * `models` is populated on either wire shape, as for {@link Seclai.listEmbeddingModels}. - */ - async listRerankerModels(): Promise { - return withModels(await this.request("GET", "/models/rerankers")); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Model Playground Experiments - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List model playground experiments. - * - * @param opts - Optional filters and pagination. - */ - async listExperiments(opts: { days?: number; startDate?: string; endDate?: string; limit?: number; offset?: number } = {}): Promise { - return (await this.request("GET", "/models/playground/experiments", { - query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate, limit: opts.limit, offset: opts.offset }, - })) as ExperimentListResponse; - } - - /** - * Create a model playground experiment. - * - * @param body - Experiment configuration. - */ - async createExperiment(body: CreateExperimentInput): Promise { - return (await this.request("POST", "/models/playground/experiments", { json: body })) as CreateExperimentResponse; - } - - /** - * Get a model playground experiment by ID. - * - * @param experimentId - Experiment identifier. - */ - async getExperiment(experimentId: string): Promise { - return (await this.request("GET", `/models/playground/experiments/${experimentId}`)) as ExperimentDetailResponse; - } - - /** - * Cancel a running model playground experiment. - * - * @param experimentId - Experiment identifier. - */ - async cancelExperiment(experimentId: string): Promise { - return (await this.request("POST", `/models/playground/experiments/${experimentId}/cancel`)) as CancelExperimentResponse; - } - - /** - * Soft-delete a model playground experiment. - * - * Removes the experiment from list/detail views while preserving audit - * history. Returns HTTP 204 with no body. - * - * @param experimentId - Experiment identifier. - */ - async deleteExperiment(experimentId: string): Promise { - await this.request("DELETE", `/models/playground/experiments/${experimentId}`); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Cloud Drives - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List the cloud-drive providers this deployment has configured. - * - * @returns The providers, read from either wire shape. - */ - async listCloudDriveProviders(): Promise { - return listItems(await this.request("GET", "/cloud-drives/providers")); - } - - /** - * List the account's cloud-drive connections. - * - * @returns The connections, read from either wire shape. - */ - async listCloudDrives(): Promise { - return listItems(await this.request("GET", "/cloud-drives")); - } - - /** - * Get a cloud-drive connection. - * - * @param connectionId - Cloud-drive connection identifier. - */ - async getCloudDrive(connectionId: string): Promise { - return (await this.request("GET", `/cloud-drives/${connectionId}`)) as CloudDriveResponse; - } - - /** - * Update a cloud-drive connection. - * - * @param connectionId - Cloud-drive connection identifier. - * @param body - Fields to change — `name` and/or `folder_path`. - * @returns The updated connection. - */ - async updateCloudDrive(connectionId: string, body: CloudDriveUpdateRequest): Promise { - return (await this.request("PATCH", `/cloud-drives/${connectionId}`, { json: body })) as CloudDriveResponse; - } - - /** - * Disconnect a cloud-drive connection, keeping the connection itself. - * - * @param connectionId - Cloud-drive connection identifier. - * @returns The connection in its disconnected state. - */ - async disconnectCloudDrive(connectionId: string): Promise { - return (await this.request("POST", `/cloud-drives/${connectionId}/disconnect`)) as CloudDriveResponse; - } - - /** - * Delete a cloud-drive connection. - * - * @param connectionId - Cloud-drive connection identifier. - */ - async deleteCloudDrive(connectionId: string): Promise { - await this.request("DELETE", `/cloud-drives/${connectionId}`); - } - - /** - * List the agents that use a cloud-drive connection. - * - * @param connectionId - Cloud-drive connection identifier. - * @returns The agents, read from either wire shape. - */ - async getAgentsUsingCloudDrive(connectionId: string): Promise { - return listItems( - await this.request("GET", `/cloud-drives/${connectionId}/agents`), - ); - } - - /** - * List the files a cloud-drive connection skipped, newest first. - * - * A skipped file fires no trigger, so this is where to look when an agent - * did not run for a file. - * - * @param connectionId - Cloud-drive connection identifier. - * @param opts.limit - Maximum number of rejections (1-200, default 50). - * @returns The rejections with their reasons, read from either wire shape. - */ - async listCloudDriveRejections( - connectionId: string, - opts: { limit?: number } = {}, - ): Promise { - return listItems( - await this.request("GET", `/cloud-drives/${connectionId}/rejections`, { - query: { limit: opts.limit }, - }), - ); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Search - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Search across all resource types in your account. - * - * Accepts a free-text keyword query or a UUID. Results are ranked: - * name-prefix > name-substring > description-substring. - * - * @param opts - Search options. - * @param opts.query - Search query string (required, 1-200 chars). - * @param opts.limit - Maximum results (1-50, default 10). - * @param opts.entityType - Optional entity type filter (e.g. "agent", "knowledge_base"). - * @returns Search results. - */ - async search(opts: { query: string; limit?: number; entityType?: string }): Promise { - return (await this.request("GET", "/search", { - query: { q: opts.query, limit: opts.limit, entity_type: opts.entityType }, - })) as SearchResponse; - } - - /** - * Search the Seclai documentation by content. - * - * `mode: "keyword"` matches page titles and summaries (fast, no AI cost); - * `mode: "semantic"` matches page body content by meaning (uses an embedding). - * - * Each result carries a `doc_slug` and an optional section `anchor` for - * building a `https://seclai.com/docs/[#]` link, a `score` - * (not comparable across modes), and — in semantic mode — a `highlight` - * (best matching verbatim sentence; `null` for keyword). - * - * Documentation is global, so results are not account-scoped. - * - * @param opts - Search options. - * @param opts.query - Search query string (required, 1-200 chars). - * @param opts.mode - Search strategy (default `"keyword"`). - * @param opts.limit - Maximum results (1-20, default 8). - */ - async searchDocs(opts: { query: string; mode?: "keyword" | "semantic"; limit?: number }): Promise> { - return (await this.request("GET", "/docs-search", { - query: { q: opts.query, mode: opts.mode, limit: opts.limit }, - })) as Record; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Email Domains - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List the account's vanity (`.seclai.com`) and custom - * (`agent.mycompany.com`) agent-email domains. - * - * Includes each domain's verification status and the DNS records the customer - * must publish, plus the plan capabilities (`can_add_vanity` / - * `can_add_custom`) and whether one of each kind already exists - * (`has_vanity` / `has_custom` — the per-kind limit is 1). - * - * Requires a user-bound credential; an account-only API key is refused with 403. - */ - async listEmailDomains(): Promise { - return (await this.request("GET", "/email-domains")) as EmailDomainsListResponse; - } - - /** - * Add and provision a new agent-email domain. - * - * Pass `kind: "vanity"` with `value: ""`, or `kind: "custom"` with - * `value: "agent.mycompany.com"` (optionally `delegated: true` to let Seclai - * manage a dedicated Route53 zone). Stands up the SES identity + DNS and - * returns the records the customer must publish. Requires an account - * owner/admin. - * - * @param body - The domain to add. `delegated` defaults to `false` server-side. - */ - async addEmailDomain(body: AddEmailDomainInput): Promise { - return (await this.request("POST", "/email-domains", { json: body })) as EmailDomainResponse; - } - - /** - * Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. - * - * Returns a `cleanup_note` when the removed domain was Seclai-managed - * (delegated), reminding you to delete the registrar NS delegation record - * (dangling-delegation / subdomain-takeover guard). Requires an account - * owner/admin. - * - * @param domainId - Domain identifier. - */ - async removeEmailDomain(domainId: string): Promise { - return (await this.request("DELETE", `/email-domains/${domainId}`)) as RemoveEmailDomainResponse; - } - - /** - * Run a verification check immediately ("Check now"). - * - * Re-polls SES + DNS for this domain instead of waiting for the background - * verification sweep, and returns its updated status + DNS-record check - * results. Useful right after publishing the required records. Requires an - * account owner/admin. - * - * @param domainId - Domain identifier. - */ - async verifyEmailDomain(domainId: string): Promise { - return (await this.request("POST", `/email-domains/${domainId}/verify`)) as EmailDomainResponse; - } - - /** - * Promote a verified domain to the account's primary domain. - * - * Agent email then sends FROM and receives ON this domain - * (`@`, `@`) instead of the shared - * `agent.seclai.com`. The domain must be verified. Requires an account - * owner/admin. - * - * @param domainId - Domain identifier. - */ - async setPrimaryEmailDomain(domainId: string): Promise { - return (await this.request("POST", `/email-domains/${domainId}/primary`)) as EmailDomainResponse; - } - - /** - * Revert to the shared `agent.seclai.com` sending/inbound domain. - * - * Clears the account's primary domain WITHOUT removing the configured - * domain(s) — they stay verified and can be promoted again later. Requires an - * account owner/admin. - */ - async useSharedEmailDomain(): Promise { - await this.request("POST", "/email-domains/use-shared-domain"); - } - - /** - * Send a test message FROM a verified domain (`noreply@`) TO the - * account owner's email. - * - * Confirms end-to-end that the domain actually sends (SES verified, DKIM/SPF - * aligned). Never sends to any other address, so it can't be used as an open - * relay. Requires an account owner/admin. - * - * @param domainId - Domain identifier. - */ - async sendEmailDomainTestEmail(domainId: string): Promise { - return (await this.request("POST", `/email-domains/${domainId}/test-email`)) as SendTestEmailResponse; - } - - /** - * Get the DMARC aggregate-report summary for a domain. - * - * Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top - * failing source IPs from the DMARC `rua` reports over the last `days` - * (clamped by the service). - * - * Populated for domains whose DNS zone Seclai controls (vanity + delegated - * custom); a self-managed custom domain keeps its own DMARC reporting and - * returns an all-zero summary. - * - * @param domainId - Domain identifier. - * @param opts - Reporting window options. - * @param opts.days - Window length in days (default 30). - * @param opts.topSources - Number of top failing sources to return (default 10). - */ - async getDmarcSummary( - domainId: string, - opts: { days?: number; topSources?: number } = {}, - ): Promise { - return (await this.request("GET", `/email-domains/${domainId}/dmarc`, { - query: { days: opts.days, top_sources: opts.topSources }, - })) as DmarcSummaryResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Top-Level AI Assistant - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Submit feedback on an AI assistant interaction. - * - * @param body - Feedback payload (thumbs up/down, optional comment). - * @returns Feedback response. - */ - async submitAiFeedback(body: AiAssistantFeedbackRequest): Promise { - return (await this.request("POST", "/ai-assistant/feedback", { json: body })) as AiAssistantFeedbackResponse; - } - - /** - * Generate a knowledge base configuration via AI assistant. - * - * @param body - Generation request. - */ - async aiAssistantKnowledgeBase(body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", "/ai-assistant/knowledge-base", { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Generate a source configuration via AI assistant. - * - * @param body - Generation request. - */ - async aiAssistantSource(body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", "/ai-assistant/source", { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Generate a solution via AI assistant. - * - * @param body - Generation request. - */ - async aiAssistantSolution(body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", "/ai-assistant/solution", { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Generate a memory bank configuration via AI assistant. - * - * @param body - Generation request. - */ - async aiAssistantMemoryBank(body: MemoryBankAiAssistantRequest): Promise { - return (await this.request("POST", "/ai-assistant/memory-bank", { json: body })) as MemoryBankAiAssistantResponse; - } - - /** - * Get AI assistant memory bank conversation history. - */ - async getAiAssistantMemoryBankHistory(): Promise { - return (await this.request("GET", "/ai-assistant/memory-bank/last-conversation")) as MemoryBankLastConversationResponse; - } - - /** - * Accept an AI assistant suggestion. - * - * @param conversationId - Conversation identifier. - * @param body - Acceptance request payload. - */ - async acceptAiAssistantPlan(conversationId: string, body: AiAssistantAcceptRequest): Promise { - return (await this.request("POST", `/ai-assistant/${conversationId}/accept`, { json: body })) as AiAssistantAcceptResponse; - } - - /** - * Decline an AI assistant suggestion. - * - * @param conversationId - Conversation identifier. - */ - async declineAiAssistantPlan(conversationId: string): Promise { - await this.request("POST", `/ai-assistant/${conversationId}/decline`); - } - - /** - * Accept/mark an AI memory bank suggestion. - * - * @param conversationId - Conversation identifier. - * @param body - Acceptance payload for the memory bank suggestion. - */ - async acceptAiMemoryBankSuggestion(conversationId: string, body: MemoryBankAcceptRequest): Promise { - return (await this.request("PATCH", `/ai-assistant/memory-bank/${conversationId}`, { json: body })) as OkResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Pagination Helpers - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Auto-paginate through a list endpoint. - * - * Yields individual items from each page, fetching the next page until the - * response reports there is none. A fetcher that answers with a bare array has - * no further pages, so its items are yielded once. - * - * @param fetchPage - A function that fetches a single page given `{ page, limit }`. - * @param opts - Page size (default: 50). - * @throws {@link SeclaiError} When a page carries its items under neither `data` nor `items`. - * - * @example - * ```ts - * for await (const agent of client.paginate( - * (opts) => client.listAgents(opts), - * )) { - * console.log(agent.name); - * } - * ``` - */ - async *paginate( - fetchPage: (opts: { page: number; limit: number }) => Promise>, - opts?: { limit?: number }, - ): AsyncGenerator { - const limit = opts?.limit ?? 50; - let page = 1; - - while (true) { - const result = (await fetchPage({ page, limit })) as unknown; - if (Array.isArray(result)) { - yield* result as T[]; - return; - } - const body = (result ?? {}) as { - data?: T[] | null; - items?: T[] | null; - pagination?: { pages?: number; total_pages?: number; has_next?: boolean } | null; - total?: number; - limit?: number; - }; - const items = "data" in body ? body.data ?? [] : body.items; - if (!Array.isArray(items)) { - throw new SeclaiError( - "paginate() could not find the page's items: expected an array, or an object with a `data` or `items` array.", - ); - } - yield* items; - - const pagination = body.pagination; - if (items.length === 0) return; - if (!pagination) { - // The flat `{data, total, page, limit}` shape. Counted from the page - // requested, so a server that ignores `page` cannot loop this forever. - if (typeof body.total !== "number") return; - const pageSize = typeof body.limit === "number" && body.limit > 0 ? body.limit : limit; - if (page * pageSize >= body.total) return; - } else if (typeof pagination.has_next === "boolean") { - if (!pagination.has_next) return; - } else { - const pages = pagination.pages ?? pagination.total_pages; - if (items.length < limit || pages === undefined || page >= pages) return; - } - page++; - } - } -} diff --git a/src/errors.ts b/src/errors.ts deleted file mode 100644 index 36c1fb2..0000000 --- a/src/errors.ts +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @module - * - * Error classes thrown by the Seclai SDK. - * - * All errors extend {@link SeclaiError}, so a single `catch (err instanceof SeclaiError)` - * handles every SDK error. Narrow to more specific subclasses for finer handling. - */ - -/** Base error class for the Seclai SDK. */ -export class SeclaiError extends Error { - constructor(message: string) { - super(message); - this.name = "SeclaiError"; - } -} - -/** Thrown when the SDK is misconfigured (for example, missing API key). */ -export class SeclaiConfigurationError extends SeclaiError { - constructor(message: string) { - super(message); - this.name = "SeclaiConfigurationError"; - } -} - -/** - * Thrown when the API returns a non-success status code. - * - * @remarks - * Use {@link SeclaiAPIValidationError} for HTTP 422 validation errors. - */ -export class SeclaiAPIStatusError extends SeclaiError { - /** HTTP status code returned by the API. */ - public readonly statusCode: number; - /** HTTP method used for the request. */ - public readonly method: string; - /** Full request URL. */ - public readonly url: string; - /** Best-effort response body text (if available). */ - public readonly responseText: string | undefined; - - constructor(opts: { - /** Human-readable error message. */ - message: string; - statusCode: number; - method: string; - url: string; - responseText: string | undefined; - }) { - super(opts.message); - this.name = "SeclaiAPIStatusError"; - this.statusCode = opts.statusCode; - this.method = opts.method; - this.url = opts.url; - this.responseText = opts.responseText; - } -} - -/** - * Thrown when the API returns a validation error response (typically HTTP 422). - * - * The `validationError` field contains the decoded validation payload when available. - */ -export class SeclaiAPIValidationError extends SeclaiAPIStatusError { - /** Parsed validation error payload (best-effort). */ - public readonly validationError: unknown; - - constructor(opts: { - message: string; - statusCode: number; - method: string; - url: string; - responseText: string | undefined; - validationError: unknown; - }) { - super(opts); - this.name = "SeclaiAPIValidationError"; - this.validationError = opts.validationError; - } -} - -/** Thrown when a streaming operation fails (e.g. stream ends unexpectedly). */ -export class SeclaiStreamingError extends SeclaiError { - /** The run ID associated with the failed stream, when available. */ - public readonly runId: string | undefined; - - constructor(message: string, runId?: string) { - super(message); - this.name = "SeclaiStreamingError"; - this.runId = runId; - } -} diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index 25d2014..0000000 --- a/src/index.ts +++ /dev/null @@ -1,329 +0,0 @@ -/** - * @module - * - * Seclai JavaScript/TypeScript SDK. - * - * ```ts - * import { Seclai } from "@seclai/sdk"; - * - * const client = new Seclai({ apiKey: process.env.SECLAI_API_KEY }); - * const agents = await client.listAgents(); - * ``` - * - * @see {@link Seclai} for the main client class. - * @packageDocumentation - */ -export type { PaginatedPage } from "./client"; -export { SeclaiApiVersion } from "./versions"; -export type { ApiVersion } from "./versions"; - -export { - Seclai, - SECLAI_API_URL, - type SeclaiOptions, - type FetchLike, - type AccessTokenProvider, -} from "./client"; - -export { - type SsoProfile, - type SsoCacheEntry, - type AuthState, - type CredentialChainOptions, - DEFAULT_SSO_DOMAIN, - DEFAULT_SSO_CLIENT_ID, - DEFAULT_SSO_REGION, - /** - * Load an SSO profile from the config file. - * **Node.js only** — uses `node:fs` and `node:path`. - */ - loadSsoProfile, - /** - * Read a cached SSO token from disk. - * **Node.js only** — uses `node:fs` and `node:path`. - */ - readSsoCache, - /** - * Write a cached SSO token to disk atomically. - * **Node.js only** — uses `node:fs` and `node:path`. - */ - writeSsoCache, - /** - * Delete a cached SSO token file. - * **Node.js only** — uses `node:fs` and `node:path`. - */ - deleteSsoCache, - isTokenValid, -} from "./auth"; - -export { - SeclaiError, - SeclaiConfigurationError, - SeclaiAPIStatusError, - SeclaiAPIValidationError, - SeclaiStreamingError, -} from "./errors"; - -export type { - // General - JSONValue, - HTTPValidationError, - ValidationError, - PaginationResponse, - ListOptions, - SortableListOptions, - - // Identity - MeResponse, - OrganizationInfoResponse, - - // Agents - AgentListResponse, - AgentDefinitionResponse, - AgentExportResponse, - AgentSummaryResponse, - CreateAgentRequest, - UpdateAgentRequest, - UpdateAgentDefinitionRequest, - AgentImportPreviewRequest, - AgentImportPreviewResponse, - AgentDefinitionImportErrorResponse, - ImportFieldErrorModel, - ImportSkipResponse, - GovernancePolicyRefResponse, - AgentCallerApiResponse, - - // Agent Email Triggers - SetEmailTriggerConfigRequest, - EmailTriggerConfigResponse, - - // Agent Email Governance - AgentEmailOptOutResponse, - AgentEmailOptOutListResponse, - BlockEmailSenderRequest, - BlockedEmailSenderResponse, - BlockedEmailSenderListResponse, - SetAutoBlockModeRequest, - InboundEmailRejectionResponse, - InboundEmailStatusResponse, - CancelQueuedRunsResponse, - ResumeInboundResponse, - - // Agent Runs - AgentRunRequest, - AgentRunStreamRequest, - AgentRunResponse, - AgentRunListResponse, - AgentRunStepResponse, - AgentRunAttemptResponse, - AgentRunFileResponse, - AgentRunToolCallResponse, - AgentTraceSearchRequest, - AgentTraceSearchResponse, - AgentTraceMatchResponse, - AgentRunEvent, - - // Agent Input Uploads - UploadAgentInputApiResponse, - AgentAttachmentRefsApiResponse, - AttachmentRefsSourceApiSummary, - - // Agent AI Assistant - GenerateAgentStepsRequest, - GenerateAgentStepsResponse, - GenerateStepConfigRequest, - GenerateStepConfigResponse, - ExamplePrompt, - MarkAiSuggestionRequest, - AiConversationHistoryResponse, - AiConversationTurnResponse, - - // Agent Evaluations - AgentEvaluationTier, - EvaluationCriteriaResponse, - EvaluationCriteriaListResponse, - ApiVersionResponse, - AlertDetailResponse, - AlertCommentResponse, - AlertSubscriberResponse, - UnreadCountResponse, - ModelRecommendationsResponse, - ModelRecommendationResponse, - ExperimentListResponse, - ExperimentSummaryResponse, - ExperimentDetailResponse, - CreateExperimentResponse, - CancelExperimentResponse, - SearchResponse, - SearchResultResponse, - OkResponse, - AlertListResponse, - AlertResponse, - AlertConfigListResponse, - AlertConfigResponse, - ModelAlertListResponse, - ModelAlertResponse, - CreateEvaluationCriteriaRequest, - UpdateEvaluationCriteriaRequest, - EvaluationResultResponse, - EvaluationResultListResponse, - CreateEvaluationResultRequest, - EvaluationResultSummaryResponse, - EvaluationResultWithCriteriaResponse, - EvaluationResultWithCriteriaListResponse, - EvaluationRunSummaryResponse, - EvaluationRunSummaryListResponse, - EvaluationStatus, - NonManualEvaluationSummaryResponse, - NonManualEvaluationModeStatResponse, - TestDraftEvaluationRequest, - TestDraftEvaluationResponse, - CompatibleRunListResponse, - CompatibleRunResponse, - - // Knowledge Bases - KnowledgeBaseListResponse, - KnowledgeBaseResponse, - CreateKnowledgeBaseBody, - UpdateKnowledgeBaseBody, - - // Memory Banks - MemoryBankListResponse, - MemoryBankResponse, - CreateMemoryBankBody, - UpdateMemoryBankBody, - MemoryBankAiAssistantRequest, - MemoryBankAiAssistantResponse, - MemoryBankAcceptRequest, - MemoryBankConfigResponse, - MemoryBankLastConversationResponse, - MemoryBankConversationTurnResponse, - TestCompactionRequest, - CompactionTestResponse, - CompactionEvaluationModel, - StandaloneTestCompactionRequest, - - // Sources - SourceListResponse, - SourceResponse, - SourceConnectionResponse, - CreateSourceBody, - UpdateSourceBody, - FileUploadResponse, - InlineTextUploadRequest, - InlineTextReplaceRequest, - SourceContentStatusResponse, - SourceContentStatusListResponse, - ListSourceContentsOptions, - - // Cloud Drives - CloudDriveProviderResponse, - CloudDriveScopeResponse, - CloudDriveAccessLevelResponse, - CloudDriveResponse, - CloudDriveUpdateRequest, - AgentUsingCloudDriveResponse, - CloudDriveRejectionResponse, - - // Source Exports - ExportListResponse, - ExportResponse, - CreateExportRequest, - EstimateExportRequest, - EstimateExportResponse, - ExportFormat, - - // Source Embedding Migrations - SourceEmbeddingMigrationResponse, - StartSourceEmbeddingMigrationRequest, - - // Content - ContentDetailResponse, - ContentEmbeddingsListResponse, - ContentEmbeddingResponse, - ContentFileUploadResponse, - - // Solutions - SolutionListResponse, - SolutionResponse, - SolutionSummaryResponse, - CreateSolutionRequest, - UpdateSolutionRequest, - SolutionAgentResponse, - SolutionKnowledgeBaseResponse, - SolutionSourceConnectionResponse, - SolutionConversationResponse, - AddConversationTurnRequest, - MarkConversationTurnRequest, - AiAssistantGenerateRequest, - AiAssistantGenerateResponse, - AiAssistantAcceptRequest, - AiAssistantAcceptResponse, - ProposedActionResponse, - ExecutedActionResponse, - - // Resource Linking - LinkResourcesRequest, - UnlinkResourcesRequest, - - // Governance - GovernanceAiAssistantRequest, - GovernanceAiAssistantResponse, - GovernanceAiAcceptResponse, - GovernanceConversationResponse, - GovernanceProposedPolicyActionResponse, - GovernanceAppliedActionResponse, - - // Alerts - CreateAlertConfigRequest, - UpdateAlertConfigRequest, - ChangeStatusRequest, - AddCommentRequest, - OrganizationAlertPreferenceResponse, - OrganizationAlertPreferenceListResponse, - UpdateOrganizationAlertPreferenceRequest, - - // AI Assistant (top-level) - AiAssistantFeedbackRequest, - AiAssistantFeedbackResponse, - - // Models - PromptModelAutoUpgradeStrategy, - ProviderGroupResponse, - PromptModelResponse, - PromptToolResponse, - ModalityRateResponse, - EffortOptionsResponse, - EmbeddingModelResponse, - EmbeddingModelListResponse, - EmbeddingModalityRateResponse, - EmbeddingStorageCreditsResponse, - RerankerModelResponse, - RerankerModelListResponse, - VariantCategoryResponse, - VariantOptionResponse, - PlaygroundCreateRequest, - CreateExperimentInput, - - // Email Domains - AddEmailDomainRequest, - AddEmailDomainInput, - EmailDomainResponse, - EmailDomainsListResponse, - RemoveEmailDomainResponse, - SendTestEmailResponse, - DnsRecordResponse, - DnsProviderResponse, - DmarcSummaryResponse, - DmarcFailingSourceResponse, - - // Sources (enums) - SourceIndexMode, - - // Errors - InsufficientCreditsResponse, - InsufficientCreditsDetail, - - // Enums - PendingProcessingCompletedFailedStatus, -} from "./types"; diff --git a/src/openapi.ts b/src/openapi.ts deleted file mode 100644 index 1d6bbe6..0000000 --- a/src/openapi.ts +++ /dev/null @@ -1,18578 +0,0 @@ -/** - * This file was auto-generated by openapi-typescript. - * Do not make direct changes to the file. - */ - -export interface paths { - "/agents": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List agents - * @description List agents for the account with pagination. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - get: operations["list_agents_api_agents_get"]; - put?: never; - /** - * Create an agent - * @description Create a new agent. - * - * Trigger types: - * - `dynamic_input`: triggered via API with user-provided input - * - `template_input`: triggered via API with a predefined template - * - `schedule`: triggered on a schedule - * - `new_content`: triggered when new content arrives - * - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`. - * - * Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline` - * - * Importing an existing agent: - * - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; items that don't resolve in this account are reported in the response's `import_warnings` array. - * - Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: target_uuid}` on this call to substitute them before save. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account. - */ - post: operations["create_agent_api_agents_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/agent-email-optouts": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List agent-email opt-outs - * @description List recipients who have opted out of this account's agent emails (filter to one agent via `agent_id`; account-wide opt-outs always apply). Paginated via `limit`/`offset`; returns the page plus the `total` count. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account. - */ - get: operations["list_agent_email_optouts_api_api_agents_agent_email_optouts_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/agent-email-optouts/{optout_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** - * Revoke an agent-email opt-out - * @description Revoke an opt-out (opt the recipient back in to agent emails). - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the opt-out must belong to the key's account. - */ - delete: operations["remove_agent_email_optout_api_api_agents_agent_email_optouts__optout_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/blocked-email-senders": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List blocked inbound email senders + the auto-block mode - * @description List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus the governance `auto_block_mode`. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account. - */ - get: operations["list_blocked_email_senders_api_api_agents_blocked_email_senders_get"]; - put?: never; - /** - * Block an inbound email sender or domain - * @description Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is `address` (default) or `domain`). - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account. - */ - post: operations["block_email_sender_api_api_agents_blocked_email_senders_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/blocked-email-senders/mode": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - /** - * Set the governance auto-block mode - * @description Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the blocklist (`disabled`, `input`, or `input_and_output`); returns the updated list. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account. - */ - put: operations["set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put"]; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/blocked-email-senders/{blocked_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** - * Unblock an inbound email sender - * @description Remove a blocked sender by id. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; the blocked sender must belong to the key's account. - */ - delete: operations["unblock_email_sender_api_api_agents_blocked_email_senders__blocked_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/evaluation-criteria/{criteria_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Evaluation Criteria - * @description Get a single evaluation criteria by ID. - * - * Returns the full criteria configuration including type-specific fields, - * current enabled state, and a summary of recent evaluation results. - */ - get: operations["get_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__get"]; - put?: never; - post?: never; - /** - * Delete Evaluation Criteria - * @description Delete an evaluation criteria and all associated evaluation results. - * - * This action is permanent and cannot be undone. All historical result - * records tied to the criteria are removed as well. - */ - delete: operations["delete_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__delete"]; - options?: never; - head?: never; - /** - * Update Evaluation Criteria - * @description Update an evaluation criteria. - * - * Accepts a partial update – only the fields included in the request body - * are modified. Use this to toggle enabled/disabled, change the - * evaluation prompt, adjust retries, or rename the criteria. - */ - patch: operations["update_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__patch"]; - trace?: never; - }; - "/agents/evaluation-criteria/{criteria_id}/compatible-runs": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Compatible Runs - * @description List agent runs that have a completed step matching the criteria's target step. - * - * Returns runs whose step output can be used for testing or replaying the - * evaluation criteria. Results are ordered newest-first and paginated. - */ - get: operations["list_compatible_runs_api_agents_evaluation_criteria__criteria_id__compatible_runs_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/evaluation-criteria/{criteria_id}/results": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Evaluation Results - * @description List evaluation results for a criteria with optional filtering. - * - * Supports filtering by status (pending, passed, failed, skipped, error), - * flagged-only mode, and an optional time range. Results are paginated - * with configurable page size. - */ - get: operations["list_evaluation_results_api_agents_evaluation_criteria__criteria_id__results_get"]; - put?: never; - /** - * Create Evaluation Result - * @description Record an evaluation result for a criteria. - * - * Use this endpoint to push results from external test harnesses, CI/CD - * pipelines, or custom evaluation logic. Each result is linked to an - * agent run and optionally a specific step run. - */ - post: operations["create_evaluation_result_api_agents_evaluation_criteria__criteria_id__results_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/evaluation-criteria/{criteria_id}/summary": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Evaluation Summary - * @description Get an aggregated summary of evaluation results for a criteria. - * - * Returns total, passed, failed, error, and flagged counts alongside the - * average score, giving a quick overview of how the criteria is performing. - */ - get: operations["get_evaluation_summary_api_agents_evaluation_criteria__criteria_id__summary_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/evaluation-results/non-manual-summary": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Non Manual Evaluation Summary - * @description Get an evaluation summary for API key clients. - * - * Returns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag). - * - * The ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset - * (opt in via the ``Seclai-Version`` header). Clients on the legacy baseline - * always receive the account-wide rollup; ``agent_id`` is ignored for them so - * the endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary - * is scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist). - */ - get: operations["get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/inbound-email-rejections": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List discarded inbound emails - * @description List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, unknown alias, spam/virus, flood-shed) for this account's agents. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account. - */ - get: operations["list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/inbound-email-status": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Account inbound-email overload status - * @description Whether the account-wide overload circuit breaker has currently paused new inbound email (all inbound turned away until the queued backlog drains), plus the size of the QUEUED (over-quota parked) run backlog. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account. - */ - get: operations["get_inbound_email_status_api_api_agents_inbound_email_status_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/inbound-email-status/cancel-queued": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Cancel all queued inbound-email runs - * @description Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run has consumed no quota, so this merely fails them. Returns the count cancelled. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account. - */ - post: operations["cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/inbound-email-status/resume": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Manually resume paused inbound email - * @description Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the breaker re-arms on the next evaluation — this is a one-shot override, not a permanent disable. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account. - */ - post: operations["resume_inbound_email_api_api_agents_inbound_email_status_resume_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/preview-import": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Preview an agent_definition import - * @description Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) without creating or modifying any agent. On success returns a summary the client can show before commit (counts of steps, schedules, alert configs, evaluation criteria, governance policies). On failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can render line/column-anchored errors. - * - * Coverage: everything decidable from the payload itself — schema, step ids, nesting depth, text lengths, attachment references, prompt-tool declarations, step-graph cycles, racing step references, and `for_each` aggregation. Rules that depend on account state (email recipients, memory-bank types, cloud-drive connections, the agent's own trigger) can only run at save time, so `POST /agents` may still reject a payload this endpoint accepts. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. No DB writes. - */ - post: operations["preview_import_agent_api_agents_preview_import_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/runs/search": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Search agent traces - * @description Search agent traces using semantic similarity. - * - * Finds step-run outputs that are most semantically similar to the query. - * Results include the matching text, agent/step metadata, and a similarity score. - * - * Agent traces are automatically indexed when runs complete. The first 7 days of storage are free; extended retention is billed. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Searches only within your account's traces. - */ - post: operations["search_agent_runs_api_agents_runs_search_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/runs/{run_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get an agent run - * @description Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST /agents/{agent_id}/runs/stream`. - * - * The response includes `status`, `error_count`, and `output` once the run completes. Use `include_step_outputs=true` to include per-step outputs, timing, durations, and credits. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access runs belonging to your account. - */ - get: operations["get_agent_run_api_agents_runs__run_id__get"]; - put?: never; - post?: never; - /** - * Cancel an agent run - * @description Cancel an in-flight (`processing`) or queued (`queued`) agent run. - * - * A `queued` run is an inbound-email run parked by the per-plan rate quota that has not yet been dispatched; it has consumed no quota. - * - * If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only cancel runs belonging to your account. - */ - delete: operations["delete_agent_run_api_agents_runs__run_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get an agent - * @description Fetch an agent's metadata (name, description, trigger type, timestamps). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account. - */ - get: operations["get_agent_metadata_api_agents__agent_id__get"]; - /** - * Update agent metadata - * @description Update an agent's name, description, evaluation settings, and model lifecycle settings. - * - * Evaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, `sampling_config`. - * - * Model lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', 'governance_block', 'agent_run_failed'). - * - * Replacing the workflow from an export: - * - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only touches the workflow + agent metadata — alert_configs, evaluation_criteria, governance_policies, schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints for those, or `POST /agents` to import as a new agent). - * - `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same shape as `POST /agents`). - * - * At least one field must be provided. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account. - */ - put: operations["update_agent_api_agents__agent_id__put"]; - post?: never; - /** - * Delete an agent - * @description Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only delete agents belonging to your account. - */ - delete: operations["delete_agent_api_agents__agent_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/ai-assistant/conversations": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get AI conversation history - * @description Fetch the AI assistant conversation history for a specific step of an agent. - * - * Returns past conversation turns (user inputs, AI responses, accept/decline status) ordered oldest first. Use `step_type` to filter by step type, and optionally `step_id` to narrow to a specific step instance. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be queried. - */ - get: operations["get_ai_conversation_history_api_agents__agent_id__ai_assistant_conversations_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/ai-assistant/generate-steps": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate agent workflow - * @description Use the AI assistant to generate a full agent step workflow from a natural language description. - * - * Provide a description of what the agent should do, along with optional context (current steps, trigger type). The AI produces a complete set of agent steps. - * Use mode 'generate_full' for new workflows or 'modify_workflow' to refine existing ones. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used. - */ - post: operations["generate_agent_steps_api_agents__agent_id__ai_assistant_generate_steps_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/ai-assistant/step-config": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate step configuration - * @description Use the AI assistant to generate or refine a single step's configuration. - * - * Provide the step type, a natural language instruction, and optionally the current configuration. The AI will produce a proposed configuration along with an explanation. The suggestion is stored as a conversation turn that can be accepted or declined separately via the mark endpoint. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used. - */ - post: operations["generate_step_config_api_agents__agent_id__ai_assistant_step_config_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/ai-assistant/{conversation_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Accept or decline suggestion - * @description Accept or decline a proposed AI assistant configuration for a conversation turn. - * - * This only updates the tracking status on the conversation record. To actually apply the proposed configuration, use the agent definition update endpoint separately. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The conversation must belong to one of your agents. - */ - patch: operations["mark_ai_suggestion_api_agents__agent_id__ai_assistant__conversation_id__patch"]; - trace?: never; - }; - "/agents/{agent_id}/attachment-references": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get agent attachment-reference contract - * @description Return the static attachment-reference contract for an agent — what files the agent's definition expects on a run. - * - * Call this BEFORE staging uploads so you know whether the agent accepts files at all (``requires_uploads``), and which specific filenames/indexes/patterns the templates reference. Mismatched batches are rejected at run time with HTTP 400. - */ - get: operations["api_get_agent_attachment_references_api_agents__agent_id__attachment_references_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/callers": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List agents that call this agent - * @description List the live agents that call this agent via a `call_agent` step. They must be disabled before this agent can be paused. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the agent must belong to the key's account. - */ - get: operations["get_agent_callers_api_api_agents__agent_id__callers_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/definition": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get agent definition - * @description Fetch the current agent definition from the main branch. - * - * The response includes `change_id` which must be provided when updating the definition (optimistic locking). - * - * The definition contains the agent's step workflow. Available step types: - * - `prompt_call`: Call an LLM with a prompt template - * - `retrieval`: Search a knowledge base - * - `regex_replace`: Reshape text via ordered regex find/replace rules - * - `gate`: Evaluate conditions, stop or continue child execution - * - `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1–10)) - * - `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional `evaluation_tier`, optional `expectation_config`) - * - `extract_data`: Progressively read and analyze large input - * - `extract_content`: Extract structured data (JSON, HTML, XML) - * - `add_chat_turn` / `load_chat_history`: Record a turn or load running history from a conversation memory bank - * - `add_memory` / `search_memory` / `load_memory`: Write, semantic-search, or load entries on a general memory bank - * - `send_email`: Send email with step output - * - `webhook_call`: POST data to an external URL - * - `write_aws_s3_object`: Write output to S3 - * - `call_agent`: Invoke another agent - * - `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents only. Fields: `metadata_key`, `content`) - * - `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, `indexed`) - * - `load_content_attachment`: Load a previously written attachment (content-triggered agents only. Fields: `attachment_key`) - * - `load_content`: Load the full text body of a source document (typically used with content-triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` optional) - * - `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of `prompt_call`; requires `dynamic_input` or `template_input` trigger; `priority: true` enables real-time streaming). To stream **and** return a schema-validated payload, add a sibling branch `extract_content` (`expected_format: "json"` + `json_schema`) → `display_result` under the same `prompt_call` — a `display_result` takes precedence over the stream regardless of which finishes first, so its validated output becomes the run's result while the tokens act as a progress channel - * - `display_result`: Show output to the user - * - `join`: Merge parallel branches - * - `merge`: Combine multiple inputs into a single templated output - * - `text`: Static text literal - * - `for_each`: Iterate a body over a list of items (body lives in `body[]`) - * - `if_else`: Conditional dispatch. Evaluates `conditions` (same shape as `gate`) and runs `then_steps` on match, otherwise the optional `else_steps`. The chosen branch's output flows to the if_else step's own `child_steps` (post-branch continuation chain). **`display_result` and `streaming_result` are not allowed inside `then_steps` / `else_steps`** — end each branch with a content-producing step (e.g. `text`, `prompt_call`) and place the single `display_result` in `child_steps`. - * - `switch`: Single-discriminator dispatch. Renders `discriminator` (default `{{input}}`) and routes to the first matching `cases[]` entry (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when nothing matches. The chosen case's output flows to the switch step's own `child_steps`. **`display_result` and `streaming_result` are not allowed inside `cases[].steps` or `else_steps`** — end each case with a content-producing step and place the single `display_result` in `child_steps`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account. - */ - get: operations["get_agent_definition_api_agents__agent_id__definition_get"]; - /** - * Update agent definition - * @description Update the agent's definition on the main branch. - * - * Uses **optimistic locking**: provide `expected_change_id` from the last `GET /agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your last read. - * - * The definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, `regex_replace`, `gate`, `retry`, `evaluate_step`, `extract_data`, `extract_content`, `add_chat_turn`, `load_chat_history`, `add_memory`, `search_memory`, `load_memory`, `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, `display_result`, `join`, `merge`, `text`, `for_each`, `if_else`, and `switch`. Non-composite step types (`display_result`, `join`, `retry`, `streaming_result`) cannot contain child steps. - * - * **Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with `target_step_id` (ancestor step ID) and `max_retries` (1–10). Best practice: place a `gate` step before the retry to make retries conditional. - * - * **if_else** runs `then_steps` when its `conditions` (same shape as `gate`) match, otherwise its optional `else_steps`. Either branch's output flows to the if_else step's own `child_steps` (the post-branch continuation chain). - * - * **switch** dispatches on a `discriminator` template (default `{{input}}`) to the first matching case (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when no case matches. Cases own their own `steps` subtrees; the chosen branch's output flows to the switch step's own `child_steps`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account. - */ - put: operations["update_agent_definition_api_agents__agent_id__definition_put"]; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/disable": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Pause (disable) an agent - * @description Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is turned away, scheduled/content triggers are skipped). - * - * Returns **409** with the blocking callers when other live agents still call this one via a `call_agent` step — disable those first. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user is recorded); the agent must belong to the key's account. - */ - post: operations["disable_agent_api_api_agents__agent_id__disable_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/enable": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Resume (enable) a paused agent - * @description Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by the inbound-email overload safeguard). - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user is recorded); the agent must belong to the key's account. - */ - post: operations["enable_agent_api_api_agents__agent_id__enable_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/evaluation-criteria": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Evaluation Criteria - * @description List evaluation criteria configured for an agent. - * - * Response shape is version-gated by the ``Seclai-Version`` header: - * - * - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - * JSON array of criteria (unpaginated — every criterion for the agent). - * - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - * envelope ``{data, pagination: {page, limit, total, pages, has_next, - * has_prev}}``. - * - * Each criterion carries its type, configuration, and a summary of results - * (pass / fail counts). Criteria can be filtered client-side by type or - * enabled status. - */ - get: operations["list_evaluation_criteria_api_agents__agent_id__evaluation_criteria_get"]; - put?: never; - /** - * Create Evaluation Criteria - * @description Create new step evaluation settings for an agent. - * - * The evaluation mode, retry settings, and sample frequency are inherited - * from the agent and stored on the criteria row for historical reference. - */ - post: operations["create_evaluation_criteria_api_agents__agent_id__evaluation_criteria_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/evaluation-criteria/test-draft": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Test Draft Evaluation - * @description Run an ephemeral evaluation against provided step output without persisting results. - * - * Use this to interactively test evaluation prompts and expectation - * configurations while editing criteria. The evaluation is a billed LLM - * call; only its result goes unrecorded. - */ - post: operations["test_draft_evaluation_api_agents__agent_id__evaluation_criteria_test_draft_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/evaluation-results": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Agent Evaluation Results - * @description List evaluation results across all criteria configured on an agent. - * - * Returns a paginated list of evaluation results with optional filtering by status, criteria, and date range. Results include score, pass/fail status, and details. - */ - get: operations["list_agent_evaluation_results_api_agents__agent_id__evaluation_results_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/evaluation-runs": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Evaluation Runs - * @description List evaluation results grouped by agent run. - * - * Returns paginated per-run summaries with pass/fail counts and optional - * filtering by evaluation outcome, step, or date range. - */ - get: operations["list_evaluation_runs_api_agents__agent_id__evaluation_runs_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/export": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Export agent definition - * @description Export an agent definition as a portable JSON snapshot. - * - * The response contains the full definition, trigger configuration with schedules, alert configs, evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps every referenced external entity UUID to its human-readable name. - * - * Response shape: - * - `export_version`: schema version (currently `"5"`) - * - `exported_at`: ISO-8601 timestamp - * - `agent`: name, description, schema_version, definition, timestamps - * - `trigger`: trigger type, input template, schedules - * - `alert_configs`: alert type, thresholds, recipients - * - `evaluation_criteria`: evaluation settings per step - * - `governance_policies`: agent-scoped governance policies - * - `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users - * - * Query params: - * - `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the response as a file download. - * - * Auth & scoping: - * - Requires `X-API-Key`. You can only export agents belonging to your account. - */ - get: operations["export_agent_api_agents__agent_id__export_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/input-uploads/{upload_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get upload status - * @description Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`. - * - * Possible `status` values: `processing`, `ready`, `failed`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - get: operations["api_get_agent_input_upload_status_api_agents__agent_id__input_uploads__upload_id__get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/runs": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List agent runs - * @description List runs for a specific agent (most recent first), with pagination. - * - * Typical use cases: - * - Build a traces UI for an agent. - * - Debug recent executions and inspect terminal statuses. - * - * Notes: - * - This endpoint returns a summary list. Fetch full details with `GET /agents/runs/{run_id}`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only list runs for agents in your account. - */ - get: operations["list_agent_runs_api_agents__agent_id__runs_get"]; - put?: never; - /** - * Run an agent - * @description Start an agent run. - * - * An *agent* is an automated workflow that can monitor content from your sources, process it with AI, and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve status and output. - * - * When to use: - * - Use this endpoint for request/response style integrations where polling is acceptable. - * - Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE. - * - * Key fields: - * - `input`: text input for agents with a `dynamic_input` trigger. - * - `input_upload_id` / `input_upload_ids`: reference one or more files previously uploaded via `POST /agents/{agent_id}/upload-input`. Send them **with** `input` to pair prompt text with the files (the text leads, each file's extracted text follows); only the two upload fields are mutually exclusive with each other. - * - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but without live token streaming. - * - `metadata`: a JSON object that becomes available to agent steps for string substitution. - * - * After starting: - * - Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`. - * - Use `include_step_outputs=true` to include per-step outputs, timing, and credits. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - post: operations["run_agent_api_agents__agent_id__runs_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/runs/stream": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Run an agent (stream events) - * @description Start a **priority** agent run and stream run events using Server-Sent Events (SSE). - * - * This is the best option for interactive UIs where you want progress updates as the run executes. - * - * How it works: - * - The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`. - * - Subsequent events are forwarded from the run event stream (status changes, step events, etc). - * - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion. - * - The final `done` event contains the terminal snapshot (including `output` and `credits` when available). - * - * Input options (for `dynamic_input` triggers): - * - `input`: text input passed directly. - * - `input_upload_id` / `input_upload_ids`: reference one or more files uploaded via `POST /agents/{agent_id}/upload-input`. Combine either with `input` to send prompt text alongside the files; only the two upload fields are mutually exclusive with each other. - * - * Client guidance: - * - Keep the connection open and handle keepalive comments. - * - On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET /agents/runs/{run_id}`. - * - `stream_token` events carry the model's raw output. When the agent pairs `streaming_result` with a sibling `extract_content`/`display_result` branch, that branch's `display_result` takes precedence over the stream, so the `done` snapshot's `output` is the validated payload and the tokens are a progress channel — render tokens live, but read the result from `done`. Check `done.status` first: the streamed text is already the run's output when the stream ends, so a run that FAILED its validation step still carries that raw text in `output`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - post: operations["run_streaming_agent_api_agents__agent_id__runs_stream_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/runs/{run_id}/evaluation-results": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Run Evaluation Results - * @description List evaluation results recorded for a specific agent run. - * - * Response shape is version-gated by the ``Seclai-Version`` header: - * - * - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - * JSON array of results (unpaginated — every result for the run). - * - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - * envelope ``{data, pagination: {page, limit, total, pages, has_next, - * has_prev}}``. - * - * Results span all evaluation criteria for the given run, useful for getting a - * complete quality snapshot of a single execution. - */ - get: operations["list_run_evaluation_results_api_agents__agent_id__runs__run_id__evaluation_results_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/triggers/{trigger_id}/email-config": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - /** - * Configure an EMAIL_RECEIVED trigger - * @description Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, `require_sender_auth`, `queue_on_quota`) on an agent's EMAIL_RECEIVED trigger, and return its computed email address(es). Omitted fields are left unchanged. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account. - */ - put: operations["set_email_trigger_config_api_api_agents__agent_id__triggers__trigger_id__email_config_put"]; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/upload-input": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Upload file input - * @description Upload a file to use as input for a `dynamic_input` agent run. - * - * Supports the same file types as content source uploads: text, PDF, DOCX, audio, video, images, etc. Text and document files are processed synchronously; audio/video are submitted for asynchronous transcription. - * - * **Size limit:** 200 MB per file. - * - * **Supported extensions:** txt, html, md, csv, xml, json, pdf, msg, docx, doc, pptx, ppt, xlsx, xls, zip, epub, png, jpg, gif, bmp, tiff, webp, mp3, wav, m4a, flac, ogg, mp4, mov, avi. - * - * After uploading, poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready`, then pass `input_upload_id` to `POST /agents/{agent_id}/runs`. - * - * **Multi-modal routing:** non-text uploads (image, audio, video, PDF) are surfaced natively to multi-modal-capable prompt steps; text-only models fall back to the OCR / transcript text counterpart. Audio originals are preserved past transcription so audio-capable models (Gemini 2.5/3, GPT-5 audio) read them directly; the agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention (the agent-traces source's retention period; free default 7 days). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - post: operations["api_upload_agent_input_api_agents__agent_id__upload_input_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/feedback": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Submit AI assistant feedback - * @description Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is analyzed for concerning issues. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_feedback_api_ai_assistant_feedback_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/knowledge-base": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a knowledge base plan (standalone) - * @description Generate a knowledge base creation/modification plan without requiring an existing solution. May also propose prerequisite source creation actions. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_knowledge_base_api_ai_assistant_knowledge_base_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/memory-bank": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a memory bank configuration (standalone) - * @description Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_memory_bank_api_ai_assistant_memory_bank_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/memory-bank/last-conversation": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Fetch memory bank AI conversation history - * @description Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. Returns turns in oldest-first order with a total count for pagination via limit/offset query parameters. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - get: operations["api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/memory-bank/{conversation_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Accept or decline a memory bank AI suggestion - * @description Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - patch: operations["api_ai_memory_bank_accept_api_ai_assistant_memory_bank__conversation_id__patch"]; - trace?: never; - }; - "/ai-assistant/solution": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a solution plan (standalone) - * @description Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an existing solution. Supports SSE streaming when ``Accept: text/event-stream`` is set. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_solution_api_ai_assistant_solution_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/source": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a source plan (standalone) - * @description Generate a content source creation/modification plan without requiring an existing solution. The AI proposes actions for the user to review before any changes are made. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_source_api_ai_assistant_source_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/{conversation_id}/accept": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Accept and execute a standalone plan - * @description Accept and execute a previously proposed standalone plan. If the plan contains destructive actions (deletions), ``confirm_deletions`` must be set to true. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_accept_api_ai_assistant__conversation_id__accept_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/{conversation_id}/decline": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Decline a standalone plan - * @description Decline a previously proposed standalone plan. No resources are modified. The conversation is marked as declined. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_decline_api_ai_assistant__conversation_id__decline_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List alerts - * @description List alerts for the account with optional filters. - * - * Filters: - * - `status`: triggered, acknowledged, resolved, dismissed - * - `agent_id`: filter by agent - * - `source_connection_id`: filter by source - * - `time_from` / `time_to`: ISO 8601 date range - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - */ - get: operations["list_alerts_api_alerts_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/configs": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List alert configs - * @description List alert configurations. - * - * Filters: - * - `agent_id`: list configs for a specific agent - * - `source_connection_id`: list configs for a specific source - * - Neither: list account-level agent alert configs - * - `scope=source`: list account-level source alert configs - * - * Credits alerts (`credits_low_threshold`, `credits_runout_prediction`, `credits_usage_spike`) are account-level alert configs. They are evaluated by the credits alert sweep and default-enabled configs may be auto-created for active accounts at runtime. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["list_alert_configs_api_alerts_configs_get"]; - put?: never; - /** - * Create alert config - * @description Create a new alert configuration. - * - * Agent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, model_deprecated, model_sunset. - * Source alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike. - * - * Distribution types: owner, owner_admins, selected_members. Organization accounts are normalized to owner_admins. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["create_alert_config_api_alerts_configs_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/configs/{config_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get alert config - * @description Get a specific alert configuration by ID. - * - * Returns all fields including type, enabled state, threshold, cooldown, distribution type, and recipient list. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["get_alert_config_api_alerts_configs__config_id__get"]; - put?: never; - post?: never; - /** - * Delete alert config - * @description Delete an alert configuration. This permanently removes the config and stops any future alerts of this type from being triggered. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - delete: operations["delete_alert_config_api_alerts_configs__config_id__delete"]; - options?: never; - head?: never; - /** - * Update alert config - * @description Update an alert configuration. Only provided fields are updated. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - patch: operations["update_alert_config_api_alerts_configs__config_id__patch"]; - trace?: never; - }; - "/alerts/organization-preferences/list": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List organization alert delivery preferences - * @description List per-organization alert delivery preferences for the authenticated user. - * - * By default, only explicit override rows are returned. Set `include_defaults=true` to return the effective subscribed state for every alert type in every organization the user can manage. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - * - Only organizations where the user is an owner or administrator are included. - */ - get: operations["list_organization_preferences_api_alerts_organization_preferences_list_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/organization-preferences/{organization_id}/{alert_type}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Update organization alert delivery preference - * @description Update the authenticated user's personal delivery preference for one alert type in one organization. - * - * Setting `subscribed=false` stores an explicit opt-out override. Setting `subscribed=true` removes the override and restores the default subscribed behavior. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - * - Only owners and administrators can update preferences for an organization. - */ - patch: operations["update_organization_preference_api_alerts_organization_preferences__organization_id___alert_type__patch"]; - trace?: never; - }; - "/alerts/{alert_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get alert detail - * @description Get full alert detail including history, comments, and subscribers. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["get_alert_detail_api_alerts__alert_id__get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/{alert_id}/comments": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Add alert comment - * @description Add a comment to an alert. Comments are visible to all subscribers and are included in the alert detail response. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["add_alert_comment_api_alerts__alert_id__comments_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/{alert_id}/status": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Change alert status - * @description Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["change_alert_status_api_alerts__alert_id__status_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/{alert_id}/subscribe": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Subscribe to alert - * @description Subscribe the current user to an alert. Subscribed users receive email notifications when the alert status changes or new comments are added, for as long as they remain an owner or administrator of the account. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["subscribe_to_alert_api_alerts__alert_id__subscribe_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/{alert_id}/unsubscribe": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Unsubscribe from alert - * @description Unsubscribe the current user from an alert. The user will no longer receive email notifications for status changes or new comments on this alert. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["unsubscribe_from_alert_api_alerts__alert_id__unsubscribe_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/cloud-drives": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List the account's cloud-drive connections - * @description List the account's cloud-drive connections. Use a connection's `id` as `cloud_drive_connection_id` when creating a `cloud_drive` content source or binding a file-change agent trigger. `realtime_updates` reports whether changes arrive within seconds or on the scheduled backstop sweep. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - get: operations["list_cloud_drives_api_api_cloud_drives_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/cloud-drives/providers": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List configured cloud-drive providers - * @description List the cloud-drive providers whose OAuth app is configured on this deployment (e.g. Dropbox, Google Drive), with the permissions each requests. A provider missing from this list cannot be connected here. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - get: operations["list_cloud_drive_providers_api_api_cloud_drives_providers_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/cloud-drives/{connection_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a cloud-drive connection - * @description Fetch a single cloud-drive connection by id. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - get: operations["get_cloud_drive_api_api_cloud_drives__connection_id__get"]; - put?: never; - post?: never; - /** - * Delete a cloud-drive connection - * @description Soft-delete a connection and clear its tokens. Refused with **409** while anything still depends on it — a live agent trigger, or a `cloud_drive` content source ingesting into a knowledge base. `GET /{connection_id}/agents` shows which agents reference it, but does NOT list content sources, so treat the 409 as the authoritative check rather than a clean /agents response. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - delete: operations["delete_cloud_drive_api_api_cloud_drives__connection_id__delete"]; - options?: never; - head?: never; - /** - * Update a cloud-drive connection - * @description Rename a connection and/or change the folder it watches. Changing the folder resets the sync cursor, so existing files in the new folder are not replayed as triggers. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - patch: operations["update_cloud_drive_api_api_cloud_drives__connection_id__patch"]; - trace?: never; - }; - "/cloud-drives/{connection_id}/agents": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List agents using a cloud-drive connection - * @description Agents that reference this connection — via a cloud-drive step, a `prompt_call` cloud-drive tool, or a file-change trigger. Check this before disconnecting or deleting a connection. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - get: operations["get_agents_using_cloud_drive_api_api_cloud_drives__connection_id__agents_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/cloud-drives/{connection_id}/disconnect": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Disconnect a cloud-drive connection - * @description Revoke and clear the stored tokens and stop change notifications, keeping the connection row so it can be reconnected from the app. Agents bound to it stop firing until it is reconnected. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - post: operations["disconnect_cloud_drive_api_api_cloud_drives__connection_id__disconnect_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/cloud-drives/{connection_id}/rejections": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List files this connection did not process - * @description Recent files the connection deliberately skipped, newest first, with the reason: `too_large` (above the size cap), `download_failed` (the provider would not serve the bytes), or `flood` (the per-sync or per-account run cap was hit, so remaining changes were dropped). - * - * This is the answer to "why didn't my agent run for that file?" — a skipped file fires no trigger and appears nowhere else. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - get: operations["list_cloud_drive_rejections_api_api_cloud_drives__connection_id__rejections_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/contents/{source_connection_content_version}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get content details - * @description Get detailed information about a specific content item (a `SourceConnectionContentVersion`). - * - * This is useful when you want to: - * - Inspect the extracted text for debugging or review. - * - Display content details in a UI. - * - * Text range: - * - `start` and `end` control the character range returned in `text_content` so clients can page through large documents. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account. - */ - get: operations["get_content_detail_api_contents__source_connection_content_version__get"]; - /** - * Replace a content version with inline text - * @description Replace a content version using a small inline text payload. - * - * **Maximum payload size:** 8192 bytes (UTF-8). - * - * **Supported content types:** - * - `application/json` - * - `application/xml` - * - `text/csv` - * - `text/html` - * - `text/markdown` - * - `text/plain` - * - `text/x-markdown` - * - `text/xml` - * - * Notes: - * - A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected. - * - Use this endpoint for small text payloads; larger files should use `/upload`. - * - `title` is merged into `metadata.title` when not already present. - * - The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version. - */ - put: operations["replace_content_with_inline_text_api_contents__source_connection_content_version__put"]; - post?: never; - /** - * Delete content - * @description Delete a content item (a `SourceConnectionContentVersion`). - * - * Use this to remove an uploaded or indexed item from your account. Deleting content can affect agents and knowledge base workflows that reference this item. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account. - * - A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected. - */ - delete: operations["delete_content_api_contents__source_connection_content_version__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/contents/{source_connection_content_version}/embeddings": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List content embeddings - * @description List the embeddings (chunk vectors) for a content item, with pagination. - * - * Embeddings are used for semantic search and retrieval in knowledge base workflows. This endpoint is primarily useful for debugging chunking, indexing, and vector contents. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access embeddings for content belonging to your account. - */ - get: operations["list_content_embeddings_api_contents__source_connection_content_version__embeddings_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/contents/{source_connection_content_version}/upload": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Replace a content version with a new upload - * @description Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`. - * - * This behaves like a source file upload, but it targets an existing content version ID. This is useful when you want to correct or update an uploaded document while keeping references stable. - * - * **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored). - * - * **Supported MIME types:** - * - `application/epub+zip` - * - `application/json` - * - `application/pdf` - * - `application/vnd.ms-excel` - * - `application/vnd.ms-outlook` - * - `application/vnd.ms-powerpoint` - * - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - * - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - * - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - * - `application/xml` - * - `application/zip` - * - `audio/flac` - * - `audio/mp4` - * - `audio/mpeg` - * - `audio/ogg` - * - `audio/wav` - * - `image/bmp` - * - `image/gif` - * - `image/jpeg` - * - `image/png` - * - `image/svg+xml` - * - `image/tiff` - * - `image/webp` - * - `text/csv` - * - `text/html` - * - `text/markdown` - * - `text/plain` - * - `text/x-markdown` - * - `text/xml` - * - `video/mp4` - * - `video/quicktime` - * - `video/x-msvideo` - * - * Notes: - * - A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected. - * - The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version. - * - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension. - * - Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={"category":"docs"}`). - * - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`). - * - For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your account. - */ - post: operations["upload_file_to_content_api_contents__source_connection_content_version__upload_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/docs-search": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Search documentation - * @description Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page titles and summaries (fast, no AI cost); `mode=semantic` matches page body content by meaning (uses an embedding). Each result carries a `doc_slug` and an optional section `anchor` for building a `https://seclai.com/docs/[#]` link, a `score` (relevance; not comparable across modes), and — in semantic mode — a `highlight` (best matching verbatim sentence; `null` for keyword). Documentation is global, so results are not account-scoped. - */ - get: operations["docs_search_api_docs_search_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List the account's email domains + plan capabilities - * @description List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email domains with their verification status, the DNS records the customer must publish, and the plan capabilities (`can_add_vanity`/`can_add_custom`) plus whether one of each kind already exists (`has_vanity`/`has_custom` — the per-kind limit is 1). - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - get: operations["list_email_domains_api_api_email_domains_get"]; - put?: never; - /** - * Add + provision an email domain - * @description Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, `value=agent.mycompany.com`; optional `delegated=true` to let Seclai manage a dedicated Route53 zone). Stands up the SES identity + DNS and returns the records the customer must publish. Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - post: operations["add_email_domain_api_api_email_domains_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/use-shared-domain": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Revert to the shared agent.seclai.com sending domain - * @description Clear the account's primary domain so agent email reverts to the shared `agent.seclai.com` sending domain, WITHOUT removing the configured domain(s) — they stay verified and can be promoted again later. Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - post: operations["use_shared_domain_api_api_email_domains_use_shared_domain_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/{domain_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** - * Remove an email domain - * @description Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a `cleanup_note` when the removed domain was Seclai-managed (delegated), reminding the caller to delete the registrar NS delegation record (dangling-delegation / subdomain-takeover guard). Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - delete: operations["remove_email_domain_api_api_email_domains__domain_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/{domain_id}/dmarc": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * DMARC aggregate-report summary for a domain - * @description Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the DMARC `rua` aggregate reports over the last `days` (clamped by the service). Populated for domains whose DNS zone Seclai controls (vanity + delegated custom); a self-managed custom domain keeps its own DMARC reporting and returns an all-zero summary. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - get: operations["get_dmarc_summary_api_api_email_domains__domain_id__dmarc_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/{domain_id}/primary": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Make a verified domain the account's primary sending domain - * @description Promote a verified domain to the account's primary domain — agent email then sends FROM this domain and shows its addresses on it (`@`, `@`) instead of the shared `agent.seclai.com`; addresses keep resolving on the account's other verified domains and the shared form. The domain must be verified. Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - post: operations["set_primary_email_domain_api_api_email_domains__domain_id__primary_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/{domain_id}/test-email": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Send a test email from a verified domain to the account owner - * @description Send a test message FROM the verified domain (`noreply@`) TO the account owner's email, to confirm end-to-end that the domain actually sends (SES verified, DKIM/SPF aligned). Never sends to any other address, so it can't be used as an open relay. Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - post: operations["send_test_email_api_api_email_domains__domain_id__test_email_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/{domain_id}/verify": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Run a verification check immediately ('Check now') - * @description Re-poll SES + DNS for this domain right now instead of waiting for the background verification sweep, and return its updated status + DNS-record check results. Useful right after publishing the required records. Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - post: operations["verify_email_domain_api_api_email_domains__domain_id__verify_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/governance/ai-assistant": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a governance plan - * @description Send a natural-language request to the governance AI assistant to generate a plan of policy changes. Returns a conversation with proposed actions that can be accepted or declined. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - */ - post: operations["governance_ai_generate_api_governance_ai_assistant_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/governance/ai-assistant/conversations": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List AI assistant conversations - * @description Return recent governance AI assistant conversations for the account, ordered by most recent first. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - */ - get: operations["list_governance_ai_conversations_api_governance_ai_assistant_conversations_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/governance/ai-assistant/{conversation_id}/accept": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Accept a governance plan - * @description Execute the proposed policy changes from a governance AI assistant conversation. Each action is applied in order and results are returned. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - */ - post: operations["governance_ai_accept_api_governance_ai_assistant__conversation_id__accept_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/governance/ai-assistant/{conversation_id}/decline": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Decline a governance plan - * @description Reject a previously proposed governance AI assistant plan without applying any changes. The conversation is marked as declined and no policy modifications are made. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - */ - post: operations["governance_ai_decline_api_governance_ai_assistant__conversation_id__decline_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/knowledge_bases": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Knowledge Bases - * @description List knowledge bases for the account. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - get: operations["list_knowledge_bases_api_knowledge_bases_get"]; - put?: never; - /** - * Create Knowledge Base - * @description Create a new knowledge base. - * - * At least one `source_id` is required. The source connections must belong to the same account. - */ - post: operations["create_knowledge_base_api_knowledge_bases_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/knowledge_bases/{knowledge_base_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Knowledge Base - * @description Fetch a knowledge base by ID. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access knowledge bases belonging to your account. - */ - get: operations["get_knowledge_base_api_knowledge_bases__knowledge_base_id__get"]; - /** - * Update Knowledge Base - * @description Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left unchanged. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only update knowledge bases belonging to your account. - */ - put: operations["update_knowledge_base_api_knowledge_bases__knowledge_base_id__put"]; - post?: never; - /** - * Delete Knowledge Base - * @description Soft-delete a knowledge base. This action cannot be undone. - * - * Fails if the knowledge base is referenced by any agent definitions. Remove the knowledge base from agents first. - */ - delete: operations["delete_knowledge_base_api_knowledge_bases__knowledge_base_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/me": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get current user identity - * @description Returns the authenticated user's personal account ID and a list of organisations they belong to. Each organisation entry includes the organisation's own id, display name, and account_id. Useful for CLI tooling that needs to let the user pick an org context. - */ - get: operations["get_me_api_me_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Memory Banks - * @description List memory banks for the account. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - get: operations["list_memory_banks_api_memory_banks_get"]; - put?: never; - /** - * Create Memory Bank - * @description Create a new memory bank. - * - * Modes: `fast_and_cheap` (256-dim), `balanced` (512-dim), `slow_and_thorough` (1024-dim), or `custom` (supply your own embedding params). - */ - post: operations["create_memory_bank_api_memory_banks_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/ai-assistant": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a memory bank configuration - * @description Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings based on the user's description. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["memory_bank_ai_generate_api_memory_banks_ai_assistant_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/ai-assistant/last-conversation": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Fetch memory bank AI conversation history - * @description Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports pagination via limit/offset. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/ai-assistant/{conversation_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Accept or decline a memory bank AI suggestion - * @description Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token. - */ - patch: operations["memory_bank_ai_accept_api_memory_banks_ai_assistant__conversation_id__patch"]; - trace?: never; - }; - "/memory_banks/templates": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Templates - * @description Return pre-built template configurations for common memory bank use cases. - * - * Each template includes a name, description, suggested use case, and full default settings that can be used directly with the create endpoint. - */ - get: operations["list_templates_api_memory_banks_templates_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/test-compaction": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Test Compaction Prompt Standalone - * @description Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning. - */ - post: operations["test_compaction_prompt_standalone_api_memory_banks_test_compaction_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Memory Bank - * @description Fetch a memory bank by ID. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to your account. - */ - get: operations["get_memory_bank_api_memory_banks__memory_bank_id__get"]; - /** - * Update Memory Bank - * @description Update a memory bank's configuration. Only provided fields are changed; omitted fields are left unchanged. - * - * Note: the embedding `mode` cannot be changed after creation because it determines the vector dimensions used to store entries. - */ - put: operations["update_memory_bank_api_memory_banks__memory_bank_id__put"]; - post?: never; - /** - * Delete Memory Bank - * @description Soft-delete a memory bank. This action is permanent and cannot be undone. - * - * The linked content source and all stored conversation memory entries will also be removed. - */ - delete: operations["delete_memory_bank_api_memory_banks__memory_bank_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}/agents": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Agents Using Bank - * @description List agents whose current definition references this memory bank. - * - * Returns an array of `{agent_id, agent_name}` objects. - */ - get: operations["get_agents_using_bank_api_memory_banks__memory_bank_id__agents_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}/compact": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Compact Memory Bank - * @description Trigger an on-demand compaction run for a memory bank. - * - * The bank must have at least one compaction threshold configured (max_turns or max_size_tokens). Age no longer triggers compaction — use retention_days to remove entries by age. Compaction runs asynchronously — the response confirms scheduling, not completion. - */ - post: operations["compact_memory_bank_api_memory_banks__memory_bank_id__compact_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}/source": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** - * Delete Memory Bank Source - * @description Delete the content source linked to a memory bank, removing all stored memory entries. - * - * A new content source is automatically created on the next write. Use this to reset a bank's data without deleting the bank itself. - */ - delete: operations["delete_memory_bank_source_api_memory_banks__memory_bank_id__source_delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}/stats": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Memory Bank Entry Stats - * @description Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per-key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters. - */ - get: operations["get_memory_bank_entry_stats_api_memory_banks__memory_bank_id__stats_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}/test-compaction": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Test Compaction Prompt - * @description Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning. - */ - post: operations["test_compaction_prompt_api_memory_banks__memory_bank_id__test_compaction_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Models - * @description List the enabled LLM models with full details. - * - * Returns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status. - * - * A model whose credit rate has not been published yet is omitted, so you are never offered a model that cannot be billed and therefore cannot be run. Such a model may appear later without any other change. - * - * Optional query parameters: - * - `provider`: filter by provider (e.g. 'anthropic', 'openai') - * - `supports_tool_use`: filter to models with tool calling support - * - `supports_thinking`: filter to models with extended thinking support - * - `supports_input_media`: filter to models accepting an input modality (`image`/`audio`/`video`/`pdf` or a full MIME) - * - `supports_output_media`: filter to models producing an output modality (`image`/`audio`/`video`) — e.g. to find generation models - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["list_models_api_models_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/alerts": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Alerts - * @description List model lifecycle alerts for the account. - * - * Returns in-app notifications about model deprecations, sunsets, and newer model availability. Supports filtering by agent, unread-only, and pagination. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account. - */ - get: operations["list_alerts_api_models_alerts_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/alerts/mark-all-read": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Mark All Read - * @description Mark all model lifecycle alerts as read for the account. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Scoped to the caller's account. - */ - post: operations["mark_all_read_api_models_alerts_mark_all_read_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/alerts/unread-count": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Alert Unread Count - * @description Get the count of unread model lifecycle alerts. - * - * Useful for badge indicators in UIs and dashboards. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account. - */ - get: operations["get_alert_unread_count_api_models_alerts_unread_count_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/alerts/{alert_id}/read": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Mark Read - * @description Mark a single model lifecycle alert as read (dismissed). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account. - */ - patch: operations["mark_read_api_models_alerts__alert_id__read_patch"]; - trace?: never; - }; - "/models/embedders": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Embedding Models - * @description List the embedding models a source can be created with. - * - * Each entry carries the `model_type` to pass as `embedding_model` when creating a source, the `dimensions` it supports, and — most importantly for multi-modal indexing — `supported_input_media`: the modalities that embedder can actually index. A source only honours a `media_types` entry its embedder lists here; unsupported kinds are dropped at save time with an `embedder_warning`, so check this before choosing an embedder for a knowledge base of images or video. - * - * Text-only embedders report `supported_input_media` as null. Pricing is reported as `credits` (per ~1,000 English words of text) plus `per_modality_rates` for the non-text modalities a multi-modal embedder bills differently. - * - * An embedder whose credit rate has not been published yet is omitted, so you are never offered one that cannot be billed. - * - * Optional query parameters: - * - `supports_input_media`: keep only embedders that can index this modality (`text`/`image`/`video`/`audio` or a full MIME) - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical for every account. - */ - get: operations["list_embedding_models_api_models_embedders_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/generation-tiers": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Generation Tiers - * @description List the media-generation quality tiers and the model + cost each resolves to. - * - * On a prompt_call's `media_generation` tool — and the dedicated generate_* steps via tier routing — the author/LLM chooses a *tier* (fast/balanced/thorough), never a model. This is the surface that maps each `(modality, tier)` to its concrete generator, raw `credits_per_unit`, `unit_label`, and a human-readable scaled `price_label`. Global routing/pricing (the same for every account); read-only. REST parity with the `list_generation_tiers` MCP tool. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["get_generation_tiers_api_models_generation_tiers_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/playground/experiments": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Experiments - * @description List model playground experiments for the account. - * - * Returns a paginated, time-filtered list of experiments ordered by creation date descending. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account and, when the credential is bound to a user, to that user. - */ - get: operations["list_experiments_api_models_playground_experiments_get"]; - put?: never; - /** - * Create Experiment - * @description Create and schedule a model playground experiment. - * - * Runs the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an LLM judge. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - * - When the credential is bound to a user, the experiment belongs to that user; only that user or an account-scoped key can cancel or delete it. - */ - post: operations["create_experiment_api_models_playground_experiments_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/playground/experiments/{experiment_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Experiment - * @description Get details and results for a specific model playground experiment. - * - * Returns the full experiment payload including prompt, model outputs, and evaluation results (if available). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404. - */ - get: operations["get_experiment_api_models_playground_experiments__experiment_id__get"]; - put?: never; - post?: never; - /** - * Delete Experiment Endpoint - * @description Soft-delete a model playground experiment. - * - * Removes the experiment from list/detail views while preserving audit history. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404. - */ - delete: operations["delete_experiment_endpoint_api_models_playground_experiments__experiment_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/playground/experiments/{experiment_id}/cancel": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Cancel Experiment Endpoint - * @description Cancel a running or pending model playground experiment. - * - * Signals running model calls to abort and marks the experiment as canceled. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404. - */ - post: operations["cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/rerankers": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Reranker Models - * @description List the reranker models a knowledge base can be created with. - * - * A reranker re-scores the top results of a vector search for relevance. Each entry carries the `model_type` to pass as `reranker_model` on a knowledge base, its `credits_per_action`, and whether it is the platform default (`is_default`, used when you omit `reranker_model`). - * - * To disable reranking, send `"none"` or an empty string as `reranker_model` rather than a value from this list. Reranking scores text, so a knowledge base whose sources all embed media natively — whose chunks carry no text — defaults to no reranker. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical for every account. - */ - get: operations["list_reranker_models_api_models_rerankers_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/{model_id}/details": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Model - * @description Get detailed information about a specific model. - * - * Returns full model details including capabilities, credit pricing, tool support, variant tiers, and lifecycle status. - * - * The `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6'). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["get_model_api_models__model_id__details_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/{model_id}/recommendations": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Recommendations - * @description Get replacement/upgrade recommendations for a model. - * - * Returns a designated successor (if any), same-family upgrades, and cross-provider/cross-family alternatives. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["get_recommendations_api_models__model_id__recommendations_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/search": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Search resources - * @description Search across all resource types in your account. Accepts a free-text keyword query or a UUID. UUIDs are matched exactly; keywords are matched by name and description (case-insensitive substring). Results are ranked: name-prefix > name-substring > description-substring. Searchable types: agent, knowledge_base, source_connection, solution, memory_bank, alert, api_key, governance_policy, mcp_client. - */ - get: operations["search_api_search_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List solutions - * @description List solutions for your account. - * - * A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Use solutions to organise related resources and leverage AI assistants for automated setup. - * - * Parameters: - * - Pagination: `page` and `limit`. - * - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - * - Filtering: `search` to filter by solution name (case-insensitive partial match). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - */ - get: operations["list_solutions_api_solutions_get"]; - put?: never; - /** - * Create a solution - * @description Create a new solution for the caller's account. - * - * A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a `name` and optional `description` in the request body. - */ - post: operations["create_solution_api_solutions_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a solution - * @description Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. - * - * Returns the full solution detail with nested resource information. - */ - get: operations["get_solution_api_solutions__solution_id__get"]; - put?: never; - post?: never; - /** - * Delete a solution - * @description Delete a solution by its ID. - * - * This permanently removes the solution and all its resource associations (agent links, knowledge base links, source connection links). The underlying resources themselves are not deleted. - */ - delete: operations["delete_solution_api_solutions__solution_id__delete"]; - options?: never; - head?: never; - /** - * Update a solution - * @description Update an existing solution's name or description. - * - * Pass the fields you wish to change in the request body. Fields not included remain unchanged. - */ - patch: operations["update_solution_api_solutions__solution_id__patch"]; - trace?: never; - }; - "/solutions/{solution_id}/agents": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Link agents - * @description Link one or more agents to a solution by their IDs. - * - * Pass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. Returns the updated solution with all linked resources. - */ - post: operations["link_agents_api_solutions__solution_id__agents_post"]; - /** - * Unlink agents - * @description Unlink one or more agents from a solution by their IDs. - * - * Pass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are silently ignored. Returns the updated solution with remaining linked resources. - */ - delete: operations["unlink_agents_api_solutions__solution_id__agents_delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/ai-assistant/generate": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate solution plan - * @description Generate a comprehensive solution management plan via the solution AI assistant. - * - * This is the most powerful assistant — it can propose changes across sources, knowledge bases, and agents. Describe your goal in natural language and the assistant will create a multi-step plan. Review the proposed actions and use the accept or decline endpoint. - * - * Supports SSE streaming when `Accept: text/event-stream` is set. - */ - post: operations["ai_assistant_generate_api_solutions__solution_id__ai_assistant_generate_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/ai-assistant/knowledge-base": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate knowledge base plan - * @description Generate a knowledge base plan via the KB AI assistant. - * - * Describe what knowledge bases you need in natural language and the assistant will propose a plan with create, update, or delete actions. The assistant may also propose creating new sources if needed. Review the proposed actions and use the accept or decline endpoint. - */ - post: operations["ai_assistant_knowledge_base_api_solutions__solution_id__ai_assistant_knowledge_base_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/ai-assistant/source": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate source plan - * @description Generate a content source plan via the source AI assistant. - * - * Describe what sources you need in natural language and the assistant will propose a plan with create, update, or delete actions. Review the proposed actions and use the accept or decline endpoint to execute or discard the plan. - */ - post: operations["ai_assistant_source_api_solutions__solution_id__ai_assistant_source_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/ai-assistant/{conversation_id}/accept": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Accept plan - * @description Accept and execute a proposed plan generated by one of the AI assistant endpoints. - * - * Executes all proposed actions in the plan and returns the results of each action. If the plan contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the request body. Returns a summary of executed actions with success/failure status. - */ - post: operations["ai_assistant_accept_api_solutions__solution_id__ai_assistant__conversation_id__accept_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/ai-assistant/{conversation_id}/decline": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Decline plan - * @description Decline a proposed plan generated by one of the AI assistant endpoints. - * - * Marks the conversation as declined without executing any actions. The conversation history is preserved for reference. You can generate a new plan afterwards if needed. - */ - post: operations["ai_assistant_decline_api_solutions__solution_id__ai_assistant__conversation_id__decline_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/conversations": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List conversations - * @description List AI assistant conversation history for a solution. - * - * Returns all conversation turns for the given solution, including user inputs, AI responses, proposed actions, and acceptance status. - */ - get: operations["list_conversations_api_solutions__solution_id__conversations_get"]; - put?: never; - /** - * Add conversation turn - * @description Add a conversation turn to a solution's AI assistant history. - * - * Records a user input and optional AI response and actions taken. This is typically called internally by AI assistant endpoints, but can also be used to manually log interactions. - */ - post: operations["add_conversation_turn_api_solutions__solution_id__conversations_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/conversations/{conversation_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Mark conversation turn - * @description Mark a conversation turn as accepted or declined. - * - * Updates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed plan to record whether it was accepted or declined by the user. - */ - patch: operations["mark_conversation_turn_api_solutions__solution_id__conversations__conversation_id__patch"]; - trace?: never; - }; - "/solutions/{solution_id}/knowledge-bases": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Link knowledge bases - * @description Link one or more knowledge bases to a solution by their IDs. - * - * Pass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are silently ignored. Returns the updated solution with all linked resources. - */ - post: operations["link_knowledge_bases_api_solutions__solution_id__knowledge_bases_post"]; - /** - * Unlink knowledge bases - * @description Unlink one or more knowledge bases from a solution by their IDs. - * - * Pass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not currently linked are silently ignored. Returns the updated solution. - */ - delete: operations["unlink_knowledge_bases_api_solutions__solution_id__knowledge_bases_delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/source-connections": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Link source connections - * @description Link one or more source connections to a solution by their IDs. - * - * Pass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently ignored. Returns the updated solution with all linked resources. - */ - post: operations["link_source_connections_api_solutions__solution_id__source_connections_post"]; - /** - * Unlink source connections - * @description Unlink one or more source connections from a solution by their IDs. - * - * Pass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently linked are silently ignored. Returns the updated solution. - */ - delete: operations["unlink_source_connections_api_solutions__solution_id__source_connections_delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List sources - * @description List content sources for your account. - * - * A *source* is where Seclai pulls or receives content from — RSS feeds, websites, or content stores (``custom_index``). Content stores support file uploads and API-driven content ingestion with configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``). - * - * Parameters: - * - Pagination: `page` and `limit`. - * - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - * - The optional `account_id` query param is only allowed when it matches the caller's account. - */ - get: operations["list_sources_api_sources_get"]; - put?: never; - /** - * Create Source - * @description Create a new content source. - * - * Source types: `rss`, `website`, `custom_index`. - * - * For RSS and website sources, provide the URL. For custom index sources, the URL is created automatically. - * - * For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`. - */ - post: operations["create_source_api_sources_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Source - * @description Fetch a content source by ID. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access sources belonging to your account. - */ - get: operations["get_source_api_sources__source_connection_id__get"]; - /** - * Update Source - * @description Update a content source's configuration. Only provided fields are changed; omitted fields are left unchanged. - * - * System-managed sources only allow `retention_days` updates. - */ - put: operations["update_source_api_sources__source_connection_id__put"]; - /** - * Upload inline text to a content source - * @description Upload a small text payload to a content source (no multipart/form-data required). - * - * **Maximum payload size:** 8192 bytes (UTF-8). - * - * **Supported content types:** - * - `application/json` - * - `application/xml` - * - `text/csv` - * - `text/html` - * - `text/markdown` - * - `text/plain` - * - `text/x-markdown` - * - `text/xml` - * - * Notes: - * - A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected. - * - Use this endpoint for small text payloads; larger files should use `/upload`. - * - `title` is merged into `metadata.title` when not already present. - * - * Tracking indexing progress: - * - **Which id you get back depends on `status`, and they are not interchangeable:** - * - `uploaded` — a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns. - * - `duplicate` — this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll. - * - For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=…&content_version_id=…` for a whole batch, to follow each item through to `completed` or `failed`. - * - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. - */ - post: operations["upload_inline_text_to_source_api_sources__source_connection_id__post"]; - /** - * Delete Source - * @description Soft-delete a content source. This action cannot be undone. - * - * System-managed sources (such as agent history or conversation memory) cannot be deleted through this endpoint. - */ - delete: operations["delete_source_api_sources__source_connection_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/contents": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List content items and their indexing status - * @description List every content item this source has attempted to index, with the status of each. - * - * Unlike the source's `content_count`, which only counts finished items, this listing includes items that are still processing and items that failed — so a bulk upload can report per-item progress and point at the specific items that did not make it. - * - * Correlating with an upload: - * - Each item is keyed by `content_version_id`, which is what the upload endpoints return. Pass those ids as repeated `content_version_id` query parameters to poll exactly the items you uploaded. - * - `source_connection_content_version_id` is `null` until an item finishes indexing; once set, it is the id `GET /contents/{id}` takes. - * - `content_status` reaches `completed` on success and `failed` on error, with the reason in `error`. The intermediate values are `pending`, `fetching`, `transcribing`, `scanning`, and `indexing`. - * - * Parameters: - * - Pagination: `page` and `limit`. - * - Sorting: `sort` (created_at/title/status) and `order` (asc/desc). `created_at` sorts on when the item was uploaded or pulled. - * - Filtering: `status` and repeatable `content_version_id`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only list content for sources belonging to your account. - */ - get: operations["list_source_contents_api_sources__source_connection_id__contents_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/contents/{content_version_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get one content item's indexing status - * @description Get the indexing status of a single content item, addressed by the `content_version_id` the upload endpoints return. - * - * Use this to follow one uploaded file through indexing. To follow many at once, use `GET /sources/{id}/contents` with repeated `content_version_id` parameters instead of polling this endpoint per item. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account. - */ - get: operations["get_source_content_status_endpoint_api_sources__source_connection_id__contents__content_version_id__get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/embedding-migration": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Source Embedding Migration - * @description Get the latest embedding migration status for a custom-index source. - * - * Returns `null` when no migration has ever been started for this source. - */ - get: operations["get_source_embedding_migration_api_sources__source_connection_id__embedding_migration_get"]; - put?: never; - /** - * Start Source Embedding Migration - * @description Start an embedding model migration for a custom-index source. - * - * The migration runs asynchronously in the background. Poll `GET /sources/{id}/embedding-migration` to track progress. - * - * Optionally override chunking configuration (`chunk_size`, `chunk_overlap`, `chunk_language`, `chunk_separators`, `chunk_regex_separators`). When a chunking field is omitted (null), the current source's value is preserved. - * - * Constraints: - * - Only `custom_index` source types support migration. - * - A migration cannot be started while another is already active. - * - The target model + dimensions must differ from the source's current settings. - */ - post: operations["start_source_embedding_migration_api_sources__source_connection_id__embedding_migration_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/embedding-migration/cancel": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Cancel Source Embedding Migration - * @description Cancel an active embedding migration for a custom-index source. - * - * Only pending and running migrations can be cancelled. A migration that has reached the switching phase is committing its switch-over in a single transaction, so there is no half-applied state to back out of and cancel is refused. - */ - post: operations["cancel_source_embedding_migration_api_sources__source_connection_id__embedding_migration_cancel_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/exports": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List exports - * @description List all export jobs for a source connection, ordered newest first. Supports pagination via ``page`` and ``limit`` query parameters. Returns status, progress, and file metadata for each export. - */ - get: operations["list_source_exports_api_sources__source_connection_id__exports_get"]; - put?: never; - /** - * Create export - * @description Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, then use /download to retrieve the file. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. - */ - post: operations["create_source_export_api_sources__source_connection_id__exports_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/exports/estimate": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Estimate export size - * @description Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use this to show users how large the download will be before they commit to running the export. - */ - post: operations["estimate_source_export_api_sources__source_connection_id__exports_estimate_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/exports/{export_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get export status - * @description Retrieve the current status and progress of an export job. Returns all metadata including progress counters, file size, item count, and expiration time once completed. - */ - get: operations["get_source_export_api_sources__source_connection_id__exports__export_id__get"]; - put?: never; - post?: never; - /** - * Delete export - * @description Delete an export job and remove the associated file from S3. This is a soft-delete: the database record is retained for audit purposes but the backing file is permanently removed. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. - */ - delete: operations["delete_source_export_api_sources__source_connection_id__exports__export_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/exports/{export_id}/cancel": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Cancel export - * @description Cancel a pending or running export. The background task will stop at the next chunk boundary. Completed, failed, expired, or already-cancelled exports cannot be cancelled. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. - */ - post: operations["cancel_source_export_api_sources__source_connection_id__exports__export_id__cancel_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/exports/{export_id}/download": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Download export - * @description Stream the completed export file. Returns the file content with appropriate Content-Type and Content-Disposition headers. Returns 409 if the export is not yet completed and 410 if it has expired. - */ - get: operations["download_source_export_api_sources__source_connection_id__exports__export_id__download_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/upload": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Upload a file to a content source - * @description Upload a file to a content source. - * - * **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored). - * - * **Supported MIME types:** - * - `application/epub+zip` - * - `application/json` - * - `application/pdf` - * - `application/vnd.ms-excel` - * - `application/vnd.ms-outlook` - * - `application/vnd.ms-powerpoint` - * - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - * - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - * - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - * - `application/xml` - * - `application/zip` - * - `audio/flac` - * - `audio/mp4` - * - `audio/mpeg` - * - `audio/ogg` - * - `audio/wav` - * - `image/bmp` - * - `image/gif` - * - `image/jpeg` - * - `image/png` - * - `image/svg+xml` - * - `image/tiff` - * - `image/webp` - * - `text/csv` - * - `text/html` - * - `text/markdown` - * - `text/plain` - * - `text/x-markdown` - * - `text/xml` - * - `video/mp4` - * - `video/quicktime` - * - `video/x-msvideo` - * - * Notes: - * - A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected. - * - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension. - * - Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={"author":"Ada","category":"docs"}`). - * - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`). - * - For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`. - * - * Response: - * - `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source. - * - * Tracking indexing progress: - * - **Which id you get back depends on `status`, and they are not interchangeable:** - * - `uploaded` — a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns. - * - `duplicate` — this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll. - * - For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=…&content_version_id=…` for a whole batch, to follow each item through to `completed` or `failed`. - * - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. - */ - post: operations["upload_file_to_source_api_sources__source_connection_id__upload_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v2/agent-runs/{run_id}/attachments/{attachment_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Download an agent-run attachment - * @description Streams the bytes of an attachment emitted by a step in the given agent run. ``attachment_id`` is the ``id`` of an entry in the run's or a step's ``attachments``, or the URL-safe-base64-encoded storage key, which webhook and email links carry. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - * - The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft-deleted agent, a run whose trace was purged, a file not in the run) all collapse to a single 404 to prevent cross-tenant existence enumeration. - * - * MIME handling: - * - Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, application/vnd.seclai.manifest+json) are served with their declared type. - * - Everything else is served as ``application/octet-stream`` with an attachment disposition to prevent stored-XSS. - */ - get: operations["serve_agent_run_attachment_api_v2_agent_runs__run_id__attachments__attachment_id__get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/version": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get the account's API version - * @description Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request resolved to, and the default/latest/known versions. Pin your account with `PUT /version` or override per request with the `Seclai-Version` header. - */ - get: operations["get_api_version_api_version_get"]; - /** - * Pin (or clear) the account's API version - * @description Sets the account's sticky `Seclai-Version` to the given `YYYY-MM-DD` date, or clears it with `null`. The new pin applies to subsequent header-less requests; a `Seclai-Version` request header still overrides it. Owner/admin only. `effective_version` in the response reflects the current request, not the new pin. - */ - put: operations["update_api_version_api_version_put"]; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; -} -export type webhooks = Record; -export interface components { - schemas: { - /** AddConversationTurnRequest */ - AddConversationTurnRequest: { - /** - * Actions Taken - * @description Actions taken by the AI - */ - actions_taken?: { - [key: string]: unknown; - } | null; - /** - * Ai Response - * @description AI response text - */ - ai_response?: string | null; - /** - * User Input - * @description User input text - */ - user_input: string; - }; - /** AddEmailDomainRequest */ - AddEmailDomainRequest: { - /** - * Delegated - * @default false - */ - delegated: boolean; - /** - * Kind - * @description 'vanity' or 'custom' - */ - kind: string; - /** Value */ - value: string; - }; - /** - * AgentAttachmentRefsApiResponse - * @description Static attachment-reference contract for an agent. - * - * Mirrors the MCP ``get_agent_attachment_references`` tool: returns - * what files (if any) an agent's templates expect on a run so API - * consumers can stage uploads correctly before calling - * ``POST /agents/{id}/runs``. - */ - AgentAttachmentRefsApiResponse: { - /** @description Aggregated selector summary across all consumer steps. ``exact_names`` entries must each appear in the upload batch; ``indexes_max+1`` is the minimum file count; every ``patterns`` glob must match at least one upload. */ - agent?: components["schemas"]["AttachmentRefsSourceApiSummary"]; - /** - * Requires Uploads - * @description When ``false`` the agent's definition does NOT reference any uploaded attachments — ``POST /agents/{id}/upload-input`` will reject with HTTP 400. When ``true`` the ``agent`` block lists the specific selectors a run-time batch must satisfy. - */ - requires_uploads: boolean; - }; - /** - * AgentCallerApiResponse - * @description One agent that calls another (blocks disabling the callee while live). - */ - AgentCallerApiResponse: { - /** Disabled */ - disabled: boolean; - /** - * Id - * Format: uuid - */ - id: string; - /** Name */ - name: string; - }; - /** - * AgentDefinitionImportErrorResponse - * @description 422 body for invalid `agent_definition` payloads. - * - * Mirrors `AgentDefinitionImportError.to_response_dict`. - */ - AgentDefinitionImportErrorResponse: { - /** - * Error - * @description Stable machine-readable error code. - * @constant - */ - error: "invalid_agent_definition"; - /** Errors */ - errors: components["schemas"]["ImportFieldErrorModel"][]; - /** Message */ - message: string; - /** - * Source - * @description Canonical pretty-printed echo of the supplied payload — error line/column refer to this string. - */ - source: string; - }; - /** AgentDefinitionResponse */ - AgentDefinitionResponse: { - /** - * Change Id - * @description Current change ID (use as expected_change_id when updating). - */ - change_id: string; - /** - * Definition - * @description The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, regex_replace, gate, retry, evaluate_step, extract_data, extract_content, add_chat_turn, load_chat_history, add_memory, search_memory, load_memory, streaming_result, send_email, webhook_call, call_agent, write_metadata, write_content_attachment, load_content_attachment, load_content, display_result, merge, for_each, if_else, switch, and others. - */ - definition: { - [key: string]: unknown; - }; - /** - * Schema Version - * @description Agent schema version. - */ - schema_version: string; - /** - * Warnings - * @description Validation warnings, if any. - */ - warnings?: { - [key: string]: string; - }[] | null; - }; - /** - * AgentEmailOptOutListResponse - * @description A page of agent-email opt-outs plus the total (for pagination). - */ - AgentEmailOptOutListResponse: { - /** Items */ - items: components["schemas"]["AgentEmailOptOutResponse"][]; - /** Total */ - total: number; - }; - /** - * AgentEmailOptOutResponse - * @description A recipient's opt-out from an account's agent emails (one agent or all). - */ - AgentEmailOptOutResponse: { - /** Agent Id */ - agent_id: string | null; - /** Agent Name */ - agent_name: string | null; - /** Comment */ - comment: string | null; - /** Created At */ - created_at: string; - /** - * Id - * Format: uuid - */ - id: string; - /** Reason */ - reason: string | null; - /** Recipient Email */ - recipient_email: string; - }; - /** - * AgentEvaluationTier - * @description Controls model selection for agent evaluation. - * - * Labels shown in UI: - * FAST → "Fast and cheap" - * BALANCED → "Balanced speed and cost" - * THOROUGH → "Slow and thorough" - * @enum {string} - */ - AgentEvaluationTier: "fast" | "balanced" | "thorough"; - /** - * AgentExportResponse - * @description Portable JSON snapshot of an agent definition. - */ - AgentExportResponse: { - /** - * Agent - * @description Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, created_at, updated_at. - */ - agent: { - [key: string]: unknown; - }; - /** - * Alert Configs - * @description Alert configurations. - */ - alert_configs?: { - [key: string]: unknown; - }[] | null; - /** - * Dependencies - * @description Resolved dependency manifest. Keys: knowledge_bases, memory_banks, source_connections, agents, users — each a list of {id, name, description, …}. - */ - dependencies?: { - [key: string]: unknown; - } | null; - /** - * Evaluation Criteria - * @description Evaluation criteria for agent steps. - */ - evaluation_criteria?: { - [key: string]: unknown; - }[] | null; - /** - * Export Version - * @description Schema version of the export format (currently "5"). - */ - export_version: string; - /** - * Exported At - * @description ISO-8601 timestamp of when the export was generated. - */ - exported_at: string; - /** - * Governance Policies - * @description Agent-scoped governance policies. - */ - governance_policies?: { - [key: string]: unknown; - }[] | null; - /** - * Software Version - * @description Application version that produced this export. - */ - software_version: string; - /** - * Trigger - * @description Trigger configuration with schedules. - */ - trigger?: { - [key: string]: unknown; - } | null; - }; - /** AgentRunAttemptResponse */ - AgentRunAttemptResponse: { - /** - * Duration - * @description Duration of the attempt in seconds. - */ - duration: number | null; - /** - * Ended At - * @description Timestamp when the attempt ended. - */ - ended_at: string | null; - /** - * Error - * @description Error message if the attempt failed. - */ - error: string | null; - /** - * Started At - * @description Timestamp when the attempt started. - */ - started_at: string | null; - /** @description Status of the agent run attempt. */ - status: components["schemas"]["PendingProcessingCompletedFailedStatus"]; - }; - /** - * AgentRunFileResponse - * @description A file in a run's or a step's output. - */ - AgentRunFileResponse: { - /** - * Bytes - * @description Size of the file in bytes, when known. - */ - bytes: number | null; - /** - * Download Url - * @description `GET` URL that streams the file; accepts an API key or OAuth token. - */ - download_url: string; - /** - * Id - * Format: uuid - * @description File identifier, used to download it. - */ - id: string; - /** - * Mime - * @description MIME type of the file. - */ - mime: string; - /** - * Name - * @description The file's name in this run, as sent to email recipients and webhooks and matched by `{{attachments[...]}}` selectors. - */ - name: string | null; - }; - /** AgentRunRequest */ - AgentRunRequest: { - /** - * Input - * @description Input to provide to the agent upon running for agents with dynamic triggers. - */ - input?: string | null; - /** - * Input Upload Id - * @description ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` — use that field to attach multiple files. May be combined with ``input``: the prompt text leads and the file's extracted text follows under a ``# {filename}`` heading. - * - * **Attachment visibility:** a step only sees the upload when its template references the input — via ``{{input}}`` / ``{{agent.input}}`` / ``{{step..input|output}}`` (implicit, all attachments) or the ``{{attachments[…]}}`` family (explicit narrowing — e.g. ``{{attachments[0]}}``, ``{{attachments[*.pdf]}}``). - * - * **Per-batch validation:** every selector the agent's definition declares must be satisfied or the run is rejected with HTTP 400. Exact-name selectors require that filename to be present; indexed selectors require at least N+1 files; glob patterns require at least one matching filename. - */ - input_upload_id?: string | null; - /** - * Input Upload Ids - * @description IDs of multiple previously uploaded files. Each upload's extracted text is concatenated under a heading; each upload's binary is surfaced as a separate ``MediaAttachment`` so multi-modal prompt steps reason over all files at once. Steps narrow visibility via ``{{attachments[…]}}`` selectors (by index, filename, or fnmatch glob). The batch must satisfy every selector the agent declares — exact names, indexed references (length must exceed the highest index), and glob patterns (each pattern needs at least one match). Mismatches return HTTP 400 with the unmet requirements listed. Mutually exclusive with ``input_upload_id`` (two spellings of the same batch), but may be combined with ``input`` — the prompt text leads and the per-file sections follow, so "a photo plus a sentence about it" needs no synthetic text upload. Max 20 uploads per run. - */ - input_upload_ids?: string[] | null; - /** - * Metadata - * @description Metadata to make available for string substitution expressions in agent tasks. - */ - metadata?: { - [key: string]: components["schemas"]["JsonValue"]; - } | null; - /** - * Priority - * @description If true, the agent run will be treated as priority execution. - * @default false - */ - priority: boolean; - /** - * Replay Of Run Id - * @description Re-run this agent reusing a prior run's uploaded input files. The files are re-resolved server-side from the source run (which must belong to this account and agent) — you do not re-upload them. Combine with ``input`` to change the text while keeping the files. A fresh upload batch (``input_upload_id(s)``) takes precedence and disables replay. Binaries swept by retention fall back to their extracted text. - */ - replay_of_run_id?: string | null; - }; - /** AgentRunResponse */ - AgentRunResponse: { - /** - * Attachments - * @description Files in the run's output, in order. Empty for runs that produced none, for runs made before files were listed here, and once the run's trace is purged. - */ - attachments?: components["schemas"]["AgentRunFileResponse"][]; - /** - * Attempts - * @description List of attempts made for this agent run. - */ - attempts: components["schemas"]["AgentRunAttemptResponse"][]; - /** - * Blocked Policies - * @description Governance policies that produced at least one BLOCK verdict during this run. Deduplicated by policy id. - */ - blocked_policies?: components["schemas"]["routers__api__agents__GovernancePolicyRefResponse"][]; - /** - * Credits - * @description Credits consumed by the agent run, if applicable. Can still rise briefly after the run ends, while governance screening finishes. - */ - credits: number | null; - /** - * Error Count - * @description Number of errors encountered during the run. - */ - error_count: number; - /** - * Flagged Policies - * @description Governance policies that produced at least one FLAG verdict during this run. Deduplicated by policy id. - */ - flagged_policies?: components["schemas"]["routers__api__agents__GovernancePolicyRefResponse"][]; - /** - * Governance Input Status - * @description Result of the governance input evaluation: safe, blocked, skipped, or timed_out. - */ - governance_input_status?: string | null; - /** - * Governance Input Wait Ms - * @description Milliseconds spent waiting for governance input evaluation. - */ - governance_input_wait_ms?: number | null; - /** - * Hitl Wait Ms - * @description Cumulative milliseconds the run was parked waiting for a human decision on a human_in_the_loop step. Subtracted from active duration in run-detail and duration-stats responses. - */ - hitl_wait_ms?: number | null; - /** - * Input - * @description Input provided to the agent for this run. - */ - input: string | null; - /** - * Input Scan Status - * @description Result of the prompt injection scan: safe, unsafe, skipped, timed_out, or error. - */ - input_scan_status?: string | null; - /** - * Output - * @description The run's output text; its files are in `attachments`. Below `Seclai-Version: 2026-09-30` an output that has files is instead the manifest JSON `{schema, text, attachments: [{storage_key, mime, name, label, bytes}]}`; `bytes` is absent on runs made before that version shipped. - */ - output: string | null; - /** - * Output Content Type - * @description MIME type of `output` — mirrors the terminal step's `output_content_type`. `text/plain` / `text/*` are free-form text and `application/json` is a JSON document. Below `Seclai-Version: 2026-09-30` an output that has files reads `application/vnd.seclai.manifest+json` (see `output`); the same files are in `attachments` on every version, each with a `download_url`. Null on runs that produced no terminal output or that pre-date this column. - */ - output_content_type?: string | null; - /** - * Priority - * @description Indicates if the run was treated as a priority execution. - */ - priority: boolean; - /** - * Run Id - * @description Unique identifier for the agent run. - */ - run_id: string; - /** - * Scan Wait Ms - * @description Milliseconds spent waiting for prompt injection scan. - */ - scan_wait_ms?: number | null; - /** @description Current status of the agent run. */ - status: components["schemas"]["PendingProcessingCompletedFailedStatus"]; - /** - * Steps - * @description Step outputs and per-step timing/credits. Only included when requested. - */ - steps?: components["schemas"]["AgentRunStepResponse"][] | null; - /** - * Trace Purged At - * @description When this run's trace content was deleted under the account's agent-trace retention window. Non-null means `input`, `output` and every step's and tool call's I/O are null **by design** and will never be available again — the run aged out, it did not fail. Branch on this rather than on a null `output`: a run that genuinely produced nothing looks identical. Status, timing and credits remain accurate. - */ - trace_purged_at?: string | null; - /** - * Wait Ms - * @description Cumulative milliseconds the run was parked on standard-mode wait steps. Subtracted from active duration in run-detail and duration-stats responses, exactly like hitl_wait_ms. Priority waits block inline and are not counted here. - */ - wait_ms?: number | null; - }; - /** AgentRunStepResponse */ - AgentRunStepResponse: { - /** - * Agent Step Id - * @description Agent step identifier. - */ - agent_step_id: string; - /** - * Attachments - * @description Files in this step's output, in order. Empty for steps that produced none, for steps run before files were listed here, and once the run's trace is purged. - */ - attachments?: components["schemas"]["AgentRunFileResponse"][]; - /** - * Credits Used - * @description Credits consumed by this step across every attempt it made. Some charges made outside any step, such as governance screening of the run's input, count toward the run's total but no step's. The timestamps above and the tool calls below describe the latest attempt only. - */ - credits_used: number; - /** - * Duration Seconds - * @description Duration of the step attempt in seconds. - */ - duration_seconds: number | null; - /** - * Ended At - * @description Timestamp when the step attempt ended. - */ - ended_at: string | null; - /** - * Input - * @description Input text provided to the step, if any. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step that produced it output files and is not a `for_each`. - */ - input: string | null; - /** - * Output - * @description Output text produced by the step, if any; its files are in `attachments`. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step output files and is not a `for_each`. - */ - output: string | null; - /** - * Output Content Type - * @description Content type of the step output, if any. - */ - output_content_type: string | null; - /** - * Started At - * @description Timestamp when the step attempt started. - */ - started_at: string | null; - /** @description Status of the step run. */ - status: components["schemas"]["PendingProcessingCompletedFailedStatus"]; - /** - * Step Type - * @description Type of the agent step. - */ - step_type: string; - /** - * Tool Calls - * @description LLM tool calls made during this step (prompt_call steps only), ordered by execution. Empty for steps that invoked no tools. - */ - tool_calls?: components["schemas"]["AgentRunToolCallResponse"][]; - /** - * Warnings - * @description Authoring problems the step ran into, whether or not it then failed, such as a file name selector that matched none of its source's files. - */ - warnings?: string[] | null; - }; - /** AgentRunStreamRequest */ - AgentRunStreamRequest: { - /** - * Input - * @description Input to provide to the agent upon running for agents with dynamic triggers. - */ - input?: string | null; - /** - * Input Upload Id - * @description ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` — use that field to attach multiple files. May be combined with ``input``. Subject to the same per-batch attachment-selector validation as the non-streaming endpoint. - */ - input_upload_id?: string | null; - /** - * Input Upload Ids - * @description IDs of multiple previously uploaded files. See the non-streaming endpoint for full semantics, including per-batch selector validation (exact names, indexed references, and glob patterns must all be satisfied or the run is rejected with HTTP 400) and combining the batch with ``input`` prompt text. Max 20. - */ - input_upload_ids?: string[] | null; - /** - * Metadata - * @description Metadata to make available for string substitution expressions in agent tasks. - */ - metadata?: { - [key: string]: components["schemas"]["JsonValue"]; - } | null; - /** - * Replay Of Run Id - * @description Re-run reusing a prior run's uploaded input files (re-resolved server-side from the source run, which must belong to this account and agent). A fresh upload batch takes precedence. - */ - replay_of_run_id?: string | null; - }; - /** - * AgentRunToolCallResponse - * @description A single LLM tool call made during a prompt_call step. - */ - AgentRunToolCallResponse: { - /** - * Credits Used - * @description Credits consumed by this tool call (0 for tools that don't bill). - * @default 0 - */ - credits_used: number; - /** - * Duration Seconds - * @description Duration of the tool call in seconds. - */ - duration_seconds?: number | null; - /** - * Ended At - * @description Timestamp when the tool call ended. - */ - ended_at?: string | null; - /** - * Error - * @description Error message when the tool call failed. - */ - error?: string | null; - /** - * Function Name - * @description Name of the tool/function invoked. - */ - function_name: string; - /** - * Id - * @description Tool call identifier. - */ - id: string; - /** - * Input - * @description JSON arguments the LLM passed to the tool, if persisted. - */ - input?: string | null; - /** - * Output - * @description JSON result the tool returned to the LLM, if persisted. - */ - output?: string | null; - /** - * Round Index - * @description 0-based tool-loop round this call belonged to. - * @default 0 - */ - round_index: number; - /** - * Sequence - * @description 0-based ordinal of this call within one attempt of the step, so it repeats across a retried step's attempts. This list holds the latest attempt only. - * @default 0 - */ - sequence: number; - /** - * Started At - * @description Timestamp when the tool call started. - */ - started_at?: string | null; - /** - * Succeeded - * @description Whether the tool call completed without error. - * @default true - */ - succeeded: boolean; - }; - /** AgentSummaryResponse */ - AgentSummaryResponse: { - /** - * Created At - * @description ISO 8601 creation timestamp. - */ - created_at: string; - /** - * Default Evaluation Tier - * @description Default evaluation tier: fast, balanced, or thorough. - */ - default_evaluation_tier?: string | null; - /** - * Description - * @description Agent description. - */ - description: string | null; - /** - * Disabled - * @description Whether the agent is paused (disabled). - * @default false - */ - disabled: boolean; - /** - * Disabled At - * @description ISO 8601 timestamp the agent was paused. - */ - disabled_at?: string | null; - /** - * Disabled Reason - * @description Why the agent is paused: 'manual' or 'email_overload'. - */ - disabled_reason?: string | null; - /** - * Evaluation Mode - * @description Evaluation mode: output_expectation, eval_and_retry, or sample_and_flag. - * @default eval_and_retry - */ - evaluation_mode: string; - /** - * Id - * @description Unique agent identifier. - */ - id: string; - /** - * Import Warnings - * @description One entry per item dropped or substituted during import. Present only on endpoints that accept agent_definition; null on non-import calls; [] when the import had no skips. - */ - import_warnings?: components["schemas"]["ImportSkipResponse"][] | null; - /** - * Max Retries - * @description Max retries for eval_and_retry mode. - * @default 3 - */ - max_retries: number; - /** - * Name - * @description Agent name. - */ - name: string; - /** - * Prompt Model Auto Rollback Enabled - * @description Whether automatic rollback is enabled for upgraded models. - * @default false - */ - prompt_model_auto_rollback_enabled: boolean; - /** - * Prompt Model Auto Rollback Triggers - * @description Failure signals that trigger rollback. Defaults to agent_eval_fail, governance_block, agent_run_failed when null. - */ - prompt_model_auto_rollback_triggers?: string[] | null; - /** - * Prompt Model Auto Upgrade Strategy - * @description Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter. - * @default none - */ - prompt_model_auto_upgrade_strategy: string; - /** - * Retry On Failure - * @description Whether to retry on evaluation failure. - * @default true - */ - retry_on_failure: boolean; - /** - * Sampling Config - * @description Sampling configuration for sample_and_flag mode. - */ - sampling_config?: { - [key: string]: unknown; - } | null; - /** - * Trigger Type - * @description Trigger type for the agent. - */ - trigger_type?: string | null; - /** - * Updated At - * @description ISO 8601 last-updated timestamp. - */ - updated_at: string; - }; - /** AgentTraceMatchResponse */ - AgentTraceMatchResponse: { - /** - * Agent Id - * @description Agent ID. - */ - agent_id: string | null; - /** - * Agent Run Id - * @description Agent run ID. - */ - agent_run_id: string | null; - /** - * Agent Run Status - * @description Status of the agent run. - */ - agent_run_status: string | null; - /** - * Agent Step Id - * @description Step identifier. - */ - agent_step_id: string | null; - /** - * Agent Step Run Id - * @description Agent step run ID. - */ - agent_step_run_id: string | null; - /** - * Agent Step Type - * @description Type of the step. - */ - agent_step_type: string | null; - /** - * Score - * @description Similarity score (0-1, higher is better). - */ - score: number; - /** - * Text - * @description Matching text chunk. - */ - text: string; - /** - * Title - * @description Title of the indexed entry. - */ - title: string | null; - }; - /** AgentTraceSearchResponse */ - AgentTraceSearchResponse: { - /** - * Matches - * @description List of matching entries. - */ - matches: components["schemas"]["AgentTraceMatchResponse"][]; - /** - * Total - * @description Number of matches returned. - */ - total: number; - }; - /** AgentUsingCloudDriveResponseModel */ - AgentUsingCloudDriveResponseModel: { - /** - * Agent Id - * @description Agent identifier. - */ - agent_id: string; - /** - * Agent Name - * @description Agent name. - */ - agent_name: string; - /** - * Trigger Types - * @description File-change trigger types bound to this drive. - */ - trigger_types: string[]; - /** - * Via Prompt Tool - * @description Uses a prompt_call cloud-drive tool. - */ - via_prompt_tool: boolean; - /** - * Via Step - * @description Uses a list/read/write cloud-drive step. - */ - via_step: boolean; - }; - /** - * AiAssistantAcceptResponse - * @description Response from accepting and executing a plan. - */ - AiAssistantAcceptResponse: { - /** - * Conversation Id - * Format: uuid - * @description Conversation ID. - */ - conversation_id: string; - /** - * Error - * @description Error message if failed. - */ - error?: string | null; - /** - * Executed Actions - * @description Results of each executed action. - */ - executed_actions: components["schemas"]["ExecutedActionResponse"][]; - /** - * Solution Id - * @description Solution ID when a new solution was auto-created. - */ - solution_id?: string | null; - /** - * Success - * @description Whether execution succeeded. - * @default true - */ - success: boolean; - }; - /** - * AiAssistantFeedbackResponse - * @description Response after submitting feedback. - */ - AiAssistantFeedbackResponse: { - /** - * Feedback Id - * Format: uuid - */ - feedback_id: string; - /** Flag Reason */ - flag_reason?: string | null; - /** Flagged */ - flagged: boolean; - }; - /** - * AiAssistantGenerateResponse - * @description Response from an AI assistant generate endpoint. - */ - AiAssistantGenerateResponse: { - /** - * Conversation Id - * Format: uuid - * @description Conversation ID for accept/decline. - */ - conversation_id: string; - /** - * Example Prompts - * @description Example natural-language prompts that demonstrate the capabilities of this AI assistant. - */ - example_prompts?: components["schemas"]["ExamplePrompt"][]; - /** - * Note - * @description AI-generated note about the plan. - */ - note: string; - /** - * Proposed Actions - * @description List of proposed actions. - */ - proposed_actions: components["schemas"]["ProposedActionResponse"][]; - /** - * Requires Delete Confirmation - * @description Whether destructive actions require explicit confirmation. - * @default false - */ - requires_delete_confirmation: boolean; - /** - * Success - * @description Whether plan generation succeeded. - * @default false - */ - success: boolean; - }; - /** AiConversationHistoryResponse */ - AiConversationHistoryResponse: { - /** - * Total - * @description Total number of conversation turns available. - */ - total: number; - /** - * Turns - * @description Conversation turns, ordered oldest first. - */ - turns: components["schemas"]["AiConversationTurnResponse"][]; - }; - /** AiConversationTurnResponse */ - AiConversationTurnResponse: { - /** - * Accepted - * @description Whether the user accepted this proposal (null if pending). - */ - accepted: boolean | null; - /** - * Ai Note - * @description AI explanation from this turn. - */ - ai_note: string | null; - /** - * Conversation Id - * @description Unique conversation turn ID. - */ - conversation_id: string; - /** - * Resulting Config - * @description The proposed configuration from this turn. - */ - resulting_config: { - [key: string]: unknown; - } | null; - /** - * Step Id - * @description Step ID for this conversation. - */ - step_id: string | null; - /** - * Step Type - * @description Step type for this conversation. - */ - step_type: string | null; - /** - * User Input - * @description User input for this turn. - */ - user_input: string; - }; - /** - * AlertConfigListResponse - * @description ``GET /alerts/configs`` legacy/default shape (header-less clients). - * - * ``Seclai-Version: 2026-07-27+`` clients receive the canonical - * ``{data, pagination}`` envelope instead (the handler returns a ``JSONResponse`` - * that bypasses this ``response_model``); this documents the default shape. - */ - AlertConfigListResponse: { - /** Configs */ - configs: components["schemas"]["AlertConfigResponse"][]; - /** Total */ - total: number; - }; - /** AlertConfigResponse */ - AlertConfigResponse: { - /** Account Id */ - account_id: string; - /** Agent Id */ - agent_id: string | null; - /** Alert Type */ - alert_type: string; - /** Cooldown Minutes */ - cooldown_minutes: number; - /** Created At */ - created_at: string | null; - /** Distribution Type */ - distribution_type: string; - /** Enabled */ - enabled: boolean; - /** Id */ - id: string; - /** Last Alerted At */ - last_alerted_at: string | null; - /** Recipient User Ids */ - recipient_user_ids: string[]; - /** Source Connection Id */ - source_connection_id: string | null; - /** Threshold */ - threshold: { - [key: string]: unknown; - } | null; - /** Updated At */ - updated_at: string | null; - }; - /** AlertHistoryEntryResponse */ - AlertHistoryEntryResponse: { - /** Changed By Name */ - changed_by_name: string | null; - /** Changed By User Id */ - changed_by_user_id: string | null; - /** Created At */ - created_at: string | null; - /** Id */ - id: string; - /** New Status */ - new_status: string; - /** Note */ - note: string | null; - /** Previous Status */ - previous_status: string | null; - }; - /** ApiVersionResponse */ - ApiVersionResponse: { - /** - * Default Version - * @description Baseline for an unpinned, header-less caller. - */ - default_version: string; - /** - * Effective Version - * @description The version THIS request resolved to (header > pin > default). - */ - effective_version: string; - /** - * Known Versions - * @description All dated versions, oldest first. - */ - known_versions: string[]; - /** - * Latest Version - * @description Newest version the server knows about. - */ - latest_version: string; - /** - * Pinned Version - * @description The account's sticky pinned version, or null when unpinned (the account resolves to the default). Applies to header-less requests. - */ - pinned_version: string | null; - }; - /** - * AppliedActionResponse - * @description Result of a single executed governance action. - */ - AppliedActionResponse: { - /** - * Action Type - * @description Type of action that was executed. - */ - action_type: string; - /** - * Description - * @description Human-readable description of the executed action. - */ - description: string; - /** - * Error - * @description Error message if this action failed, or null. - */ - error?: string | null; - /** - * Policy Id - * @description ID of the policy that was created or modified, or null. - */ - policy_id?: string | null; - /** - * Success - * @description Whether this individual action succeeded. - */ - success: boolean; - }; - /** - * AttachmentRefsSourceApiSummary - * @description Per-source attachment-reference summary. - */ - AttachmentRefsSourceApiSummary: { - /** Exact Names */ - exact_names?: string[]; - /** Indexes Max */ - indexes_max?: number | null; - /** Kinds */ - kinds?: string[]; - /** Patterns */ - patterns?: string[]; - }; - /** - * BlockEmailSenderRequest - * @description Add one sender/domain to the account blocklist (shared REST request). - */ - BlockEmailSenderRequest: { - /** - * Match Type - * @default address - */ - match_type: string; - /** Note */ - note?: string | null; - /** Sender Email */ - sender_email: string; - }; - /** - * BlockedEmailSenderListResponse - * @description A page of blocked senders + the account's auto-block mode. - */ - BlockedEmailSenderListResponse: { - /** Auto Block Mode */ - auto_block_mode: string; - /** Items */ - items: components["schemas"]["BlockedEmailSenderResponse"][]; - /** Total */ - total: number; - }; - /** - * BlockedEmailSenderResponse - * @description A single blocked inbound email sender. - */ - BlockedEmailSenderResponse: { - /** Created At */ - created_at: string; - /** - * Id - * Format: uuid - */ - id: string; - /** Match Type */ - match_type: string; - /** Note */ - note: string | null; - /** Sender Email */ - sender_email: string; - /** Source */ - source: string; - }; - /** Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post */ - Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post: { - /** - * File - * Format: binary - * @description File to upload - */ - file: string; - /** - * Metadata - * @description Optional JSON object string of metadata. Example: `{"category":"docs","author":"Ada"}`. `title` will be merged into this dictionary as `metadata.title` if it is not already present. - */ - metadata?: string | null; - /** - * Title - * @description Optional title for the content - */ - title?: string; - }; - /** Body_upload_file_to_source_api_sources__source_connection_id__upload_post */ - Body_upload_file_to_source_api_sources__source_connection_id__upload_post: { - /** - * File - * Format: binary - * @description File to upload - */ - file: string; - /** - * Metadata - * @description Optional JSON object string of metadata. Example: `{"author":"Ada","category":"docs"}`. `title` will be merged into this dictionary as `metadata.title` if it is not already present. - */ - metadata?: string | null; - /** - * Title - * @description Optional title for the content - */ - title?: string; - }; - /** CancelExperimentResponse */ - CancelExperimentResponse: { - /** Status */ - status: string; - }; - /** CancelQueuedRunsResponse */ - CancelQueuedRunsResponse: { - /** Cancelled */ - cancelled: number; - }; - /** ChangeStatusRequest */ - ChangeStatusRequest: { - /** - * Note - * @description Optional note - */ - note?: string | null; - /** - * Status - * @description New alert status - */ - status: string; - }; - /** CloudDriveAccessLevelResponseModel */ - CloudDriveAccessLevelResponseModel: { - /** - * Default - * @description Whether connecting without a choice uses it. - */ - default: boolean; - /** - * Description - * @description What agents can do at this level. - */ - description: string; - /** - * Key - * @description Level identifier, e.g. `read_write`/`read_only`. - */ - key: string; - /** - * Label - * @description Short human-readable name. - */ - label: string; - }; - /** CloudDriveProviderResponseModel */ - CloudDriveProviderResponseModel: { - /** - * Access Levels - * @description Mutually-exclusive permission bundles offered when connecting. Connecting happens in the app, so this is informational here — it explains what a connection's `access_level` can be. - */ - access_levels: components["schemas"]["CloudDriveAccessLevelResponseModel"][]; - /** - * Display Name - * @description Human-readable provider name. - */ - display_name: string; - /** - * Key - * @description Provider key used as `provider` on a connection. - */ - key: string; - /** - * Scopes - * @description OAuth permissions this provider can request. - */ - scopes: components["schemas"]["CloudDriveScopeResponseModel"][]; - }; - /** - * CloudDriveRejectionResponseModel - * @description One file the connection deliberately did not process. - */ - CloudDriveRejectionResponseModel: { - /** - * Created At - * @description When the file was skipped. - */ - created_at: string; - /** - * Detail - * @description Extra context, e.g. the cap that was hit. - */ - detail?: string | null; - /** - * File Id - * @description The provider's file id, when the file was known. - */ - file_id?: string | null; - /** - * File Path - * @description Path of the skipped file, when known. - */ - file_path?: string | null; - /** - * Id - * @description Rejection identifier. - */ - id: string; - /** - * Reason - * @description `too_large`, `download_failed`, or `flood`. - */ - reason: string; - }; - /** - * CloudDriveResponseModel - * @description A cloud-drive connection, without any secret material. - */ - CloudDriveResponseModel: { - /** - * Access Level - * @description The permission bundle the granted scopes correspond to — `read_write` or `read_only`. Null when the grant matches no level the provider currently offers; treat that as unknown rather than assuming write access. - */ - access_level?: string | null; - /** - * Connected - * @description True when the connection is usable. - */ - connected: boolean; - /** - * Created At - * @description When the connection was created. - */ - created_at: string; - /** - * Drive Id - * @description Opaque id of the shared drive the folder resolves to, or null for the user's own drive. Stable across renames — compare on this rather than on the name in `folder_path`. - */ - drive_id?: string | null; - /** - * Drive Name - * @description Display name the shared drive last resolved to. Presentation only; never match on it. - */ - drive_name?: string | null; - /** - * Drive Name Stale - * @description True when `drive_name` could not be re-confirmed (the drive was deleted, access was lost, or the provider was unreachable). The last known name is still reported — treat it as possibly out of date rather than current. - */ - drive_name_stale: boolean; - /** - * External Account Id - * @description The provider's own opaque account identifier (never an email). - */ - external_account_id?: string | null; - /** - * Folder Path - * @description Watched folder; empty string means the drive root. A folder on a shared drive is written `/Shared drives//`. - */ - folder_path: string; - /** - * Id - * @description Connection identifier. - */ - id: string; - /** - * Last Error - * @description Most recent sync or authorization error, if any. - */ - last_error?: string | null; - /** - * Last Synced At - * @description When the connection last synced successfully. - */ - last_synced_at?: string | null; - /** - * Name - * @description Human-readable name. - */ - name?: string | null; - /** - * Oauth Scopes - * @description Space-separated OAuth scopes granted to this connection. - */ - oauth_scopes?: string | null; - /** - * Provider - * @description Provider key, e.g. `dropbox` or `google_drive`. - */ - provider: string; - /** - * Realtime Updates - * @description True when changes arrive via the provider's push notifications. False means the drive still syncs, but only on the scheduled backstop sweep rather than within seconds of a change. - */ - realtime_updates: boolean; - /** - * Status - * @description One of `active`, `pending_auth`, `error`, `disconnected`. - */ - status: string; - /** - * Updated At - * @description When the connection was last modified. - */ - updated_at: string; - }; - /** CloudDriveScopeResponseModel */ - CloudDriveScopeResponseModel: { - /** - * Description - * @description What the scope allows. - */ - description: string; - /** - * Key - * @description The OAuth scope string sent to the provider. - */ - key: string; - /** - * Label - * @description Short human-readable name. - */ - label: string; - /** - * Recommended - * @description Whether this scope is requested by default on connect. - */ - recommended: boolean; - }; - /** CloudDriveUpdateRequest */ - CloudDriveUpdateRequest: { - /** - * Folder Path - * @description New watched folder; empty means the whole drive. A folder on a shared drive is written `/Shared drives//`. Changing it resets the sync cursor, so files already in the new folder are NOT replayed as triggers — only subsequent changes fire, matching connect-time behaviour. Rejected when the new folder would make an agent that writes there re-trigger itself. - */ - folder_path?: string | null; - /** - * Name - * @description New display name for the connection. - */ - name?: string | null; - }; - /** - * CompactionEvaluationModel - * @description Structured LLM-as-judge evaluation result. - */ - CompactionEvaluationModel: { - /** - * Reasoning - * @description Explanation of the evaluation. - */ - reasoning: string; - /** - * Score - * @description Quality score from 1 to 5. - */ - score: number; - /** - * Verdict - * @description 'pass' or 'fail'. - */ - verdict: string; - }; - /** - * CompactionScheduledResponse - * @description Acknowledgement that an on-demand compaction run was scheduled. - */ - CompactionScheduledResponse: { - /** Memory Bank Id */ - memory_bank_id: string; - /** Status */ - status: string; - }; - /** - * CompactionTestResponseModel - * @description Response from a compaction prompt test. - */ - CompactionTestResponseModel: { - /** - * Compaction Summary - * @description The generated compaction summary. - */ - compaction_summary: string | null; - /** @description LLM-as-judge quality evaluation. */ - evaluation: components["schemas"]["CompactionEvaluationModel"]; - /** - * Generated - * @description True when entries were LLM-generated rather than real. - */ - generated: boolean; - /** - * Original Entries - * @description Entries fed into the compactor. - */ - original_entries: string[]; - /** - * Surviving Entries - * @description Entries that survived after compaction. - */ - surviving_entries: string[]; - }; - /** - * CompatibleRunListResponse - * @description Paginated list of compatible runs. - */ - CompatibleRunListResponse: { - /** Data */ - data: components["schemas"]["CompatibleRunResponse"][]; - /** Limit */ - limit: number; - /** Page */ - page: number; - /** Total */ - total: number; - }; - /** - * CompatibleRunResponse - * @description A run that has a completed step matching a criteria's step_id. - */ - CompatibleRunResponse: { - /** - * Agent Run Id - * Format: uuid - */ - agent_run_id: string; - /** - * Agent Step Run Id - * Format: uuid - */ - agent_step_run_id: string; - /** Completed At */ - completed_at: string | null; - /** Input Preview */ - input_preview?: string | null; - /** Output Storage Key */ - output_storage_key: string | null; - /** Run Status */ - run_status?: string | null; - /** Started At */ - started_at?: string | null; - }; - /** - * ContentEmbeddingResponse - * @description Response model for content embedding. - */ - ContentEmbeddingResponse: { - /** Batch Duration */ - batch_duration: number; - /** Batch Size */ - batch_size: number; - /** Id */ - id: string; - /** Media Name */ - media_name?: string | null; - /** Page Number */ - page_number?: number | null; - /** Source Mime */ - source_mime?: string | null; - /** Source Url */ - source_url?: string | null; - /** Text */ - text: string; - /** Text End */ - text_end: number; - /** Text Start */ - text_start: number; - /** Vector */ - vector: number[]; - }; - /** CreateAlertConfigRequest */ - CreateAlertConfigRequest: { - /** - * Agent Id - * @description Agent ID (for agent alerts) - */ - agent_id?: string | null; - /** - * Alert Type - * @description Alert type - */ - alert_type: string; - /** - * Cooldown Minutes - * @description Cooldown period in minutes. Omit to use the per-alert-type default (1440 for credit alerts, 60 otherwise). - */ - cooldown_minutes?: number | null; - /** - * Distribution Type - * @description Distribution type (owner, owner_admins, selected_members) - * @default owner - */ - distribution_type: string; - /** - * Enabled - * @description Whether the alert config is enabled - * @default true - */ - enabled: boolean; - /** - * Recipient User Ids - * @description User IDs for selected_members distribution - */ - recipient_user_ids?: string[] | null; - /** - * Source Connection Id - * @description Source connection ID (for source alerts) - */ - source_connection_id?: string | null; - /** - * Threshold - * @description Threshold configuration - */ - threshold?: { - [key: string]: unknown; - } | null; - }; - /** - * CreateEvaluationCriteriaRequest - * @description Request body for creating an evaluation criteria. - * - * The evaluation mode, retry settings, and sample frequency are set at the - * agent level, not per-criteria. - */ - CreateEvaluationCriteriaRequest: { - /** Description */ - description?: string | null; - /** - * Enabled - * @default true - */ - enabled: boolean; - /** Evaluation Prompt */ - evaluation_prompt?: string | null; - evaluation_tier?: components["schemas"]["AgentEvaluationTier"] | null; - /** Expectation Config */ - expectation_config?: { - [key: string]: unknown; - } | null; - /** - * Pass Threshold - * @default 0.5 - */ - pass_threshold: number; - /** Step Id */ - step_id: string; - }; - /** - * CreateEvaluationResultRequest - * @description Request body for recording an evaluation result. - */ - CreateEvaluationResultRequest: { - /** - * Agent Run Id - * Format: uuid - */ - agent_run_id: string; - /** Agent Step Run Id */ - agent_step_run_id?: string | null; - /** Details */ - details?: { - [key: string]: unknown; - } | null; - /** - * Flagged - * @default false - */ - flagged: boolean; - /** - * Retry Count - * @default 0 - */ - retry_count: number; - /** - * Retry Triggered - * @default false - */ - retry_triggered: boolean; - /** Score */ - score?: number | null; - status: components["schemas"]["EvaluationStatus"]; - }; - /** CreateExperimentResponse */ - CreateExperimentResponse: { - /** Experiment Id */ - experiment_id: string; - /** Status */ - status: string; - }; - /** - * CreateKnowledgeBaseBody - * @description Request body for creating a knowledge base. - */ - CreateKnowledgeBaseBody: { - /** - * Default Score Threshold - * @description Prefilled into Minimum Rerank Score on a new retrieval step in the editor. Not applied at retrieval time — the step's own value is used. - */ - default_score_threshold?: number | null; - /** - * Default Top K - * @description Prefilled into Top K on a new retrieval step in the editor. Not applied at retrieval time. - */ - default_top_k?: number | null; - /** - * Default Top N - * @description Prefilled into Top N on a new retrieval step in the editor. Not applied at retrieval time — the step's own value is used. - */ - default_top_n?: number | null; - /** - * Description - * @description Optional description. - */ - description?: string | null; - /** - * Name - * @description Knowledge base name. - */ - name: string; - /** - * Reranker Model - * @description Reranker model to use — a `model_type` from `GET /models/rerankers`. Pass "none" to disable reranking (not a value from that list). Omit it for a default chosen from the sources ("none" when every source embeds media natively, whose chunks carry no text for a reranker to score). "" is accepted as a synonym for "none". - */ - reranker_model?: string | null; - /** - * Source Ids - * @description List of source connection IDs to link. - */ - source_ids: string[]; - }; - /** - * CreateMemoryBankBody - * @description Request body for creating a memory bank. - */ - CreateMemoryBankBody: { - /** - * Chunk Overlap - * @description Chunk overlap (custom mode only). - */ - chunk_overlap?: number | null; - /** - * Chunk Size - * @description Chunk size (custom mode only). - */ - chunk_size?: number | null; - /** - * Compaction Prompt - * @description Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted. - */ - compaction_prompt?: string | null; - /** - * Description - * @description Optional description of the bank's purpose. - */ - description?: string | null; - /** - * Dimensions - * @description Embedding dimensions (custom mode only). - */ - dimensions?: number | null; - /** - * Embedding Model - * @description Custom embedding model (custom mode only). - */ - embedding_model?: string | null; - /** - * Max Age Days - * @description DEPRECATED and no longer applied. Age used to trigger compaction, which duplicated retention_days — both removed the same entries at the same age. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending Seclai-Version 2026-08-03 or later; accepted and stored but inert for older clients. - */ - max_age_days?: number | null; - /** - * Max Size Tokens - * @description Max total tokens (per partition) before compaction. Checked inline after each write and by the hourly background sweep. - */ - max_size_tokens?: number | null; - /** - * Max Turns - * @description Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep. - */ - max_turns?: number | null; - /** - * Mode - * @description Embedding quality / cost trade-off. One of: fast_and_cheap, balanced, slow_and_thorough, custom. - * @default fast_and_cheap - */ - mode: string; - /** - * Name - * @description Memory bank name. - */ - name: string; - /** - * Retention Days - * @description Retention in days — when entries are deleted outright, text and embeddings. This is the only age-based control; compaction triggers on max_size_tokens and max_turns. For clients sending Seclai-Version 2026-08-03 or later, omitting the field resolves per bank type: 90 days for a conversation bank, indefinite for a general bank. Older clients keep the previous default of 30 days for a conversation bank — unless a longer max_age_days was sent, which wins, since the window is never lowered beneath the only age the caller expressed — while a general bank keeps entries indefinitely. Send an explicit value (or null for indefinite) to be unambiguous on every version. - */ - retention_days?: number | null; - /** - * Strip Quoted Reply Chains - * @description Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation. - * @default false - */ - strip_quoted_reply_chains: boolean; - /** - * Type - * @description Bank type. 'conversation' for chat-turn data with conversation_key + speaker; 'general' for flat entries with optional group_key. - * @default conversation - */ - type: string; - }; - /** - * CreateSolutionRequest - * @description Request model for creating a new solution - */ - CreateSolutionRequest: { - /** - * Description - * @description Description of the solution - * @default - */ - description: string; - /** - * Name - * @description Name of the solution - */ - name: string; - }; - /** - * CreateSourceBody - * @description Request body for creating a content source. - */ - CreateSourceBody: { - /** - * Chunk Overlap - * @description Chunk overlap for content processing. - */ - chunk_overlap?: number | null; - /** - * Chunk Size - * @description Chunk size for content processing. - */ - chunk_size?: number | null; - /** - * Content Filter - * @description Content filter type. - */ - content_filter?: string | null; - /** - * Dimensions - * @description Embedding dimensions override. - */ - dimensions?: number | null; - /** - * Embedding Model - * @description Embedding model override — a `model_type` from `GET /models/embedders`, which also reports each embedder's `supported_input_media`. Defaults to the platform embedder (`default_model_type` on that endpoint) when omitted. Indexing images or video requires an embedder that lists that modality. - */ - embedding_model?: string | null; - /** @description Index mode for custom_index sources: fast_and_cheap (default), balanced, slow_and_thorough, or custom. */ - index_mode?: components["schemas"]["SourceIndexMode"] | null; - /** - * Media Types - * @description Media kinds to extract from indexed content and embed as multi-modal KB chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored (see `supported_input_media` on GET /models/embedders); unsupported values are dropped. Omit / [] for text-only. - */ - media_types?: string[] | null; - /** - * Name - * @description Source name. - */ - name: string; - /** - * Polling - * @description Polling interval (e.g. hourly, daily). - */ - polling?: string | null; - /** - * Polling Action - * @description Polling action. - */ - polling_action?: string | null; - /** - * Polling Max Items - * @description Max items per poll. - */ - polling_max_items?: number | null; - /** - * Retention - * @description Retention period in days. - */ - retention?: number | null; - /** - * Source Type - * @description Source type: rss, website, or custom_index. The legacy value 'file_uploads' is accepted as an alias for custom_index. - */ - source_type: string; - /** - * Url Id - * @description URL record ID (required for rss/website sources). - */ - url_id?: string | null; - }; - /** DmarcFailingSourceResponse */ - DmarcFailingSourceResponse: { - /** Failed Count */ - failed_count: number; - /** Header From */ - header_from?: string | null; - /** Source Ip */ - source_ip: string; - }; - /** DmarcSummaryResponse */ - DmarcSummaryResponse: { - /** Dispositions */ - dispositions?: { - [key: string]: number; - }; - /** Failed Messages */ - failed_messages: number; - /** - * Monitored - * @default true - */ - monitored: boolean; - /** Pass Rate */ - pass_rate?: number | null; - /** Passed Messages */ - passed_messages: number; - /** Report Count */ - report_count: number; - /** Top Failing Sources */ - top_failing_sources?: components["schemas"]["DmarcFailingSourceResponse"][]; - /** Total Messages */ - total_messages: number; - /** Window Days */ - window_days: number; - }; - /** DnsProviderResponse */ - DnsProviderResponse: { - /** Dashboard Url */ - dashboard_url?: string | null; - /** Key */ - key: string; - /** - * Mx Priority Separate - * @default true - */ - mx_priority_separate: boolean; - /** Name */ - name: string; - /** Tips */ - tips?: string[]; - /** - * Txt Quotes - * @default strip - */ - txt_quotes: string; - }; - /** DnsRecordResponse */ - DnsRecordResponse: { - /** Detail */ - detail?: string | null; - /** Key */ - key: string; - /** Mx Host */ - mx_host?: string | null; - /** Mx Priority */ - mx_priority?: number | null; - /** Name */ - name: string; - /** Ok */ - ok: boolean; - /** Relative Name */ - relative_name: string; - /** Type */ - type: string; - /** Value */ - value: string; - }; - /** DocsSearchResultResponse */ - DocsSearchResultResponse: { - /** Anchor */ - anchor: string | null; - /** Doc Slug */ - doc_slug: string; - /** Highlight */ - highlight: string | null; - /** Score */ - score: number; - /** Snippet */ - snippet: string | null; - /** Title */ - title: string; - }; - /** - * EffortOptionsResponse - * @description The reasoning-effort values a model accepts. - */ - EffortOptionsResponse: { - /** - * Default - * @description The vendor's default level, when known. - */ - default?: string | null; - /** - * Kind - * @description `levels` today: `values` lists them. - */ - kind: string; - /** - * Values - * @description Accepted values, weakest first. - */ - values?: string[]; - }; - /** EmailDomainResponse */ - EmailDomainResponse: { - /** - * Delegated - * @default false - */ - delegated: boolean; - /** Dns Records */ - dns_records?: components["schemas"]["DnsRecordResponse"][]; - /** Domain */ - domain: string; - /** Error Message */ - error_message?: string | null; - /** - * Id - * Format: uuid - */ - id: string; - /** Is Primary */ - is_primary: boolean; - /** Kind */ - kind: string; - /** Last Checked At */ - last_checked_at?: string | null; - provider?: components["schemas"]["DnsProviderResponse"] | null; - /** - * Regressing - * @default false - */ - regressing: boolean; - /** Status */ - status: string; - /** - * Verified - * @default false - */ - verified: boolean; - /** Verified At */ - verified_at?: string | null; - /** - * Zone Apex - * @default - */ - zone_apex: string; - }; - /** EmailDomainsListResponse */ - EmailDomainsListResponse: { - /** - * Can Add Custom - * @default false - */ - can_add_custom: boolean; - /** - * Can Add Vanity - * @default false - */ - can_add_vanity: boolean; - /** Custom Plan Names */ - custom_plan_names?: string[]; - /** Domains */ - domains?: components["schemas"]["EmailDomainResponse"][]; - /** - * Has Custom - * @default false - */ - has_custom: boolean; - /** - * Has Vanity - * @default false - */ - has_vanity: boolean; - /** Vanity Plan Names */ - vanity_plan_names?: string[]; - }; - /** - * EmailTriggerConfigResponse - * @description An EMAIL_RECEIVED trigger's resolved address(es) and config. - */ - EmailTriggerConfigResponse: { - /** - * Agent Id - * Format: uuid - */ - agent_id: string; - /** Email Addresses */ - email_addresses?: string[]; - /** Email Alias */ - email_alias?: string | null; - /** Email Allowed Senders */ - email_allowed_senders?: string[] | null; - /** - * Email Ignore Auto Generated - * @default true - */ - email_ignore_auto_generated: boolean; - /** - * Email Queue On Quota - * @default false - */ - email_queue_on_quota: boolean; - /** - * Email Require Sender Auth - * @default true - */ - email_require_sender_auth: boolean; - /** - * Trigger Id - * Format: uuid - */ - trigger_id: string; - /** Trigger Type */ - trigger_type: string; - }; - /** - * EmbeddingModalityRateResponse - * @description Per-modality rate for a multi-modal embedder. - * - * The default ``credits`` field on :class:`EmbeddingModelResponse` is the - * text rate (credits per ~1k English words). Embedders that index image or - * video chunks natively charge those modalities at a different rate and unit - * — e.g. Cohere Embed v4 prices images per record; Nova 2 Multimodal prices - * video per second. Surfacing the modality and unit lets a caller render an - * honest cost breakdown alongside the text rate. - */ - EmbeddingModalityRateResponse: { - /** - * Credits - * @description Rate value in the unit below - */ - credits: number; - /** - * Modality - * @description Modality kind, e.g. image / video - */ - modality: string; - /** - * Unit - * @description Billing unit for this rate (credit_per_record / credit_per_second / credit_per_1000_tokens). - */ - unit: string; - }; - /** - * EmbeddingModelListResponse - * @description Legacy (header-less) response shape for the embedder catalog. - */ - EmbeddingModelListResponse: { - /** - * Default Dimension - * @description Dimensions used with the default embedding model - */ - default_dimension?: number | null; - /** - * Default Model Type - * @description Embedding model used when a source does not override it - */ - default_model_type?: string | null; - /** - * File Processing Credits Per Mb - * @description Credits per MB for file processing at ingest - */ - file_processing_credits_per_mb: number; - /** - * Models - * @description Available embedding models - */ - models: components["schemas"]["EmbeddingModelResponse"][]; - /** - * Storage Credits - * @description Monthly storage credits per dimension count - */ - storage_credits: components["schemas"]["EmbeddingStorageCreditsResponse"][]; - }; - /** - * EmbeddingModelResponse - * @description Information about an embedding model. - */ - EmbeddingModelResponse: { - /** - * Credits - * @description Estimated credits per 1,000 English words - */ - credits: number; - /** - * Description - * @description Model description - */ - description?: string | null; - /** - * Dimensions - * @description Dimensions options - */ - dimensions: number[]; - /** - * Is New - * @description Whether the model is newly released - * @default false - */ - is_new: boolean; - /** - * Max Input Tokens - * @description Max input tokens per request - */ - max_input_tokens?: number | null; - /** - * Model Id - * @description Model identifier - */ - model_id: string; - /** - * Model Type - * @description Full model type identifier (enum value). This is the value to send as embedding_model when creating a source. - */ - model_type: string; - /** - * Mteb Retrieval Score - * @description MTEB retrieval score - */ - mteb_retrieval_score?: number | null; - /** - * Name - * @description Human-readable model name - */ - name?: string | null; - /** - * Per Modality Rates - * @description Non-text rates the vendor charges for this embedder (image, video, audio). Empty for text-only embedders. - */ - per_modality_rates?: components["schemas"]["EmbeddingModalityRateResponse"][]; - /** - * Provider - * @description Model provider identifier - */ - provider?: string | null; - /** - * Speed - * @description Model processing speed - */ - speed?: string | null; - /** - * Supported Input Media - * @description Modalities the embedder accepts on input (short kinds like text / image / video, or full MIMEs). null means text-only. A source only honours a media_types entry its embedder lists here. - */ - supported_input_media?: string[] | null; - /** - * Supported Languages - * @description Supported languages - */ - supported_languages?: string[] | null; - /** - * Url - * @description Model documentation URL - */ - url?: string | null; - }; - /** - * EmbeddingStorageCreditsResponse - * @description Monthly storage credits per stored record at a dimension count. - */ - EmbeddingStorageCreditsResponse: { - /** - * Credits - * @description Credits per record per month - */ - credits: number; - /** - * Dimensions - * @description Number of embedding dimensions - */ - dimensions: number; - }; - /** - * EvaluationCriteriaResponse - * @description Response schema for evaluation criteria. - */ - EvaluationCriteriaResponse: { - /** - * Account Id - * Format: uuid - */ - account_id: string; - /** - * Agent Id - * Format: uuid - */ - agent_id: string; - /** Created At */ - created_at: string; - /** Description */ - description: string | null; - /** Enabled */ - enabled: boolean; - /** - * Evaluation Mode - * @description Runtime behavior mode. output_expectation (manual validation), eval_and_retry (every run + retry), sample_and_flag (sampled monitoring). - */ - evaluation_mode: string; - /** Evaluation Prompt */ - evaluation_prompt: string | null; - /** Evaluation Tier */ - evaluation_tier: string | null; - /** Expectation Config */ - expectation_config: { - [key: string]: unknown; - } | null; - /** - * Id - * Format: uuid - */ - id: string; - /** Max Retries */ - max_retries: number; - /** - * Pass Threshold - * @description Score cutoff for pass/fail, inclusive (0.0 to 1.0). - */ - pass_threshold: number; - /** Result Summary */ - result_summary: { - [key: string]: number; - }; - /** Retry On Failure */ - retry_on_failure: boolean; - /** Step Id */ - step_id: string | null; - /** Updated At */ - updated_at: string; - }; - /** - * EvaluationResultListResponse - * @description Paginated list of evaluation results. - */ - EvaluationResultListResponse: { - /** Data */ - data: components["schemas"]["EvaluationResultResponse"][]; - /** Limit */ - limit: number; - /** Page */ - page: number; - /** Total */ - total: number; - }; - /** - * EvaluationResultResponse - * @description Response schema for a single evaluation result. - */ - EvaluationResultResponse: { - /** - * Agent Run Id - * Format: uuid - */ - agent_run_id: string; - /** Agent Step Run Id */ - agent_step_run_id: string | null; - /** Created At */ - created_at: string; - /** - * Criteria Id - * Format: uuid - */ - criteria_id: string; - /** - * Details - * @description Evaluation details including explanation and raw LLM response. - */ - details?: { - [key: string]: unknown; - } | null; - /** Evaluated At */ - evaluated_at: string; - /** - * Flagged - * @description True when the result was flagged for human review. - */ - flagged: boolean; - /** - * Id - * Format: uuid - */ - id: string; - /** Retry Count */ - retry_count: number; - /** Retry Triggered */ - retry_triggered: boolean; - /** - * Score - * @description LLM-assigned quality score between 0.0 (worst) and 1.0 (best). - */ - score?: number | null; - /** - * Status - * @description Outcome status: pending, passed, failed, skipped, or error. - */ - status: string; - }; - /** - * EvaluationResultSummaryResponse - * @description Aggregated pass/fail/error counts and average score for a criteria. - */ - EvaluationResultSummaryResponse: { - /** - * Average Score - * @description Mean score across all evaluated results, or null if none. - */ - average_score?: number | null; - /** Error */ - error: number; - /** Failed */ - failed: number; - /** Flagged */ - flagged: number; - /** Passed */ - passed: number; - /** Total */ - total: number; - }; - /** - * EvaluationResultWithCriteriaListResponse - * @description Paginated list of evaluation results with criteria context. - */ - EvaluationResultWithCriteriaListResponse: { - /** Data */ - data: components["schemas"]["EvaluationResultWithCriteriaResponse"][]; - /** Limit */ - limit: number; - /** Page */ - page: number; - /** Total */ - total: number; - }; - /** - * EvaluationResultWithCriteriaResponse - * @description Evaluation result including criteria context for aggregated listing. - */ - EvaluationResultWithCriteriaResponse: { - /** - * Agent Run Id - * Format: uuid - */ - agent_run_id: string; - /** Agent Step Run Id */ - agent_step_run_id: string | null; - /** Created At */ - created_at: string; - /** Criteria Description */ - criteria_description: string | null; - /** - * Criteria Id - * Format: uuid - */ - criteria_id: string; - /** - * Details - * @description Evaluation details including explanation and raw LLM response. - */ - details?: { - [key: string]: unknown; - } | null; - /** Evaluated At */ - evaluated_at: string; - /** - * Flagged - * @description True when the result was flagged for human review. - */ - flagged: boolean; - /** - * Id - * Format: uuid - */ - id: string; - /** Retry Count */ - retry_count: number; - /** Retry Triggered */ - retry_triggered: boolean; - /** - * Score - * @description LLM-assigned quality score between 0.0 (worst) and 1.0 (best). - */ - score?: number | null; - /** - * Status - * @description Outcome status: pending, passed, failed, skipped, or error. - */ - status: string; - /** Step Id */ - step_id: string | null; - }; - /** - * EvaluationRunSummaryListResponse - * @description Paginated list of per-run evaluation summaries. - */ - EvaluationRunSummaryListResponse: { - /** Data */ - data: components["schemas"]["EvaluationRunSummaryResponse"][]; - /** Limit */ - limit: number; - /** Page */ - page: number; - /** Total */ - total: number; - }; - /** - * EvaluationRunSummaryResponse - * @description Per-run evaluation summary with pass/fail/error breakdown. - */ - EvaluationRunSummaryResponse: { - /** - * Agent Run Id - * Format: uuid - */ - agent_run_id: string; - /** Error Count */ - error_count: number; - /** Failed Count */ - failed_count: number; - /** Flagged Count */ - flagged_count: number; - /** Passed Count */ - passed_count: number; - /** Run Created At */ - run_created_at: string; - /** - * Run Status - * @description Status of the agent run (processing, completed, failed). - */ - run_status: string; - /** Skipped Count */ - skipped_count: number; - /** Total Evaluations */ - total_evaluations: number; - }; - /** - * EvaluationStatus - * @description Result status of a single evaluation run. - * @enum {string} - */ - EvaluationStatus: "pending" | "passed" | "failed" | "skipped" | "error"; - ExamplePrompt: { - [key: string]: string; - }; - /** - * ExecutedActionResponse - * @description A single executed action result. - */ - ExecutedActionResponse: { - /** - * Action Type - * @description Type of the executed action. - */ - action_type: string; - /** - * Description - * @description Human-readable description. - */ - description: string; - /** - * Error - * @description Error message if failed. - */ - error?: string | null; - /** - * Needs Clarification - * @description True when the action paused for a clarifying question rather than failing. The created resource is kept and the question is in ``description``/``error``. - * @default false - */ - needs_clarification: boolean; - /** - * Resource Id - * @description ID of the affected resource. - */ - resource_id?: string | null; - /** - * Resource Type - * @description Type of the affected resource. - */ - resource_type?: string | null; - /** - * Success - * @description Whether the action succeeded. - * @default true - */ - success: boolean; - }; - /** ExperimentDetailResponse */ - ExperimentDetailResponse: { - /** Completed At */ - completed_at: string | null; - /** Created At */ - created_at: string; - /** - * Effort - * @description The reasoning effort each model was run at, by model ID. - */ - effort?: { - [key: string]: string; - }; - /** Error Message */ - error_message: string | null; - /** Evaluation Complexity */ - evaluation_complexity: string; - /** Evaluation Mode */ - evaluation_mode: string; - /** Evaluator Model Id */ - evaluator_model_id: string | null; - /** Id */ - id: string; - /** Include Step Output In Evaluation */ - include_step_output_in_evaluation: boolean; - /** Json Template */ - json_template: string | null; - /** Progress Current */ - progress_current: number | null; - /** Progress Message */ - progress_message: string | null; - /** Progress Total */ - progress_total: number | null; - /** Prompt */ - prompt: string; - /** Result Data */ - result_data: { - [key: string]: unknown; - } | null; - /** Selected Model Ids */ - selected_model_ids: string[]; - /** Selected Step Output */ - selected_step_output: string | null; - /** Started At */ - started_at: string | null; - /** Status */ - status: string; - /** System Prompt */ - system_prompt: string; - }; - /** - * ExperimentListResponse - * @description ``GET /models/playground/experiments`` legacy/default shape; 2026-07-27+ - * clients get the canonical ``{data, pagination}`` envelope. - */ - ExperimentListResponse: { - /** Experiments */ - experiments: components["schemas"]["ExperimentSummaryResponse"][]; - /** Total */ - total: number; - }; - /** ExperimentSummaryResponse */ - ExperimentSummaryResponse: { - /** Created At */ - created_at: string; - /** Evaluation Complexity */ - evaluation_complexity: string; - /** Evaluation Mode */ - evaluation_mode: string; - /** Id */ - id: string; - /** Selected Model Ids */ - selected_model_ids: string[]; - /** Status */ - status: string; - }; - /** - * ExportFormat - * @description Supported export file formats. - * @enum {string} - */ - ExportFormat: "jsonl" | "csv" | "parquet" | "zip"; - /** - * ExportListResponse - * @description Paginated list of export jobs. - */ - ExportListResponse: { - /** Data */ - data: unknown[]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** GenerateAgentStepsRequest */ - GenerateAgentStepsRequest: { - /** - * Agent Description - * @description Agent description for additional AI context. - */ - agent_description?: string | null; - /** - * Agent Steps - * @description Current agent step hierarchy for context when modifying. - */ - agent_steps?: { - [key: string]: unknown; - }[] | null; - /** - * Mode - * @description 'generate_full' to create from scratch, 'modify_workflow' to refine. - * @default generate_full - */ - mode: string; - /** - * Trigger Type - * @description Agent trigger type for context (e.g. 'dynamic_input', 'content_added'). - */ - trigger_type?: string | null; - /** - * User Input - * @description Natural language description of the desired agent workflow. - */ - user_input: string; - }; - /** GenerateAgentStepsResponse */ - GenerateAgentStepsResponse: { - /** - * Agent Config - * @description Suggested agent-level configuration, if any. - */ - agent_config?: { - [key: string]: unknown; - } | null; - /** - * Conversation Id - * @description Conversation turn ID for tracking. - */ - conversation_id: string; - /** - * Example Prompts - * @description Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given mode. - */ - example_prompts?: components["schemas"]["ExamplePrompt"][]; - /** - * Intent Assessment - * @description How the assistant interpreted the request: 'clear' when steps were generated, or an ask-path value (e.g. 'ambiguous_output', 'cannot_build') when it returned no steps and put a clarifying question or blocker in `note`. Mirrors the MCP surface so callers can distinguish a clarification pause from a hard failure. - */ - intent_assessment?: string | null; - /** - * Note - * @description AI explanation of the proposed workflow. - */ - note: string; - /** - * Steps - * @description Generated agent steps. - */ - steps: { - [key: string]: unknown; - }[]; - /** - * Success - * @description Whether steps were successfully generated. - */ - success: boolean; - }; - /** GenerateStepConfigRequest */ - GenerateStepConfigRequest: { - /** - * Agent Steps - * @description Current agent step hierarchy for context. - */ - agent_steps?: { - [key: string]: unknown; - }[] | null; - /** - * Current Config - * @description Current step configuration to refine, if any. - */ - current_config?: { - [key: string]: unknown; - } | null; - /** - * Step Id - * @description ID of the specific step to refine. Omit for new steps. - */ - step_id?: string | null; - /** - * Step Type - * @description The step type to generate config for (e.g. 'regex_replace', 'gate', 'text', 'prompt_call', 'retrieval'). - */ - step_type: string; - /** - * User Input - * @description Natural language description of what the step should do. - */ - user_input: string; - }; - /** GenerateStepConfigResponse */ - GenerateStepConfigResponse: { - /** - * Conversation Id - * @description Conversation turn ID for tracking. - */ - conversation_id: string; - /** - * Example Prompts - * @description Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given step type. - */ - example_prompts?: components["schemas"]["ExamplePrompt"][]; - /** - * Note - * @description AI explanation of the proposed configuration. - */ - note: string; - /** - * Resulting Config - * @description The proposed step configuration. - */ - resulting_config?: { - [key: string]: unknown; - } | null; - /** - * Step Type - * @description The step type that was generated. - */ - step_type: string; - /** - * Success - * @description Whether a valid configuration was generated. - */ - success: boolean; - }; - /** - * GenerationTierListResponse - * @description ``GET /models/generation-tiers`` legacy/default shape; 2026-07-27+ clients - * get the canonical ``{data, pagination}`` envelope. - */ - GenerationTierListResponse: { - /** Tiers */ - tiers: components["schemas"]["GenerationTierResponse"][]; - }; - /** GenerationTierResponse */ - GenerationTierResponse: { - /** Credits Per Unit */ - credits_per_unit: number | null; - /** Modality */ - modality: string; - /** Model Id */ - model_id: string; - /** Model Name */ - model_name: string; - /** Price Label */ - price_label: string | null; - /** Tier */ - tier: string; - /** Unit Label */ - unit_label: string | null; - }; - /** - * GovernanceAiAcceptResponse - * @description Response from accepting a governance AI assistant plan. - */ - GovernanceAiAcceptResponse: { - /** - * Actions Applied - * @description Results of each action that was executed. - */ - actions_applied: components["schemas"]["AppliedActionResponse"][]; - /** - * Conversation Id - * @description Conversation ID that was accepted. - */ - conversation_id: string; - /** - * Error - * @description Overall error message if the plan failed, or null. - */ - error?: string | null; - /** - * Success - * @description Whether all actions were applied successfully. - */ - success: boolean; - }; - /** - * GovernanceAiAssistantResponse - * @description Response from the governance AI assistant generate endpoint. - */ - GovernanceAiAssistantResponse: { - /** - * Conversation Id - * @description Conversation ID to accept or decline this plan. - */ - conversation_id: string; - /** - * Example Prompts - * @description Example natural-language prompts that demonstrate the capabilities of the governance AI assistant. - */ - example_prompts?: components["schemas"]["ExamplePrompt"][]; - /** - * Note - * @description AI-generated summary of the proposed changes. - */ - note: string; - /** - * Prompt Call Id - * @description Prompt call ID for credit tracking, or null. - */ - prompt_call_id?: string | null; - /** - * Proposed Actions - * @description Ordered list of policy actions the AI proposes to execute. - */ - proposed_actions: components["schemas"]["ProposedPolicyActionResponse"][]; - /** - * Success - * @description Whether the plan was generated successfully. - */ - success: boolean; - }; - /** HTTPValidationError */ - HTTPValidationError: { - /** Detail */ - detail?: components["schemas"]["ValidationError"][]; - }; - /** - * ImportFieldErrorModel - * @description Single agent_definition validation error with source position. - */ - ImportFieldErrorModel: { - /** - * Column - * @description 1-indexed column in `source`. - */ - column: number; - /** - * Line - * @description 1-indexed line in `source`. - */ - line: number; - /** - * Message - * @description Human-readable description of the problem. - */ - message: string; - /** - * Path - * @description Dotted path of the offending field, e.g. `agent.definition.child_steps[0].step_type`. - */ - path: string; - }; - /** - * ImportSkipResponse - * @description One item that was not applied during an agent import. - * - * Used as the element type for ``import_warnings`` on every - * response model that accepts an ``agent_definition`` payload. - * See ``services.agent_definition_import.AgentImportSkip`` for the - * full category list. - * - * Lives here (not on each router) so the authenticated and public - * API responses share one definition — keeping the shape that - * clients (UI modal, MCP, OpenAPI consumers) depend on aligned. - */ - ImportSkipResponse: { - /** - * Category - * @description The kind of item that was skipped or substituted: 'schedule', 'evaluation_criteria', 'alert_config', 'alert_recipient', 'governance_policy', 'governance_kb_link', 'solution_link'. - */ - category: string; - /** - * Details - * @description Category-specific identifiers for the skipped item (step_id, alert_type, kb_name, etc.). Stable keys per category; absent keys are simply not applicable. - */ - details?: { - [key: string]: unknown; - }; - /** - * Message - * @description Human-readable explanation of what was skipped and why. - */ - message: string; - }; - /** - * InboundEmailRejectionResponse - * @description An inbound email that was discarded without running an agent. - */ - InboundEmailRejectionResponse: { - /** Agent Id */ - agent_id: string | null; - /** Created At */ - created_at: string; - /** - * Id - * Format: uuid - */ - id: string; - /** Message Id */ - message_id: string | null; - /** Reason */ - reason: string; - /** Recipient */ - recipient: string; - /** Sender */ - sender: string; - /** Sender Ip */ - sender_ip: string | null; - /** Subject */ - subject: string | null; - }; - /** InboundEmailStatusResponse */ - InboundEmailStatusResponse: { - /** Paused */ - paused: boolean; - /** Queued Backlog */ - queued_backlog: number; - }; - /** - * InlineTextReplaceRequest - * @description Request model for inline text content replacement. - */ - InlineTextReplaceRequest: { - /** - * Content Type - * @description MIME type for the text content - * @default text/plain - */ - content_type: string | null; - /** - * Metadata - * @description Optional metadata object - */ - metadata?: { - [key: string]: unknown; - } | null; - /** - * Text - * @description Text content to upload - */ - text: string; - /** - * Title - * @description Optional title - */ - title?: string | null; - }; - /** - * InlineTextUploadRequest - * @description Request model for inline text uploads. - */ - InlineTextUploadRequest: { - /** - * Content Type - * @description MIME type for the text content - * @default text/plain - */ - content_type: string | null; - /** - * Metadata - * @description Optional metadata object - */ - metadata?: { - [key: string]: unknown; - } | null; - /** - * Text - * @description Text content to upload - */ - text: string; - /** - * Title - * @description Optional title - */ - title?: string | null; - }; - /** - * InsufficientCreditsDetail - * @description ``detail`` body for a 402 ``insufficient_credits`` response. - */ - InsufficientCreditsDetail: { - /** - * Account Id - * @description UUID of the account that ran out of credits. - */ - account_id: string; - /** - * Error - * @description Stable machine-readable error code. - * @constant - */ - error: "insufficient_credits"; - /** - * Message - * @description Human-readable explanation. - */ - message: string; - }; - /** - * InsufficientCreditsResponse - * @description 402 envelope returned when the account has exhausted its credits. - */ - InsufficientCreditsResponse: { - detail: components["schemas"]["InsufficientCreditsDetail"]; - }; - JsonValue: unknown; - /** - * KnowledgeBaseListResponseModel - * @description Paginated list of knowledge bases. - */ - KnowledgeBaseListResponseModel: { - /** - * Knowledge Bases - * @description List of knowledge bases on this page. - */ - knowledge_bases: components["schemas"]["KnowledgeBaseResponseModel"][]; - /** - * Limit - * @description Items per page. - */ - limit: number; - /** - * Page - * @description Current page number (1-based). - */ - page: number; - /** - * Total - * @description Total number of knowledge bases. - */ - total: number; - }; - /** - * KnowledgeBase - * @description Response model for a single knowledge base. - */ - KnowledgeBaseResponseModel: { - /** - * Created At - * @description ISO-8601 creation timestamp. - */ - created_at: string; - /** - * Default Score Threshold - * @description Editor default for a new retrieval step's Minimum Rerank Score. - */ - default_score_threshold?: number | null; - /** - * Default Top K - * @description Editor default for a new retrieval step's Top K. - */ - default_top_k?: number | null; - /** - * Default Top N - * @description Editor default for a new retrieval step's Top N. - */ - default_top_n?: number | null; - /** - * Description - * @description Optional description. - */ - description?: string | null; - /** - * Id - * @description Unique knowledge base identifier. - */ - id: string; - /** - * Name - * @description Human-readable name. - */ - name: string; - /** - * Readonly - * @description Whether the knowledge base is read-only. - * @default false - */ - readonly: boolean; - /** - * Reranker Model - * @description Reranker model in use. - */ - reranker_model?: string | null; - /** - * Sources - * @description Linked source connections. - */ - sources?: components["schemas"]["SourceConnectionResponseModel"][]; - /** - * Updated At - * @description ISO-8601 last-update timestamp. - */ - updated_at: string; - }; - /** LinkResourcesRequest */ - LinkResourcesRequest: { - /** - * Ids - * @description Resource IDs to link - */ - ids: string[]; - }; - /** MarkAiSuggestionRequest */ - MarkAiSuggestionRequest: { - /** - * Accepted - * @description True to accept the suggestion, false to decline it. - */ - accepted: boolean; - }; - /** MarkConversationTurnRequest */ - MarkConversationTurnRequest: { - /** - * Accepted - * @description Whether the suggestion was accepted - */ - accepted: boolean; - }; - /** MeResponse */ - MeResponse: { - /** - * Account Id - * Format: uuid - */ - account_id: string; - /** Organizations */ - organizations: components["schemas"]["OrganizationInfoResponse"][]; - }; - /** - * MemoryBankAiAssistantResponse - * @description Response from the memory bank AI assistant. - */ - MemoryBankAiAssistantResponse: { - /** @description Proposed configuration, or null. */ - config?: components["schemas"]["MemoryBankConfigResponse"] | null; - /** - * Conversation Id - * @description Conversation ID for follow-up. - */ - conversation_id: string; - /** - * Example Prompts - * @description Example natural-language prompts that demonstrate the capabilities of the memory bank AI assistant. - */ - example_prompts?: components["schemas"]["ExamplePrompt"][]; - /** - * Note - * @description AI-generated explanation. - */ - note: string; - /** - * Prompt Call Id - * @description Prompt call ID for credit tracking. - */ - prompt_call_id?: string | null; - /** - * Success - * @description Whether generation succeeded. - * @default false - */ - success: boolean; - }; - /** - * MemoryBankConfigResponse - * @description Suggested memory bank configuration from the AI assistant. - */ - MemoryBankConfigResponse: { - /** - * Compaction Prompt - * @description Suggested compaction prompt. - */ - compaction_prompt?: string | null; - /** - * Description - * @description Suggested description. - */ - description?: string | null; - /** - * Max Age Days - * @description Always null. Age-based compaction is retired — the assistant never suggests it. Kept so an SDK generated before the change still validates this response. - */ - max_age_days?: number | null; - /** - * Max Size Tokens - * @description Max size in tokens. - */ - max_size_tokens?: number | null; - /** - * Max Turns - * @description Max conversation turns. - */ - max_turns?: number | null; - /** - * Mode - * @description Memory bank mode. - */ - mode: string; - /** - * Name - * @description Suggested name. - */ - name: string; - /** - * Retention Days - * @description Retention in days. - */ - retention_days?: number | null; - /** - * Type - * @description Memory bank type: conversation or general. - */ - type: string; - }; - /** - * MemoryBankListResponseModel - * @description Paginated list of memory banks. - */ - MemoryBankListResponseModel: { - /** - * Limit - * @description Items per page. - */ - limit: number; - /** - * Memory Banks - * @description List of memory banks on this page. - */ - memory_banks: components["schemas"]["MemoryBankResponseModel"][]; - /** - * Page - * @description Current page number (1-based). - */ - page: number; - /** - * Total - * @description Total number of memory banks. - */ - total: number; - }; - /** - * MemoryBank - * @description Response model for a single memory bank. - */ - MemoryBankResponseModel: { - /** - * Chunk Overlap - * @description Character overlap between chunks. - */ - chunk_overlap?: number | null; - /** - * Chunk Size - * @description Characters per chunk. - */ - chunk_size?: number | null; - /** - * Compaction Prompt - * @description Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted. - */ - compaction_prompt?: string | null; - /** - * Created At - * @description ISO-8601 creation timestamp. - */ - created_at: string; - /** - * Description - * @description Optional description of the memory bank's purpose. - */ - description?: string | null; - /** - * Dimensions - * @description Vector embedding dimensions. - */ - dimensions?: number | null; - /** - * Embedding Model - * @description Embedding model identifier. - */ - embedding_model?: string | null; - /** - * Id - * @description Unique memory bank identifier. - */ - id: string; - /** - * Max Age Days - * @description DEPRECATED and no longer applied. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Always null for clients sending Seclai-Version 2026-08-03 or later; older clients keep reading whatever value was stored. - */ - max_age_days?: number | null; - /** - * Max Size Tokens - * @description Max total tokens (per partition) before compaction. Checked both inline after each write and by the hourly background sweep. - */ - max_size_tokens?: number | null; - /** - * Max Turns - * @description Max conversation turns (per partition) before compaction. Checked both inline after each write and by the hourly background sweep. - */ - max_turns?: number | null; - /** - * Mode - * @description Embedding mode: fast_and_cheap, balanced, slow_and_thorough, or custom. - */ - mode: string; - /** - * Name - * @description Human-readable name. - */ - name: string; - /** - * Retention Days - * @description Content retention period in days (null = indefinite). - */ - retention_days?: number | null; - /** - * Source Connection Id - * @description Linked content source ID (null if not yet provisioned). - */ - source_connection_id?: string | null; - /** - * Strip Quoted Reply Chains - * @description Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation. - * @default false - */ - strip_quoted_reply_chains: boolean; - /** - * Type - * @description Bank type: conversation (chat-turn with speaker) or general (flat entries). - */ - type: string; - /** - * Updated At - * @description ISO-8601 last-update timestamp. - */ - updated_at: string; - }; - /** - * ModalityRateResponse - * @description Per-modality rate for an LLM that prices image/audio/video output - * (or input) at a rate distinct from the default text rate. - * - * Example: Gemini 3.1 Flash Image charges $3/1M output tokens for - * text but $60/1M output tokens for generated images. The image rate - * surfaces here with ``modality="image"`` and ``output_credits_per_1000_tokens`` - * set; the default text rate stays on the parent model fields. - */ - ModalityRateResponse: { - /** Input Credits Per 1000 Tokens */ - input_credits_per_1000_tokens?: number | null; - /** Modality */ - modality: string; - /** Output Credits Per 1000 Tokens */ - output_credits_per_1000_tokens?: number | null; - }; - /** - * OkResponse - * @description A minimal ``{"ok": true}`` acknowledgement for state-mutating actions - * that have no richer resource to return (e.g. accept/decline a suggestion). - */ - OkResponse: { - /** Ok */ - ok: boolean; - }; - /** OrganizationAlertPreferenceListResponse */ - OrganizationAlertPreferenceListResponse: { - /** Preferences */ - preferences: components["schemas"]["routers__api__alerts__OrganizationAlertPreferenceResponse"][]; - /** Total */ - total: number; - }; - /** OrganizationInfoResponse */ - OrganizationInfoResponse: { - /** - * Account Id - * Format: uuid - */ - account_id: string; - /** - * Id - * Format: uuid - */ - id: string; - /** Name */ - name: string; - }; - /** - * PaginationResponse - * @description Pagination information. - */ - PaginationResponse: { - /** Has Next */ - has_next: boolean; - /** Has Prev */ - has_prev: boolean; - /** Limit */ - limit: number; - /** Page */ - page: number; - /** Pages */ - pages: number; - /** Total */ - total: number; - }; - /** - * PendingProcessingCompletedFailedStatus - * @enum {string} - */ - PendingProcessingCompletedFailedStatus: "pending" | "processing" | "completed" | "failed" | "queued" | "waiting_human" | "waiting_scheduled"; - /** - * PlaygroundCreateRequest - * @description Create a model playground experiment via the public API. - */ - PlaygroundCreateRequest: { - /** - * Effort - * @description Reasoning effort per model id, each one of that model's `effort_options` values. Not combinable with `json_template`. - */ - effort?: { - [key: string]: string; - } | null; - /** - * Evaluation Complexity - * @description simple, medium, or complex - * @default medium - * @enum {string} - */ - evaluation_complexity: "simple" | "medium" | "complex"; - /** - * Evaluation Mode - * @description manual or prompt - * @default manual - * @enum {string} - */ - evaluation_mode: "manual" | "prompt"; - /** - * Evaluator Model Id - * @description Evaluator model ID when evaluation_mode is prompt. - */ - evaluator_model_id?: string | null; - /** - * Include Step Output In Evaluation - * @description Whether to include selected step output as evaluator context. - * @default false - */ - include_step_output_in_evaluation: boolean; - /** - * Json Template - * @description Optional JSON template for advanced mode. - */ - json_template?: string | null; - /** - * Model Ids - * @description Selected model IDs (1-10). - */ - model_ids: string[]; - /** - * Prompt - * @description Prompt text for the experiment. - */ - prompt: string; - /** - * Selected Step Output - * @description Optional step output text for evaluator context. - */ - selected_step_output?: string | null; - /** - * System Prompt - * @description Optional system prompt. - * @default - */ - system_prompt: string; - }; - /** - * PromptModelAutoUpgradeStrategy - * @enum {string} - */ - PromptModelAutoUpgradeStrategy: "none" | "early_adopter" | "middle_of_road" | "cautious_adopter"; - /** - * PromptToolResponse - * @description Response model for a prompt tool. - */ - PromptToolResponse: { - /** Description */ - description?: string | null; - /** Documentation Url */ - documentation_url?: string | null; - /** Example */ - example?: string | null; - /** Headers */ - headers?: { - [key: string]: string; - } | null; - /** Id */ - id: string; - /** Name */ - name: string; - /** Notes */ - notes?: string | null; - /** Tool Name */ - tool_name?: string | null; - /** Tool Type */ - tool_type: string; - /** Tool Type Pattern */ - tool_type_pattern?: string | null; - }; - /** - * ProposedActionResponse - * @description A single proposed action. - */ - ProposedActionResponse: { - /** - * Action Type - * @description Type of the proposed action. - */ - action_type: string; - /** - * Description - * @description Human-readable description of the action. - */ - description: string; - /** - * Is Destructive - * @description Whether the action is destructive. - * @default false - */ - is_destructive: boolean; - /** - * Params - * @description Parameters for the action. - */ - params: { - [key: string]: unknown; - }; - /** - * Preview - * @description Planning-time dry-run preview attached by the solution AI assistant for create_agent / update_agent actions. Contains ``steps`` (the generated step tree), ``step_count``, ``warnings`` (a mix of heuristic structural issues — e.g. brittle JSONPath, pass-through ``regex_replace``, ``prompt_call`` missing a model — and deterministic resource-usage issues: every pre-bound knowledge base / memory bank must be referenced by at least one step, and no step may reference an unknown id), and ``skipped`` / ``skipped_reason`` when preview couldn't run (e.g. the action depends on resources created earlier in the same plan). ``None`` for non-agent actions or when generation failed. - */ - preview?: { - [key: string]: unknown; - } | null; - }; - /** - * ProposedPolicyActionResponse - * @description A single proposed governance policy action. - */ - ProposedPolicyActionResponse: { - /** - * Action Type - * @description Type of action: create, update, delete, enable, or disable. - */ - action_type: string; - /** - * Description - * @description Human-readable description of what this action will do. - */ - description: string; - /** - * Params - * @description Parameters for the action (e.g. policy_document_id, thresholds). - */ - params: { - [key: string]: unknown; - }; - }; - /** RemoveEmailDomainResponse */ - RemoveEmailDomainResponse: { - /** Cleanup Note */ - cleanup_note?: string | null; - /** - * Removed - * @default true - */ - removed: boolean; - }; - /** - * RerankerModelListResponse - * @description Legacy (header-less) response shape for the reranker catalog. - */ - RerankerModelListResponse: { - /** - * Default Model Type - * @description Reranker used when a knowledge base does not choose one - */ - default_model_type: string; - /** - * Models - * @description Available reranker models - */ - models: components["schemas"]["RerankerModelResponse"][]; - /** - * Search Processing Credits - * @description Credits charged for processing a search request - */ - search_processing_credits: number; - }; - /** - * RerankerModelResponse - * @description Information about a reranker model. - */ - RerankerModelResponse: { - /** - * Credits Per Action - * @description Credits charged per rerank action - */ - credits_per_action: number; - /** - * Description - * @description Model description - */ - description?: string | null; - /** - * Is Default - * @description Whether this is the platform default reranker - */ - is_default: boolean; - /** - * Is New - * @description Whether the model is newly released - * @default false - */ - is_new: boolean; - /** - * Max Input Tokens - * @description Max input tokens per request - */ - max_input_tokens?: number | null; - /** - * Model Type - * @description Full model type identifier. This is the value to send as reranker_model on a knowledge base; send "none" or an empty string to disable reranking. - */ - model_type: string; - /** - * Name - * @description Human-readable model name - */ - name: string; - /** - * Provider - * @description Model provider identifier - */ - provider?: string | null; - /** - * Supported Languages - * @description Supported languages - */ - supported_languages?: string[] | null; - /** - * Url - * @description Model documentation URL - */ - url?: string | null; - }; - /** ResumeInboundResponse */ - ResumeInboundResponse: { - /** Resumed */ - resumed: boolean; - }; - /** SendTestEmailResponse */ - SendTestEmailResponse: { - /** - * Sent - * @default true - */ - sent: boolean; - }; - /** ServiceUnavailableError */ - ServiceUnavailableError: { - error: { - /** @enum {string} */ - code: "database_unavailable" | "vector_store_unavailable"; - message: string; - }; - }; - /** - * SetAutoBlockModeRequest - * @description Set the account's governance auto-block mode (shared REST request). - */ - SetAutoBlockModeRequest: { - /** Mode */ - mode: string; - }; - /** SolutionSourceConnectionResponse */ - SolutionSourceConnectionResponse: { - /** - * Id - * Format: uuid - */ - id: string; - /** Name */ - name: string; - }; - /** - * SolutionSummaryResponse - * @description Response model for solution summary. - */ - SolutionSummaryResponse: { - /** - * Agent Count - * @description Number of linked agents. - */ - agent_count: number; - /** - * Created At - * @description Timestamp when the solution was created. - */ - created_at: string; - /** - * Description - * @description Description of the solution. - */ - description: string; - /** - * Id - * Format: uuid - * @description Unique identifier for the solution. - */ - id: string; - /** - * Knowledge Base Count - * @description Number of linked knowledge bases. - */ - knowledge_base_count: number; - /** - * Memory Bank Count - * @description Number of linked memory banks. - */ - memory_bank_count: number; - /** - * Name - * @description Name of the solution. - */ - name: string; - /** - * Source Connection Count - * @description Number of linked source connections. - */ - source_connection_count: number; - /** - * Updated At - * @description Timestamp when the solution was last updated. - */ - updated_at: string; - }; - /** - * SourceConnectionResponseModel - * @description Nested source connection summary within a knowledge base response. - */ - SourceConnectionResponseModel: { - /** - * Id - * @description Source connection identifier. - */ - id: string; - /** - * Name - * @description Source connection name. - */ - name: string; - /** - * Polling - * @description Polling configuration. - */ - polling?: string | null; - /** - * Source Type - * @description Type of source (rss, website, etc.). - */ - source_type: string; - /** - * Url - * @description Source URL. - */ - url: string; - }; - /** - * SourceContentStatusListResponse - * @description Response model for a paginated per-item indexing status list. - */ - SourceContentStatusListResponse: { - /** Data */ - data: components["schemas"]["SourceContentStatusResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * SourceContentStatusResponse - * @description Response model for one content item's indexing status. - */ - SourceContentStatusResponse: { - /** - * Awaiting Reindex - * @description True when the item is linked and reports completed but its content is not yet embedded under the index the source connection currently uses, because it still sits under the index that connection used before an embedding migration switched it. Anything ingested while a migration ran can land in this state. Semantic and content search will not match it until it is re-embedded; a title keyword match can still return it, so the item may appear in results while its body is unsearchable. It clears on its own — a reconciliation pass re-embeds the item under the current index, typically within minutes of the migration finishing, and a daily sweep retries whatever is still outstanding, so a large backlog can take more than one sweep to drain. The re-embedding is not charged to your account: nothing you did caused it, so Seclai absorbs the cost. Never true for an item that is simply still indexing; content_status covers that. - * @default false - */ - awaiting_reindex: boolean; - /** - * Content Status - * @description Indexing status: pending, fetching, transcribing, scanning, indexing, completed, or failed. - */ - content_status: string; - /** - * Content Token Count - * @description Extracted token count. - */ - content_token_count: number | null; - /** - * Content Type - * @description Content type group: text, audio, video, image, or document. - */ - content_type: string; - /** - * Content Url - * @description Internal URL identifying the item. Uploaded files use a `file-upload://` URL. - */ - content_url: string | null; - /** - * Content Version Id - * @description ID of the content version. This is the `content_version_id` returned by the upload endpoints, so it is what you match an upload against. - */ - content_version_id: string; - /** - * Content Word Count - * @description Extracted word count. - */ - content_word_count: number | null; - /** - * Error - * @description Why the item failed, when `content_status` is `failed`. - */ - error: string | null; - /** - * Extracted Media Capped - * @description True when extraction stopped with media still unread, so the item references more media than was indexed and media search will not match anything past the cut. Two causes: a web page that ran out of the budget for fetching remote assets, or a container that could not be read to the end (a truncated or hostile archive). An uploaded document that reads cleanly is never capped, however much media it holds — there is no limit on that. - * @default false - */ - extracted_media_capped: boolean; - /** - * Extracted Media Count - * @description Number of embedded images / videos extracted from inside this item and indexed as their own chunks. There is no limit on this — a document contributes as many as it holds. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container, or found nothing. Treat null as 'unknown', never as zero. - */ - extracted_media_count?: number | null; - /** - * Extracted Media Limit - * @description The bound that was reached, when extracted_media_capped is true and the stop was a bound — a number of fetch attempts, or a number of seconds. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired. - */ - extracted_media_limit?: number | null; - /** - * Indexed At - * @description Timestamp when the item finished indexing and became retrievable. `null` until then. - */ - indexed_at: string | null; - /** - * Mime Type - * @description MIME type the item was ingested as, when known. - */ - mime_type: string | null; - /** - * Published At - * @description Publication timestamp of the item, when known. - */ - published_at: string | null; - /** - * Pulled At - * @description Timestamp when the item was uploaded or pulled. - */ - pulled_at: string; - /** - * Source Connection Content Version Id - * @description ID to pass to `GET /contents/{id}`. `null` until the item has finished indexing — an item that is still processing, or that failed, has no retrievable content and keeps this `null`. - */ - source_connection_content_version_id: string | null; - /** - * Title - * @description Title of the content item. - */ - title: string | null; - }; - /** - * SourceEmbeddingMigrationResponse - * @description Response model for source embedding migration status. - */ - SourceEmbeddingMigrationResponse: { - /** Completed At */ - completed_at: string | null; - /** Created At */ - created_at: string; - /** Failure Message */ - failure_message: string | null; - /** Id */ - id: string; - /** Notification Recipients */ - notification_recipients: string[] | null; - /** Phase */ - phase: string; - /** Progress Current */ - progress_current: number; - /** Progress Message */ - progress_message: string | null; - /** Progress Total */ - progress_total: number; - /** Source Connection Id */ - source_connection_id: string; - /** Source Id New */ - source_id_new: string; - /** Source Id Old */ - source_id_old: string; - /** Started At */ - started_at: string | null; - /** Status */ - status: string; - /** Target Dimensions */ - target_dimensions: number; - /** Target Embedding Model */ - target_embedding_model: string; - /** Task Execution Id */ - task_execution_id: string | null; - /** Updated At */ - updated_at: string; - }; - /** - * SourceIndexMode - * @description Embedding quality / cost trade-off preset for custom_index sources. - * - * Each preset controls the default embedding dimensions, chunk size, and - * chunk overlap. The embedding model is always the account-level default - * (currently ``AWS_BEDROCK_AMAZON_NOVA_2_MULTIMODAL``). - * - * Presets: - * FAST_AND_CHEAP: 256 dimensions, 3 000 char chunks, 500 char overlap. - * BALANCED: 384 dimensions, 1 500 char chunks, 300 char overlap. - * SLOW_AND_THOROUGH: 1 024 dimensions, 1 000 char chunks, 200 char overlap. - * CUSTOM: Caller supplies embedding model, dimensions, and chunk config. - * @enum {string} - */ - SourceIndexMode: "fast_and_cheap" | "balanced" | "slow_and_thorough" | "custom"; - /** - * SourceResponse - * @description Response model for source data. - */ - SourceResponse: { - /** - * Account Id - * Format: uuid - * @description Account ID associated with the source. - */ - account_id: string; - /** - * Avg Episodes Per Month - * @description Average number of episodes per month. - */ - avg_episodes_per_month?: number | null; - /** - * Avg Words Per Episode - * @description Average number of words per episode. - */ - avg_words_per_episode?: number | null; - /** - * Chunk Language - * @description Language used for chunking content. - */ - chunk_language?: string | null; - /** - * Chunk Overlap - * @description Chunk overlap for content processing. - */ - chunk_overlap?: number | null; - /** - * Chunk Regex Separators - * @description Indicates if chunk separators are regex patterns. - */ - chunk_regex_separators?: boolean | null; - /** - * Chunk Separators - * @description Chunk separators used for content processing. - */ - chunk_separators?: string | null; - /** - * Chunk Size - * @description Chunk size for content processing. - */ - chunk_size?: number | null; - /** - * Content Count - * @description Number of content items associated with the source connection. - * @default 0 - */ - content_count: number; - /** - * Content Filter - * @description Content filter for the source connection. - */ - content_filter: string; - /** - * Created At - * @description Timestamp when the source connection was created. - */ - created_at: string; - /** - * Dimensions - * @description Dimensions of the embedding model. - */ - dimensions?: number | null; - /** - * Embedding Model - * @description Embedding model used for the source connection. - */ - embedding_model?: string | null; - /** - * Embedding Model Type - * @description Type of the embedding model. - */ - embedding_model_type?: string | null; - /** - * Free Retention Days - * @description Number of days content is stored for free before billing applies. - */ - free_retention_days?: number | null; - /** - * Has Historical Data - * @description Indicates if the source connection has historical data. - * @default false - */ - has_historical_data: boolean; - /** - * Id - * @description Unique identifier for the source connection. - */ - id: string; - /** @description Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom. */ - index_mode?: components["schemas"]["SourceIndexMode"] | null; - /** - * Media Types - * @description Media kinds extracted from indexed content and embedded as multi-modal KB chunks (subset of ['images', 'video']). Empty = text-only. - */ - media_types?: string[]; - /** - * Name - * @description Name of the source connection. - */ - name: string; - /** - * Next Poll At - * @description Timestamp for the next scheduled poll. - */ - next_poll_at: string | null; - /** - * Polling - * @description Polling configuration for the source connection. - */ - polling: string | null; - /** - * Polling Action - * @description Polling action for the source connection. - */ - polling_action: string | null; - /** - * Polling Max Items - * @description Maximum items to poll for the source connection. - */ - polling_max_items: number | null; - /** - * Pulled At - * @description Timestamp when content was last pulled. - */ - pulled_at: string | null; - /** - * Readonly - * @description Indicates if the source connection is read-only. - * @default false - */ - readonly: boolean; - /** - * Retention - * @description Retention period for the source connection. - */ - retention: number | null; - /** - * Source Type - * @description Type of the source connection. - */ - source_type: string; - /** - * System Managed - * @description Indicates if this source is automatically managed by the system (e.g., agent traces). - * @default false - */ - system_managed: boolean; - /** - * Updated At - * @description Timestamp when the source connection was last updated. - */ - updated_at: string; - /** - * Url - * @description URL of the source connection. - */ - url: string | null; - }; - /** - * StandaloneTestCompactionRequest - * @description Request body for testing a compaction prompt *without* an existing bank. - * - * Used on the create-memory-bank page where no bank ID exists yet. - * ``compaction_prompt`` is required (no bank to fall back to). - * Content must come from ``sample_entries`` or ``generate_direction`` - * (no existing entries to fetch). - */ - StandaloneTestCompactionRequest: { - /** - * Bank Type - * @description Memory bank type ('conversation' or 'general') — controls the style of generated entries. - * @default conversation - */ - bank_type: string; - /** - * Compaction Prompt - * @description Compaction prompt to test. - */ - compaction_prompt: string; - /** - * Entry Count - * @description Number of entries to generate when using generate_direction. - * @default 5 - */ - entry_count: number; - /** - * Generate Direction - * @description Direction for the LLM to generate sample entries. - */ - generate_direction?: string | null; - /** - * Sample Entries - * @description Explicit sample entries to compact. - */ - sample_entries?: string[] | null; - }; - /** - * StartSourceEmbeddingMigrationRequest - * @description Request payload to start a source embedding migration. - */ - StartSourceEmbeddingMigrationRequest: { - /** - * Chunk Language - * @description Language-specific chunking language code - */ - chunk_language?: string | null; - /** - * Chunk Overlap - * @description Override chunk overlap (characters) - */ - chunk_overlap?: number | null; - /** - * Chunk Regex Separators - * @description Whether chunk separators are regex patterns - */ - chunk_regex_separators?: boolean | null; - /** - * Chunk Separators - * @description Custom chunk separators (JSON-encoded list) - */ - chunk_separators?: string | null; - /** - * Chunk Size - * @description Override chunk size (characters per chunk) - */ - chunk_size?: number | null; - /** - * Notification Recipients - * @description Optional notification recipient emails - */ - notification_recipients?: string[] | null; - /** - * Target Dimensions - * @description Target embedding dimensions - */ - target_dimensions: number; - /** - * Target Embedding Model - * @description Target embedding model — a `model_type` from `GET /models/embedders`, which also reports the `dimensions` each embedder supports and the modalities it can index. - */ - target_embedding_model: string; - }; - /** - * TestCompactionRequest - * @description Request body for testing a compaction prompt against an existing bank. - * - * The user may supply a ``compaction_prompt`` to override (or provide when - * the bank has none). Content can come from three sources: - * - * 1. Existing entries in the bank (default when neither field is set). - * 2. ``sample_entries`` – caller-provided list of strings. - * 3. ``generate_direction`` – an instruction to the LLM to generate sample - * memory entries. Useful for trying a prompt before any real data - * exists. - * - * At most one of ``sample_entries`` / ``generate_direction`` may be given. - */ - TestCompactionRequest: { - /** - * Compaction Prompt - * @description Compaction prompt to test. Falls back to the bank's current prompt when omitted. - */ - compaction_prompt?: string | null; - /** - * Entry Count - * @description Number of entries to generate when using generate_direction. - * @default 5 - */ - entry_count: number; - /** - * Generate Direction - * @description Direction for the LLM to generate sample entries (e.g. 'Generate 5 entries about a customer support interaction'). - */ - generate_direction?: string | null; - /** - * Sample Entries - * @description Explicit sample entries to compact. - */ - sample_entries?: string[] | null; - }; - /** - * TestDraftEvaluationRequest - * @description Request body for ephemeral (non-persisted) evaluation testing. - * - * Provide either ``step_output`` (raw text) **or** ``agent_step_run_id`` - * (to load output from storage). Exactly one must be supplied. - */ - TestDraftEvaluationRequest: { - /** - * Agent Input - * @description The original agent run input for context. When agent_step_run_id is supplied this is loaded automatically from the parent run if omitted. - */ - agent_input?: string | null; - /** - * Agent Step Run Id - * @description Load step output from this completed step run instead of supplying text. - */ - agent_step_run_id?: string | null; - /** Evaluation Prompt */ - evaluation_prompt?: string | null; - evaluation_tier?: components["schemas"]["AgentEvaluationTier"] | null; - /** Expectation Config */ - expectation_config?: { - [key: string]: unknown; - } | null; - /** - * Pass Threshold - * @default 0.5 - */ - pass_threshold: number; - /** - * Step Output - * @description The step output text to evaluate. Omit if agent_step_run_id is supplied. - */ - step_output?: string | null; - }; - /** - * TestDraftEvaluationResponse - * @description Response for an ephemeral evaluation test. - */ - TestDraftEvaluationResponse: { - /** Explanation */ - explanation: string | null; - /** Passed */ - passed: boolean; - /** Score */ - score: number; - }; - /** UnlinkResourcesRequest */ - UnlinkResourcesRequest: { - /** - * Ids - * @description Resource IDs to unlink - */ - ids: string[]; - }; - /** UnreadCountResponse */ - UnreadCountResponse: { - /** Count */ - count: number; - }; - /** UpdateAgentDefinitionRequest */ - UpdateAgentDefinitionRequest: { - /** - * Definition - * @description The full agent definition (name, description, tags, steps). Steps form a tree workflow. Each step has a `step_type`, `id`, `name`, and type-specific config. Content enrichment steps (write_metadata, write_content_attachment, load_content_attachment, load_content) require content-triggered agents. - */ - definition: { - [key: string]: unknown; - }; - /** - * Expected Change Id - * @description The change_id from the last GET, for optimistic locking. - */ - expected_change_id: string; - }; - /** UpdateAlertConfigRequest */ - UpdateAlertConfigRequest: { - /** - * Cooldown Minutes - * @description Cooldown period in minutes - */ - cooldown_minutes?: number | null; - /** - * Distribution Type - * @description Distribution type - */ - distribution_type?: string | null; - /** - * Enabled - * @description Whether the alert config is enabled - */ - enabled?: boolean | null; - /** - * Recipient User Ids - * @description User IDs for selected_members distribution - */ - recipient_user_ids?: string[] | null; - /** - * Threshold - * @description Threshold configuration - */ - threshold?: { - [key: string]: unknown; - } | null; - }; - /** UpdateApiVersionRequest */ - UpdateApiVersionRequest: { - /** - * Version - * @description A YYYY-MM-DD date to pin the account to, or null to clear the pin (revert to the default baseline). - */ - version?: string | null; - }; - /** - * UpdateEvaluationCriteriaRequest - * @description Request body for updating an evaluation criteria. - * - * Retry settings and sample frequency are set at the agent level. - */ - UpdateEvaluationCriteriaRequest: { - /** Description */ - description?: string | null; - /** Enabled */ - enabled?: boolean | null; - /** Evaluation Prompt */ - evaluation_prompt?: string | null; - evaluation_tier?: components["schemas"]["AgentEvaluationTier"] | null; - /** Expectation Config */ - expectation_config?: { - [key: string]: unknown; - } | null; - /** Pass Threshold */ - pass_threshold?: number | null; - /** Step Id */ - step_id?: string | null; - }; - /** - * UpdateKnowledgeBaseBody - * @description Request body for updating a knowledge base. - */ - UpdateKnowledgeBaseBody: { - /** - * Default Score Threshold - * @description Prefilled into Minimum Rerank Score on a new retrieval step (-1 to clear). - */ - default_score_threshold?: number | null; - /** - * Default Top K - * @description Prefilled into Top K on a new retrieval step (0 to clear). - */ - default_top_k?: number | null; - /** - * Default Top N - * @description Prefilled into Top N on a new retrieval step (0 to clear). - */ - default_top_n?: number | null; - /** - * Description - * @description New description. - */ - description?: string | null; - /** - * Name - * @description New name. - */ - name?: string | null; - /** - * Reranker Model - * @description New reranker model — a `model_type` from `GET /models/rerankers`. Pass "none" to turn reranking off (not a value from that list). Omitting the field (or sending null) leaves the current reranker in place — it does NOT turn it off. "" is accepted as a synonym for "none", but prefer "none": an empty string does not survive every client's serialization. - */ - reranker_model?: string | null; - /** - * Source Ids - * @description New list of source connection IDs. - */ - source_ids?: string[] | null; - }; - /** - * UpdateMemoryBankBody - * @description Request body for updating a memory bank. - * - * Omitted fields are left unchanged. To **clear** a field back to null, - * send a zero-value sentinel: ``0`` for integers, ``""`` for strings. - */ - UpdateMemoryBankBody: { - /** - * Compaction Prompt - * @description Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted. Send empty string "" to clear and disable summarisation. - */ - compaction_prompt?: string | null; - /** - * Description - * @description Optional description. Send empty string "" to clear. - */ - description?: string | null; - /** - * Max Age Days - * @description DEPRECATED and no longer applied. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending Seclai-Version 2026-08-03 or later, except 0, which clears a value stored earlier. Accepted and stored but inert for older clients. - */ - max_age_days?: number | null; - /** - * Max Size Tokens - * @description Max total tokens (per partition) before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable. - */ - max_size_tokens?: number | null; - /** - * Max Turns - * @description Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable. - */ - max_turns?: number | null; - /** - * Name - * @description New name. - */ - name?: string | null; - /** - * Retention Days - * @description Content source retention in days. Send 0 to clear (indefinite). - */ - retention_days?: number | null; - /** - * Strip Quoted Reply Chains - * @description Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation. - */ - strip_quoted_reply_chains?: boolean | null; - }; - /** - * UpdateSolutionRequest - * @description Request model for updating a solution - */ - UpdateSolutionRequest: { - /** - * Description - * @description Description of the solution - */ - description?: string | null; - /** - * Name - * @description Name of the solution - */ - name?: string | null; - }; - /** - * UpdateSourceBody - * @description Request body for updating a content source. - */ - UpdateSourceBody: { - /** - * Media Types - * @description Media kinds to extract from indexed content and embed as multi-modal KB chunks. Subset of ['images', 'video']. Only kinds the source's embedder can index are honored (see `supported_input_media` on GET /models/embedders); unsupported values are dropped. [] disables media extraction (text-only). - */ - media_types?: string[] | null; - /** - * Name - * @description New name. - */ - name?: string | null; - /** - * Polling - * @description New polling interval. - */ - polling?: string | null; - /** - * Retention Days - * @description New retention period in days — content older than this is deleted permanently. Send null to clear the window: content is then kept indefinitely. Omit the field to leave it unchanged. - */ - retention_days?: number | null; - }; - /** UploadAgentInputApiResponse */ - UploadAgentInputApiResponse: { - /** - * Content Type - * @description Resolved MIME type. - */ - content_type: string; - /** - * Error - * @description Error message if status is failed. - */ - error?: string | null; - /** - * File Size - * @description Size in bytes. - */ - file_size: number; - /** - * Filename - * @description Original filename. - */ - filename: string; - /** - * Id - * @description Unique identifier for the upload. - */ - id: string; - /** - * Status - * @description processing, ready, or failed. - */ - status: string; - }; - /** ValidationError */ - ValidationError: { - /** Location */ - loc: (string | number)[]; - /** Message */ - msg: string; - /** Error Type */ - type: string; - }; - /** - * VariantCategoryResponse - * @description Response model for a variant category - */ - VariantCategoryResponse: { - /** Category */ - category: string; - /** Configurable */ - configurable: boolean; - /** Description */ - description: string; - /** Options */ - options: components["schemas"]["VariantOptionResponse"][]; - /** Title */ - title: string; - }; - /** - * VariantOptionResponse - * @description Response model for a variant option - */ - VariantOptionResponse: { - /** Default */ - default: boolean; - /** Description */ - description?: string | null; - /** - * Input 1H Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 1-hour prompt cache. - */ - input_1h_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input 30M Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 30-minute prompt cache. - */ - input_30m_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input 5M Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 5-minute prompt cache. - */ - input_5m_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input Cache Hit Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens read from a prompt cache. - */ - input_cache_hit_credits_per_1000_tokens?: number | null; - /** Input Credits Per 1000 Tokens */ - input_credits_per_1000_tokens?: number | null; - /** - * Long Context Input Cache Hit Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens read from a prompt cache, on a call whose input exceeds `long_context_threshold` tokens. - */ - long_context_input_cache_hit_credits_per_1000_tokens?: number | null; - /** Long Context Input Credits Per 1000 Tokens */ - long_context_input_credits_per_1000_tokens?: number | null; - /** Long Context Output Credits Per 1000 Tokens */ - long_context_output_credits_per_1000_tokens?: number | null; - /** Long Context Threshold */ - long_context_threshold?: number | null; - /** Output Credits Per 1000 Tokens */ - output_credits_per_1000_tokens?: number | null; - /** Title */ - title: string; - /** Value */ - value: string; - }; - /** - * AgentImportPreviewRequest - * @description Dry-run import request — same payload shape as the export endpoint. - */ - routers__api__agents__AgentImportPreviewRequest: { - /** - * Agent Definition - * @description Payload in the same shape as GET /agents/{agent_id}/export. - */ - agent_definition: { - [key: string]: unknown; - }; - }; - /** - * AgentImportPreviewResponse - * @description Summary of a successfully validated import payload (no DB writes). - * - * Counts are derived from the validated payload as supplied — they - * reflect what was requested, not what would eventually be persisted - * (cross-account skips for recipients and KB names happen later, only - * on commit). - */ - routers__api__agents__AgentImportPreviewResponse: { - /** - * Agent Name - * @description Imported agent name, if any. - */ - agent_name: string | null; - /** - * Alert Configs - * @description Number of alert configs in the payload. - */ - alert_configs: number; - /** - * Description - * @description Imported agent description, if any. - */ - description: string | null; - /** - * Evaluation Criteria - * @description Number of evaluation criteria in the payload. - */ - evaluation_criteria: number; - /** - * Governance Policies - * @description Number of agent-scoped governance policies in the payload. - */ - governance_policies: number; - /** - * Ok - * @description Always true on a 200 response; failures use HTTP 422. - */ - ok: boolean; - /** - * Payload Export Version - * @description Export-format version the payload claims (or ``null`` for legacy payloads). When this differs from ``supported_export_version``, fields may have been silently dropped or defaulted on import. - */ - payload_export_version?: string | null; - /** - * Schedules - * @description Number of trigger schedules in the payload. - */ - schedules: number; - /** - * Solutions - * @description Number of solutions the source agent belonged to. On import these are matched by name in the target account; unmatched names are silently skipped. - * @default 0 - */ - solutions: number; - /** - * Step Count - * @description Total number of steps in the workflow tree (recursive). - */ - step_count: number; - /** - * Supported Export Version - * @description Export-format version this server understands. Compare against ``payload_export_version`` to detect cross-version imports. - * @default 2 - */ - supported_export_version: string; - /** - * Unresolved Refs - * @description Entity references in the imported workflow that don't exist in the target account. Each entry: {category, ref_id, ref_name?, locations:[step:], alternatives:[{id, name, description?}]}. Pass {source_uuid: target_uuid} as ``entity_remap`` on the create/update call to substitute these references before save. - */ - unresolved_refs?: { - [key: string]: unknown; - }[]; - }; - /** AgentListResponse */ - routers__api__agents__AgentListResponse: { - /** - * Data - * @description List of agents. - */ - data: components["schemas"]["AgentSummaryResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** AgentRunListResponse */ - routers__api__agents__AgentRunListResponse: { - /** - * Data - * @description List of agent runs. - */ - data: components["schemas"]["AgentRunResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** AgentTraceSearchRequest */ - routers__api__agents__AgentTraceSearchRequest: { - /** - * Agent Id - * @description Filter by agent ID. - */ - agent_id?: string | null; - /** - * Query - * @description Search query text. - */ - query: string; - /** - * Run Status - * @description Filter by run status. - */ - run_status?: string | null; - /** - * Step Type - * @description Filter by step type. - */ - step_type?: string | null; - /** - * Top N - * @description Maximum number of results. - * @default 10 - */ - top_n: number; - }; - /** CreateAgentRequest */ - routers__api__agents__CreateAgentRequest: { - /** - * Agent Definition - * @description Optional payload in the same format produced by GET /agents/{id}/export. When provided, replaces any template-derived workflow and pre-fills metadata/trigger fields the request does not specify explicitly. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload. - */ - agent_definition?: { - [key: string]: unknown; - } | null; - /** - * Agent Template - * @description Template to initialize the agent from. Values: blank, retrieval_example, simple_qa, summarizer, json_extractor, content_change_notifier, scheduled_report, webhook_pipeline. - */ - agent_template?: string | null; - /** - * Description - * @description Optional description. - */ - description?: string | null; - /** - * Entity Remap - * @description Optional UUID-substitution map applied to the imported workflow before save. Each key is a source-account UUID (as returned by /agents/preview-import's ``unresolved_refs``); each value is the target-account UUID to substitute. Used to relink knowledge bases, memory banks, source connections, and sub-agents on cross-account imports. - */ - entity_remap?: { - [key: string]: string; - } | null; - /** - * Name - * @description Name for the new agent. - */ - name: string; - /** - * Trigger Type - * @description Trigger type: dynamic_input, template_input, schedule, new_content, email_received. - * @default dynamic_input - */ - trigger_type: string; - }; - /** - * GovernancePolicyRefResponse - * @description Reference to a governance policy by id and name. - */ - routers__api__agents__GovernancePolicyRefResponse: { - /** - * Policy Id - * @description Governance policy identifier. - */ - policy_id: string; - /** - * Policy Name - * @description Display name of the policy at evaluation time. May be null when the policy has been deleted. - */ - policy_name?: string | null; - }; - /** - * SetEmailTriggerConfigRequest - * @description Alias and/or sender allowlist for an EMAIL_RECEIVED trigger. - * - * A field omitted is left unchanged; passing ``null`` (or ``""`` for - * ``alias``) clears it. - */ - routers__api__agents__SetEmailTriggerConfigRequest: { - /** - * Alias - * @description Custom alias, unique per account, answering as `.@agent.seclai.com` and as `@` on each verified account email domain (alphanumeric plus '+', '.', '-'; 1–32 chars; not starting/ending with '+', '.', '-'; not UUID-shaped). Pass null/empty to clear. - */ - alias?: string | null; - /** - * Allowed Senders - * @description Allowlist of full sender addresses and/or bare domains (a bare domain also matches sub-domains). Empty/null accepts any sender. - */ - allowed_senders?: string[] | null; - /** - * Ignore Auto Generated - * @description When true (default for new triggers), machine-generated inbound mail (auto-replies, bulk/list mail, bounces) is dropped before a run to prevent auto-reply loops. Set false to process automated mail. - */ - ignore_auto_generated?: boolean | null; - /** - * Queue On Quota - * @description When true (default false), inbound mail that exceeds the account's hourly email-trigger rate is parked in a QUEUED run and drained later by the catch-up sweep instead of being failed; when false, over-rate mail fails immediately. - */ - queue_on_quota?: boolean | null; - /** - * Require Sender Auth - * @description When true (default for new triggers), the envelope sender must pass SPF or DMARC even on an open inbox (no allowlist); unauthenticated, spoofable mail is rejected. Set false to accept fully unauthenticated mail on an open inbox. - */ - require_sender_auth?: boolean | null; - }; - /** UpdateAgentRequest */ - routers__api__agents__UpdateAgentRequest: { - /** - * Agent Definition - * @description Optional payload in the same format produced by GET /agents/{id}/export. When provided, agent metadata fields the request does not set explicitly are taken from the payload, and the agent's workflow is replaced from `agent.definition`. The previous version is preserved in history. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload. - */ - agent_definition?: { - [key: string]: unknown; - } | null; - /** - * Default Evaluation Tier - * @description Default evaluation tier: 'fast', 'balanced', or 'thorough'. - */ - default_evaluation_tier?: string | null; - /** - * Description - * @description New description for the agent. - */ - description?: string | null; - /** - * Entity Remap - * @description Optional UUID-substitution map applied to the imported workflow before save (same shape as on POST /agents). - */ - entity_remap?: { - [key: string]: string; - } | null; - /** - * Evaluation Mode - * @description Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'. - */ - evaluation_mode?: string | null; - /** - * Max Retries - * @description Max retries for eval_and_retry mode (1-10). - */ - max_retries?: number | null; - /** - * Name - * @description New name for the agent. - */ - name?: string | null; - /** - * Prompt Model Auto Rollback Enabled - * @description Enable or disable automatic rollback for upgraded models. - */ - prompt_model_auto_rollback_enabled?: boolean | null; - /** - * Prompt Model Auto Rollback Triggers - * @description Failure signals that trigger rollback: agent_eval_fail, governance_flag, governance_block, agent_run_failed. - */ - prompt_model_auto_rollback_triggers?: string[] | null; - /** @description Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter. */ - prompt_model_auto_upgrade_strategy?: components["schemas"]["PromptModelAutoUpgradeStrategy"] | null; - /** - * Retry On Failure - * @description Whether to retry on evaluation failure. - */ - retry_on_failure?: boolean | null; - /** - * Sampling Config - * @description Sampling configuration for sample_and_flag mode. Format: {combinator: 'and'|'or', rules: [...]}. - */ - sampling_config?: { - [key: string]: unknown; - } | null; - /** - * Set Default Evaluation Tier - * @description When true and default_evaluation_tier is omitted, clears the tier to null (system default). - * @default false - */ - set_default_evaluation_tier: boolean; - /** - * Set Prompt Model Auto Rollback Triggers - * @description When true and prompt_model_auto_rollback_triggers is omitted, clears the list to null (revert to system defaults). - * @default false - */ - set_prompt_model_auto_rollback_triggers: boolean; - /** - * Set Sampling Config - * @description When true and sampling_config is omitted, clears the config to null. - * @default false - */ - set_sampling_config: boolean; - }; - /** - * AiAssistantFeedbackRequest - * @description Request body for submitting AI assistant feedback. - */ - routers__api__ai_assistant__AiAssistantFeedbackRequest: { - /** - * Agent Conversation Id - * @description Agent conversation ID, if applicable. - */ - agent_conversation_id?: string | null; - /** - * Comment - * @description Optional comment. - */ - comment?: string | null; - /** - * Context - * @description Additional context. - */ - context?: { - [key: string]: unknown; - } | null; - /** - * Conversation Id - * @description Conversation ID for the interaction. - */ - conversation_id?: string | null; - /** - * Feature - * @description Feature name (e.g. 'source', 'solution'). - */ - feature: string; - /** - * Governance Conversation Id - * @description Governance conversation ID, if applicable. - */ - governance_conversation_id?: string | null; - /** - * Prompt Call Id - * @description Prompt call ID for credit tracking. - */ - prompt_call_id?: string | null; - /** - * Rating - * @description Rating: 'thumbs_up' or 'thumbs_down'. - */ - rating: string; - }; - /** AddCommentRequest */ - routers__api__alerts__AddCommentRequest: { - /** - * Body - * @description Comment text - */ - body: string; - }; - /** AlertCommentResponse */ - routers__api__alerts__AlertCommentResponse: { - /** Body */ - body: string; - /** Created At */ - created_at: string | null; - /** Id */ - id: string; - /** User Id */ - user_id: string; - /** User Name */ - user_name: string | null; - }; - /** AlertDetailResponse */ - routers__api__alerts__AlertDetailResponse: { - alert: components["schemas"]["routers__api__alerts__AlertResponse"]; - /** Comments */ - comments: components["schemas"]["routers__api__alerts__AlertCommentResponse"][]; - /** History */ - history: components["schemas"]["AlertHistoryEntryResponse"][]; - /** Subscribers */ - subscribers: components["schemas"]["routers__api__alerts__AlertSubscriberResponse"][]; - }; - /** - * AlertListResponse - * @description ``GET /alerts`` — always the canonical ``{data, pagination}`` envelope. - */ - routers__api__alerts__AlertListResponse: { - /** Data */ - data: components["schemas"]["routers__api__alerts__AlertResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** AlertResponse */ - routers__api__alerts__AlertResponse: { - /** Account Id */ - account_id: string; - /** Agent Id */ - agent_id: string | null; - /** Agent Run Id */ - agent_run_id: string | null; - /** Alert Config Id */ - alert_config_id: string | null; - /** Alert Type */ - alert_type: string; - /** Comment Count */ - comment_count: number; - /** Created At */ - created_at: string | null; - /** Description */ - description: string | null; - /** Details */ - details?: unknown; - /** Id */ - id: string; - /** Is Subscribed */ - is_subscribed: boolean; - /** Mcp Client Id */ - mcp_client_id: string | null; - /** Source Connection Id */ - source_connection_id: string | null; - /** Source Connection Pull Id */ - source_connection_pull_id: string | null; - /** Status */ - status: string; - /** Subscriber Count */ - subscriber_count: number; - /** Title */ - title: string; - /** Updated At */ - updated_at: string | null; - }; - /** AlertSubscriberResponse */ - routers__api__alerts__AlertSubscriberResponse: { - /** Created At */ - created_at: string | null; - /** Id */ - id: string; - /** User Id */ - user_id: string; - /** User Name */ - user_name: string | null; - }; - /** OrganizationAlertPreferenceResponse */ - routers__api__alerts__OrganizationAlertPreferenceResponse: { - /** Alert Type */ - alert_type: string; - /** Is Override */ - is_override: boolean; - /** Organization Id */ - organization_id: string; - /** Subscribed */ - subscribed: boolean; - }; - /** UpdateOrganizationAlertPreferenceRequest */ - routers__api__alerts__UpdateOrganizationAlertPreferenceRequest: { - /** - * Subscribed - * @description Whether the user should receive this alert for the organization - */ - subscribed: boolean; - }; - /** - * ContentDetailResponse - * @description Response model for content detail. - */ - routers__api__contents__ContentDetailResponse: { - /** - * Content Duration - * @description Duration of the content in seconds. - */ - content_duration: number | null; - /** - * Content Duration Display - * @description Display string for content duration. - */ - content_duration_display: string | null; - /** - * Content Status - * @description Status of the content. - */ - content_status: string; - /** - * Content Type - * @description Type of the content. - */ - content_type: string; - /** - * Content Type Display - * @description Display name of the content type. - */ - content_type_display: string; - /** - * Content Url - * @description URL of the content. - */ - content_url: string; - /** - * Content Word Count - * @description Word count of the content. - */ - content_word_count: number | null; - /** - * Description - * @description Description of the content. - */ - description: string | null; - /** - * Error - * @description Error message, if any. - */ - error: string | null; - /** - * Extracted Media Capped - * @description True when extraction stopped with media still unread, so the item references more media than was indexed and media search will not match anything past the cut. Two causes: a web page that ran out of the budget for fetching remote assets, or a container that could not be read to the end (a truncated or hostile archive). An uploaded document that reads cleanly is never capped, however much media it holds — there is no limit on that. - * @default false - */ - extracted_media_capped: boolean; - /** - * Extracted Media Count - * @description Number of embedded images / videos extracted from inside this item and indexed as their own chunks. There is no limit on this — a document contributes as many as it holds. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container, or found nothing. Treat null as 'unknown', never as zero. - */ - extracted_media_count?: number | null; - /** - * Extracted Media Limit - * @description The bound that was reached, when extracted_media_capped is true and the stop was a bound — a number of fetch attempts, or a number of seconds. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired. - */ - extracted_media_limit?: number | null; - /** - * Id - * @description Unique identifier for the content version. - */ - id: string; - /** - * Metadata - * @description Metadata associated with the content. - */ - metadata: { - [key: string]: string; - }[] | null; - /** - * Published At - * @description Timestamp when the content was published. - */ - published_at: string | null; - /** - * Pulled At - * @description Timestamp when the content was pulled. - */ - pulled_at: string; - /** - * Source Connection Content Version Id - * @description ID of the source connection content version. - */ - source_connection_content_version_id: string; - /** - * Source Connection Id - * @description ID of the source connection. - */ - source_connection_id: string; - /** - * Source Name - * @description Name of the source. - */ - source_name: string; - /** - * Source Type - * @description Type of the source. - */ - source_type: string; - /** - * Text Content - * @description Text content. - */ - text_content: string | null; - /** - * Text Content End - * @description End position of the text content. - */ - text_content_end: number; - /** - * Text Content Start - * @description Start position of the text content. - */ - text_content_start: number; - /** - * Text Content Total Length - * @description Total length of the text content. - */ - text_content_total_length: number; - /** - * Title - * @description Title of the content. - */ - title: string | null; - }; - /** - * ContentEmbeddingsListResponse - * @description Response model for paginated content embeddings. - */ - routers__api__contents__ContentEmbeddingsListResponse: { - /** Data */ - data: components["schemas"]["ContentEmbeddingResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * FileUploadResponse - * @description Response model for content file replacement upload. - */ - routers__api__contents__FileUploadResponse: { - /** - * Content Version Id - * @description ID of the newly created content version. A replacement creates a new version rather than overwriting the previous one. - */ - content_version_id: string | null; - /** - * Embedder Warning - * @description Set when the file's type is not embedded directly on this source, so indexing relies on extracted text. Content with none (e.g. a photograph) will be marked FAILED. - */ - embedder_warning?: string | null; - /** - * Filename - * @description Original filename - */ - filename: string; - /** - * Source Connection Content Version Id - * @description ID of the source connection content version. Unchanged by a replacement, so it stays a stable handle for the content. - */ - source_connection_content_version_id: string | null; - /** - * Status - * @description Always `uploaded`. Unlike the create endpoints, a replacement is never rejected as a duplicate of another item. - */ - status: string; - }; - /** - * DocsSearchResponse - * @description Ranked results, NOT a paginated collection — the ``{results}`` shape is a - * deliberate carve-out matching the MCP ``search_docs`` tool. - */ - routers__api__docs_search__DocsSearchResponse: { - /** Results */ - results: components["schemas"]["DocsSearchResultResponse"][]; - }; - /** - * GovernanceAiAssistantRequest - * @description Request body for the governance AI assistant. - */ - routers__api__governance__GovernanceAiAssistantRequest: { - /** - * User Input - * @description Natural-language request for the governance AI assistant. - */ - user_input: string; - }; - /** - * GovernanceConversationResponse - * @description A governance AI assistant conversation entry. - */ - routers__api__governance__GovernanceConversationResponse: { - /** - * Accepted - * @description True if accepted, false if declined, null if pending. - */ - accepted: boolean | null; - /** - * Ai Response - * @description The AI assistant's response note, or null. - */ - ai_response: string | null; - /** - * Created At - * @description ISO 8601 creation timestamp. - */ - created_at: string; - /** - * Id - * @description Conversation ID. - */ - id: string; - /** - * Proposed Actions - * @description JSON of proposed actions, or null. - */ - proposed_actions: { - [key: string]: unknown; - } | null; - /** - * User Input - * @description The original user request. - */ - user_input: string; - }; - /** - * MemoryBankAcceptRequest - * @description Accept or decline a memory bank AI suggestion. - */ - routers__api__memory_banks__MemoryBankAcceptRequest: { - /** - * Accepted - * @description Whether the user accepted the proposed configuration. - */ - accepted: boolean; - }; - /** - * MemoryBankAiAssistantRequest - * @description Request body for the memory bank AI assistant. - */ - routers__api__memory_banks__MemoryBankAiAssistantRequest: { - /** - * Current Config - * @description Current configuration to refine, if any. - */ - current_config?: { - [key: string]: unknown; - } | null; - /** - * History Since - * @description Optional ISO 8601 timestamp. When set, only conversation turns created at or after this timestamp are loaded as context, scoping history to the current session so the assistant remembers earlier turns in a multi-turn refinement. - */ - history_since?: string | null; - /** - * User Input - * @description Natural-language description of the memory bank. - */ - user_input: string; - }; - /** - * MemoryBankConversationTurnResponse - * @description A single turn of memory bank AI assistant conversation. - */ - routers__api__memory_banks__MemoryBankConversationTurnResponse: { - /** - * Accepted - * @description Whether the user accepted this proposal. - */ - accepted?: boolean | null; - /** - * Ai Note - * @description AI note from this turn. - */ - ai_note?: string | null; - /** - * Conversation Id - * @description Unique ID for this conversation turn. - */ - conversation_id: string; - /** - * Resulting Config - * @description The proposed configuration from this turn. - */ - resulting_config?: { - [key: string]: unknown; - } | null; - /** - * User Input - * @description User input for this turn. - */ - user_input: string; - }; - /** - * MemoryBankLastConversationResponse - * @description Response for fetching memory bank conversation history. - */ - routers__api__memory_banks__MemoryBankLastConversationResponse: { - /** - * Accepted - * @description Whether the user accepted the last proposal. - */ - accepted?: boolean | null; - /** - * Ai Note - * @description AI note from the most recent turn. - */ - ai_note?: string | null; - /** - * Total - * @description Total conversation turns. - * @default 0 - */ - total: number; - /** - * Turns - * @description Recent conversation turns (oldest first). - */ - turns?: components["schemas"]["routers__api__memory_banks__MemoryBankConversationTurnResponse"][]; - /** - * User Input - * @description Most recent user input. - */ - user_input?: string | null; - }; - /** - * ModelAlertListResponse - * @description ``GET /models/alerts`` legacy/default shape; 2026-07-27+ clients get the - * canonical ``{data, pagination}`` envelope (bypasses this ``response_model``). - */ - routers__api__model_lifecycle__ModelAlertListResponse: { - /** Alerts */ - alerts: components["schemas"]["routers__api__model_lifecycle__ModelAlertResponse"][]; - /** Total */ - total: number; - }; - /** ModelAlertResponse */ - routers__api__model_lifecycle__ModelAlertResponse: { - /** Account Id */ - account_id: string; - /** Agent Id */ - agent_id: string | null; - /** Alert Type */ - alert_type: string; - /** Created At */ - created_at: string; - /** Id */ - id: string; - /** Message */ - message: string; - /** Model Name */ - model_name: string; - /** Prompt Model Id */ - prompt_model_id: string; - /** Read At */ - read_at: string | null; - /** Successor Model Name */ - successor_model_name: string | null; - }; - /** ModelRecommendationResponse */ - routers__api__model_lifecycle__ModelRecommendationResponse: { - /** Deprecated At */ - deprecated_at?: string | null; - /** Description */ - description: string; - effort_options?: components["schemas"]["EffortOptionsResponse"] | null; - /** Family */ - family?: string | null; - /** Family Generation */ - family_generation?: number | null; - /** Id */ - id: string; - /** Max Context Tokens */ - max_context_tokens: number; - /** Max Output Tokens */ - max_output_tokens: number; - /** Model Id */ - model_id: string; - /** Name */ - name: string; - /** Provider */ - provider: string; - /** Reason */ - reason: string; - /** Recommendation Type */ - recommendation_type: string; - /** Released At */ - released_at?: string | null; - /** Sunset At */ - sunset_at?: string | null; - /** Supports Openai Arguments */ - supports_openai_arguments: boolean; - /** Supports Streaming */ - supports_streaming: boolean; - /** Supports Structured Output */ - supports_structured_output: boolean; - /** Supports Thinking */ - supports_thinking: boolean; - /** Supports Tool Use */ - supports_tool_use: boolean; - }; - /** ModelRecommendationsResponse */ - routers__api__model_lifecycle__ModelRecommendationsResponse: { - /** Alternatives */ - alternatives: components["schemas"]["routers__api__model_lifecycle__ModelRecommendationResponse"][]; - /** Current Model Id */ - current_model_id: string; - /** Current Model Name */ - current_model_name: string; - /** Same Provider */ - same_provider: components["schemas"]["routers__api__model_lifecycle__ModelRecommendationResponse"][]; - successor?: components["schemas"]["routers__api__model_lifecycle__ModelRecommendationResponse"] | null; - /** Upgrades */ - upgrades: components["schemas"]["routers__api__model_lifecycle__ModelRecommendationResponse"][]; - }; - /** - * SearchResponse - * @description Ranked results, NOT a paginated collection — the ``{results}`` shape is a - * deliberate carve-out matching the MCP ``search_resources`` tool. - */ - routers__api__search__SearchResponse: { - /** Results */ - results: components["schemas"]["routers__api__search__SearchResultResponse"][]; - }; - /** SearchResultResponse */ - routers__api__search__SearchResultResponse: { - /** Description */ - description: string | null; - /** Entity Type */ - entity_type: string; - /** Id */ - id: string; - /** Name */ - name: string; - }; - /** - * AiAssistantAcceptRequest - * @description Request body for accepting a proposed plan. - */ - routers__api__solutions__AiAssistantAcceptRequest: { - /** - * Confirm Deletions - * @description Must be true when the plan contains destructive actions - * @default false - */ - confirm_deletions: boolean; - /** - * Solution Description - * @description When running in standalone mode (no pre-existing solution), provide a description for the auto-created solution. - */ - solution_description?: string | null; - /** - * Solution Name - * @description When running in standalone mode (no pre-existing solution), provide a name to auto-create a solution and link resources. - */ - solution_name?: string | null; - }; - /** - * AiAssistantGenerateRequest - * @description Request body for AI assistant generate endpoints. - */ - routers__api__solutions__AiAssistantGenerateRequest: { - /** - * History Since - * @description Optional ISO 8601 timestamp. When set, only conversation turns created at or after this timestamp are loaded as context, scoping history to the current session so the assistant remembers earlier turns in a create flow. - */ - history_since?: string | null; - /** - * User Input - * @description User input describing what to do - */ - user_input: string; - }; - /** SolutionAgentResponse */ - routers__api__solutions__SolutionAgentResponse: { - /** - * Id - * Format: uuid - */ - id: string; - /** - * Knowledge Base Ids - * @description Knowledge base IDs connected to this agent via triggers. - */ - knowledge_base_ids?: string[]; - /** Name */ - name: string; - }; - /** - * SolutionConversationResponse - * @description Response model for a conversation turn. - */ - routers__api__solutions__SolutionConversationResponse: { - /** - * Accepted - * @description Whether the suggestion was accepted or declined. - */ - accepted: boolean | null; - /** - * Actions Taken - * @description Actions taken by the AI. - */ - actions_taken: { - [key: string]: unknown; - } | null; - /** - * Ai Response - * @description AI response text. - */ - ai_response: string | null; - /** - * Created At - * @description Timestamp when the conversation was created. - */ - created_at: string; - /** - * Id - * Format: uuid - * @description Unique identifier for the conversation turn. - */ - id: string; - /** - * User Input - * @description User input text. - */ - user_input: string; - }; - /** SolutionKnowledgeBaseResponse */ - routers__api__solutions__SolutionKnowledgeBaseResponse: { - /** - * Id - * Format: uuid - */ - id: string; - /** Name */ - name: string; - /** - * Source Connection Ids - * @description Source connection IDs linked to this knowledge base. - */ - source_connection_ids?: string[]; - }; - /** - * SolutionListResponse - * @description Response model for paginated solution list. - */ - routers__api__solutions__SolutionListResponse: { - /** Data */ - data: components["schemas"]["SolutionSummaryResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * SolutionResponse - * @description Response model for solution data. - */ - routers__api__solutions__SolutionResponse: { - /** - * Agents - * @description Agents linked to the solution. - */ - agents: components["schemas"]["routers__api__solutions__SolutionAgentResponse"][]; - /** - * Created At - * @description Timestamp when the solution was created. - */ - created_at: string; - /** - * Description - * @description Description of the solution. - */ - description: string; - /** - * Id - * Format: uuid - * @description Unique identifier for the solution. - */ - id: string; - /** - * Knowledge Bases - * @description Knowledge bases linked to the solution. - */ - knowledge_bases: components["schemas"]["routers__api__solutions__SolutionKnowledgeBaseResponse"][]; - /** - * Name - * @description Name of the solution. - */ - name: string; - /** - * Source Connections - * @description Source connections linked to the solution. - */ - source_connections: components["schemas"]["SolutionSourceConnectionResponse"][]; - /** - * Updated At - * @description Timestamp when the solution was last updated. - */ - updated_at: string; - }; - /** - * CreateExportRequest - * @description Parameters for creating a new export job. - */ - routers__api__source_exports__CreateExportRequest: { - /** - * Date From - * @description Only include content created on or after this timestamp. - */ - date_from?: string | null; - /** - * Date To - * @description Only include content created on or before this timestamp. - */ - date_to?: string | null; - /** @description Output file format (jsonl, csv, parquet, zip). */ - format: components["schemas"]["ExportFormat"]; - /** - * Metadata Filter - * @description JSONB containment filter applied to content metadata. - */ - metadata_filter?: { - [key: string]: unknown; - } | null; - /** - * Query Filter - * @description Title substring filter (case-insensitive ILIKE). - */ - query_filter?: string | null; - }; - /** - * EstimateExportRequest - * @description Parameters for estimating export size. - */ - routers__api__source_exports__EstimateExportRequest: { - /** - * Date From - * @description Only include content created on or after this timestamp. - */ - date_from?: string | null; - /** - * Date To - * @description Only include content created on or before this timestamp. - */ - date_to?: string | null; - /** @description Output file format. */ - format: components["schemas"]["ExportFormat"]; - /** - * Metadata Filter - * @description JSONB containment filter applied to content metadata. - */ - metadata_filter?: { - [key: string]: unknown; - } | null; - /** - * Query Filter - * @description Title substring filter (case-insensitive ILIKE). - */ - query_filter?: string | null; - }; - /** - * EstimateExportResponse - * @description Rough size estimate for a potential export. - */ - routers__api__source_exports__EstimateExportResponse: { - /** - * Estimated Size Bytes - * @description Estimated export file size in bytes. - */ - estimated_size_bytes: number; - /** - * Source Connection Id - * @description Source connection ID. - */ - source_connection_id: string; - }; - /** - * ExportResponse - * @description Status and metadata for a content source export job. - */ - routers__api__source_exports__ExportResponse: { - /** - * Account Id - * @description Owning account ID. - */ - account_id: string; - /** - * Completed At - * @description Completion time. - */ - completed_at?: string | null; - /** - * Created At - * @description Creation time. - */ - created_at: string; - /** - * Date From - * @description Date-from filter applied to this export. - */ - date_from?: string | null; - /** - * Date To - * @description Date-to filter applied to this export. - */ - date_to?: string | null; - /** - * Destination - * @description Storage destination. - */ - destination: string; - /** - * Error - * @description Error message if failed. - */ - error?: string | null; - /** - * Estimated Size Bytes - * @description Pre-run size estimate. - */ - estimated_size_bytes?: number | null; - /** - * Expires At - * @description Download expiry time. - */ - expires_at?: string | null; - /** - * File Size Bytes - * @description File size in bytes. - */ - file_size_bytes?: number | null; - /** - * Format - * @description Output format. - */ - format: string; - /** - * Id - * @description Export job ID. - */ - id: string; - /** - * Item Count - * @description Items exported. - */ - item_count?: number | null; - /** - * Metadata Filter - * @description Metadata filter applied to this export. - */ - metadata_filter?: { - [key: string]: unknown; - } | null; - /** - * Progress Current - * @description Items processed so far. - */ - progress_current?: number | null; - /** - * Progress Total - * @description Total items to process. - */ - progress_total?: number | null; - /** - * Query Filter - * @description Query filter applied to this export. - */ - query_filter?: string | null; - /** - * Requested By User Id - * @description ID of the user who requested this export. - */ - requested_by_user_id?: string | null; - /** - * Requested By User Name - * @description Name of the user who requested this export. - */ - requested_by_user_name?: string | null; - /** - * Source Connection Id - * @description Source connection ID. - */ - source_connection_id: string; - /** - * Started At - * @description Processing start time. - */ - started_at?: string | null; - /** - * Status - * @description Job status. - */ - status: string; - /** - * Storage Key - * @description S3 key of exported file. - */ - storage_key?: string | null; - /** - * Updated At - * @description Last update time. - */ - updated_at: string; - }; - /** - * FileUploadResponse - * @description Response model for file upload - */ - routers__api__sources__FileUploadResponse: { - /** - * Content Version Id - * @description ID of the created content version, and what the source content status endpoints take. Set when `status` is `uploaded`; `null` when `status` is `duplicate`, because no new version was created. - */ - content_version_id: string | null; - /** - * Embedder Warning - * @description Set when the file is non-text but the source's embedder is text-only — indexing will rely on OCR / transcription and may produce a FAILED row if no text can be extracted. - */ - embedder_warning?: string | null; - /** - * Filename - * @description Original filename - */ - filename: string; - /** - * Source Connection Content Version Id - * @description ID of the existing, already-indexed item this file duplicates, and what `GET /contents/{id}` takes. Set only when `status` is `duplicate`; `null` on a new upload, which has no such id until it finishes indexing. - */ - source_connection_content_version_id: string | null; - /** - * Status - * @description `uploaded` for a new item, or `duplicate` when this exact file is already on the source. - */ - status: string; - }; - /** - * SourceListResponse - * @description Response model for paginated source list - */ - routers__api__sources__SourceListResponse: { - /** Data */ - data: components["schemas"]["SourceResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * PromptModelResponse - * @description Response model for prompt model data - */ - schemas__model_responses__PromptModelResponse: { - /** - * Chat Capable - * @description Whether this model can serve a chat request (`prompt_call`, `extract_data`). True for every plain text LLM, and for a dual-capability model that generates media AND holds a conversation; false for a dedicated generator (Imagen, Veo, a TTS voice), which bills per produced unit and has no chat interface. Authoritative: consumers must read this rather than inferring it from `generation_params` or `supported_output_media`, because the answer also depends on which inference interface serves the model — something no response field exposes. - * @default true - */ - chat_capable: boolean; - /** Default */ - default: boolean; - /** Deprecated At */ - deprecated_at?: string | null; - /** Description */ - description: string; - /** @description The reasoning-effort values a prompt_call or extract_data step may set as `effort` with this model. Null when the model takes none. */ - effort_options?: components["schemas"]["EffortOptionsResponse"] | null; - /** Enabled */ - enabled: boolean; - /** Family */ - family?: string | null; - /** Family Generation */ - family_generation?: number | null; - /** - * Generation Credits Per Unit - * @description Per-unit credit cost for a dedicated media-generation model, in the unit named by ``generation_params.pricing_unit`` (per image / per second / per character / per output token). Multiply by the produced unit count (images, seconds, characters) for the run cost. None for models with no generation descriptor. This rate applies when the model is used in a generate_image/audio/video step; a model that also serves the chat path is billed per token there instead, using the input/output token rates on this same record. When `generation_params.price_varies_by` is set the model has one rate per value of that option and this is the **highest** of them — read `generation_credits_per_variant` for the real spread rather than presenting this as the price. - */ - generation_credits_per_unit?: number | null; - /** - * Generation Credits Per Variant - * @description Per-unit credit cost keyed by the value of the option named in `generation_params.price_varies_by` (e.g. `{'720p': 1330, '1080p': 1995}`). None for a model with a single rate, where `generation_credits_per_unit` already describes it exactly. - */ - generation_credits_per_variant?: { - [key: string]: number; - } | null; - /** - * Generation Params - * @description Media-generation descriptor (modality, pricing_unit, and modality-specific constraints). NULL for text LLMs; present for image/audio/video generation models. See schemas.generation_params. A present descriptor does NOT imply the model is generation-only: some models serve both paths (they generate media AND hold a chat conversation). Read `chat_capable` to tell whether a model with a descriptor can also be used as a chat model — do not branch on this field being non-null alone, and do not re-derive the answer from `supported_output_media`. - */ - generation_params?: { - [key: string]: unknown; - } | null; - /** - * Generation Unit Label - * @description Human suffix for the per-unit generation rate (e.g. ``/image``, ``/second``, ``/1k chars``, ``/1k tokens``) — single-sourced from the pricing unit so clients render cost without re-deriving the mapping. None for non-generation models. Char/token rates are shown per 1,000 (the ``/1k …`` suffix), so scale ``generation_credits_per_unit`` accordingly for those units. - */ - generation_unit_label?: string | null; - /** Id */ - id: string; - /** - * Image Generation Tool Credits Per Image - * @description Per-image credit cost of using the built-in image_generation tool (it runs gpt-image-1). Set only for models that actually support the tool (tool-use capable); None otherwise. - */ - image_generation_tool_credits_per_image?: number | null; - /** - * Input 1H Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 1-hour prompt cache. - */ - input_1h_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input 30M Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 30-minute prompt cache. - */ - input_30m_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input 5M Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 5-minute prompt cache. - */ - input_5m_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input Cache Hit Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens read from a prompt cache. - */ - input_cache_hit_credits_per_1000_tokens?: number | null; - /** Input Credits Per 1000 Tokens */ - input_credits_per_1000_tokens?: number | null; - /** - * Is New - * @default false - */ - is_new: boolean; - /** - * Last Used - * @default false - */ - last_used: boolean; - /** Max Context Tokens */ - max_context_tokens: number; - /** Max Conversation Length */ - max_conversation_length: number; - /** Max Output Tokens */ - max_output_tokens: number; - /** Model Id */ - model_id: string; - /** Name */ - name: string; - /** Output Credits Per 1000 Tokens */ - output_credits_per_1000_tokens?: number | null; - /** - * Payload Schema - * @description Model-specific JSON schema for advanced prompt_call json_template payloads. - */ - payload_schema?: { - [key: string]: unknown; - } | null; - /** - * Payload Schema Source Url - * @description Source URL used to derive payload_schema guidance for this model. - */ - payload_schema_source_url?: string | null; - /** Per Modality Rates */ - per_modality_rates?: components["schemas"]["ModalityRateResponse"][]; - /** Provider */ - provider: string; - /** Released At */ - released_at?: string | null; - /** - * Schema Documentation Url - * @description Model documentation URL with request/response payload details. - */ - schema_documentation_url?: string | null; - /** - * Schema Notes - * @description Human-readable notes about request payload compatibility. - */ - schema_notes?: string | null; - /** Successor Model Id */ - successor_model_id?: string | null; - /** Sunset At */ - sunset_at?: string | null; - /** Supported Input Media */ - supported_input_media?: string[] | null; - /** Supported Languages */ - supported_languages?: string[] | null; - /** Supported Output Media */ - supported_output_media?: string[] | null; - /** - * Supports Openai Arguments - * @default false - */ - supports_openai_arguments: boolean; - /** - * Supports Streaming - * @default false - */ - supports_streaming: boolean; - /** - * Supports Structured Output - * @default true - */ - supports_structured_output: boolean; - /** - * Supports Thinking - * @default false - */ - supports_thinking: boolean; - /** - * Supports Tool Use - * @default true - */ - supports_tool_use: boolean; - /** Tools Disabled */ - tools_disabled?: components["schemas"]["PromptToolResponse"][]; - /** Tools Enabled */ - tools_enabled?: components["schemas"]["PromptToolResponse"][]; - /** Training Cutoff At */ - training_cutoff_at?: string | null; - /** Url */ - url?: string | null; - /** Variants */ - variants?: components["schemas"]["VariantCategoryResponse"][] | null; - }; - /** - * ProviderGroupResponse - * @description Response model for provider group with models - */ - schemas__model_responses__ProviderGroupResponse: { - /** Models */ - models: components["schemas"]["schemas__model_responses__PromptModelResponse"][]; - /** Provider */ - provider: string; - }; - /** - * NonManualEvaluationModeStatResponse - * @description Per-mode rollup for evaluation activity. - */ - schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse: { - /** Failed */ - failed: number; - /** Failure Rate */ - failure_rate: number; - /** Flagged */ - flagged: number; - /** Mode */ - mode: string; - /** Pass Rate */ - pass_rate: number; - /** Passed */ - passed: number; - /** Total */ - total: number; - }; - /** - * NonManualEvaluationSummaryResponse - * @description Account-level summary for evaluations. - */ - schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse: { - /** By Mode */ - by_mode: components["schemas"]["schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse"][]; - /** Failed */ - failed: number; - /** Failure Rate */ - failure_rate: number; - /** Flagged */ - flagged: number; - /** Pass Rate */ - pass_rate: number; - /** Passed */ - passed: number; - /** Total */ - total: number; - }; - }; - responses: never; - parameters: { - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version": string; - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id": string; - }; - requestBodies: never; - headers: never; - pathItems: never; -} -export type $defs = Record; -export interface operations { - list_agents_api_agents_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__agents__AgentListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_agent_api_agents_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__agents__CreateAgentRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentSummaryResponse"]; - }; - }; - /** @description Plan limit exceeded — the account has reached the maximum number of agents allowed by its subscription plan. */ - 402: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`). */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentDefinitionImportErrorResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_agent_email_optouts_api_api_agents_agent_email_optouts_get: { - parameters: { - query?: { - /** @description Filter to one agent (account-wide opt-outs still apply) */ - agent_id?: string | null; - limit?: number; - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentEmailOptOutListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - remove_agent_email_optout_api_api_agents_agent_email_optouts__optout_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - optout_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_blocked_email_senders_api_api_agents_blocked_email_senders_get: { - parameters: { - query?: { - limit?: number; - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BlockedEmailSenderListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - block_email_sender_api_api_agents_blocked_email_senders_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["BlockEmailSenderRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BlockedEmailSenderResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["SetAutoBlockModeRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BlockedEmailSenderListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - unblock_email_sender_api_api_agents_blocked_email_senders__blocked_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - blocked_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationCriteriaResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateEvaluationCriteriaRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationCriteriaResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_compatible_runs_api_agents_evaluation_criteria__criteria_id__compatible_runs_get: { - parameters: { - query?: { - page?: number; - limit?: number; - started_after?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CompatibleRunListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_evaluation_results_api_agents_evaluation_criteria__criteria_id__results_get: { - parameters: { - query?: { - status?: string | null; - flagged_only?: boolean; - time_from?: string | null; - time_to?: string | null; - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationResultListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_evaluation_result_api_agents_evaluation_criteria__criteria_id__results_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateEvaluationResultRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationResultResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_evaluation_summary_api_agents_evaluation_criteria__criteria_id__summary_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationResultSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get: { - parameters: { - query?: { - /** @description Scope the summary to a single agent. Omit for account-wide. */ - agent_id?: string | null; - days?: number; - start_date?: string | null; - end_date?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get: { - parameters: { - query?: { - /** @description Filter to a single agent's rejections */ - agent_id?: string | null; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["InboundEmailRejectionResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_inbound_email_status_api_api_agents_inbound_email_status_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["InboundEmailStatusResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CancelQueuedRunsResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - resume_inbound_email_api_api_agents_inbound_email_status_resume_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ResumeInboundResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - preview_import_agent_api_agents_preview_import_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__agents__AgentImportPreviewRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__agents__AgentImportPreviewResponse"]; - }; - }; - /** @description The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`). */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentDefinitionImportErrorResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - search_agent_runs_api_agents_runs_search_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__agents__AgentTraceSearchRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentTraceSearchResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agent_run_api_agents_runs__run_id__get: { - parameters: { - query?: { - /** @description If true, include per-step outputs with timing, durations, and credits. */ - include_step_outputs?: boolean; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - run_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentRunResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_agent_run_api_agents_runs__run_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - run_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentRunResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agent_metadata_api_agents__agent_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_agent_api_agents__agent_id__put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__agents__UpdateAgentRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentSummaryResponse"]; - }; - }; - /** @description The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`). */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentDefinitionImportErrorResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_agent_api_agents__agent_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_ai_conversation_history_api_agents__agent_id__ai_assistant_conversations_get: { - parameters: { - query: { - /** @description Step type to look up. */ - step_type: string; - /** @description Step ID to filter by. */ - step_id?: string | null; - /** @description Max turns to return. */ - limit?: number; - /** @description Number of recent turns to skip. */ - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiConversationHistoryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - generate_agent_steps_api_agents__agent_id__ai_assistant_generate_steps_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["GenerateAgentStepsRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GenerateAgentStepsResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - generate_step_config_api_agents__agent_id__ai_assistant_step_config_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["GenerateStepConfigRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GenerateStepConfigResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - mark_ai_suggestion_api_agents__agent_id__ai_assistant__conversation_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["MarkAiSuggestionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["OkResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_get_agent_attachment_references_api_agents__agent_id__attachment_references_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentAttachmentRefsApiResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agent_callers_api_api_agents__agent_id__callers_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentCallerApiResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agent_definition_api_agents__agent_id__definition_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentDefinitionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_agent_definition_api_agents__agent_id__definition_put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateAgentDefinitionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentDefinitionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - disable_agent_api_api_agents__agent_id__disable_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - enable_agent_api_api_agents__agent_id__enable_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_evaluation_criteria_api_agents__agent_id__evaluation_criteria_get: { - parameters: { - query?: { - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationCriteriaResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_evaluation_criteria_api_agents__agent_id__evaluation_criteria_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateEvaluationCriteriaRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationCriteriaResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - test_draft_evaluation_api_agents__agent_id__evaluation_criteria_test_draft_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["TestDraftEvaluationRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["TestDraftEvaluationResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_agent_evaluation_results_api_agents__agent_id__evaluation_results_get: { - parameters: { - query?: { - status?: string | null; - step?: string | null; - flagged_only?: boolean; - time_from?: string | null; - time_to?: string | null; - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationResultWithCriteriaListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_evaluation_runs_api_agents__agent_id__evaluation_runs_get: { - parameters: { - query?: { - status?: string | null; - step?: string | null; - time_from?: string | null; - time_to?: string | null; - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationRunSummaryListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - export_agent_api_agents__agent_id__export_get: { - parameters: { - query?: { - /** @description Return as file download */ - download?: boolean; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentExportResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_get_agent_input_upload_status_api_agents__agent_id__input_uploads__upload_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - upload_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["UploadAgentInputApiResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_agent_runs_api_agents__agent_id__runs_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - /** @description Filter runs by status */ - status?: components["schemas"]["PendingProcessingCompletedFailedStatus"] | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__agents__AgentRunListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - run_agent_api_agents__agent_id__runs_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["AgentRunRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentRunResponse"]; - }; - }; - /** @description Insufficient credits — the account has exhausted its credits. */ - 402: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["InsufficientCreditsResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - run_streaming_agent_api_agents__agent_id__runs_stream_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["AgentRunStreamRequest"]; - }; - }; - responses: { - /** - * @description Streams agent run events via Server-Sent Events (SSE); run is always created as priority. - * - * SSE events: - * - `event: init` — `data` is an `AgentRunResponse` snapshot (includes `run_id`). - * - `event: done` — `data` is the final `AgentRunResponse` snapshot (includes `output`, `credits`, etc). - * - Other events (e.g. `status`, step events) are forwarded from the run event stream. - * - On `timeout` / `error`, the payload includes `run_id` so clients can fetch status via `GET /agents/runs/{run_id}`. - */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": unknown; - /** - * @example : keepalive - * - * event: init - * data: {"run_id":"...","status":"pending","error_count":0,"credits":0.0,"priority":true,"input":"...","output":null,"attempts":[]} - * - * event: done - * data: {"run_id":"...","status":"completed","error_count":0,"credits":0.0,"priority":true,"input":"...","output":"...","attempts":[]} - */ - "text/event-stream": string; - }; - }; - /** @description Insufficient credits — the account has exhausted its credits. */ - 402: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["InsufficientCreditsResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_run_evaluation_results_api_agents__agent_id__runs__run_id__evaluation_results_get: { - parameters: { - query?: { - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - run_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationResultWithCriteriaResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - set_email_trigger_config_api_api_agents__agent_id__triggers__trigger_id__email_config_put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - trigger_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__agents__SetEmailTriggerConfigRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailTriggerConfigResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_upload_agent_input_api_agents__agent_id__upload_input_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 202: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["UploadAgentInputApiResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_feedback_api_ai_assistant_feedback_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__ai_assistant__AiAssistantFeedbackRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantFeedbackResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_knowledge_base_api_ai_assistant_knowledge_base_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_memory_bank_api_ai_assistant_memory_bank_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankAiAssistantRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankAiAssistantResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get: { - parameters: { - query?: { - /** @description Max turns. */ - limit?: number; - /** @description Skip count. */ - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankLastConversationResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_memory_bank_accept_api_ai_assistant_memory_bank__conversation_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankAcceptRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["OkResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_solution_api_ai_assistant_solution_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_source_api_ai_assistant_source_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_accept_api_ai_assistant__conversation_id__accept_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantAcceptRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantAcceptResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_decline_api_ai_assistant__conversation_id__decline_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_alerts_api_alerts_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - /** @description Filter by alert status */ - status?: string | null; - /** @description Filter by agent ID */ - agent_id?: string | null; - /** @description Filter by source connection ID */ - source_connection_id?: string | null; - /** @description From (ISO 8601) */ - time_from?: string | null; - /** @description To (ISO 8601) */ - time_to?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_alert_configs_api_alerts_configs_get: { - parameters: { - query?: { - /** @description Filter by agent ID */ - agent_id?: string | null; - /** @description Filter by source connection ID */ - source_connection_id?: string | null; - /** @description Set to 'source' to list account-level source alert configs */ - scope?: string | null; - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AlertConfigListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_alert_config_api_alerts_configs_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateAlertConfigRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AlertConfigResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_alert_config_api_alerts_configs__config_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - config_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AlertConfigResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_alert_config_api_alerts_configs__config_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - config_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_alert_config_api_alerts_configs__config_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - config_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateAlertConfigRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AlertConfigResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_organization_preferences_api_alerts_organization_preferences_list_get: { - parameters: { - query?: { - /** @description Optional organization filter */ - organization_id?: string | null; - /** @description Include default subscribed entries for all alert types */ - include_defaults?: boolean; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["OrganizationAlertPreferenceListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_organization_preference_api_alerts_organization_preferences__organization_id___alert_type__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - organization_id: string; - alert_type: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__alerts__UpdateOrganizationAlertPreferenceRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__OrganizationAlertPreferenceResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_alert_detail_api_alerts__alert_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - add_alert_comment_api_alerts__alert_id__comments_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__alerts__AddCommentRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - change_alert_status_api_alerts__alert_id__status_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["ChangeStatusRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - subscribe_to_alert_api_alerts__alert_id__subscribe_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - unsubscribe_from_alert_api_alerts__alert_id__unsubscribe_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_cloud_drives_api_api_cloud_drives_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveResponseModel"][]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_cloud_drive_providers_api_api_cloud_drives_providers_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveProviderResponseModel"][]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_cloud_drive_api_api_cloud_drives__connection_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_cloud_drive_api_api_cloud_drives__connection_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["OkResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_cloud_drive_api_api_cloud_drives__connection_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CloudDriveUpdateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agents_using_cloud_drive_api_api_cloud_drives__connection_id__agents_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentUsingCloudDriveResponseModel"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - disconnect_cloud_drive_api_api_cloud_drives__connection_id__disconnect_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_cloud_drive_rejections_api_api_cloud_drives__connection_id__rejections_get: { - parameters: { - query?: { - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveRejectionResponseModel"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_content_detail_api_contents__source_connection_content_version__get: { - parameters: { - query?: { - start?: number; - end?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__ContentDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - replace_content_with_inline_text_api_contents__source_connection_content_version__put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["InlineTextReplaceRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__FileUploadResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_content_api_contents__source_connection_content_version__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description The key's user is a member of the account but not an owner or administrator (`error.code` is `permission_denied`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_content_embeddings_api_contents__source_connection_content_version__embeddings_get: { - parameters: { - query?: { - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__ContentEmbeddingsListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - upload_file_to_content_api_contents__source_connection_content_version__upload_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "multipart/form-data": components["schemas"]["Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__FileUploadResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - docs_search_api_docs_search_get: { - parameters: { - query: { - /** @description Search query */ - q: string; - /** @description Search strategy */ - mode?: "keyword" | "semantic"; - /** @description Maximum results */ - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__docs_search__DocsSearchResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_email_domains_api_api_email_domains_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailDomainsListResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - add_email_domain_api_api_email_domains_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["AddEmailDomainRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailDomainResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - use_shared_domain_api_api_email_domains_use_shared_domain_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - remove_email_domain_api_api_email_domains__domain_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - domain_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["RemoveEmailDomainResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_dmarc_summary_api_api_email_domains__domain_id__dmarc_get: { - parameters: { - query?: { - days?: number; - top_sources?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - domain_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["DmarcSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - set_primary_email_domain_api_api_email_domains__domain_id__primary_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - domain_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailDomainResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - send_test_email_api_api_email_domains__domain_id__test_email_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - domain_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SendTestEmailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - verify_email_domain_api_api_email_domains__domain_id__verify_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - domain_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailDomainResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - governance_ai_generate_api_governance_ai_assistant_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__governance__GovernanceAiAssistantRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GovernanceAiAssistantResponse"]; - }; - }; - /** @description AI assistant error. */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Plan does not include governance access. */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_governance_ai_conversations_api_governance_ai_assistant_conversations_get: { - parameters: { - query?: { - /** @description Number of conversations. */ - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__governance__GovernanceConversationResponse"][]; - }; - }; - /** @description Plan does not include governance access. */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - governance_ai_accept_api_governance_ai_assistant__conversation_id__accept_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GovernanceAiAcceptResponse"]; - }; - }; - /** @description Plan already accepted/declined or AI error. */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Plan does not include governance access. */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - governance_ai_decline_api_governance_ai_assistant__conversation_id__decline_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Plan already accepted/declined or AI error. */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Plan does not include governance access. */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_knowledge_bases_api_knowledge_bases_get: { - parameters: { - query?: { - /** @description Page number (1-based). */ - page?: number; - /** @description Items per page. */ - limit?: number; - /** @description Sort field. One of: created_at, updated_at, name. */ - sort?: string; - /** @description Sort direction: asc or desc. */ - order?: string; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["KnowledgeBaseListResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_knowledge_base_api_knowledge_bases_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateKnowledgeBaseBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["KnowledgeBaseResponseModel"]; - }; - }; - /** @description Insufficient credits or no active subscription — the account has exhausted its credits or does not have a valid subscription. */ - 402: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_knowledge_base_api_knowledge_bases__knowledge_base_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - knowledge_base_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["KnowledgeBaseResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_knowledge_base_api_knowledge_bases__knowledge_base_id__put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - knowledge_base_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateKnowledgeBaseBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["KnowledgeBaseResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_knowledge_base_api_knowledge_bases__knowledge_base_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - knowledge_base_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_me_api_me_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MeResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_memory_banks_api_memory_banks_get: { - parameters: { - query?: { - /** @description Page number (1-based). */ - page?: number; - /** @description Items per page. */ - limit?: number; - /** @description Sort field. One of: created_at, updated_at, name. */ - sort?: string; - /** @description Sort direction: asc or desc. */ - order?: string; - /** @description Filter by bank type: conversation or general. */ - type?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankListResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_memory_bank_api_memory_banks_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateMemoryBankBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - memory_bank_ai_generate_api_memory_banks_ai_assistant_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankAiAssistantRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankAiAssistantResponse"]; - }; - }; - /** @description AI assistant error. */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get: { - parameters: { - query?: { - /** @description Max turns to return. */ - limit?: number; - /** @description Number of most-recent turns to skip. */ - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankLastConversationResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - memory_bank_ai_accept_api_memory_banks_ai_assistant__conversation_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankAcceptRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["OkResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_templates_api_memory_banks_templates_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": unknown; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - test_compaction_prompt_standalone_api_memory_banks_test_compaction_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["StandaloneTestCompactionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CompactionTestResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_memory_bank_api_memory_banks__memory_bank_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_memory_bank_api_memory_banks__memory_bank_id__put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateMemoryBankBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_memory_bank_api_memory_banks__memory_bank_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agents_using_bank_api_memory_banks__memory_bank_id__agents_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": unknown; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - compact_memory_bank_api_memory_banks__memory_bank_id__compact_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 202: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CompactionScheduledResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_memory_bank_source_api_memory_banks__memory_bank_id__source_delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_memory_bank_entry_stats_api_memory_banks__memory_bank_id__stats_get: { - parameters: { - query?: { - days?: number; - start_date?: string | null; - end_date?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - [key: string]: unknown; - }; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - test_compaction_prompt_api_memory_banks__memory_bank_id__test_compaction_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["TestCompactionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CompactionTestResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_models_api_models_get: { - parameters: { - query?: { - /** @description Filter by provider name */ - provider?: string | null; - /** @description Filter to models that support tool use */ - supports_tool_use?: boolean | null; - /** @description Filter to models that support extended thinking */ - supports_thinking?: boolean | null; - /** @description Filter to models that accept this input modality — a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME. */ - supports_input_media?: string | null; - /** @description Filter to models that produce this output modality — a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find image/audio/video generation models. */ - supports_output_media?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["schemas__model_responses__ProviderGroupResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_alerts_api_models_alerts_get: { - parameters: { - query?: { - /** @description Filter alerts to a specific agent UUID. */ - agent_id?: string | null; - /** @description When true, only return unread alerts. */ - unread_only?: boolean; - /** @description Maximum number of alerts to return (1-100). */ - limit?: number; - /** @description Pagination offset. */ - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__model_lifecycle__ModelAlertListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - mark_all_read_api_models_alerts_mark_all_read_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_alert_unread_count_api_models_alerts_unread_count_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["UnreadCountResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - mark_read_api_models_alerts__alert_id__read_patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_embedding_models_api_models_embedders_get: { - parameters: { - query?: { - /** @description Filter to embedders that can index this input modality — a coarse kind (text, image, video, audio) or a full MIME. */ - supports_input_media?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmbeddingModelListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_generation_tiers_api_models_generation_tiers_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GenerationTierListResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_experiments_api_models_playground_experiments_get: { - parameters: { - query?: { - /** @description Look-back window in days. */ - days?: number; - /** @description Explicit start date (overrides days). */ - start_date?: string | null; - /** @description Explicit end date (overrides days). */ - end_date?: string | null; - /** @description Page size. */ - limit?: number; - /** @description Pagination offset. */ - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ExperimentListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_experiment_api_models_playground_experiments_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["PlaygroundCreateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CreateExperimentResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_experiment_api_models_playground_experiments__experiment_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - experiment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ExperimentDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_experiment_endpoint_api_models_playground_experiments__experiment_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - experiment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - experiment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CancelExperimentResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_reranker_models_api_models_rerankers_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["RerankerModelListResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_model_api_models__model_id__details_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - model_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["schemas__model_responses__PromptModelResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_recommendations_api_models__model_id__recommendations_get: { - parameters: { - query?: { - /** @description Only recommend models that support tool use. */ - require_tool_use?: boolean | null; - /** @description Only recommend models that support structured output. */ - require_structured_output?: boolean | null; - /** @description Only recommend models that support thinking/reasoning. */ - require_thinking?: boolean | null; - /** @description Minimum context window size in tokens. */ - min_context_tokens?: number | null; - /** @description Minimum output token limit. */ - min_output_tokens?: number | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - model_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__model_lifecycle__ModelRecommendationsResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - search_api_search_get: { - parameters: { - query: { - /** @description Search query */ - q: string; - /** @description Maximum results */ - limit?: number; - /** @description Optional entity type filter (e.g. 'agent', 'knowledge_base') */ - entity_type?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__search__SearchResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_solutions_api_solutions_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - /** @description Sort field */ - sort?: string; - /** @description Sort order */ - order?: string; - /** @description Filter by solution name (case-insensitive partial match) */ - search?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_solution_api_solutions_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateSolutionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_solution_api_solutions__solution_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_solution_api_solutions__solution_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_solution_api_solutions__solution_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateSolutionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - link_agents_api_solutions__solution_id__agents_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["LinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - unlink_agents_api_solutions__solution_id__agents_delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UnlinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - ai_assistant_generate_api_solutions__solution_id__ai_assistant_generate_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - ai_assistant_knowledge_base_api_solutions__solution_id__ai_assistant_knowledge_base_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - ai_assistant_source_api_solutions__solution_id__ai_assistant_source_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - ai_assistant_accept_api_solutions__solution_id__ai_assistant__conversation_id__accept_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantAcceptRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantAcceptResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - ai_assistant_decline_api_solutions__solution_id__ai_assistant__conversation_id__decline_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - conversation_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_conversations_api_solutions__solution_id__conversations_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionConversationResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - add_conversation_turn_api_solutions__solution_id__conversations_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["AddConversationTurnRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionConversationResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - mark_conversation_turn_api_solutions__solution_id__conversations__conversation_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["MarkConversationTurnRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - link_knowledge_bases_api_solutions__solution_id__knowledge_bases_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["LinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - unlink_knowledge_bases_api_solutions__solution_id__knowledge_bases_delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UnlinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - link_source_connections_api_solutions__solution_id__source_connections_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["LinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - unlink_source_connections_api_solutions__solution_id__source_connections_delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UnlinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_sources_api_sources_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - /** @description Sort field */ - sort?: string; - /** @description Sort order */ - order?: string; - /** @description List sources for the given account. Defaults to the caller's account. */ - account_id?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__sources__SourceListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_source_api_sources_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateSourceBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceResponse"]; - }; - }; - /** @description Insufficient credits or no active subscription — the account has exhausted its credits or does not have a valid subscription. */ - 402: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_source_api_sources__source_connection_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_source_api_sources__source_connection_id__put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateSourceBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - upload_inline_text_to_source_api_sources__source_connection_id__post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["InlineTextUploadRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__sources__FileUploadResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_source_api_sources__source_connection_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_source_contents_api_sources__source_connection_id__contents_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - /** @description Sort field (created_at/title/status) */ - sort?: string; - /** @description Sort order */ - order?: string; - /** @description Filter to one status: pending, fetching, transcribing, scanning, indexing, completed, or failed. Use `failed` to list only the items that could not be indexed. */ - status?: string | null; - /** @description Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. The ids travel in the query string, so keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches the API. The API itself accepts at most 500 — beyond either limit, split the poll or page through the unfiltered listing. */ - content_version_id?: string[] | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceContentStatusListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_source_content_status_endpoint_api_sources__source_connection_id__contents__content_version_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - content_version_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceContentStatusResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_source_embedding_migration_api_sources__source_connection_id__embedding_migration_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceEmbeddingMigrationResponse"] | null; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - start_source_embedding_migration_api_sources__source_connection_id__embedding_migration_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["StartSourceEmbeddingMigrationRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceEmbeddingMigrationResponse"]; - }; - }; - /** @description A migration is already active for this source, or the target matches the current settings. */ - 409: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - cancel_source_embedding_migration_api_sources__source_connection_id__embedding_migration_cancel_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceEmbeddingMigrationResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_source_exports_api_sources__source_connection_id__exports_get: { - parameters: { - query?: { - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ExportListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_source_export_api_sources__source_connection_id__exports_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__source_exports__CreateExportRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 202: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__source_exports__ExportResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - estimate_source_export_api_sources__source_connection_id__exports_estimate_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__source_exports__EstimateExportRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__source_exports__EstimateExportResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_source_export_api_sources__source_connection_id__exports__export_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - export_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__source_exports__ExportResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_source_export_api_sources__source_connection_id__exports__export_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - export_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - cancel_source_export_api_sources__source_connection_id__exports__export_id__cancel_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - export_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__source_exports__ExportResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - download_source_export_api_sources__source_connection_id__exports__export_id__download_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - export_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": unknown; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - upload_file_to_source_api_sources__source_connection_id__upload_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "multipart/form-data": components["schemas"]["Body_upload_file_to_source_api_sources__source_connection_id__upload_post"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__sources__FileUploadResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - serve_agent_run_attachment_api_v2_agent_runs__run_id__attachments__attachment_id__get: { - parameters: { - query?: { - download_name?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - run_id: string; - attachment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Attachment bytes streamed with the resolved MIME type (inline-safe types keep their declared type; everything else is ``application/octet-stream``). */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/octet-stream": string; - "application/pdf": string; - "application/vnd.seclai.manifest+json": string; - "audio/*": string; - "image/*": string; - "text/plain": string; - "video/*": string; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_api_version_api_version_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ApiVersionResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_api_version_api_version_put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateApiVersionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ApiVersionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; -} diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index ad0004b..0000000 --- a/src/types.ts +++ /dev/null @@ -1,802 +0,0 @@ -/** - * @module - * - * Developer-friendly type aliases for Seclai API request and response shapes. - * - * Every type is an alias over the auto-generated OpenAPI schema in `openapi.ts`, - * giving a stable, readable name that won't change if the generated identifiers - * are regenerated. - */ -import type { components } from "./openapi"; - -// ─── General ───────────────────────────────────────────────────────────────── - -/** JSON-serializable values accepted/returned by the SDK's low-level `request()` method. */ -export type JSONValue = - | { [key: string]: JSONValue } - | JSONValue[] - | string - | number - | boolean - | null; - -/** Standard OpenAPI validation error shape (typically HTTP 422). */ -export type HTTPValidationError = components["schemas"]["HTTPValidationError"]; - -/** Individual validation error entry within an {@link HTTPValidationError}. */ -export type ValidationError = components["schemas"]["ValidationError"]; - -/** Pagination metadata included in list responses. */ -export type PaginationResponse = components["schemas"]["PaginationResponse"]; - -// ─── Identity ──────────────────────────────────────────────────────────────── - -/** The authenticated user's personal account ID and the organizations they belong to. */ -export type MeResponse = components["schemas"]["MeResponse"]; - -/** One organization the authenticated user belongs to, within a {@link MeResponse}. */ -export type OrganizationInfoResponse = components["schemas"]["OrganizationInfoResponse"]; - -// ─── Agents ────────────────────────────────────────────────────────────────── - -/** Paginated list of agents. */ -export type AgentListResponse = components["schemas"]["routers__api__agents__AgentListResponse"]; - -/** Full agent configuration including definition and metadata. */ -export type AgentDefinitionResponse = components["schemas"]["AgentDefinitionResponse"]; - -/** Portable JSON snapshot of an agent definition. */ -export type AgentExportResponse = components["schemas"]["AgentExportResponse"]; - -/** Summary of an agent (returned on create/update). */ -export type AgentSummaryResponse = components["schemas"]["AgentSummaryResponse"]; - -/** Request body for creating an agent. */ -export type CreateAgentRequest = components["schemas"]["routers__api__agents__CreateAgentRequest"]; - -/** Request body for updating an agent. */ -export type UpdateAgentRequest = components["schemas"]["routers__api__agents__UpdateAgentRequest"]; - -/** Request body for updating an agent definition (steps, model, etc.). */ -export type UpdateAgentDefinitionRequest = components["schemas"]["UpdateAgentDefinitionRequest"]; - -/** Request body for previewing an agent_definition import (dry-run validation). */ -export type AgentImportPreviewRequest = components["schemas"]["routers__api__agents__AgentImportPreviewRequest"]; - -/** Response body summarising a successfully validated agent_definition import payload. */ -export type AgentImportPreviewResponse = components["schemas"]["routers__api__agents__AgentImportPreviewResponse"]; - -/** - * 422 response body for invalid `agent_definition` payloads on create/update/preview-import. - * Errors carry 1-indexed line/column references into the canonical `source` echo. - */ -export type AgentDefinitionImportErrorResponse = components["schemas"]["AgentDefinitionImportErrorResponse"]; - -/** Single validation error within an {@link AgentDefinitionImportErrorResponse} (with source position). */ -export type ImportFieldErrorModel = components["schemas"]["ImportFieldErrorModel"]; - -/** One item dropped or substituted during an agent import (emitted in `import_warnings`). */ -export type ImportSkipResponse = components["schemas"]["ImportSkipResponse"]; - -/** Reference to a governance policy (id and optional display name). */ -export type GovernancePolicyRefResponse = components["schemas"]["routers__api__agents__GovernancePolicyRefResponse"]; - -/** A live agent that calls another agent via a `call_agent` step (blocks disabling the callee). */ -export type AgentCallerApiResponse = components["schemas"]["AgentCallerApiResponse"]; - -// ─── Agent Email Triggers ──────────────────────────────────────────────────── - -/** - * Request body for configuring an `EMAIL_RECEIVED` trigger. - * - * An omitted field is left unchanged; passing `null` (or `""` for `alias`) clears it. - */ -export type SetEmailTriggerConfigRequest = components["schemas"]["routers__api__agents__SetEmailTriggerConfigRequest"]; - -/** An `EMAIL_RECEIVED` trigger's resolved email address(es) and inbound-handling config. */ -export type EmailTriggerConfigResponse = components["schemas"]["EmailTriggerConfigResponse"]; - -// ─── Agent Email Governance ────────────────────────────────────────────────── - -/** A recipient's opt-out from an account's agent emails (one agent, or account-wide). */ -export type AgentEmailOptOutResponse = components["schemas"]["AgentEmailOptOutResponse"]; - -/** A page of agent-email opt-outs plus the total count. */ -export type AgentEmailOptOutListResponse = components["schemas"]["AgentEmailOptOutListResponse"]; - -/** Request body for blocking an inbound email sender or domain. */ -export type BlockEmailSenderRequest = components["schemas"]["BlockEmailSenderRequest"]; - -/** A single blocked inbound email sender. */ -export type BlockedEmailSenderResponse = components["schemas"]["BlockedEmailSenderResponse"]; - -/** A page of blocked senders plus the account's governance auto-block mode. */ -export type BlockedEmailSenderListResponse = components["schemas"]["BlockedEmailSenderListResponse"]; - -/** Request body for setting the governance auto-block mode. */ -export type SetAutoBlockModeRequest = components["schemas"]["SetAutoBlockModeRequest"]; - -/** An inbound email that was discarded before running an agent. */ -export type InboundEmailRejectionResponse = components["schemas"]["InboundEmailRejectionResponse"]; - -/** Account-wide inbound-email overload state (breaker paused + queued backlog size). */ -export type InboundEmailStatusResponse = components["schemas"]["InboundEmailStatusResponse"]; - -/** Number of queued inbound-email runs cancelled. */ -export type CancelQueuedRunsResponse = components["schemas"]["CancelQueuedRunsResponse"]; - -/** Result of manually lifting the inbound-email pause. */ -export type ResumeInboundResponse = components["schemas"]["ResumeInboundResponse"]; - -// ─── Agent Runs ────────────────────────────────────────────────────────────── - -/** Request body for starting an agent run. */ -export type AgentRunRequest = components["schemas"]["AgentRunRequest"]; - -/** Request body for starting an agent run in streaming mode (SSE). */ -export type AgentRunStreamRequest = components["schemas"]["AgentRunStreamRequest"]; - -/** Response body describing an agent run. */ -export type AgentRunResponse = components["schemas"]["AgentRunResponse"]; - -/** Paginated list of agent runs. */ -export type AgentRunListResponse = components["schemas"]["routers__api__agents__AgentRunListResponse"]; - -/** Details of a single step within an agent run. */ -export type AgentRunStepResponse = components["schemas"]["AgentRunStepResponse"]; - -/** Details of a single attempt within an agent run step. */ -export type AgentRunAttemptResponse = components["schemas"]["AgentRunAttemptResponse"]; - -/** A file a run or step produced or received (within `attachments`). */ -export type AgentRunFileResponse = components["schemas"]["AgentRunFileResponse"]; - -/** A single LLM tool call made during a `prompt_call` step (within {@link AgentRunStepResponse}'s `tool_calls`). */ -export type AgentRunToolCallResponse = components["schemas"]["AgentRunToolCallResponse"]; - -/** Search request for agent runs (traces). */ -export type AgentTraceSearchRequest = components["schemas"]["routers__api__agents__AgentTraceSearchRequest"]; - -/** Search response containing matching agent runs. */ -export type AgentTraceSearchResponse = components["schemas"]["AgentTraceSearchResponse"]; - -/** Individual match within an agent trace search. */ -export type AgentTraceMatchResponse = components["schemas"]["AgentTraceMatchResponse"]; - -// ─── Agent Input Uploads ───────────────────────────────────────────────────── - -/** Response from uploading a file input for an agent run. */ -export type UploadAgentInputApiResponse = components["schemas"]["UploadAgentInputApiResponse"]; - -/** - * Static attachment-reference contract for an agent — what files (if any) its - * templates expect on a run, so uploads can be staged before calling `runAgent`. - */ -export type AgentAttachmentRefsApiResponse = components["schemas"]["AgentAttachmentRefsApiResponse"]; - -/** Per-source attachment-reference summary (exact names, indexes, glob patterns) within an {@link AgentAttachmentRefsApiResponse}. */ -export type AttachmentRefsSourceApiSummary = components["schemas"]["AttachmentRefsSourceApiSummary"]; - -// ─── Agent Steps AI Assistant ──────────────────────────────────────────────── - -/** Request body for generating agent workflow steps via AI. */ -export type GenerateAgentStepsRequest = components["schemas"]["GenerateAgentStepsRequest"]; - -/** Response containing AI-generated agent workflow steps. */ -export type GenerateAgentStepsResponse = components["schemas"]["GenerateAgentStepsResponse"]; - -/** Request body for generating a single step config via AI. */ -export type GenerateStepConfigRequest = components["schemas"]["GenerateStepConfigRequest"]; - -/** Response containing an AI-generated step config. */ -export type GenerateStepConfigResponse = components["schemas"]["GenerateStepConfigResponse"]; - -/** Example prompt entry used in step config generation. */ -export type ExamplePrompt = components["schemas"]["ExamplePrompt"]; - -/** Request body for marking an AI suggestion as accepted/rejected. */ -export type MarkAiSuggestionRequest = components["schemas"]["MarkAiSuggestionRequest"]; - -/** AI conversation history for an agent. */ -export type AiConversationHistoryResponse = components["schemas"]["AiConversationHistoryResponse"]; - -/** Individual turn in an AI conversation. */ -export type AiConversationTurnResponse = components["schemas"]["AiConversationTurnResponse"]; - -// ─── Agent Evaluations ─────────────────────────────────────────────────────── - -/** Evaluation tier: fast, balanced, or thorough. */ -export type AgentEvaluationTier = components["schemas"]["AgentEvaluationTier"]; - -/** Evaluation criteria configuration for an agent. */ -export type EvaluationCriteriaResponse = components["schemas"]["EvaluationCriteriaResponse"]; - -/** A page of alerts. Always the canonical `{data, pagination}` envelope. */ -export type AlertListResponse = components["schemas"]["routers__api__alerts__AlertListResponse"]; - -/** A single alert. */ -export type AlertResponse = components["schemas"]["routers__api__alerts__AlertResponse"]; - -/** A single alert configuration. */ -export type AlertConfigResponse = components["schemas"]["AlertConfigResponse"]; - -/** - * A page of alert configurations. - * - * The top-level key is version-gated: `configs` alongside `total` by default, - * the canonical `{data, pagination}` envelope once `apiVersion` is `2026-07-27` - * or later. Both are declared optional so either shape type-checks. - */ -export type AlertConfigListResponse = { - configs?: AlertConfigResponse[]; - data?: AlertConfigResponse[]; - pagination?: PaginationResponse; - total?: number; -}; - -/** A single model lifecycle alert. */ -export type ModelAlertResponse = components["schemas"]["routers__api__model_lifecycle__ModelAlertResponse"]; - -/** - * A page of model lifecycle alerts. - * - * The top-level key is version-gated: `alerts` alongside `total` by default, the - * canonical `{data, pagination}` envelope once `apiVersion` is `2026-07-27` or - * later. Both are declared optional so either shape type-checks. - */ -export type ModelAlertListResponse = { - alerts?: ModelAlertResponse[]; - data?: ModelAlertResponse[]; - pagination?: PaginationResponse; - total?: number; -}; - -/** A single alert with its comments, subscribers and history. */ -export type AlertDetailResponse = components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - -/** A comment on an alert. */ -export type AlertCommentResponse = components["schemas"]["routers__api__alerts__AlertCommentResponse"]; - -/** A subscriber to an alert. */ -export type AlertSubscriberResponse = components["schemas"]["routers__api__alerts__AlertSubscriberResponse"]; - -/** A count of unread items. */ -export type UnreadCountResponse = components["schemas"]["UnreadCountResponse"]; - -/** Successor recommendations for a model. */ -export type ModelRecommendationsResponse = components["schemas"]["routers__api__model_lifecycle__ModelRecommendationsResponse"]; - -/** A single successor recommendation. */ -export type ModelRecommendationResponse = components["schemas"]["routers__api__model_lifecycle__ModelRecommendationResponse"]; - -/** A page of model playground experiments. */ -export type ExperimentListResponse = components["schemas"]["ExperimentListResponse"]; - -/** A model playground experiment in a listing. */ -export type ExperimentSummaryResponse = components["schemas"]["ExperimentSummaryResponse"]; - -/** A model playground experiment with its results. */ -export type ExperimentDetailResponse = components["schemas"]["ExperimentDetailResponse"]; - -/** Acknowledgement of a created experiment. */ -export type CreateExperimentResponse = components["schemas"]["CreateExperimentResponse"]; - -/** Acknowledgement of a cancelled experiment. */ -export type CancelExperimentResponse = components["schemas"]["CancelExperimentResponse"]; - -/** A ranked set of search results. Deliberately not paginated. */ -export type SearchResponse = components["schemas"]["routers__api__search__SearchResponse"]; - -/** A single search hit. */ -export type SearchResultResponse = components["schemas"]["routers__api__search__SearchResultResponse"]; - -/** A simple acknowledgement. */ -export type OkResponse = components["schemas"]["OkResponse"]; - -/** The API version a request resolved to, and the versions available. */ -export type ApiVersionResponse = components["schemas"]["ApiVersionResponse"]; - -/** - * A page of evaluation criteria. - * - * Not a generated type: the endpoint returns a bare array by default, and only - * emits the canonical `{data, pagination}` envelope once the caller opts in with - * `apiVersion: "2026-07-27"` or later. `pagination` is therefore absent unless - * opted in. - */ -export type EvaluationCriteriaListResponse = { - data: EvaluationCriteriaResponse[]; - pagination?: PaginationResponse; -}; - -/** Request body for creating evaluation criteria. */ -export type CreateEvaluationCriteriaRequest = components["schemas"]["CreateEvaluationCriteriaRequest"]; - -/** Request body for updating evaluation criteria. */ -export type UpdateEvaluationCriteriaRequest = components["schemas"]["UpdateEvaluationCriteriaRequest"]; - -/** Individual evaluation result. */ -export type EvaluationResultResponse = components["schemas"]["EvaluationResultResponse"]; - -/** Paginated list of evaluation results. */ -export type EvaluationResultListResponse = components["schemas"]["EvaluationResultListResponse"]; - -/** Request body for creating a manual evaluation result. */ -export type CreateEvaluationResultRequest = components["schemas"]["CreateEvaluationResultRequest"]; - -/** Summary of evaluation results for a criteria. */ -export type EvaluationResultSummaryResponse = components["schemas"]["EvaluationResultSummaryResponse"]; - -/** Evaluation result with its associated criteria. */ -export type EvaluationResultWithCriteriaResponse = components["schemas"]["EvaluationResultWithCriteriaResponse"]; - -/** Paginated list of evaluation results with criteria. */ -/** - * A page of evaluation results with criteria context. - * - * Not a generated type: two endpoints share this shape and populate different - * halves of it. - * - * - `GET /agents/{id}/evaluation-results` is always paginated and fills `total`, - * `page` and `limit`. - * - `GET /agents/{id}/runs/{runId}/evaluation-results` is version-gated: a bare - * array by default, and the canonical `{data, pagination}` envelope once - * `apiVersion` is `2026-07-27` or later — in which case the metadata is on - * `pagination` and the flat fields are absent. - */ -export type EvaluationResultWithCriteriaListResponse = Omit< - components["schemas"]["EvaluationResultWithCriteriaListResponse"], - "total" | "page" | "limit" -> & { - pagination?: PaginationResponse; - total?: number; - page?: number; - limit?: number; -}; - -/** Summary of an evaluation run. */ -export type EvaluationRunSummaryResponse = components["schemas"]["EvaluationRunSummaryResponse"]; - -/** Paginated list of evaluation run summaries. */ -export type EvaluationRunSummaryListResponse = components["schemas"]["EvaluationRunSummaryListResponse"]; - -/** Status of an evaluation: pending, passed, failed, skipped, or error. */ -export type EvaluationStatus = components["schemas"]["EvaluationStatus"]; - -/** Summary of non-manual (automated) evaluation results. */ -export type NonManualEvaluationSummaryResponse = components["schemas"]["schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse"]; - -/** Per-mode stats within a non-manual evaluation summary. */ -export type NonManualEvaluationModeStatResponse = components["schemas"]["schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse"]; - -/** Request for testing a draft evaluation. */ -export type TestDraftEvaluationRequest = components["schemas"]["TestDraftEvaluationRequest"]; - -/** Response from testing a draft evaluation. */ -export type TestDraftEvaluationResponse = components["schemas"]["TestDraftEvaluationResponse"]; - -/** Paginated list of runs compatible with a specific evaluation criteria. */ -export type CompatibleRunListResponse = components["schemas"]["CompatibleRunListResponse"]; - -/** Individual compatible run. */ -export type CompatibleRunResponse = components["schemas"]["CompatibleRunResponse"]; - -// ─── Knowledge Bases ───────────────────────────────────────────────────────── - -/** Paginated list of knowledge bases. */ -export type KnowledgeBaseListResponse = components["schemas"]["KnowledgeBaseListResponseModel"]; - -/** Full knowledge base configuration and metadata. */ -export type KnowledgeBaseResponse = components["schemas"]["KnowledgeBaseResponseModel"]; - -/** Request body for creating a knowledge base. */ -export type CreateKnowledgeBaseBody = components["schemas"]["CreateKnowledgeBaseBody"]; - -/** Request body for updating a knowledge base. */ -export type UpdateKnowledgeBaseBody = components["schemas"]["UpdateKnowledgeBaseBody"]; - -// ─── Memory Banks ──────────────────────────────────────────────────────────── - -/** Paginated list of memory banks. */ -export type MemoryBankListResponse = components["schemas"]["MemoryBankListResponseModel"]; - -/** Full memory bank configuration and metadata. */ -export type MemoryBankResponse = components["schemas"]["MemoryBankResponseModel"]; - -/** Request body for creating a memory bank. */ -export type CreateMemoryBankBody = components["schemas"]["CreateMemoryBankBody"]; - -/** Request body for updating a memory bank. */ -export type UpdateMemoryBankBody = components["schemas"]["UpdateMemoryBankBody"]; - -/** Memory bank AI assistant request. */ -export type MemoryBankAiAssistantRequest = components["schemas"]["routers__api__memory_banks__MemoryBankAiAssistantRequest"]; - -/** Memory bank AI assistant response. */ -export type MemoryBankAiAssistantResponse = components["schemas"]["MemoryBankAiAssistantResponse"]; - -/** Memory bank AI accept request. */ -export type MemoryBankAcceptRequest = components["schemas"]["routers__api__memory_banks__MemoryBankAcceptRequest"]; - -/** Memory bank configuration generated by AI. */ -export type MemoryBankConfigResponse = components["schemas"]["MemoryBankConfigResponse"]; - -/** Last conversation for a memory bank AI assistant. */ -export type MemoryBankLastConversationResponse = components["schemas"]["routers__api__memory_banks__MemoryBankLastConversationResponse"]; - -/** Individual turn in a memory bank AI conversation. */ -export type MemoryBankConversationTurnResponse = components["schemas"]["routers__api__memory_banks__MemoryBankConversationTurnResponse"]; - -/** Compaction test request for memory banks. */ -export type TestCompactionRequest = components["schemas"]["TestCompactionRequest"]; - -/** Compaction test response. */ -export type CompactionTestResponse = components["schemas"]["CompactionTestResponseModel"]; - -/** Standalone compaction test request. */ -export type StandaloneTestCompactionRequest = components["schemas"]["StandaloneTestCompactionRequest"]; - -/** Compaction evaluation model result. */ -export type CompactionEvaluationModel = components["schemas"]["CompactionEvaluationModel"]; - -// ─── Sources ───────────────────────────────────────────────────────────────── - -/** Paginated list of sources. */ -export type SourceListResponse = components["schemas"]["routers__api__sources__SourceListResponse"]; - -/** Full source response with metadata, sync status, and configuration. */ -export type SourceResponse = components["schemas"]["SourceResponse"]; - -/** Detailed source connection model. */ -export type SourceConnectionResponse = components["schemas"]["SourceConnectionResponseModel"]; - -/** Request body for creating a source. */ -export type CreateSourceBody = components["schemas"]["CreateSourceBody"]; - -/** Request body for updating a source. */ -export type UpdateSourceBody = components["schemas"]["UpdateSourceBody"]; - -/** Upload response for file uploads to a source. */ -export type FileUploadResponse = components["schemas"]["routers__api__sources__FileUploadResponse"]; - -/** Request body for uploading inline text to a source. */ -export type InlineTextUploadRequest = components["schemas"]["InlineTextUploadRequest"]; - -/** Request body for replacing content with inline text. */ -export type InlineTextReplaceRequest = components["schemas"]["InlineTextReplaceRequest"]; - -/** One content item's indexing status within a source. */ -export type SourceContentStatusResponse = components["schemas"]["SourceContentStatusResponse"]; - -/** Paginated list of a source's content items and their indexing status. */ -export type SourceContentStatusListResponse = components["schemas"]["SourceContentStatusListResponse"]; - -/** Filters for {@link Seclai.listSourceContents}. */ -export interface ListSourceContentsOptions extends SortableListOptions { - /** Keep only one status: pending, fetching, transcribing, scanning, indexing, completed or failed. */ - status?: string; - /** - * Keep only these items — the `content_version_id` values the upload methods - * return. Keep it to about 100: the ids travel in the query string, and a URL - * over 8,192 bytes is rejected with a 414. The API itself accepts at most 500. - */ - contentVersionIds?: string[]; -} - -// ─── Cloud Drives ──────────────────────────────────────────────────────────── - -/** A cloud-drive provider this deployment has configured. */ -export type CloudDriveProviderResponse = components["schemas"]["CloudDriveProviderResponseModel"]; - -/** An OAuth scope a {@link CloudDriveProviderResponse} can request. */ -export type CloudDriveScopeResponse = components["schemas"]["CloudDriveScopeResponseModel"]; - -/** An access level a {@link CloudDriveProviderResponse} offers. */ -export type CloudDriveAccessLevelResponse = components["schemas"]["CloudDriveAccessLevelResponseModel"]; - -/** A cloud-drive connection. */ -export type CloudDriveResponse = components["schemas"]["CloudDriveResponseModel"]; - -/** Request body for updating a cloud-drive connection. */ -export type CloudDriveUpdateRequest = components["schemas"]["CloudDriveUpdateRequest"]; - -/** An agent that uses a cloud-drive connection. */ -export type AgentUsingCloudDriveResponse = components["schemas"]["AgentUsingCloudDriveResponseModel"]; - -/** A file a cloud-drive connection skipped, and why. */ -export type CloudDriveRejectionResponse = components["schemas"]["CloudDriveRejectionResponseModel"]; - -// ─── Source Exports ────────────────────────────────────────────────────────── - -/** Paginated list of source exports. */ -export type ExportListResponse = components["schemas"]["ExportListResponse"]; - -/** Response for a single source export. */ -export type ExportResponse = components["schemas"]["routers__api__source_exports__ExportResponse"]; - -/** Request body for creating a source export. */ -export type CreateExportRequest = components["schemas"]["routers__api__source_exports__CreateExportRequest"]; - -/** Request body for estimating a source export. */ -export type EstimateExportRequest = components["schemas"]["routers__api__source_exports__EstimateExportRequest"]; - -/** Response for a source export estimate. */ -export type EstimateExportResponse = components["schemas"]["routers__api__source_exports__EstimateExportResponse"]; - -/** Supported export formats. */ -export type ExportFormat = components["schemas"]["ExportFormat"]; - -// ─── Source Embedding Migrations ───────────────────────────────────────────── - -/** Response for a source embedding migration. */ -export type SourceEmbeddingMigrationResponse = components["schemas"]["SourceEmbeddingMigrationResponse"]; - -/** Request body for starting a source embedding migration. */ -export type StartSourceEmbeddingMigrationRequest = components["schemas"]["StartSourceEmbeddingMigrationRequest"]; - -// ─── Content ───────────────────────────────────────────────────────────────── - -/** Content detail response for a specific content version. */ -export type ContentDetailResponse = components["schemas"]["routers__api__contents__ContentDetailResponse"]; - -/** Paginated list of content embeddings. */ -export type ContentEmbeddingsListResponse = components["schemas"]["routers__api__contents__ContentEmbeddingsListResponse"]; - -/** Individual content embedding. */ -export type ContentEmbeddingResponse = components["schemas"]["ContentEmbeddingResponse"]; - -/** Upload response for content replacement uploads. */ -export type ContentFileUploadResponse = components["schemas"]["routers__api__contents__FileUploadResponse"]; - -// ─── Solutions ─────────────────────────────────────────────────────────────── - -/** Paginated list of solutions. */ -export type SolutionListResponse = components["schemas"]["routers__api__solutions__SolutionListResponse"]; - -/** Full solution configuration and metadata. */ -export type SolutionResponse = components["schemas"]["routers__api__solutions__SolutionResponse"]; - -/** Summary of a solution. */ -export type SolutionSummaryResponse = components["schemas"]["SolutionSummaryResponse"]; - -/** Request body for creating a solution. */ -export type CreateSolutionRequest = components["schemas"]["CreateSolutionRequest"]; - -/** Request body for updating a solution. */ -export type UpdateSolutionRequest = components["schemas"]["UpdateSolutionRequest"]; - -/** Agent within a solution. */ -export type SolutionAgentResponse = components["schemas"]["routers__api__solutions__SolutionAgentResponse"]; - -/** Knowledge base within a solution. */ -export type SolutionKnowledgeBaseResponse = components["schemas"]["routers__api__solutions__SolutionKnowledgeBaseResponse"]; - -/** Source connection within a solution. */ -export type SolutionSourceConnectionResponse = components["schemas"]["SolutionSourceConnectionResponse"]; - -/** Conversation in a solution AI assistant. */ -export type SolutionConversationResponse = components["schemas"]["routers__api__solutions__SolutionConversationResponse"]; - -/** Request body for adding a conversation turn. */ -export type AddConversationTurnRequest = components["schemas"]["AddConversationTurnRequest"]; - -/** Request body for marking a conversation turn. */ -export type MarkConversationTurnRequest = components["schemas"]["MarkConversationTurnRequest"]; - -/** AI assistant generate request for solutions. */ -export type AiAssistantGenerateRequest = components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - -/** AI assistant generate response for solutions. */ -export type AiAssistantGenerateResponse = components["schemas"]["AiAssistantGenerateResponse"]; - -/** AI assistant accept request for solutions. */ -export type AiAssistantAcceptRequest = components["schemas"]["routers__api__solutions__AiAssistantAcceptRequest"]; - -/** AI assistant accept response for solutions. */ -export type AiAssistantAcceptResponse = components["schemas"]["AiAssistantAcceptResponse"]; - -/** Proposed action in a solution AI plan. */ -export type ProposedActionResponse = components["schemas"]["ProposedActionResponse"]; - -/** Executed action in a solution AI plan. */ -export type ExecutedActionResponse = components["schemas"]["ExecutedActionResponse"]; - -// ─── Resource Linking ──────────────────────────────────────────────────────── - -/** Request body for linking resources (agents, KBs, sources) to a parent. */ -export type LinkResourcesRequest = components["schemas"]["LinkResourcesRequest"]; - -/** Request body for unlinking resources from a parent. */ -export type UnlinkResourcesRequest = components["schemas"]["UnlinkResourcesRequest"]; - -// ─── Governance ────────────────────────────────────────────────────────────── - -/** Governance AI assistant request. */ -export type GovernanceAiAssistantRequest = components["schemas"]["routers__api__governance__GovernanceAiAssistantRequest"]; - -/** Governance AI assistant response. */ -export type GovernanceAiAssistantResponse = components["schemas"]["GovernanceAiAssistantResponse"]; - -/** Governance AI accept response. */ -export type GovernanceAiAcceptResponse = components["schemas"]["GovernanceAiAcceptResponse"]; - -/** Governance conversation turn. */ -export type GovernanceConversationResponse = components["schemas"]["routers__api__governance__GovernanceConversationResponse"]; - -/** Proposed policy action from governance AI. */ -export type GovernanceProposedPolicyActionResponse = components["schemas"]["ProposedPolicyActionResponse"]; - -/** Applied policy action from governance AI. */ -export type GovernanceAppliedActionResponse = components["schemas"]["AppliedActionResponse"]; - -// ─── Alerts ────────────────────────────────────────────────────────────────── - -/** Request body for creating an alert config. */ -export type CreateAlertConfigRequest = components["schemas"]["CreateAlertConfigRequest"]; - -/** Request body for updating an alert config. */ -export type UpdateAlertConfigRequest = components["schemas"]["UpdateAlertConfigRequest"]; - -/** Request body to change alert status. */ -export type ChangeStatusRequest = components["schemas"]["ChangeStatusRequest"]; - -/** Request to add a comment to an alert. */ -export type AddCommentRequest = components["schemas"]["routers__api__alerts__AddCommentRequest"]; - -/** Organization alert preference. */ -export type OrganizationAlertPreferenceResponse = components["schemas"]["routers__api__alerts__OrganizationAlertPreferenceResponse"]; - -/** Paginated list of organization alert preferences. */ -export type OrganizationAlertPreferenceListResponse = components["schemas"]["OrganizationAlertPreferenceListResponse"]; - -/** Request to update an organization alert preference. */ -export type UpdateOrganizationAlertPreferenceRequest = components["schemas"]["routers__api__alerts__UpdateOrganizationAlertPreferenceRequest"]; - -// ─── AI Assistant (top-level) ──────────────────────────────────────────────── - -/** Request body for AI assistant feedback. */ -export type AiAssistantFeedbackRequest = components["schemas"]["routers__api__ai_assistant__AiAssistantFeedbackRequest"]; - -/** AI assistant feedback response. */ -export type AiAssistantFeedbackResponse = components["schemas"]["AiAssistantFeedbackResponse"]; - -// ─── Models ────────────────────────────────────────────────────────────────── - -/** Prompt model auto-upgrade strategy. */ -export type PromptModelAutoUpgradeStrategy = components["schemas"]["PromptModelAutoUpgradeStrategy"]; - -/** Models grouped by provider. */ -export type ProviderGroupResponse = components["schemas"]["schemas__model_responses__ProviderGroupResponse"]; - -/** Full model details including capabilities, pricing, and lifecycle status. */ -export type PromptModelResponse = components["schemas"]["schemas__model_responses__PromptModelResponse"]; - -/** Prompt tool configuration within a model. */ -export type PromptToolResponse = components["schemas"]["PromptToolResponse"]; - -/** Per-modality rate for a model that prices image/audio/video distinctly from its default text rate. */ -export type ModalityRateResponse = components["schemas"]["ModalityRateResponse"]; - -/** The effort levels a model accepts, and its default. */ -export type EffortOptionsResponse = components["schemas"]["EffortOptionsResponse"]; - -/** An embedding model a source can index with. */ -export type EmbeddingModelResponse = components["schemas"]["EmbeddingModelResponse"]; - -/** The embedding models, with the defaults and pricing that apply to all of them. */ -export type EmbeddingModelListResponse = components["schemas"]["EmbeddingModelListResponse"]; - -/** Per-modality rate for an embedding model. */ -export type EmbeddingModalityRateResponse = components["schemas"]["EmbeddingModalityRateResponse"]; - -/** Storage credits for one embedding dimension. */ -export type EmbeddingStorageCreditsResponse = components["schemas"]["EmbeddingStorageCreditsResponse"]; - -/** A reranker model a knowledge base can use. */ -export type RerankerModelResponse = components["schemas"]["RerankerModelResponse"]; - -/** The reranker models, with the default and pricing that apply to all of them. */ -export type RerankerModelListResponse = components["schemas"]["RerankerModelListResponse"]; - -/** Variant category for model pricing tiers. */ -export type VariantCategoryResponse = components["schemas"]["VariantCategoryResponse"]; - -/** Variant option with credit pricing and context limits. */ -export type VariantOptionResponse = components["schemas"]["VariantOptionResponse"]; - -/** Request body for creating a model playground experiment. */ -export type PlaygroundCreateRequest = components["schemas"]["PlaygroundCreateRequest"]; - -/** - * Input type for {@link SeclaiClient.createExperiment}. - * - * Only `model_ids` and `prompt` are required — every other field has a - * server-side default and can be omitted. - */ -export type CreateExperimentInput = Pick & - Partial>; - -// ─── Email Domains ─────────────────────────────────────────────────────────── - -/** Request body for adding a vanity or custom agent-email domain. */ -export type AddEmailDomainRequest = components["schemas"]["AddEmailDomainRequest"]; - -/** - * Input type for {@link Seclai.addEmailDomain}. - * - * Only `kind` and `value` are required. `delegated` has a server-side default - * of `false` and can be omitted — the generated {@link AddEmailDomainRequest} - * marks it required only because the schema declares a default. - */ -export type AddEmailDomainInput = Pick & - Partial>; - -/** An agent-email domain with its verification status and required DNS records. */ -export type EmailDomainResponse = components["schemas"]["EmailDomainResponse"]; - -/** The account's email domains plus the plan capabilities for adding more. */ -export type EmailDomainsListResponse = components["schemas"]["EmailDomainsListResponse"]; - -/** Result of removing an email domain (with an optional registrar `cleanup_note`). */ -export type RemoveEmailDomainResponse = components["schemas"]["RemoveEmailDomainResponse"]; - -/** Result of sending a test email from a verified domain. */ -export type SendTestEmailResponse = components["schemas"]["SendTestEmailResponse"]; - -/** A DNS record the customer must publish for a domain, plus whether it currently resolves. */ -export type DnsRecordResponse = components["schemas"]["DnsRecordResponse"]; - -/** Detected DNS provider for a domain, with dashboard URL and provider-specific tips. */ -export type DnsProviderResponse = components["schemas"]["DnsProviderResponse"]; - -/** DMARC aggregate-report summary for a domain over a time window. */ -export type DmarcSummaryResponse = components["schemas"]["DmarcSummaryResponse"]; - -/** A top DMARC-failing source IP within a {@link DmarcSummaryResponse}. */ -export type DmarcFailingSourceResponse = components["schemas"]["DmarcFailingSourceResponse"]; - -// ─── Errors ────────────────────────────────────────────────────────────────── - -/** 402 envelope returned when an account has exhausted its credits. */ -export type InsufficientCreditsResponse = components["schemas"]["InsufficientCreditsResponse"]; - -/** `detail` body of an {@link InsufficientCreditsResponse} (error code, message, and account id). */ -export type InsufficientCreditsDetail = components["schemas"]["InsufficientCreditsDetail"]; - -// ─── Sources (enums) ───────────────────────────────────────────────────────── - -/** Source index mode: fast_and_cheap, balanced, slow_and_thorough, or custom. */ -export type SourceIndexMode = components["schemas"]["SourceIndexMode"]; - -// ─── Enums ─────────────────────────────────────────────────────────────────── - -/** Processing status: pending, processing, completed, or failed. */ -export type PendingProcessingCompletedFailedStatus = components["schemas"]["PendingProcessingCompletedFailedStatus"]; - -// ─── SSE Event Types ───────────────────────────────────────────────────────── - -/** An SSE event emitted during a streaming agent run. */ -export interface AgentRunEvent { - /** The SSE event type (e.g. "init", "step", "done", "error", "timeout"). */ - event: string; - /** Parsed JSON payload (typically an {@link AgentRunResponse}). */ - data: unknown; -} - -// ─── Pagination Options ────────────────────────────────────────────────────── - -/** Common pagination + sorting options for list endpoints. */ -export interface ListOptions { - /** Page number (1-indexed). */ - page?: number; - /** Items per page. */ - limit?: number; -} - -/** Pagination + sorting options. */ -export interface SortableListOptions extends ListOptions { - /** Field to sort by (e.g. "created_at"). */ - sort?: string; - /** Sort order. */ - order?: "asc" | "desc"; -} diff --git a/src/versions.ts b/src/versions.ts deleted file mode 100644 index 98914ad..0000000 --- a/src/versions.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Dated API versions known to this release, for use with the `apiVersion` - * client option. - * - * The set is open: the API adds versions without an SDK release, and - * {@link ApiVersion} widens to `string`, so a date newer than this release - * knows about can be passed directly. Treat these as convenience constants - * rather than an exhaustive list — `getApiVersion()` reports what the server - * actually supports. - */ -export const SeclaiApiVersion = { - V2026_07_01: "2026-07-01", - V2026_07_27: "2026-07-27", - V2026_08_03: "2026-08-03", - V2026_08_21: "2026-08-21", - V2026_09_28: "2026-09-28", - V2026_09_30: "2026-09-30", - V2026_10_03: "2026-10-03", - /** Baseline applied to an unpinned, header-less caller. */ - Default: "2026-07-01", - /** Newest version known to this SDK release. May lag the server. */ - Latest: "2026-10-03", -} as const; - -/** - * A dated API version. Known values autocomplete; any `YYYY-MM-DD` string still - * typechecks, but one this release was not built against is rejected at - * construction unless `allowUnknownApiVersion` is set. - */ -export type ApiVersion = - | (typeof SeclaiApiVersion)[keyof typeof SeclaiApiVersion] - // eslint-disable-next-line @typescript-eslint/ban-types - | (string & {}); - -/** Every version this release was built against, oldest first. */ -export const KNOWN_API_VERSIONS: readonly string[] = Object.entries(SeclaiApiVersion) - .filter(([k]) => k.startsWith("V")) - .map(([, v]) => v); diff --git a/tests/client.test.ts b/tests/client.test.ts deleted file mode 100644 index d117510..0000000 --- a/tests/client.test.ts +++ /dev/null @@ -1,3094 +0,0 @@ -import { readFileSync } from "node:fs"; -import { describe, expect, test } from "vitest"; - -import { - Seclai, - SeclaiAPIStatusError, - SeclaiAPIValidationError, - SeclaiConfigurationError, - SeclaiError, - SeclaiStreamingError, - SeclaiApiVersion, -} from "../src/index"; -import { parseIni, isTokenValid } from "../src/auth"; - -type RecordedRequest = { - url: string; - method: string; - headers: Record; - bodyText?: string; - body?: BodyInit; - signal?: AbortSignal | null; -}; - -function makeFetch(handler: (req: RecordedRequest) => Response | Promise) { - return async (input: RequestInfo | URL, init?: RequestInit): Promise => { - const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url; - const method = init?.method ?? "GET"; - - const headersObj = new Headers(init?.headers); - const headers: Record = {}; - for (const [k, v] of headersObj.entries()) headers[k.toLowerCase()] = v; - - let bodyText: string | undefined; - if (typeof init?.body === "string") { - bodyText = init.body; - } - - return await handler({ - url, - method, - headers, - bodyText, - body: init?.body ?? undefined, - signal: init?.signal ?? null, - }); - }; -} - -function jsonResponse(data: unknown, status = 200): Response { - return new Response(JSON.stringify(data), { - status, - headers: { "content-type": "application/json" }, - }); -} - -function makeSseResponse( - chunks: string[], - opts?: { signal?: AbortSignal | null; contentType?: string } -): Response { - const encoder = new TextEncoder(); - const stream = new ReadableStream({ - start(controller) { - let cancelled = false; - const onAbort = () => { - cancelled = true; - try { controller.error(new Error("aborted")); } catch { /* ignore */ } - }; - opts?.signal?.addEventListener("abort", onAbort, { once: true }); - (async () => { - for (const chunk of chunks) { - if (cancelled) return; - controller.enqueue(encoder.encode(chunk)); - await Promise.resolve(); - } - controller.close(); - })().catch((e) => controller.error(e)); - }, - }); - return new Response(stream as any, { - status: 200, - headers: { "content-type": opts?.contentType ?? "text/event-stream" }, - }); -} - -function makeClient( - handler: (req: RecordedRequest) => Response | Promise, - extra: Partial[0]> = {}, -) { - return new Seclai({ - apiKey: "test-key", - baseUrl: "https://test.invalid", - fetch: makeFetch(handler), - ...extra, - }); -} - -// ───────────────────────────────────────────────────────────────────────────── -// Configuration & Auth -// ───────────────────────────────────────────────────────────────────────────── - -describe("Configuration & Auth", () => { - test("constructor throws when both apiKey and accessToken provided", () => { - expect(() => new Seclai({ - apiKey: "k", - accessToken: "t", - fetch: makeFetch(() => new Response("ok")), - })).toThrow(SeclaiConfigurationError); - }); - - test("first request rejects when no credentials can be resolved", async () => { - const p = (globalThis as any).process; - const prev = p?.env?.SECLAI_API_KEY; - const prevDir = p?.env?.SECLAI_CONFIG_DIR; - if (p?.env) { - delete p.env.SECLAI_API_KEY; - p.env.SECLAI_CONFIG_DIR = "/nonexistent-seclai-dir"; - } - const client = new Seclai({ fetch: makeFetch(() => new Response("ok")) }); - await expect(client.request("GET", "/test")).rejects.toThrow(/SSO token expired/); - if (p?.env) { - if (prev === undefined) delete p.env.SECLAI_API_KEY; - else p.env.SECLAI_API_KEY = prev; - if (prevDir === undefined) delete p.env.SECLAI_CONFIG_DIR; - else p.env.SECLAI_CONFIG_DIR = prevDir; - } - }); - - test("injects x-api-key header", async () => { - const client = makeClient((req) => { - expect(req.headers["x-api-key"]).toBe("test-key"); - return jsonResponse({ ok: true }); - }); - await client.request("GET", "/test"); - }); - - test("uses SECLAI_API_URL env var", async () => { - const p = (globalThis as any).process; - const prev = p?.env?.SECLAI_API_URL; - if (p?.env) p.env.SECLAI_API_URL = "https://env.example.invalid"; - - const client = new Seclai({ - apiKey: "k", - fetch: makeFetch((req) => { - expect(new URL(req.url).origin).toBe("https://env.example.invalid"); - return jsonResponse({}); - }), - }); - await client.request("GET", "/test"); - - if (p?.env) { - if (prev === undefined) delete p.env.SECLAI_API_URL; - else p.env.SECLAI_API_URL = prev; - } - }); - - test("preserves path prefix in baseUrl", async () => { - const client = new Seclai({ - apiKey: "k", - baseUrl: "https://proxy.example.invalid/v1/api", - fetch: makeFetch((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/v1/api/agents"); - return jsonResponse([]); - }), - }); - await client.request("GET", "/agents"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Error Handling -// ───────────────────────────────────────────────────────────────────────────── - -describe("Error Handling", () => { - test("throws SeclaiAPIValidationError on 422", async () => { - const client = makeClient(() => - new Response(JSON.stringify({ detail: [{ loc: ["body"], msg: "bad", type: "value_error" }] }), { - status: 422, headers: { "content-type": "application/json" }, - }), - ); - await expect(client.listSources()).rejects.toBeInstanceOf(SeclaiAPIValidationError); - }); - - test("throws SeclaiAPIStatusError on non-2xx", async () => { - const client = makeClient(() => new Response("nope", { status: 401 })); - await expect(client.listSources()).rejects.toBeInstanceOf(SeclaiAPIStatusError); - }); - - test("SeclaiStreamingError has runId", () => { - const err = new SeclaiStreamingError("timeout", "run_xyz"); - expect(err.runId).toBe("run_xyz"); - expect(err.name).toBe("SeclaiStreamingError"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agents — CRUD -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agents — CRUD", () => { - test("listAgents sends GET /agents with pagination", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - const u = new URL(req.url); - expect(u.pathname).toBe("/agents"); - expect(u.searchParams.get("page")).toBe("2"); - expect(u.searchParams.get("limit")).toBe("10"); - return jsonResponse({ items: [], pagination: {} }); - }); - await client.listAgents({ page: 2, limit: 10 }); - }); - - test("createAgent sends POST /agents", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents"); - const body = JSON.parse(req.bodyText!); - expect(body.name).toBe("test-agent"); - return jsonResponse({ id: "ag_1", name: "test-agent" }, 201); - }); - await client.createAgent({ name: "test-agent" } as any); - }); - - test("getAgent sends GET /agents/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1"); - return jsonResponse({ id: "ag_1" }); - }); - await client.getAgent("ag_1"); - }); - - test("updateAgent sends PUT /agents/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1"); - return jsonResponse({ id: "ag_1" }); - }); - await client.updateAgent("ag_1", { name: "updated" } as any); - }); - - test("deleteAgent sends DELETE /agents/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1"); - return new Response(null, { status: 204 }); - }); - await client.deleteAgent("ag_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Export -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Export", () => { - test("exportAgent sends GET /agents/:id/export with download=true by default", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - const url = new URL(req.url); - expect(url.pathname).toBe("/agents/ag_1/export"); - expect(url.searchParams.get("download")).toBe("true"); - return jsonResponse({ export_version: "2", agent: {} }); - }); - await client.exportAgent("ag_1"); - }); - - test("exportAgent passes download=false when specified", async () => { - const client = makeClient((req) => { - const url = new URL(req.url); - expect(url.searchParams.get("download")).toBe("false"); - return jsonResponse({ export_version: "2", agent: {} }); - }); - await client.exportAgent("ag_1", false); - }); - - test("previewImportAgent sends POST /agents/preview-import", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/preview-import"); - const body = JSON.parse(req.bodyText!); - expect(body.agent_definition).toEqual({ agent: { name: "n" } }); - return jsonResponse({ - ok: true, - agent_name: "n", - description: null, - step_count: 0, - schedules: 0, - alert_configs: 0, - evaluation_criteria: 0, - governance_policies: 0, - }); - }); - await client.previewImportAgent({ agent_definition: { agent: { name: "n" } } } as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Definitions -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Definitions", () => { - test("getAgentDefinition sends GET /agents/:id/definition", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/ag_1/definition"); - return jsonResponse({ steps: [] }); - }); - await client.getAgentDefinition("ag_1"); - }); - - test("updateAgentDefinition sends PUT /agents/:id/definition", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/definition"); - return jsonResponse({ steps: [] }); - }); - await client.updateAgentDefinition("ag_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Runs -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Runs", () => { - test("runAgent sends POST /agents/:id/runs", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/runs"); - const body = JSON.parse(req.bodyText!); - expect(body.input).toBe("hello"); - return jsonResponse({ id: "run_1", status: "pending" }); - }); - await client.runAgent("ag_1", { input: "hello" } as any); - }); - - test("listAgentRuns sends GET /agents/:id/runs with status filter", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/ag_1/runs"); - expect(u.searchParams.get("status")).toBe("completed"); - return jsonResponse({ items: [] }); - }); - await client.listAgentRuns("ag_1", { status: "completed" }); - }); - - test("searchAgentRuns sends POST /agents/runs/search", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/runs/search"); - return jsonResponse({ items: [] }); - }); - await client.searchAgentRuns({} as any); - }); - - test("getAgentRun includes step outputs via query param", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/runs/run_1"); - expect(u.searchParams.get("include_step_outputs")).toBe("true"); - return jsonResponse({ id: "run_1", status: "completed" }); - }); - await client.getAgentRun("run_1", { includeStepOutputs: true }); - }); - - test("deleteAgentRun is a deprecated alias that cancels", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/runs/run_1"); - return jsonResponse({ id: "run_1", status: "cancelled" }); - }); - await client.deleteAgentRun("run_1"); - }); - - test("cancelAgentRun sends DELETE /agents/runs/:id", async () => { - // Cancellation is DELETE on the run resource. This test asserted - // POST /agents/runs/:id/cancel, a path the API has never had, so it - // confirmed a 404-ing method rather than catching it. - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/runs/run_1"); - return jsonResponse({ id: "run_1", status: "cancelled" }); - }); - const run = await client.cancelAgentRun("run_1"); - expect((run as { status: string }).status).toBe("cancelled"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Streaming -// ───────────────────────────────────────────────────────────────────────────── - -describe("Streaming", () => { - test("runStreamingAgentAndWait parses SSE and returns done payload", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/ag_1/runs/stream"); - expect(req.headers["accept"]).toContain("text/event-stream"); - - const sse = [ - ": keepalive\n\n", - `event: init\ndata: ${JSON.stringify({ run_id: "run_1", status: "running" })}\n\n`, - `event: done\ndata: ${JSON.stringify({ run_id: "run_1", status: "completed", output: "ok" })}\n\n`, - ]; - return makeSseResponse(sse, { signal: req.signal }); - }); - - const result = await client.runStreamingAgentAndWait( - "ag_1", - { input: "hello", metadata: {} as any }, - { timeoutMs: 5_000 }, - ); - expect((result as any).status).toBe("completed"); - expect((result as any).output).toBe("ok"); - }); - - test("runStreamingAgentAndWait times out", async () => { - const client = makeClient((req) => - makeSseResponse([": keepalive\n\n", "event: init\ndata: {}\n\n"], { signal: req.signal }), - ); - - await expect( - client.runStreamingAgentAndWait("ag_1", { input: "hello", metadata: {} as any }, { timeoutMs: 5 }), - ).rejects.toBeInstanceOf(SeclaiStreamingError); - }); - - test("runStreamingAgent yields events as async iterable", async () => { - const client = makeClient((req) => { - const sse = [ - `event: init\ndata: ${JSON.stringify({ run_id: "run_1", status: "running" })}\n\n`, - `event: step\ndata: ${JSON.stringify({ step: 1 })}\n\n`, - `event: done\ndata: ${JSON.stringify({ run_id: "run_1", status: "completed" })}\n\n`, - ]; - return makeSseResponse(sse, { signal: req.signal }); - }); - - const events: { event: string; data: unknown }[] = []; - for await (const event of client.runStreamingAgent("ag_1", { input: "hi" } as any, { timeoutMs: 5_000 })) { - events.push(event); - } - - expect(events.length).toBe(3); - expect(events[0].event).toBe("init"); - expect(events[1].event).toBe("step"); - expect(events[2].event).toBe("done"); - expect((events[2].data as any).status).toBe("completed"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Polling -// ───────────────────────────────────────────────────────────────────────────── - -describe("Polling", () => { - test("runAgentAndPoll polls until completed", async () => { - let callCount = 0; - const client = makeClient((req) => { - callCount++; - const u = new URL(req.url); - if (req.method === "POST" && u.pathname.endsWith("/runs")) { - return jsonResponse({ id: "run_1", status: "pending" }); - } - // GET /agents/runs/run_1 - if (callCount <= 3) { - return jsonResponse({ id: "run_1", status: "running" }); - } - return jsonResponse({ id: "run_1", status: "completed", output: "done" }); - }); - - const result = await client.runAgentAndPoll("ag_1", { input: "hi" } as any, { - pollIntervalMs: 10, - timeoutMs: 5_000, - }); - expect((result as any).status).toBe("completed"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Knowledge Bases -// ───────────────────────────────────────────────────────────────────────────── - -describe("Knowledge Bases", () => { - test("listKnowledgeBases sends GET /knowledge_bases", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/knowledge_bases"); - return jsonResponse({ items: [] }); - }); - await client.listKnowledgeBases(); - }); - - test("createKnowledgeBase sends POST /knowledge_bases", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/knowledge_bases"); - return jsonResponse({ id: "kb_1" }, 201); - }); - await client.createKnowledgeBase({ name: "test" } as any); - }); - - test("getKnowledgeBase sends GET /knowledge_bases/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/knowledge_bases/kb_1"); - return jsonResponse({ id: "kb_1" }); - }); - await client.getKnowledgeBase("kb_1"); - }); - - test("updateKnowledgeBase sends PUT /knowledge_bases/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - return jsonResponse({ id: "kb_1" }); - }); - await client.updateKnowledgeBase("kb_1", {} as any); - }); - - test("deleteKnowledgeBase sends DELETE /knowledge_bases/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteKnowledgeBase("kb_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Memory Banks -// ───────────────────────────────────────────────────────────────────────────── - -describe("Memory Banks", () => { - test("listMemoryBanks sends GET /memory_banks", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks"); - return jsonResponse({ items: [] }); - }); - await client.listMemoryBanks(); - }); - - test("createMemoryBank sends POST /memory_banks", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - return jsonResponse({ id: "mb_1" }, 201); - }); - await client.createMemoryBank({ name: "test" } as any); - }); - - test("getMemoryBank sends GET /memory_banks/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1"); - return jsonResponse({ id: "mb_1" }); - }); - await client.getMemoryBank("mb_1"); - }); - - test("updateMemoryBank sends PUT /memory_banks/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - return jsonResponse({ id: "mb_1" }); - }); - await client.updateMemoryBank("mb_1", {} as any); - }); - - test("deleteMemoryBank sends DELETE /memory_banks/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteMemoryBank("mb_1"); - }); - - test("getMemoryBankStats sends GET /memory_banks/:id/stats", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1/stats"); - return jsonResponse({}); - }); - await client.getMemoryBankStats("mb_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Sources -// ───────────────────────────────────────────────────────────────────────────── - -describe("Sources", () => { - test("listSources sends GET /sources with query params", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/sources"); - expect(u.searchParams.get("page")).toBe("2"); - expect(u.searchParams.get("order")).toBe("asc"); - expect(u.searchParams.get("account_id")).toBe("acc_1"); - return jsonResponse({ items: [] }); - }); - await client.listSources({ page: 2, order: "asc", accountId: "acc_1" }); - }); - - test("createSource sends POST /sources", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/sources"); - return jsonResponse({ id: "src_1" }, 201); - }); - await client.createSource({ name: "test" } as any); - }); - - test("getSource sends GET /sources/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/sources/src_1"); - return jsonResponse({ id: "src_1" }); - }); - await client.getSource("src_1"); - }); - - test("updateSource sends PUT /sources/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - return jsonResponse({ id: "src_1" }); - }); - await client.updateSource("src_1", {} as any); - }); - - test("deleteSource sends DELETE /sources/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteSource("src_1"); - }); - - test("uploadFileToSource sends multipart form data", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/sources/src_1/upload"); - expect(req.method).toBe("POST"); - expect(req.headers["content-type"]).toBeUndefined(); - expect(req.body).toBeInstanceOf(FormData); - - const form = req.body as FormData; - expect(form.get("title")).toBe("My title"); - expect(form.get("metadata")).toBe(JSON.stringify({ category: "docs" })); - const file = form.get("file") as any; - expect(file).toBeInstanceOf(Blob); - expect(file.type).toBe("text/plain"); - if (typeof file?.name === "string") expect(file.name).toBe("hello.txt"); - - return jsonResponse({ ok: true }); - }); - - await client.uploadFileToSource("src_1", { - file: new Uint8Array([104, 101, 108, 108, 111]), - title: "My title", - metadata: { category: "docs" }, - fileName: "hello.txt", - mimeType: "text/plain", - }); - }); - - test("uploadFileToSource infers MIME type from fileName", async () => { - const client = makeClient((req) => { - const form = req.body as FormData; - const file = form.get("file") as any; - expect(file.type).toBe("application/pdf"); - return jsonResponse({ ok: true }); - }); - - await client.uploadFileToSource("src_1", { - file: new Uint8Array([1, 2, 3]), - fileName: "document.pdf", - }); - }); - - test("uploadInlineTextToSource sends POST /sources/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/sources/src_1"); - return jsonResponse({ ok: true }); - }); - await client.uploadInlineTextToSource("src_1", { text: "hello" } as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Source Exports -// ───────────────────────────────────────────────────────────────────────────── - -describe("Source Exports", () => { - test("listSourceExports sends GET /sources/:id/exports", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/sources/src_1/exports"); - return jsonResponse({ items: [] }); - }); - await client.listSourceExports("src_1"); - }); - - test("createSourceExport sends POST /sources/:id/exports", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - return jsonResponse({ id: "exp_1" }); - }); - await client.createSourceExport("src_1", {} as any); - }); - - test("downloadSourceExport returns raw Response", async () => { - const client = makeClient(() => new Response("binary-data", { status: 200 })); - const resp = await client.downloadSourceExport("src_1", "exp_1"); - const text = await resp.text(); - expect(text).toBe("binary-data"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Source Embedding Migrations -// ───────────────────────────────────────────────────────────────────────────── - -describe("Source Embedding Migrations", () => { - test("getSourceEmbeddingMigration sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/sources/src_1/embedding-migration"); - return jsonResponse({ status: "idle" }); - }); - await client.getSourceEmbeddingMigration("src_1"); - }); - - test("startSourceEmbeddingMigration sends POST", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - return jsonResponse({ status: "running" }); - }); - await client.startSourceEmbeddingMigration("src_1", {} as any); - }); - - test("cancelSourceEmbeddingMigration sends POST /cancel", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/sources/src_1/embedding-migration/cancel"); - return jsonResponse({ status: "cancelled" }); - }); - await client.cancelSourceEmbeddingMigration("src_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Content -// ───────────────────────────────────────────────────────────────────────────── - -describe("Content", () => { - test("getContentDetail sends GET with range params", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/contents/cv_1"); - expect(u.searchParams.get("start")).toBe("100"); - expect(u.searchParams.get("end")).toBe("200"); - return jsonResponse({ text: "hello" }); - }); - await client.getContentDetail("cv_1", { start: 100, end: 200 }); - }); - - test("deleteContent sends DELETE /contents/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteContent("cv_1"); - }); - - test("listContentEmbeddings sends GET with pagination", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/contents/cv_1/embeddings"); - return jsonResponse({ items: [] }); - }); - await client.listContentEmbeddings("cv_1"); - }); - - test("uploadFileToContent sends multipart", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/contents/cv_1/upload"); - expect(req.body).toBeInstanceOf(FormData); - return jsonResponse({ ok: true }); - }); - await client.uploadFileToContent("cv_1", { - file: new Uint8Array([1, 2, 3]), - fileName: "update.pdf", - mimeType: "application/pdf", - }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Solutions -// ───────────────────────────────────────────────────────────────────────────── - -describe("Solutions", () => { - test("listSolutions sends GET /solutions", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions"); - return jsonResponse({ items: [] }); - }); - await client.listSolutions(); - }); - - test("createSolution sends POST /solutions", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - return jsonResponse({ id: "sol_1" }, 201); - }); - await client.createSolution({ name: "test" } as any); - }); - - test("getSolution sends GET /solutions/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1"); - return jsonResponse({ id: "sol_1" }); - }); - await client.getSolution("sol_1"); - }); - - test("updateSolution sends PATCH /solutions/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - return jsonResponse({ id: "sol_1" }); - }); - await client.updateSolution("sol_1", {} as any); - }); - - test("deleteSolution sends DELETE /solutions/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteSolution("sol_1"); - }); - - test("linkAgentsToSolution sends POST /solutions/:id/agents", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/agents"); - return jsonResponse({ id: "sol_1" }); - }); - await client.linkAgentsToSolution("sol_1", { ids: ["ag_1"] } as any); - }); - - test("unlinkAgentsFromSolution sends DELETE /solutions/:id/agents", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/agents"); - return jsonResponse({ id: "sol_1" }); - }); - await client.unlinkAgentsFromSolution("sol_1", { ids: ["ag_1"] } as any); - }); - - test("linkKnowledgeBasesToSolution sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/knowledge-bases"); - return jsonResponse({ id: "sol_1" }); - }); - await client.linkKnowledgeBasesToSolution("sol_1", { ids: ["kb_1"] } as any); - }); - - test("linkSourceConnectionsToSolution sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/source-connections"); - return jsonResponse({ id: "sol_1" }); - }); - await client.linkSourceConnectionsToSolution("sol_1", { ids: ["src_1"] } as any); - }); - - test("listSolutionConversations sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/conversations"); - return jsonResponse([]); - }); - await client.listSolutionConversations("sol_1"); - }); - - test("generateSolutionAiPlan sends POST /solutions/:id/ai-assistant/generate", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/ai-assistant/generate"); - return jsonResponse({ actions: [] }); - }); - await client.generateSolutionAiPlan("sol_1", { user_input: "setup" } as any); - }); - - test("acceptSolutionAiPlan sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/ai-assistant/conv_1/accept"); - return jsonResponse({ actions: [] }); - }); - await client.acceptSolutionAiPlan("sol_1", "conv_1", {} as any); - }); - - test("declineSolutionAiPlan sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/ai-assistant/conv_1/decline"); - return new Response(null, { status: 204 }); - }); - await client.declineSolutionAiPlan("sol_1", "conv_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Governance -// ───────────────────────────────────────────────────────────────────────────── - -describe("Governance", () => { - test("generateGovernanceAiPlan sends POST /governance/ai-assistant", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/governance/ai-assistant"); - return jsonResponse({ actions: [] }); - }); - await client.generateGovernanceAiPlan({} as any); - }); - - test("listGovernanceAiConversations sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/governance/ai-assistant/conversations"); - return jsonResponse([]); - }); - await client.listGovernanceAiConversations(); - }); - - test("acceptGovernanceAiPlan sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/governance/ai-assistant/conv_1/accept"); - return jsonResponse({ actions: [] }); - }); - await client.acceptGovernanceAiPlan("conv_1"); - }); - - test("declineGovernanceAiPlan sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/governance/ai-assistant/conv_1/decline"); - return new Response(null, { status: 204 }); - }); - await client.declineGovernanceAiPlan("conv_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Alerts -// ───────────────────────────────────────────────────────────────────────────── - -describe("Alerts", () => { - test("listAlerts sends GET /alerts with filters", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/alerts"); - expect(u.searchParams.get("status")).toBe("active"); - return jsonResponse({ items: [] }); - }); - await client.listAlerts({ status: "active" }); - }); - - test("getAlert sends GET /alerts/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/alerts/alert_1"); - return jsonResponse({ id: "alert_1" }); - }); - await client.getAlert("alert_1"); - }); - - test("changeAlertStatus sends POST /alerts/:id/status", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/alerts/alert_1/status"); - return jsonResponse({ id: "alert_1" }); - }); - await client.changeAlertStatus("alert_1", {} as any); - }); - - test("listAlertConfigs sends GET /alerts/configs", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/alerts/configs"); - return jsonResponse({ items: [] }); - }); - await client.listAlertConfigs(); - }); - - test("createAlertConfig sends POST /alerts/configs", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - return jsonResponse({ id: "cfg_1" }); - }); - await client.createAlertConfig({} as any); - }); - - test("updateAlertConfig sends PATCH /alerts/configs/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/alerts/configs/cfg_1"); - return jsonResponse({ id: "cfg_1" }); - }); - await client.updateAlertConfig("cfg_1", {} as any); - }); - - test("deleteAlertConfig sends DELETE /alerts/configs/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteAlertConfig("cfg_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Input Uploads -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Input Uploads", () => { - test("uploadAgentInput sends multipart to /agents/:id/upload-input", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/upload-input"); - expect(req.body).toBeInstanceOf(FormData); - return jsonResponse({ upload_id: "upl_1", status: "processing" }); - }); - await client.uploadAgentInput("ag_1", { - file: new Uint8Array([1, 2, 3]), - fileName: "input.txt", - }); - }); - - test("getAgentInputUploadStatus sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/ag_1/input-uploads/upl_1"); - return jsonResponse({ upload_id: "upl_1", status: "ready" }); - }); - await client.getAgentInputUploadStatus("ag_1", "upl_1"); - }); - - test("getAgentAttachmentReferences sends GET /agents/:id/attachment-references", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/attachment-references"); - return jsonResponse({ requires_uploads: false }); - }); - const refs = await client.getAgentAttachmentReferences("ag_1"); - expect(refs.requires_uploads).toBe(false); - }); - - test("downloadAgentRunAttachment returns raw Response with download_name", async () => { - const client = makeClient((req) => { - const url = new URL(req.url); - expect(req.method).toBe("GET"); - expect(url.pathname).toBe("/v2/agent-runs/run_1/attachments/att_1"); - expect(url.searchParams.get("download_name")).toBe("report.pdf"); - return new Response("file-bytes", { status: 200 }); - }); - const resp = await client.downloadAgentRunAttachment("run_1", "att_1", { - downloadName: "report.pdf", - }); - expect(await resp.text()).toBe("file-bytes"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent AI Assistant -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent AI Assistant", () => { - test("generateAgentSteps sends POST /agents/:id/ai-assistant/generate-steps", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/ai-assistant/generate-steps"); - return jsonResponse({ steps: [] }); - }); - await client.generateAgentSteps("ag_1", {} as any); - }); - - test("generateStepConfig sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/ag_1/ai-assistant/step-config"); - return jsonResponse({}); - }); - await client.generateStepConfig("ag_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Evaluations -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Evaluations", () => { - test("listEvaluationCriteria sends GET /agents/:id/evaluation-criteria", async () => { - // Asserting only the path let the 2026-07 change through: the endpoint - // began returning a paginated envelope instead of a bare list, and this - // test discarded the body, so it stayed green while callers broke. - const client = makeClient((req) => { - const url = new URL(req.url); - expect(url.pathname).toBe("/agents/ag_1/evaluation-criteria"); - expect(url.searchParams.get("page")).toBe("2"); - expect(url.searchParams.get("limit")).toBe("25"); - return jsonResponse({ - data: [{ id: "ec1" }], - pagination: { page: 2, limit: 25, total: 7, pages: 1, has_next: false, has_prev: true }, - }); - }); - const result = await client.listEvaluationCriteria("ag_1", { page: 2, limit: 25 }); - expect(result).toEqual([{ id: "ec1" }]); - }); - - test("listEvaluationCriteria unwraps the canonical envelope", async () => { - const client = makeClient(() => - jsonResponse({ - data: [{ id: "ec1" }], - pagination: { page: 1, limit: 50, total: 1, pages: 1, has_next: false, has_prev: false }, - }), - ); - expect(await client.listEvaluationCriteria("ag_1")).toEqual([{ id: "ec1" }]); - }); - - test("listEvaluationCriteria accepts a bare array too", async () => { - // Both shapes are live realities: the envelope is merged on main but not - // yet deployed, so decoding only one breaks the day the other ships. - const client = makeClient(() => jsonResponse([{ id: "ec1" }])); - expect(await client.listEvaluationCriteria("ag_1")).toEqual([{ id: "ec1" }]); - }); - - test("listEvaluationCriteriaPage exposes pagination metadata", async () => { - // The canonical {data, pagination} envelope, which the endpoint only emits - // once the caller opts in with apiVersion 2026-07-27 or later. - const client = makeClient(() => - jsonResponse({ - data: [{ id: "ec1" }], - pagination: { page: 2, limit: 25, total: 7, pages: 1, has_next: false, has_prev: true }, - }), - ); - const page = await client.listEvaluationCriteriaPage("ag_1", { page: 2, limit: 25 }); - expect(page.data).toEqual([{ id: "ec1" }]); - expect(page.pagination?.total).toBe(7); - }); - - test("createEvaluationCriteria sends POST", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/evaluation-criteria"); - return jsonResponse({ id: "crit_1" }); - }); - await client.createEvaluationCriteria("ag_1", {} as any); - }); - - test("getEvaluationCriteria sends GET /agents/evaluation-criteria/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1"); - return jsonResponse({ id: "crit_1" }); - }); - await client.getEvaluationCriteria("crit_1"); - }); - - test("deleteEvaluationCriteria sends DELETE", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1"); - return new Response(null, { status: 204 }); - }); - await client.deleteEvaluationCriteria("crit_1"); - }); - - test("testDraftEvaluation sends POST /agents/:id/evaluation-criteria/test-draft", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/evaluation-criteria/test-draft"); - return jsonResponse({}); - }); - await client.testDraftEvaluation("ag_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Models -// ───────────────────────────────────────────────────────────────────────────── - -describe("Models", () => { - test("listModelAlerts sends GET /models/alerts", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/models/alerts"); - return jsonResponse({ items: [] }); - }); - await client.listModelAlerts(); - }); - - test("getModelRecommendations sends GET /models/:id/recommendations", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/models/m_1/recommendations"); - return jsonResponse({}); - }); - await client.getModelRecommendations("m_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Search -// ───────────────────────────────────────────────────────────────────────────── - -describe("Search", () => { - test("search sends GET /search with query params", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - const u = new URL(req.url); - expect(u.pathname).toBe("/search"); - expect(u.searchParams.get("q")).toBe("hello"); - expect(u.searchParams.get("limit")).toBe("5"); - expect(u.searchParams.get("entity_type")).toBe("agent"); - return jsonResponse({ results: [] }); - }); - await client.search({ query: "hello", limit: 5, entityType: "agent" }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Pagination Helper -// ───────────────────────────────────────────────────────────────────────────── - -describe("Pagination Helper", () => { - const pageOf = (page: number, pages: number, limit: number, total: number) => ({ - page, - limit, - total, - pages, - has_next: page < pages, - has_prev: page > 1, - }); - - // Two full-envelope pages, as the server sends them, then nothing more. - function twoPageClient(path: string, seen: string[]) { - return makeClient((req) => { - const url = new URL(req.url); - expect(url.pathname).toBe(path); - seen.push(url.search); - const page = Number(url.searchParams.get("page")); - return jsonResponse({ - data: page === 1 ? [{ id: "a" }, { id: "b" }] : [{ id: "c" }], - pagination: pageOf(page, 2, 2, 3), - }); - }); - } - - test("paginate walks listSources and stops after the last page", async () => { - const seen: string[] = []; - const client = twoPageClient("/sources", seen); - const ids: string[] = []; - for await (const source of client.paginate((opts) => client.listSources(opts), { limit: 2 })) { - ids.push(source.id); - } - expect(ids).toEqual(["a", "b", "c"]); - expect(seen).toEqual(["?page=1&limit=2", "?page=2&limit=2"]); - }); - - test("paginate walks listAgents and stops after the last page", async () => { - const seen: string[] = []; - const client = twoPageClient("/agents", seen); - const ids: string[] = []; - for await (const agent of client.paginate((opts) => client.listAgents(opts), { limit: 2 })) { - ids.push(agent.id); - } - expect(ids).toEqual(["a", "b", "c"]); - expect(seen).toEqual(["?page=1&limit=2", "?page=2&limit=2"]); - }); - - // The four evaluation listings answer `{data, total, page, limit}` with no - // `pagination` key unless the client opts into 2026-07-27. - test.each([ - { total: 3, requests: 2, ids: ["p1a", "p1b", "p2a"] }, - { total: 4, requests: 2, ids: ["p1a", "p1b", "p2a", "p2b"] }, - { total: 2, requests: 1, ids: ["p1a", "p1b"] }, - ])("paginate walks a flat-shaped listing of $total", async ({ total, requests, ids }) => { - const seen: string[] = []; - const client = makeClient((req) => { - const url = new URL(req.url); - expect(url.pathname).toBe("/agents/evaluation-criteria/c1/results"); - seen.push(url.search); - const page = Number(url.searchParams.get("page")); - const all = [`p${page}a`, `p${page}b`].map((id) => ({ id })); - return jsonResponse({ data: all.slice(0, total - (page - 1) * 2), total, page, limit: 2 }); - }); - const got: string[] = []; - for await (const result of client.paginate((opts) => client.listEvaluationResults("c1", opts), { - limit: 2, - })) { - got.push(result.id); - } - expect(got).toEqual(ids); - expect(seen).toHaveLength(requests); - }); - - test("paginate stops on a flat-shaped listing whose server ignores page", async () => { - let calls = 0; - const client = makeClient(() => { - calls++; - return jsonResponse({ data: [{ id: "a" }, { id: "b" }], total: 3, page: 1, limit: 2 }); - }); - const got: string[] = []; - for await (const result of client.paginate((opts) => client.listEvaluationResults("c1", opts), { - limit: 2, - })) { - got.push(result.id); - } - expect(calls).toBe(2); - }); - - test("paginate makes one request for a single full page", async () => { - let requests = 0; - const client = makeClient(() => { - requests += 1; - return jsonResponse({ data: [{ id: "a" }, { id: "b" }], pagination: pageOf(1, 1, 2, 2) }); - }); - const ids: string[] = []; - for await (const source of client.paginate((opts) => client.listSources(opts), { limit: 2 })) { - ids.push(source.id); - } - expect(ids).toEqual(["a", "b"]); - expect(requests).toBe(1); - }); - - test("paginate follows pages when has_next is absent", async () => { - const client = makeClient(() => jsonResponse({})); - let fetched = 0; - const items: string[] = []; - for await (const item of client.paginate( - async ({ page }) => { - fetched += 1; - return { data: page === 1 ? ["a", "b"] : ["c"], pagination: { pages: 2 } }; - }, - { limit: 2 }, - )) { - items.push(item); - } - expect(items).toEqual(["a", "b", "c"]); - expect(fetched).toBe(2); - }); - - test("paginate yields a bare array once", async () => { - let requests = 0; - const client = makeClient(() => { - requests += 1; - return jsonResponse([{ id: "p1" }, { id: "p2" }]); - }); - const ids: string[] = []; - for await (const drive of client.paginate(() => client.listCloudDrives(), { limit: 2 })) { - ids.push(drive.id); - } - expect(ids).toEqual(["p1", "p2"]); - expect(requests).toBe(1); - }); - - test("paginate still accepts a custom fetcher's items and total_pages", async () => { - let pagesFetched = 0; - const client = makeClient(() => jsonResponse({})); - - const allItems: string[] = []; - for await (const item of client.paginate( - async (opts) => { - pagesFetched++; - if (opts.page === 1) { - return { items: ["a", "b"], pagination: { page: 1, total_pages: 2 } }; - } - return { items: ["c"], pagination: { page: 2, total_pages: 2 } }; - }, - { limit: 2 }, - )) { - allItems.push(item); - } - - expect(allItems).toEqual(["a", "b", "c"]); - expect(pagesFetched).toBe(2); - }); - - test("paginate treats a null data as an empty page", async () => { - const client = makeClient(() => jsonResponse({})); - const items: unknown[] = []; - for await (const item of client.paginate(async () => ({ data: null }))) items.push(item); - expect(items).toEqual([]); - }); - - test("paginate throws SeclaiError on a page with no items key", async () => { - const client = makeClient(() => jsonResponse({ configs: [{ id: "c1" }], total: 1 })); - const run = async () => { - // The legacy `configs` shape is not one paginate() reads; the cast stands - // in for a caller whose fetcher is typed more loosely than it behaves. - for await (const _ of client.paginate( - async (opts) => (await client.listAlertConfigs(opts)) as { data?: unknown[] }, - )) { - void _; - } - }; - await expect(run()).rejects.toThrow(SeclaiError); - await expect(run()).rejects.not.toThrow(TypeError); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Raw Request -// ───────────────────────────────────────────────────────────────────────────── - -describe("Raw Requests", () => { - test("request sends JSON body and content-type", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(req.headers["content-type"]).toContain("application/json"); - expect(req.bodyText).toBe(JSON.stringify({ hello: "world" })); - return jsonResponse({ ok: true }); - }); - await client.request("POST", "/test", { json: { hello: "world" } }); - }); - - test("requestRaw returns raw Response", async () => { - const client = makeClient(() => new Response("raw-data", { status: 200 })); - const resp = await client.requestRaw("GET", "/download"); - expect(await resp.text()).toBe("raw-data"); - }); - - test("requestRaw throws on error status", async () => { - const client = makeClient(() => new Response("error", { status: 500 })); - await expect(client.requestRaw("GET", "/fail")).rejects.toBeInstanceOf(SeclaiAPIStatusError); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// AbortSignal Support -// ───────────────────────────────────────────────────────────────────────────── - -describe("AbortSignal Support", () => { - test("request passes signal to fetch", async () => { - const controller = new AbortController(); - const client = new Seclai({ - apiKey: "test-key", - baseUrl: "https://test.invalid", - fetch: async (_input: RequestInfo | URL, init?: RequestInit) => { - expect(init?.signal).toBe(controller.signal); - return jsonResponse({ ok: true }); - }, - }); - await client.request("GET", "/test", { signal: controller.signal }); - }); - - test("requestRaw passes signal to fetch", async () => { - const controller = new AbortController(); - const client = new Seclai({ - apiKey: "test-key", - baseUrl: "https://test.invalid", - fetch: async (_input: RequestInfo | URL, init?: RequestInit) => { - expect(init?.signal).toBe(controller.signal); - return new Response("ok"); - }, - }); - await client.requestRaw("GET", "/test", { signal: controller.signal }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Source Exports (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Source Exports — extended", () => { - test("deleteSourceExport sends DELETE /sources/:id/exports/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/sources/src_1/exports/exp_1"); - return new Response(null, { status: 204 }); - }); - await client.deleteSourceExport("src_1", "exp_1"); - }); - - test("getSourceExport sends GET /sources/:id/exports/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/sources/src_1/exports/exp_1"); - return jsonResponse({ id: "exp_1", status: "completed" }); - }); - await client.getSourceExport("src_1", "exp_1"); - }); - - test("estimateSourceExport sends POST /sources/:id/exports/estimate", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/sources/src_1/exports/estimate"); - return jsonResponse({ size: 1024 }); - }); - await client.estimateSourceExport("src_1", {} as any); - }); - - test("cancelSourceExport sends POST /sources/:id/exports/:id/cancel", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/sources/src_1/exports/exp_1/cancel"); - return jsonResponse({ id: "exp_1" }); - }); - await client.cancelSourceExport("src_1", "exp_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Memory Banks (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Memory Banks — extended", () => { - test("getAgentsUsingMemoryBank sends GET /memory_banks/:id/agents", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1/agents"); - return jsonResponse([]); - }); - await client.getAgentsUsingMemoryBank("mb_1"); - }); - - test("compactMemoryBank sends POST /memory_banks/:id/compact", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1/compact"); - return new Response(null, { status: 204 }); - }); - await client.compactMemoryBank("mb_1"); - }); - - test("deleteMemoryBankSource sends DELETE /memory_banks/:id/source", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1/source"); - return new Response(null, { status: 204 }); - }); - await client.deleteMemoryBankSource("mb_1"); - }); - - test("testMemoryBankCompaction sends POST /memory_banks/:id/test-compaction", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1/test-compaction"); - return jsonResponse({ evaluation: {} }); - }); - await client.testMemoryBankCompaction("mb_1", {} as any); - }); - - test("testCompactionPromptStandalone sends POST /memory_banks/test-compaction", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/memory_banks/test-compaction"); - return jsonResponse({ evaluation: {} }); - }); - await client.testCompactionPromptStandalone({} as any); - }); - - test("listMemoryBankTemplates sends GET /memory_banks/templates", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks/templates"); - return jsonResponse([]); - }); - await client.listMemoryBankTemplates(); - }); - - test("generateMemoryBankConfig sends POST /memory_banks/ai-assistant", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/memory_banks/ai-assistant"); - return jsonResponse({}); - }); - await client.generateMemoryBankConfig({} as any); - }); - - test("getMemoryBankAiLastConversation sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks/ai-assistant/last-conversation"); - return jsonResponse({}); - }); - await client.getMemoryBankAiLastConversation(); - }); - - test("acceptMemoryBankAiSuggestion sends PATCH", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/memory_banks/ai-assistant/conv_1"); - return jsonResponse({}); - }); - await client.acceptMemoryBankAiSuggestion("conv_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Alerts (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Alerts — extended", () => { - test("addAlertComment sends POST /alerts/:id/comments", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/alerts/alert_1/comments"); - return jsonResponse({}); - }); - await client.addAlertComment("alert_1", {} as any); - }); - - test("subscribeToAlert sends POST /alerts/:id/subscribe", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/alerts/alert_1/subscribe"); - return jsonResponse({}); - }); - await client.subscribeToAlert("alert_1"); - }); - - test("unsubscribeFromAlert sends POST /alerts/:id/unsubscribe", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/alerts/alert_1/unsubscribe"); - return jsonResponse({}); - }); - await client.unsubscribeFromAlert("alert_1"); - }); - - test("getAlertConfig sends GET /alerts/configs/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/alerts/configs/cfg_1"); - return jsonResponse({ id: "cfg_1" }); - }); - await client.getAlertConfig("cfg_1"); - }); - - test("listOrganizationAlertPreferences sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/alerts/organization-preferences/list"); - return jsonResponse({ items: [] }); - }); - await client.listOrganizationAlertPreferences(); - }); - - test("updateOrganizationAlertPreference sends PATCH and returns the typed preference", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/alerts/organization-preferences/org_1/model_alert"); - return jsonResponse({ - organization_id: "org_1", - alert_type: "model_alert", - subscribed: true, - is_override: false, - }); - }); - const pref = await client.updateOrganizationAlertPreference("org_1", "model_alert", {} as any); - // Typed fields are reachable without a cast. - expect(pref.subscribed).toBe(true); - expect(pref.alert_type).toBe("model_alert"); - expect(pref.is_override).toBe(false); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Models (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Models — extended", () => { - test("markAllModelAlertsRead sends POST /models/alerts/mark-all-read", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/models/alerts/mark-all-read"); - return new Response(null, { status: 204 }); - }); - await client.markAllModelAlertsRead(); - }); - - test("markModelAlertRead sends PATCH /models/alerts/:id/read", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/models/alerts/alert_1/read"); - return new Response(null, { status: 204 }); - }); - await client.markModelAlertRead("alert_1"); - }); - - test("getUnreadModelAlertCount sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/models/alerts/unread-count"); - return jsonResponse({ count: 3 }); - }); - await client.getUnreadModelAlertCount(); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Evaluations (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Evaluations — extended", () => { - test("updateEvaluationCriteria sends PATCH", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1"); - return jsonResponse({ id: "crit_1" }); - }); - await client.updateEvaluationCriteria("crit_1", {} as any); - }); - - test("getEvaluationCriteriaSummary sends GET /agents/evaluation-criteria/:id/summary", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1/summary"); - return jsonResponse({}); - }); - await client.getEvaluationCriteriaSummary("crit_1"); - }); - - test("listEvaluationResults sends GET /agents/evaluation-criteria/:id/results", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1/results"); - return jsonResponse({ items: [] }); - }); - await client.listEvaluationResults("crit_1"); - }); - - test("createEvaluationResult sends POST /agents/evaluation-criteria/:id/results", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1/results"); - return jsonResponse({ id: "res_1" }); - }); - await client.createEvaluationResult("crit_1", {} as any); - }); - - test("listEvaluationResults with pagination sends GET with query params", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/evaluation-criteria/crit_1/results"); - expect(u.searchParams.get("page")).toBe("2"); - expect(u.searchParams.get("limit")).toBe("10"); - return jsonResponse({ items: [] }); - }); - await client.listEvaluationResults("crit_1", { page: 2, limit: 10 }); - }); - - test("listCompatibleRuns sends GET /agents/evaluation-criteria/:id/compatible-runs", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1/compatible-runs"); - return jsonResponse({ items: [] }); - }); - await client.listCompatibleRuns("crit_1"); - }); - - test("listRunEvaluationResults sends GET /agents/:agentId/runs/:runId/evaluation-results", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/ag_1/runs/run_1/evaluation-results"); - return jsonResponse({ items: [] }); - }); - await client.listRunEvaluationResults("ag_1", "run_1"); - }); - - test("getNonManualEvaluationSummary sends GET with agent_id query", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/evaluation-results/non-manual-summary"); - expect(u.searchParams.get("agent_id")).toBe("ag_1"); - return jsonResponse({ by_mode: [] }); - }); - await client.getNonManualEvaluationSummary("ag_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Content (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Content — extended", () => { - test("replaceContentWithInlineText sends PUT /contents/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/contents/cv_1"); - return jsonResponse({ id: "cv_1" }); - }); - await client.replaceContentWithInlineText("cv_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Solutions (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Solutions — extended", () => { - test("unlinkKnowledgeBasesFromSolution sends DELETE", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/knowledge-bases"); - return jsonResponse({ id: "sol_1" }); - }); - await client.unlinkKnowledgeBasesFromSolution("sol_1", { ids: ["kb_1"] } as any); - }); - - test("unlinkSourceConnectionsFromSolution sends DELETE", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/source-connections"); - return jsonResponse({ id: "sol_1" }); - }); - await client.unlinkSourceConnectionsFromSolution("sol_1", { ids: ["src_1"] } as any); - }); - - test("addSolutionConversationTurn sends POST /solutions/:id/conversations", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/conversations"); - return jsonResponse({}); - }); - await client.addSolutionConversationTurn("sol_1", {} as any); - }); - - test("markSolutionConversationTurn sends PATCH", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/conversations/conv_1"); - return jsonResponse({}); - }); - await client.markSolutionConversationTurn("sol_1", "conv_1", {} as any); - }); - - test("generateSolutionAiKnowledgeBase sends POST", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/ai-assistant/knowledge-base"); - return jsonResponse({}); - }); - await client.generateSolutionAiKnowledgeBase("sol_1", {} as any); - }); - - test("generateSolutionAiSource sends POST", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/ai-assistant/source"); - return jsonResponse({}); - }); - await client.generateSolutionAiSource("sol_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Top-Level AI Assistant -// ───────────────────────────────────────────────────────────────────────────── - -describe("Top-Level AI Assistant", () => { - test("submitAiFeedback sends POST /ai-assistant/feedback", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/ai-assistant/feedback"); - return jsonResponse({}); - }); - await client.submitAiFeedback({} as any); - }); - - test("aiAssistantKnowledgeBase sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/ai-assistant/knowledge-base"); - return jsonResponse({}); - }); - await client.aiAssistantKnowledgeBase({} as any); - }); - - test("aiAssistantSource sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/ai-assistant/source"); - return jsonResponse({}); - }); - await client.aiAssistantSource({} as any); - }); - - test("aiAssistantSolution sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/ai-assistant/solution"); - return jsonResponse({}); - }); - await client.aiAssistantSolution({} as any); - }); - - test("aiAssistantMemoryBank sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/ai-assistant/memory-bank"); - return jsonResponse({}); - }); - await client.aiAssistantMemoryBank({} as any); - }); - - test("getAiAssistantMemoryBankHistory sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/ai-assistant/memory-bank/last-conversation"); - return jsonResponse({}); - }); - await client.getAiAssistantMemoryBankHistory(); - }); - - test("acceptAiAssistantPlan sends POST with JSON body", async () => { - const requestBody = { confirm_deletions: true }; - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/ai-assistant/conv_1/accept"); - expect(req.headers["content-type"]).toContain("application/json"); - expect(JSON.parse(req.bodyText!)).toEqual(requestBody); - return jsonResponse({}); - }); - await client.acceptAiAssistantPlan("conv_1", requestBody as any); - }); - - test("declineAiAssistantPlan sends POST", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/ai-assistant/conv_1/decline"); - return new Response(null, { status: 204 }); - }); - await client.declineAiAssistantPlan("conv_1"); - }); - - test("acceptAiMemoryBankSuggestion sends PATCH with body", async () => { - const requestBody = { accepted: true }; - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/ai-assistant/memory-bank/conv_1"); - expect(req.headers["content-type"]).toContain("application/json"); - expect(JSON.parse(req.bodyText!)).toEqual(requestBody); - return jsonResponse({}); - }); - await client.acceptAiMemoryBankSuggestion("conv_1", requestBody as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent AI Assistant (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent AI Assistant — extended", () => { - test("getAgentAiConversationHistory sends GET with the required step_type", async () => { - const client = makeClient((req) => { - const url = new URL(req.url); - expect(url.pathname).toBe("/agents/ag_1/ai-assistant/conversations"); - // Asserting only the path is what let this method ship unable to send the - // parameter the API requires. - expect(url.searchParams.get("step_type")).toBe("llm"); - return jsonResponse([]); - }); - await client.getAgentAiConversationHistory("ag_1", { stepType: "llm" }); - }); - - test("getAgentAiConversationHistory rejects a call without stepType", async () => { - const client = makeClient(() => jsonResponse([])); - await expect(client.getAgentAiConversationHistory("ag_1")).rejects.toThrow( - /stepType/, - ); - }); - - test("markAgentAiSuggestion sends PATCH", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/ai-assistant/conv_1"); - return new Response(null, { status: 204 }); - }); - await client.markAgentAiSuggestion("ag_1", "conv_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Bearer Token Auth -// ───────────────────────────────────────────────────────────────────────────── - -describe("Bearer Token Auth", () => { - test("static accessToken sends Authorization Bearer header", async () => { - const client = new Seclai({ - accessToken: "my-jwt-token", - baseUrl: "https://test.invalid", - fetch: makeFetch((req) => { - expect(req.headers["authorization"]).toBe("Bearer my-jwt-token"); - expect(req.headers["x-api-key"]).toBeUndefined(); - return jsonResponse({ ok: true }); - }), - }); - await client.request("GET", "/test"); - }); - - test("accessToken function provider is called per request", async () => { - let callCount = 0; - const provider = () => { - callCount++; - return `token-${callCount}`; - }; - const client = new Seclai({ - accessToken: provider, - baseUrl: "https://test.invalid", - fetch: makeFetch((req) => { - expect(req.headers["authorization"]).toMatch(/^Bearer token-\d+$/); - return jsonResponse({ ok: true }); - }), - }); - - await client.request("GET", "/test1"); - await client.request("GET", "/test2"); - expect(callCount).toBe(2); - }); - - test("async accessToken provider is supported", async () => { - const provider = async () => { - await new Promise((r) => setTimeout(r, 1)); - return "async-token"; - }; - const client = new Seclai({ - accessToken: provider, - baseUrl: "https://test.invalid", - fetch: makeFetch((req) => { - expect(req.headers["authorization"]).toBe("Bearer async-token"); - return jsonResponse({ ok: true }); - }), - }); - await client.request("GET", "/test"); - }); - - test("accountId sends X-Account-Id header", async () => { - const client = new Seclai({ - accessToken: "tok", - accountId: "550e8400-e29b-41d4-a716-446655440000", - baseUrl: "https://test.invalid", - fetch: makeFetch((req) => { - expect(req.headers["x-account-id"]).toBe("550e8400-e29b-41d4-a716-446655440000"); - expect(req.headers["authorization"]).toBe("Bearer tok"); - return jsonResponse({ ok: true }); - }), - }); - await client.request("GET", "/test"); - }); - - test("accountId also works with apiKey auth", async () => { - const client = new Seclai({ - apiKey: "k", - accountId: "acct-123", - baseUrl: "https://test.invalid", - fetch: makeFetch((req) => { - expect(req.headers["x-account-id"]).toBe("acct-123"); - expect(req.headers["x-api-key"]).toBe("k"); - return jsonResponse({ ok: true }); - }), - }); - await client.request("GET", "/test"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// INI Parser -// ───────────────────────────────────────────────────────────────────────────── - -describe("INI Parser", () => { - test("parses default and profile sections", () => { - const ini = ` -[default] -sso_account_id = acct-default -sso_region = us-east-1 -sso_client_id = client123 -sso_domain = auth.seclai.com - -# Comment line -[profile staging] -sso_account_id = acct-staging -`; - const result = parseIni(ini); - expect(result["default"]).toEqual({ - sso_account_id: "acct-default", - sso_region: "us-east-1", - sso_client_id: "client123", - sso_domain: "auth.seclai.com", - }); - expect(result["staging"]).toEqual({ - sso_account_id: "acct-staging", - }); - }); - - test("ignores comment and empty lines", () => { - const ini = ` -; semicolon comment -# hash comment - -[default] -key = value -`; - const result = parseIni(ini); - expect(result["default"]).toEqual({ key: "value" }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Model Playground Experiments -// ───────────────────────────────────────────────────────────────────────────── - -describe("Model Playground Experiments", () => { - test("deleteExperiment sends DELETE /models/playground/experiments/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/models/playground/experiments/exp_1"); - return new Response(null, { status: 204 }); - }); - await client.deleteExperiment("exp_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Identity -// ───────────────────────────────────────────────────────────────────────────── - -describe("Identity", () => { - test("getMe sends GET /me", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/me"); - return jsonResponse({ - account_id: "acct_personal", - organizations: [{ id: "org_1", name: "Acme", account_id: "acct_acme" }], - }); - }); - const me = await client.getMe(); - expect(me.account_id).toBe("acct_personal"); - expect(me.organizations[0].name).toBe("Acme"); - }); - - test("getMe sends X-Account-Id when the client targets an org", async () => { - const client = new Seclai({ - apiKey: "test-key", - baseUrl: "https://api.test", - accountId: "acct_acme", - fetch: makeFetch((req) => { - expect(req.headers["x-account-id"]).toBe("acct_acme"); - return jsonResponse({ account_id: "acct_acme", organizations: [] }); - }), - }); - await client.getMe(); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agents — Enable / Disable -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agents — Enable / Disable", () => { - test("disableAgent sends POST /agents/:id/disable", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/disable"); - return jsonResponse({ id: "ag_1", disabled: true }); - }); - const agent = await client.disableAgent("ag_1"); - expect(agent.disabled).toBe(true); - }); - - test("enableAgent sends POST /agents/:id/enable", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/enable"); - return jsonResponse({ id: "ag_1", disabled: false }); - }); - const agent = await client.enableAgent("ag_1"); - expect(agent.disabled).toBe(false); - }); - - test("getAgentCallers sends GET /agents/:id/callers", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/callers"); - return jsonResponse([{ id: "ag_2", name: "Caller", disabled: false }]); - }); - const callers = await client.getAgentCallers("ag_1"); - expect(callers).toHaveLength(1); - expect(callers[0].name).toBe("Caller"); - }); - - test("disableAgent surfaces a 409 as SeclaiAPIStatusError", async () => { - const client = makeClient(() => jsonResponse({ detail: "blocked by callers" }, 409)); - await expect(client.disableAgent("ag_1")).rejects.toThrow(SeclaiAPIStatusError); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Email Triggers -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Email Triggers", () => { - test("setEmailTriggerConfig sends PUT /agents/:id/triggers/:tid/email-config", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/triggers/tr_1/email-config"); - const body = JSON.parse(req.bodyText!); - expect(body.alias).toBe("support"); - expect(body.allowed_senders).toEqual(["example.com"]); - expect(body.require_sender_auth).toBe(false); - return jsonResponse({ - trigger_id: "tr_1", - agent_id: "ag_1", - trigger_type: "EMAIL_RECEIVED", - email_addresses: ["support.acct@agent.seclai.com"], - }); - }); - const config = await client.setEmailTriggerConfig("ag_1", "tr_1", { - alias: "support", - allowed_senders: ["example.com"], - require_sender_auth: false, - }); - expect(config.email_addresses).toEqual(["support.acct@agent.seclai.com"]); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Email Governance -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Email Governance", () => { - test("listAgentEmailOptOuts sends GET with agent_id/limit/offset", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/agent-email-optouts"); - expect(u.searchParams.get("agent_id")).toBe("ag_1"); - expect(u.searchParams.get("limit")).toBe("25"); - expect(u.searchParams.get("offset")).toBe("50"); - return jsonResponse({ items: [], total: 0 }); - }); - await client.listAgentEmailOptOuts({ agentId: "ag_1", limit: 25, offset: 50 }); - }); - - test("listAgentEmailOptOuts omits unset filters", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.searchParams.has("agent_id")).toBe(false); - expect(u.searchParams.has("limit")).toBe(false); - return jsonResponse({ items: [], total: 0 }); - }); - await client.listAgentEmailOptOuts(); - }); - - test("removeAgentEmailOptOut sends DELETE /agents/agent-email-optouts/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/agent-email-optouts/oo_1"); - return new Response(null, { status: 204 }); - }); - await client.removeAgentEmailOptOut("oo_1"); - }); - - test("listBlockedEmailSenders sends GET with limit/offset", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/blocked-email-senders"); - expect(u.searchParams.get("limit")).toBe("10"); - expect(u.searchParams.get("offset")).toBe("0"); - return jsonResponse({ items: [], total: 0, auto_block_mode: "disabled" }); - }); - const result = await client.listBlockedEmailSenders({ limit: 10, offset: 0 }); - expect(result.auto_block_mode).toBe("disabled"); - }); - - test("blockEmailSender sends POST /agents/blocked-email-senders", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/blocked-email-senders"); - const body = JSON.parse(req.bodyText!); - expect(body.sender_email).toBe("spam@example.com"); - expect(body.match_type).toBe("domain"); - return jsonResponse({ - id: "bl_1", - created_at: "2026-07-01T00:00:00Z", - sender_email: "spam@example.com", - match_type: "domain", - source: "manual", - note: null, - }, 201); - }); - const blocked = await client.blockEmailSender({ - sender_email: "spam@example.com", - match_type: "domain", - }); - expect(blocked.id).toBe("bl_1"); - }); - - test("unblockEmailSender sends DELETE /agents/blocked-email-senders/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/blocked-email-senders/bl_1"); - return new Response(null, { status: 204 }); - }); - await client.unblockEmailSender("bl_1"); - }); - - test("setAutoBlockMode sends PUT /agents/blocked-email-senders/mode", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/agents/blocked-email-senders/mode"); - expect(JSON.parse(req.bodyText!).mode).toBe("input_and_output"); - return jsonResponse({ items: [], total: 0, auto_block_mode: "input_and_output" }); - }); - const result = await client.setAutoBlockMode({ mode: "input_and_output" }); - expect(result.auto_block_mode).toBe("input_and_output"); - }); - - test("listInboundEmailRejections sends GET with agent_id/limit", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/inbound-email-rejections"); - expect(u.searchParams.get("agent_id")).toBe("ag_1"); - expect(u.searchParams.get("limit")).toBe("5"); - return jsonResponse([{ id: "rj_1", reason: "unauthorized_sender" }]); - }); - const rejections = await client.listInboundEmailRejections({ agentId: "ag_1", limit: 5 }); - expect(rejections).toHaveLength(1); - }); - - test("getInboundEmailStatus sends GET /agents/inbound-email-status", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/inbound-email-status"); - return jsonResponse({ paused: true, queued_backlog: 42 }); - }); - const status = await client.getInboundEmailStatus(); - expect(status.paused).toBe(true); - expect(status.queued_backlog).toBe(42); - }); - - test("cancelQueuedEmailRuns sends POST .../cancel-queued", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/inbound-email-status/cancel-queued"); - return jsonResponse({ cancelled: 7 }); - }); - const result = await client.cancelQueuedEmailRuns(); - expect(result.cancelled).toBe(7); - }); - - test("resumeInboundEmail sends POST .../resume", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/inbound-email-status/resume"); - return jsonResponse({ resumed: true }); - }); - const result = await client.resumeInboundEmail(); - expect(result.resumed).toBe(true); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Email Domains -// ───────────────────────────────────────────────────────────────────────────── - -describe("Email Domains", () => { - test("listEmailDomains sends GET /email-domains", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/email-domains"); - return jsonResponse({ domains: [], can_add_vanity: true, has_vanity: false }); - }); - const result = await client.listEmailDomains(); - expect(result.can_add_vanity).toBe(true); - }); - - test("addEmailDomain sends POST /email-domains", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/email-domains"); - const body = JSON.parse(req.bodyText!); - expect(body.kind).toBe("custom"); - expect(body.value).toBe("agent.example.com"); - expect(body.delegated).toBe(true); - return jsonResponse({ - id: "dom_1", - domain: "agent.example.com", - kind: "custom", - status: "pending", - is_primary: false, - }); - }); - const domain = await client.addEmailDomain({ - kind: "custom", - value: "agent.example.com", - delegated: true, - }); - expect(domain.id).toBe("dom_1"); - }); - - test("addEmailDomain accepts a vanity domain without `delegated`", async () => { - const client = makeClient((req) => { - const body = JSON.parse(req.bodyText!); - expect(body).toEqual({ kind: "vanity", value: "acme" }); - expect("delegated" in body).toBe(false); - return jsonResponse({ - id: "dom_2", domain: "acme.seclai.com", kind: "vanity", - status: "pending", is_primary: false, - }); - }); - // Compiles without `delegated` — the server defaults it to false. - const domain = await client.addEmailDomain({ kind: "vanity", value: "acme" }); - expect(domain.kind).toBe("vanity"); - }); - - test("removeEmailDomain sends DELETE /email-domains/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/email-domains/dom_1"); - return jsonResponse({ removed: true, cleanup_note: "Delete the NS record" }); - }); - const result = await client.removeEmailDomain("dom_1"); - expect(result.cleanup_note).toBe("Delete the NS record"); - }); - - test("verifyEmailDomain sends POST /email-domains/:id/verify", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/email-domains/dom_1/verify"); - return jsonResponse({ - id: "dom_1", domain: "agent.example.com", kind: "custom", - status: "verified", is_primary: false, verified: true, - }); - }); - const domain = await client.verifyEmailDomain("dom_1"); - expect(domain.verified).toBe(true); - }); - - test("setPrimaryEmailDomain sends POST /email-domains/:id/primary", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/email-domains/dom_1/primary"); - return jsonResponse({ - id: "dom_1", domain: "agent.example.com", kind: "custom", - status: "verified", is_primary: true, - }); - }); - const domain = await client.setPrimaryEmailDomain("dom_1"); - expect(domain.is_primary).toBe(true); - }); - - test("useSharedEmailDomain sends POST /email-domains/use-shared-domain", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/email-domains/use-shared-domain"); - return new Response(null, { status: 204 }); - }); - await client.useSharedEmailDomain(); - }); - - test("sendEmailDomainTestEmail sends POST /email-domains/:id/test-email", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/email-domains/dom_1/test-email"); - return jsonResponse({ sent: true }); - }); - const result = await client.sendEmailDomainTestEmail("dom_1"); - expect(result.sent).toBe(true); - }); - - test("getDmarcSummary sends GET /email-domains/:id/dmarc with window params", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/email-domains/dom_1/dmarc"); - expect(u.searchParams.get("days")).toBe("7"); - expect(u.searchParams.get("top_sources")).toBe("3"); - return jsonResponse({ - window_days: 7, report_count: 2, total_messages: 100, - passed_messages: 99, failed_messages: 1, top_failing_sources: [], - }); - }); - const summary = await client.getDmarcSummary("dom_1", { days: 7, topSources: 3 }); - expect(summary.window_days).toBe(7); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Models — media filters & generation tiers -// ───────────────────────────────────────────────────────────────────────────── - -describe("Models — media filters & generation tiers", () => { - test("listModels forwards the media capability filters", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/models"); - expect(u.searchParams.get("supports_input_media")).toBe("pdf"); - expect(u.searchParams.get("supports_output_media")).toBe("image"); - expect(u.searchParams.get("supports_tool_use")).toBe("true"); - return jsonResponse([]); - }); - await client.listModels({ - supportsInputMedia: "pdf", - supportsOutputMedia: "image", - supportsToolUse: true, - }); - }); - - test("getGenerationTiers sends GET /models/generation-tiers", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/models/generation-tiers"); - return jsonResponse({ image: { fast: { model: "m_1" } } }); - }); - const tiers = await client.getGenerationTiers() as Record; - expect(tiers["image"]).toEqual({ fast: { model: "m_1" } }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Docs Search -// ───────────────────────────────────────────────────────────────────────────── - -describe("Docs Search", () => { - test("searchDocs sends GET /docs-search with query params", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - const u = new URL(req.url); - expect(u.pathname).toBe("/docs-search"); - expect(u.searchParams.get("q")).toBe("agent triggers"); - expect(u.searchParams.get("mode")).toBe("semantic"); - expect(u.searchParams.get("limit")).toBe("3"); - return jsonResponse({ results: [] }); - }); - await client.searchDocs({ query: "agent triggers", mode: "semantic", limit: 3 }); - }); - - test("searchDocs omits mode and limit when unset", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.searchParams.get("q")).toBe("webhooks"); - expect(u.searchParams.has("mode")).toBe(false); - expect(u.searchParams.has("limit")).toBe(false); - return jsonResponse({ results: [] }); - }); - await client.searchDocs({ query: "webhooks" }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Token Validation -// ───────────────────────────────────────────────────────────────────────────── - -describe("Token Validation", () => { - test("isTokenValid returns true for future expiry", () => { - const future = new Date(Date.now() + 3600_000).toISOString(); - expect(isTokenValid({ - accessToken: "t", expiresAt: future, clientId: "c", region: "r", cognitoDomain: "d", - })).toBe(true); - }); - - test("isTokenValid returns false for past expiry", () => { - const past = new Date(Date.now() - 1000).toISOString(); - expect(isTokenValid({ - accessToken: "t", expiresAt: past, clientId: "c", region: "r", cognitoDomain: "d", - })).toBe(false); - }); - - test("isTokenValid returns false within 30s buffer", () => { - const almostExpired = new Date(Date.now() + 10_000).toISOString(); // 10s out - expect(isTokenValid({ - accessToken: "t", expiresAt: almostExpired, clientId: "c", region: "r", cognitoDomain: "d", - })).toBe(false); - }); -}); - - -describe("API version", () => { - test("Seclai-Version header is omitted unless opted in", async () => { - // The point of the option: upgrading the SDK must not silently move an - // account onto a newer API version and change response shapes. - const client = makeClient((req) => { - expect(req.headers["seclai-version"]).toBeUndefined(); - return jsonResponse({ data: [] }); - }); - await client.listAgents(); - }); - - test("Seclai-Version header is sent when set", async () => { - const client = makeClient( - (req) => { - expect(req.headers["seclai-version"]).toBe("2026-07-27"); - return jsonResponse({ data: [] }); - }, - { apiVersion: "2026-07-27" }, - ); - await client.listAgents(); - }); - - test("getApiVersion sends GET /version", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/version"); - return jsonResponse({ - pinned_version: null, - effective_version: "2026-01-01", - default_version: "2026-01-01", - latest_version: "2026-07-27", - known_versions: ["2026-01-01", "2026-07-27"], - }); - }); - const res = await client.getApiVersion(); - expect(res.latest_version).toBe("2026-07-27"); - }); - - test("updateApiVersion sends explicit null to clear the pin", async () => { - // null is the documented way to clear the pin, so it must reach the wire. - let body: unknown; - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/version"); - body = JSON.parse(req.bodyText!); - return jsonResponse({ pinned_version: null }); - }); - await client.updateApiVersion(null); - expect(body).toEqual({ version: null }); - }); -}); - - -describe("Undeclared and required query params", () => { - test("listAlerts does not send severity", async () => { - // GET /alerts declares no severity filter: it never filtered anything, and - // sending it is a 422 once apiVersion is 2026-07-27 or later. - const client = makeClient((req) => { - expect(new URL(req.url).searchParams.has("severity")).toBe(false); - return jsonResponse({ data: [] }); - }); - await client.listAlerts({ severity: "high" }); - }); - - test("listModelAlerts translates page to offset", async () => { - // /models/alerts declares limit/offset, not page, so page 2 used to return - // page 1. - const client = makeClient((req) => { - const q = new URL(req.url).searchParams; - expect(q.get("offset")).toBe("50"); - expect(q.get("limit")).toBe("25"); - expect(q.has("page")).toBe(false); - return jsonResponse({ data: [] }); - }); - await client.listModelAlerts({ page: 3, limit: 25 }); - }); - - test("getAgentAiConversationHistory sends step_type", async () => { - // step_type is required by the API and the method had no way to send it, - // so every call answered 422. - const client = makeClient((req) => { - expect(new URL(req.url).searchParams.get("step_type")).toBe("llm"); - return jsonResponse({ turns: [] }); - }); - await client.getAgentAiConversationHistory("ag_1", { stepType: "llm" }); - }); -}); - - -describe("Version-gated evaluation result shapes", () => { - test("listRunEvaluationResults reads the canonical pagination", async () => { - // The run-level endpoint is version-gated to {data, pagination}. Reading - // only the flat total/page/limit reported undefined for opted-in callers. - const client = makeClient( - () => - jsonResponse({ - data: [], - pagination: { page: 2, limit: 25, total: 7, pages: 1, has_next: false, has_prev: true }, - }), - { apiVersion: "2026-07-27" }, - ); - const res = await client.listRunEvaluationResults("ag_1", "r_1", { page: 2, limit: 25 }); - expect(res.pagination?.total).toBe(7); - }); - - test("listAgentEvaluationResults still reads the flat shape", async () => { - // The agent-level endpoint is not version-gated, so the shared type must - // keep serving both. - const client = makeClient(() => jsonResponse({ data: [], total: 7, page: 2, limit: 25 })); - const res = await client.listAgentEvaluationResults("ag_1", { page: 2, limit: 25 }); - expect(res.total).toBe(7); - expect(res.pagination).toBeUndefined(); - }); -}); - - -describe("Typed alert list shapes", () => { - test("listAlerts decodes the typed envelope", async () => { - const client = makeClient(() => - jsonResponse({ - data: [{ id: "al1", title: "Disk full", status: "triggered" }], - pagination: { page: 1, limit: 20, total: 1, pages: 1, has_next: false, has_prev: false }, - }), - ); - const res = await client.listAlerts(); - expect(res.data[0].id).toBe("al1"); - expect(res.pagination.total).toBe(1); - }); - - test("listAlertConfigs reads either top-level key", async () => { - // `configs` by default, `data` once opted in. - const legacy = makeClient(() => jsonResponse({ configs: [{ id: "c1" }], total: 1 })); - const a = await legacy.listAlertConfigs(); - expect(a.configs?.[0].id).toBe("c1"); - - const canonical = makeClient(() => - jsonResponse({ - data: [{ id: "c1" }], - pagination: { page: 1, limit: 20, total: 1, pages: 1, has_next: false, has_prev: false }, - }), - ); - const b = await canonical.listAlertConfigs(); - expect(b.data?.[0].id).toBe("c1"); - expect(b.pagination?.total).toBe(1); - }); - - test("listModelAlerts reads either top-level key", async () => { - const legacy = makeClient(() => jsonResponse({ alerts: [{ id: "m1" }], total: 1 })); - const a = await legacy.listModelAlerts(); - expect(a.alerts?.[0].id).toBe("m1"); - - const canonical = makeClient(() => - jsonResponse({ - data: [{ id: "m1" }], - pagination: { page: 1, limit: 20, total: 1, pages: 1, has_next: false, has_prev: false }, - }), - ); - const b = await canonical.listModelAlerts(); - expect(b.data?.[0].id).toBe("m1"); - }); -}); - -describe("Typed returns", () => { - test("search returns the typed envelope", async () => { - const client = makeClient(() => - jsonResponse({ results: [{ entity_type: "agent", name: "Support" }] }), - ); - const res = await client.search({ query: "support" }); - // Deliberately not paginated — the spec carves this shape out to match the - // MCP search_resources tool. - expect(res.results[0].name).toBe("Support"); - }); - - test("getAlert returns the typed detail", async () => { - const client = makeClient(() => - jsonResponse({ alert: { id: "al1", title: "Disk full" }, comments: [], subscribers: [] }), - ); - const res = await client.getAlert("al1"); - expect(res.alert.title).toBe("Disk full"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Retyped methods — runtime smoke -// -// The 20 methods below had their return types narrowed from `unknown` by a bulk -// edit. A TypeScript `as` cast is unchecked, so neither the compiler nor the -// type tests can prove the body still issues the right request and hands back a -// parsed object. This table calls each one against a mock and asserts both. -// ───────────────────────────────────────────────────────────────────────────── - -describe("Retyped methods issue the right request and parse the body", () => { - const BODY = { id: "x1", alert: { id: "x1" }, results: [], data: [], ok: true }; - - const cases: Array<[string, string, string, (c: Seclai) => Promise]> = [ - ["getAlert", "GET", "/alerts/a1", (c) => c.getAlert("a1")], - ["changeAlertStatus", "POST", "/alerts/a1/status", (c) => c.changeAlertStatus("a1", { status: "resolved" })], - ["addAlertComment", "POST", "/alerts/a1/comments", (c) => c.addAlertComment("a1", { comment: "hi" })], - ["subscribeToAlert", "POST", "/alerts/a1/subscribe", (c) => c.subscribeToAlert("a1")], - ["unsubscribeFromAlert", "POST", "/alerts/a1/unsubscribe", (c) => c.unsubscribeFromAlert("a1")], - ["listAlerts", "GET", "/alerts", (c) => c.listAlerts()], - ["listAlertConfigs", "GET", "/alerts/configs", (c) => c.listAlertConfigs()], - ["createAlertConfig", "POST", "/alerts/configs", (c) => c.createAlertConfig({ alert_type: "x" } as never)], - ["getAlertConfig", "GET", "/alerts/configs/c1", (c) => c.getAlertConfig("c1")], - ["updateAlertConfig", "PATCH", "/alerts/configs/c1", (c) => c.updateAlertConfig("c1", {} as never)], - ["listModelAlerts", "GET", "/models/alerts", (c) => c.listModelAlerts()], - ["getUnreadModelAlertCount", "GET", "/models/alerts/unread-count", (c) => c.getUnreadModelAlertCount()], - ["getModelRecommendations", "GET", "/models/m1/recommendations", (c) => c.getModelRecommendations("m1")], - ["listExperiments", "GET", "/models/playground/experiments", (c) => c.listExperiments()], - ["createExperiment", "POST", "/models/playground/experiments", (c) => c.createExperiment({} as never)], - ["getExperiment", "GET", "/models/playground/experiments/e1", (c) => c.getExperiment("e1")], - ["cancelExperiment", "POST", "/models/playground/experiments/e1/cancel", (c) => c.cancelExperiment("e1")], - ["search", "GET", "/search", (c) => c.search({ query: "q" })], - ["acceptAiMemoryBankSuggestion", "PATCH", "/ai-assistant/memory-bank/cv1", (c) => c.acceptAiMemoryBankSuggestion("cv1", {} as never)], - ["acceptMemoryBankAiSuggestion", "PATCH", "/memory_banks/ai-assistant/cv1", (c) => c.acceptMemoryBankAiSuggestion("cv1", {} as never)], - ]; - - test.each(cases)("%s sends %s %s and returns a parsed object", async (_name, verb, path, call) => { - let seen: { method: string; pathname: string } | undefined; - const client = makeClient((req) => { - seen = { method: req.method, pathname: new URL(req.url).pathname }; - return jsonResponse(BODY); - }); - const res = await call(client); - expect(seen).toEqual({ method: verb, pathname: path }); - // A parsed object, not a Response and not a raw string. - expect(typeof res).toBe("object"); - expect(res).not.toBeNull(); - expect(res).toHaveProperty("id", "x1"); - }); -}); - -describe("API version constants", () => { - test("constants track the spec's x-seclai-versions block", async () => { - const spec = JSON.parse( - readFileSync(new URL("../openapi/seclai.openapi.json", import.meta.url), "utf8"), - ); - const v = spec["x-seclai-versions"]; - expect(SeclaiApiVersion.Default).toBe(v.default); - expect(SeclaiApiVersion.Latest).toBe(v.latest); - const known = Object.entries(SeclaiApiVersion) - .filter(([k]) => k.startsWith("V")) - .map(([, val]) => val); - expect(known).toEqual(v.known); - }); - - test("a constant reaches the wire", async () => { - const client = makeClient( - (req) => { - expect(req.headers["seclai-version"]).toBe("2026-10-03"); - return jsonResponse({ data: [] }); - }, - { apiVersion: SeclaiApiVersion.Latest }, - ); - await client.listAgents(); - }); - - test("an unknown version is rejected", () => { - // A newer server version can reshape responses, and this client would - // mis-decode them silently rather than error. Fail closed at construction. - expect(() => new Seclai({ apiKey: "k", apiVersion: "2099-01-01" })).toThrow( - /2099-01-01[\s\S]*allowUnknownApiVersion/, - ); - }); - - test("an unknown version is allowed when asked", async () => { - const client = makeClient( - (req) => { - expect(req.headers["seclai-version"]).toBe("2099-01-01"); - return jsonResponse({ data: [] }); - }, - { apiVersion: "2099-01-01", allowUnknownApiVersion: true }, - ); - await client.listAgents(); - }); - - test("a known version needs no escape hatch", async () => { - const client = makeClient( - (req) => { - expect(req.headers["seclai-version"]).toBe(SeclaiApiVersion.Latest); - return jsonResponse({ data: [] }); - }, - { apiVersion: SeclaiApiVersion.Latest }, - ); - await client.listAgents(); - }); -}); - -describe("API version guard cannot be bypassed via defaultHeaders", () => { - test("an unknown version in defaultHeaders is rejected", () => { - // defaultHeaders is spread last so it wins, which means it can carry a - // Seclai-Version. Validating only `apiVersion` left the guard one header - // away from being bypassed. - expect( - () => - new Seclai({ - apiKey: "k", - defaultHeaders: { "Seclai-Version": "2099-01-01" }, - }), - ).toThrow(/2099-01-01[\s\S]*defaultHeaders/); - }); - - test("a lowercase header key is caught too", () => { - expect( - () => - new Seclai({ - apiKey: "k", - defaultHeaders: { "seclai-version": "2099-01-01" }, - }), - ).toThrow(/2099-01-01/); - }); - - test("the escape hatch still covers the header form", async () => { - const client = makeClient( - (req) => { - expect(req.headers["seclai-version"]).toBe("2099-01-01"); - return jsonResponse({ data: [] }); - }, - { - defaultHeaders: { "Seclai-Version": "2099-01-01" }, - allowUnknownApiVersion: true, - }, - ); - await client.listAgents(); - }); - - test("a caller-supplied header overrides rather than duplicating", async () => { - const client = makeClient( - (req) => { - // One value, not two: differing cases would otherwise emit both keys and - // let the server pick arbitrarily. - expect(req.headers["seclai-version"]).toBe("2026-07-27"); - return jsonResponse({ data: [] }); - }, - { - apiVersion: SeclaiApiVersion.V2026_07_01, - defaultHeaders: { "seclai-version": SeclaiApiVersion.V2026_07_27 }, - }, - ); - await client.listAgents(); - }); - - test("a known version in defaultHeaders needs no escape hatch", () => { - expect( - () => - new Seclai({ - apiKey: "k", - defaultHeaders: { "Seclai-Version": SeclaiApiVersion.V2026_07_27 }, - }), - ).not.toThrow(); - }); -}); - -describe("API version guard validates what the merge produces", () => { - test("a second, differently-cased header cannot slip past the guard", () => { - // The merge lets the LAST entry win. Validating the first match would - // approve "2026-07-27" and then send "2099-01-01". - expect( - () => - new Seclai({ - apiKey: "k", - defaultHeaders: { - "Seclai-Version": SeclaiApiVersion.V2026_07_27, - "seclai-version": "2099-01-01", - }, - }), - ).toThrow(/2099-01-01/); - }); - - test("and the value it approves is the one that reaches the wire", async () => { - let seen: string[] = []; - const client = makeClient( - (req) => { - seen = [req.headers["seclai-version"] ?? ""]; - return jsonResponse({ data: [] }); - }, - { - defaultHeaders: { - "Seclai-Version": SeclaiApiVersion.V2026_07_01, - "seclai-version": SeclaiApiVersion.V2026_07_27, - }, - }, - ); - await client.listAgents(); - expect(seen).toEqual([SeclaiApiVersion.V2026_07_27]); - }); - - test("the option is still named as the source when it is the culprit", () => { - expect(() => new Seclai({ apiKey: "k", apiVersion: "2099-01-01" })).toThrow( - /via apiVersion/, - ); - }); -}); - -describe("Cloud drives, embedders/rerankers and source contents", () => { - const PAGINATION = { page: 1, limit: 1, total: 1, pages: 1, has_next: false, has_prev: false }; - - type Call = { - name: string; - run: (c: Seclai) => Promise; - verb: string; - path: string; - query?: [string, string][]; - body?: unknown; - }; - - const calls: Call[] = [ - { name: "listCloudDriveProviders", run: (c) => c.listCloudDriveProviders(), verb: "GET", path: "/cloud-drives/providers" }, - { name: "listCloudDrives", run: (c) => c.listCloudDrives(), verb: "GET", path: "/cloud-drives" }, - { name: "getCloudDrive", run: (c) => c.getCloudDrive("c1"), verb: "GET", path: "/cloud-drives/c1" }, - { - name: "updateCloudDrive", - run: (c) => c.updateCloudDrive("c1", { name: "Contracts" }), - verb: "PATCH", - path: "/cloud-drives/c1", - body: { name: "Contracts" }, - }, - { name: "disconnectCloudDrive", run: (c) => c.disconnectCloudDrive("c1"), verb: "POST", path: "/cloud-drives/c1/disconnect" }, - { name: "deleteCloudDrive", run: (c) => c.deleteCloudDrive("c1"), verb: "DELETE", path: "/cloud-drives/c1" }, - { name: "getAgentsUsingCloudDrive", run: (c) => c.getAgentsUsingCloudDrive("c1"), verb: "GET", path: "/cloud-drives/c1/agents" }, - { - name: "listCloudDriveRejections with a limit", - run: (c) => c.listCloudDriveRejections("c1", { limit: 20 }), - verb: "GET", - path: "/cloud-drives/c1/rejections", - query: [["limit", "20"]], - }, - { name: "listCloudDriveRejections", run: (c) => c.listCloudDriveRejections("c1"), verb: "GET", path: "/cloud-drives/c1/rejections" }, - { - name: "listEmbeddingModels with a filter", - run: (c) => c.listEmbeddingModels({ supportsInputMedia: "image" }), - verb: "GET", - path: "/models/embedders", - query: [["supports_input_media", "image"]], - }, - { name: "listEmbeddingModels", run: (c) => c.listEmbeddingModels(), verb: "GET", path: "/models/embedders" }, - { name: "listRerankerModels", run: (c) => c.listRerankerModels(), verb: "GET", path: "/models/rerankers" }, - { - name: "listSourceContents with every option", - run: (c) => - c.listSourceContents("s1", { - page: 2, - limit: 10, - sort: "title", - order: "asc", - status: "failed", - contentVersionIds: ["cv1", "cv2"], - }), - verb: "GET", - path: "/sources/s1/contents", - query: [ - ["page", "2"], - ["limit", "10"], - ["sort", "title"], - ["order", "asc"], - ["status", "failed"], - ["content_version_id", "cv1"], - ["content_version_id", "cv2"], - ], - }, - { name: "listSourceContents", run: (c) => c.listSourceContents("s1"), verb: "GET", path: "/sources/s1/contents" }, - { - name: "getSourceContentStatus", - run: (c) => c.getSourceContentStatus("s1", "cv1"), - verb: "GET", - path: "/sources/s1/contents/cv1", - }, - ]; - - test.each(calls)("$name sends $verb $path", async ({ run, verb, path, query, body }) => { - let seen: unknown; - const client = makeClient((req) => { - const url = new URL(req.url); - seen = { - verb: req.method, - path: url.pathname, - query: [...url.searchParams.entries()], - body: req.bodyText === undefined ? undefined : JSON.parse(req.bodyText), - }; - return jsonResponse({ data: [] }); - }); - await run(client); - expect(seen).toEqual({ verb, path, query: query ?? [], body }); - }); - - const lists: { name: string; run: (c: Seclai) => Promise }[] = [ - { name: "listCloudDriveProviders", run: (c) => c.listCloudDriveProviders() }, - { name: "listCloudDrives", run: (c) => c.listCloudDrives() }, - { name: "getAgentsUsingCloudDrive", run: (c) => c.getAgentsUsingCloudDrive("c1") }, - { name: "listCloudDriveRejections", run: (c) => c.listCloudDriveRejections("c1") }, - ]; - - test.each(lists)("$name reads the legacy bare array", async ({ run }) => { - const client = makeClient(() => jsonResponse([{ id: "x1" }])); - expect(await run(client)).toEqual([{ id: "x1" }]); - }); - - test.each(lists)("$name reads the 2026-07-27 envelope", async ({ run }) => { - const client = makeClient(() => jsonResponse({ data: [{ id: "x1" }], pagination: PAGINATION })); - expect(await run(client)).toEqual([{ id: "x1" }]); - }); - - const modelLists: { name: string; run: (c: Seclai) => Promise<{ models: unknown[] }> }[] = [ - { name: "listEmbeddingModels", run: (c) => c.listEmbeddingModels() }, - { name: "listRerankerModels", run: (c) => c.listRerankerModels() }, - ]; - - test.each(modelLists)("$name reads the legacy models key", async ({ run }) => { - const client = makeClient(() => - jsonResponse({ models: [{ model_type: "m1" }], default_model_type: "m1" }), - ); - const res = await run(client); - expect(res.models).toEqual([{ model_type: "m1" }]); - expect(res).toHaveProperty("default_model_type", "m1"); - }); - - test.each(modelLists)("$name keeps models and the pricing on the 2026-07-27 envelope", async ({ run }) => { - const client = makeClient(() => - jsonResponse({ data: [{ model_type: "m1" }], pagination: PAGINATION, default_model_type: "m1" }), - ); - const res = await run(client); - expect(res.models).toEqual([{ model_type: "m1" }]); - expect(res).toHaveProperty("default_model_type", "m1"); - expect(res).toHaveProperty("pagination", PAGINATION); - }); - - test("listSourceContents returns the envelope", async () => { - const body = { data: [{ content_version_id: "cv1" }], pagination: PAGINATION }; - const client = makeClient(() => jsonResponse(body)); - expect(await client.listSourceContents("s1")).toEqual(body); - }); - - test("listSourceContents with no ids returns an empty page without a request", async () => { - let requests = 0; - const client = makeClient(() => { - requests += 1; - return jsonResponse({ data: [{ content_version_id: "cv1" }], pagination: PAGINATION }); - }); - expect(await client.listSourceContents("s1", { contentVersionIds: [] })).toEqual({ - data: [], - pagination: { page: 1, limit: 20, total: 0, pages: 0, has_next: false, has_prev: false }, - }); - expect( - (await client.listSourceContents("s1", { contentVersionIds: [], page: 3, limit: 5 })).pagination, - ).toEqual({ page: 3, limit: 5, total: 0, pages: 0, has_next: false, has_prev: false }); - expect(requests).toBe(0); - }); - - test("deleteCloudDrive discards the acknowledgement", async () => { - const client = makeClient(() => jsonResponse({ ok: true })); - expect(await client.deleteCloudDrive("c1")).toBeUndefined(); - }); -}); diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index f10bddd..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - "target": "ES2022", - "module": "ESNext", - "moduleResolution": "Bundler", - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "outDir": "dist", - "strict": true, - "noUncheckedIndexedAccess": true, - "exactOptionalPropertyTypes": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/tsup.config.ts b/tsup.config.ts deleted file mode 100644 index ff1a153..0000000 --- a/tsup.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - format: ["esm", "cjs"], - dts: true, - sourcemap: true, - clean: true, -}); diff --git a/typedoc.json b/typedoc.json deleted file mode 100644 index f8b6b30..0000000 --- a/typedoc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://typedoc.org/schema.json", - "entryPoints": ["src/index.ts"], - "out": "build/docs", - "exclude": [ - "src/openapi.ts", - "dist/**", - "node_modules/**" - ], - "excludePrivate": true, - "excludeProtected": true, - "excludeInternal": true, - "readme": "README.md", - "cleanOutputDir": true -} diff --git a/.claude/skills/seclai-changelog/validate.py b/validate.py similarity index 100% rename from .claude/skills/seclai-changelog/validate.py rename to validate.py diff --git a/vitest.config.ts b/vitest.config.ts deleted file mode 100644 index faa6d98..0000000 --- a/vitest.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - environment: "node", - include: ["tests/**/*.test.ts"], - }, -}); From a3cda3d3681d9ba2e476388028b1bec29252e867 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Fri, 30 Oct 2026 23:32:40 -0700 Subject: [PATCH 5/8] Squashed '.claude/skills/seclai-sdk-sync/' changes from b62c912..5b4e063 5b4e063 Updated skills 14a086e Addressed review comments 4a9410f Addressed review comments 683ba85 Addressed review comments f16043e Addressed review comments 9f5a04b More audit tool fixes 20f845d Addressed review comments 77cecda Updated the audit-tool git-subtree-dir: .claude/skills/seclai-sdk-sync git-subtree-split: 5b4e0631ddc4763967fcb2bf25c1623709a7e3dd --- .claude/skills/seclai-changelog/SKILL.md | 188 - .claude/skills/seclai-changelog/validate.py | 134 - .gitattributes | 22 - .github/copilot-instructions.md | 41 - .github/workflows/main-build.yaml | 166 - .github/workflows/pr-build.yaml | 42 - .gitignore | 9 - CHANGELOG.md | 270 - LICENSE | 21 - README.md | 1012 - .../seclai-sdk-sync/SKILL.md => SKILL.md | 22 +- .../docexamples.py => docexamples.py | 0 openapi/seclai.openapi.json | 28030 ---------------- package-lock.json | 2937 -- package.json | 49 - scripts/set-readme-version.mjs | 44 - scripts/set-version.mjs | 56 - .../seclai-sdk-sync/sdksync.py => sdksync.py | 308 +- src/auth.ts | 602 - src/client.ts | 3734 -- src/errors.ts | 92 - src/index.ts | 341 - src/openapi.ts | 19626 ----------- src/types.ts | 893 - src/versions.ts | 44 - tests/client.test.ts | 3767 --- tsconfig.json | 19 - tsup.config.ts | 9 - typedoc.json | 15 - vitest.config.ts | 8 - 30 files changed, 304 insertions(+), 62197 deletions(-) delete mode 100644 .claude/skills/seclai-changelog/SKILL.md delete mode 100755 .claude/skills/seclai-changelog/validate.py delete mode 100644 .gitattributes delete mode 100644 .github/copilot-instructions.md delete mode 100644 .github/workflows/main-build.yaml delete mode 100644 .github/workflows/pr-build.yaml delete mode 100644 .gitignore delete mode 100644 CHANGELOG.md delete mode 100644 LICENSE delete mode 100644 README.md rename .claude/skills/seclai-sdk-sync/SKILL.md => SKILL.md (93%) rename .claude/skills/seclai-sdk-sync/docexamples.py => docexamples.py (100%) delete mode 100644 openapi/seclai.openapi.json delete mode 100644 package-lock.json delete mode 100644 package.json delete mode 100644 scripts/set-readme-version.mjs delete mode 100644 scripts/set-version.mjs rename .claude/skills/seclai-sdk-sync/sdksync.py => sdksync.py (83%) delete mode 100644 src/auth.ts delete mode 100644 src/client.ts delete mode 100644 src/errors.ts delete mode 100644 src/index.ts delete mode 100644 src/openapi.ts delete mode 100644 src/types.ts delete mode 100644 src/versions.ts delete mode 100644 tests/client.test.ts delete mode 100644 tsconfig.json delete mode 100644 tsup.config.ts delete mode 100644 typedoc.json delete mode 100644 vitest.config.ts diff --git a/.claude/skills/seclai-changelog/SKILL.md b/.claude/skills/seclai-changelog/SKILL.md deleted file mode 100644 index 06a0beb..0000000 --- a/.claude/skills/seclai-changelog/SKILL.md +++ /dev/null @@ -1,188 +0,0 @@ ---- -name: seclai-changelog -description: Write or update CHANGELOG.md in a Seclai SDK repo (seclai-python, seclai-javascript, seclai-go, seclai-csharp, seclai-cli, seclai-mcp) using the Common Changelog format. Use when adding a changelog entry, preparing a release, backfilling history from version tags, or finishing an OpenAPI spec sync in one of these repos. ---- - -# Seclai changelog entries - -> **Vendored file — do not edit in place.** The canonical copy lives in the -> `seclai/sdk-tools` repository at `skills/seclai-changelog/`, and is mirrored -> into each SDK repo with `git subtree`. Edits made here are reported as drift by -> `sdk-tools/sync.sh --check` and are overwritten on the next pull. To change it, -> change it upstream — or, if you can't reach that repo, open an issue on this -> one describing the fix and a maintainer will carry it across. - -All six Seclai SDK repos keep a root `CHANGELOG.md` in [Common Changelog](https://common-changelog.org) format. This skill covers writing a new entry and backfilling from tags. - -## Write against the last release, not against the branch - -An entry describes what changed between the **last released tag** and now. -Anything introduced and then revised inside the same unreleased version is -invisible to consumers and must not appear. - -Three of these shipped into a draft in 2026-07: - -- "Return `JsonElement` from `ListAlertsAsync` **as before**" — typed and then - untyped again within an unreleased version. Net change: nothing. -- "Omit unset properties on `SetEmailTriggerConfigRequest`" — that class was - *introduced* in the same version, so its serialization is not a change from - anything. Fold such detail into the `Added` entry instead. -- "`Total`/`Page`/`Limit` were always 0 **for callers who opted in**" — opting in - was itself new in that release, so no released version could have hit it. The - real defect predated it and needed describing on its own terms. - -Check it mechanically before publishing: - -```bash -python3 .claude/skills/seclai-sdk-sync/sdksync.py surface -git diff -- -``` - -If an entry does not correspond to something in that diff, delete it. Counts age -badly for the same reason: "adding 22 paths" was written mid-sync and was 23 by -the time the version shipped — derive them from the tag, do not carry them -forward. - -## Format rules - -- File starts with `# Changelog`, then releases sorted latest-first. -- Release heading: `## [1.4.0] - 2026-07-25` — semver without a `v`, ISO date. -- **No `Unreleased` section.** Entries are written in the PR that ships them, under the version that PR will become (see "Determine the version"). -- Change groups are third-level headings, only these four, always in this order: - `### Changed`, `### Added`, `### Removed`, `### Fixed`. -- A group heading is followed by an unordered list and nothing else. -- Entry form: `- Change ([ref](url))`. Imperative present tense, self-describing — it must read correctly without its group heading. "Support CentOS", never "Support of CentOS" or "Added support". -- Breaking changes take a `**Breaking:**` prefix and sort first within their group. Otherwise sort by importance. -- A release may open with a one-sentence italic notice instead of, or before, its groups — used for first releases (`_Initial release._`) and no-op version bumps. -- Version links are reference-style at the bottom: - `[1.4.0]: https://github.com/seclai//releases/tag/1.4.0`. **Check the tag - format per repo** — seclai-python and seclai-javascript tag without a prefix, - seclai-go tags `v1.4.0` because Go module resolution requires it. The heading - stays bare (`## [1.5.0]`); only the link target carries the `v`. Confirm with - `git tag --sort=-v:refname | head -1` before writing the link block. -- Authors are omitted — these are effectively single-contributor repos. - -## Determine the version - -Do not guess the next version. Releases are cut by `seclai/github-tag-action` in `.github/workflows/main-build.yaml`, which reads the **merge commit message**: - -- contains `#major` → major bump -- contains `#minor` → minor bump -- otherwise → `DEFAULT_BUMP: patch` - -So a PR that adds endpoints must say `#minor` in its title/merge commit, or the heading you write will not match the tag that gets cut. Confirm the intended bump with the user when it isn't stated, and flag the mismatch risk if the PR title lacks the keyword. - -Check `git tag --sort=-v:refname | head -1` for the current latest, then apply the bump. - -## Derive entries from diffs, not from release notes - -`gh release view` bodies are `--generate-notes` output — just "PR #N by @author". They are useless as entry text. Commit subjects like "2026 05 22 api sync" are equally useless. Always read the actual diff. - -Extract the public API delta for a range. Per repo: - -| Repo | Path | Pattern | -| --- | --- | --- | -| seclai-javascript | `src/client.ts` | `async ([a-zA-Z_][a-zA-Z0-9_]*)\(` | -| seclai-python | `seclai/seclai.py` | `^ (async )?def ([a-z][a-z0-9_]*)` | -| seclai-go | `*.go` | `^func \(c \*Client\) ([A-Z][A-Za-z0-9]*)\(` | -| seclai-csharp | `src/Seclai/SeclaiClient.cs` | `public (async )?[A-Za-z<>,? ]+ ([A-Z][A-Za-z0-9]*)\(` | -| seclai-cli | `src/commands/` | one file or subcommand per feature | -| seclai-mcp | `src/` | registered tool names | - -```bash -# methods added between two tags -git diff PREV TAG -- src/ | grep "^+" | grep -oE '' | sort -u -# and removed -git diff PREV TAG -- src/ | grep "^-" | grep -oE '' | sort -u -``` - -A name in **both** lists was modified, not removed — check the signature diff before writing a `Removed` entry. Renames and reordering produce false positives constantly. - -Also diff the type aliases (`src/types.ts`, `seclai/models`, etc.) and the bundled `openapi/seclai.openapi.json` — new schemas often mean new public types worth an entry even when no method changed. - -## Classify - -- New method, option, type export, or capability → **Added** -- Changed signature, default, accepted type, or behavior of something that already worked → **Changed** -- Deleted public surface → **Removed** -- It was broken and now works → **Fixed** - -Judgment calls that have come up: - -- A wrong default host or a wrong request path is **Fixed** — requests were failing — not Changed. -- Making a required parameter optional (via overload) is **Changed**, not Added. -- Exporting a type that should already have been exported is **Fixed**. -- Adding an endpoint to the bundled spec without a client method is worth its own entry; say so plainly rather than implying the method exists. -- A version bump with no code change gets a notice, not a group: `_Stable release. No functional changes since 0.0.1._` - -## Write - -Reference the PR when there is one (`([#9](https://github.com/seclai//pull/9))`), otherwise the short commit SHA (`([`36bff73`](https://github.com/seclai//commit/36bff73))`). For a PR not yet opened, omit the reference — never invent a number. - -Group related additions into one entry when they ship as a unit (e.g. eight email-domain methods), and give standalone capabilities their own line. Aim for entries a user scanning for "what changed for me" can act on. - -## Check the surface before you describe it - -The changelog is the last gate before a release, so use the entries you are -writing as a prompt to spot-check the public surface they describe. Fix these, or -raise them, before they ship — each one is far cheaper now than after consumers -depend on it. - -**Return the shape the spec declares.** Look up the endpoint's 2xx response schema -and mirror it: - -| Spec response | Return type | -| --- | --- | -| `$ref` to a schema | that aliased type — never `unknown` | -| `type: object`, `additionalProperties: true` | `Record` | -| `additionalProperties: {type: T}` | `Record` | -| `type: array` | `T[]` / `unknown[]` — **not** `Record` | - -A hand-written wrapper returning `unknown` where the generator had a real type -available is a bug, not a style choice. - -**Widening `unknown` is breaking.** Changing a released method from `unknown` to -`Record` breaks consumer code that does `result as SomeInterface` -— TypeScript rejects it with TS2352 and demands `as unknown as SomeInterface`. -That makes it a `#major`, never a patch or minor. New methods have no consumers -yet, so type them correctly from the start rather than inheriting a neighbour's -`unknown`. - -**Server-defaulted request fields must be optional.** openapi-typescript emits any -property carrying a `default` as **required**, even when the spec leaves it out of -`required`. Callers then have to pass a value the server would have defaulted. -Wrap the generated request in an input type: - -```ts -export type AddEmailDomainInput = Pick & - Partial>; -``` - -See `AddEmailDomainInput` and `CreateExperimentInput` in `src/types.ts`. - -**Compile the doc examples.** `npm run typecheck` covers `src/` and `tests/`, not -README or changelog snippets. Paste any example you write into a scratch `.ts` -that imports from `../src/index` and compile it — that is how the -`delegated`-is-required bug above was found, after the snippet had already shipped -in a PR. - -## Validate - -Run the bundled checker from the repo root before declaring done: - -```bash -python3 .claude/skills/seclai-changelog/validate.py CHANGELOG.md -``` - -That path holds in every SDK repo, since this skill is vendored into each one. When working inside `sdk-tools` itself, the canonical copy is `skills/seclai-changelog/validate.py`. - -It verifies heading format, descending version order, group names and ordering, `Breaking:` sorting, absence of an `Unreleased` section, and that every release has exactly one matching link definition. It exits non-zero on error, so the same invocation works as a CI gate. - -Also confirm `CHANGELOG.md` is in the published artifact list — `files` in `package.json` for the JS/CLI/MCP repos, the packaging config for the others. - -## Backfilling from tags - -1. `git tag --sort=-v:refname` and `gh release list` for versions and dates. Use the GitHub release published date (UTC) as the entry date. -2. Walk consecutive tag pairs oldest-first, extracting the API delta for each as above. -3. Map each range to its PR via `gh release view --json body`, which does at least carry the PR number reliably. -4. The earliest release gets `_Initial release._`. diff --git a/.claude/skills/seclai-changelog/validate.py b/.claude/skills/seclai-changelog/validate.py deleted file mode 100755 index b73deb7..0000000 --- a/.claude/skills/seclai-changelog/validate.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -"""Validate a Common Changelog file as used by the Seclai SDK repos. - -Usage: python3 validate.py [CHANGELOG.md] - -Exits non-zero and prints one line per problem. Warnings do not affect the -exit code. -""" -import re -import sys - -GROUPS = ["Changed", "Added", "Removed", "Fixed"] -RELEASE_RE = re.compile(r"^## \[([^\]]+)\] - (\d{4}-\d{2}-\d{2})\s*$") -GROUP_RE = re.compile(r"^### (.+?)\s*$") -LINKDEF_RE = re.compile(r"^\[([^\]]+)\]:\s+(\S+)\s*$") -SEMVER_RE = re.compile(r"^(\d+)\.(\d+)\.(\d+)$") - - -def semver_key(v): - m = SEMVER_RE.match(v) - return tuple(int(g) for g in m.groups()) if m else (-1, -1, -1) - - -def main(): - path = sys.argv[1] if len(sys.argv) > 1 else "CHANGELOG.md" - try: - lines = open(path, encoding="utf-8").read().split("\n") - except OSError as e: - print(f"error: cannot read {path}: {e}") - return 1 - - errors, warnings = [], [] - releases, linkdefs = [], [] - cur = None - seen_groups = [] - group_entries = [] - in_group = None - - def close_group(): - if in_group is None: - return - if not group_entries: - errors.append(f"{cur}: '### {in_group}' has no entries") - breaking = [i for i, e in enumerate(group_entries) if e.startswith("**Breaking:**")] - if breaking and breaking != list(range(len(breaking))): - errors.append(f"{cur}: breaking changes must sort first under '### {in_group}'") - - if not lines or lines[0].strip() != "# Changelog": - errors.append("file must start with '# Changelog'") - - for n, line in enumerate(lines, 1): - if line.strip().lower().startswith("## [unreleased") or line.strip().lower() == "## unreleased": - errors.append(f"line {n}: Common Changelog has no Unreleased section") - continue - - m = RELEASE_RE.match(line) - if m: - close_group() - cur, seen_groups, in_group, group_entries = m.group(1), [], None, [] - if not SEMVER_RE.match(cur): - errors.append(f"line {n}: '{cur}' is not a bare semver version") - releases.append(cur) - continue - - if line.startswith("## "): - errors.append(f"line {n}: malformed release heading: {line.strip()!r}") - continue - - m = GROUP_RE.match(line) - if m: - close_group() - g = m.group(1) - if cur is None: - # Stay outside the group. Entering it would let close_group() - # later report against a release that never started, emitting a - # confusing "None: ..." on top of the real error below. - in_group, group_entries = None, [] - errors.append(f"line {n}: '### {g}' before any release heading") - continue - in_group, group_entries = g, [] - if g not in GROUPS: - errors.append(f"{cur}: unknown group '{g}' (allowed: {', '.join(GROUPS)})") - continue - i = GROUPS.index(g) - if g in [GROUPS[j] for j in seen_groups]: - errors.append(f"{cur}: duplicate group '{g}'") - elif seen_groups and i < seen_groups[-1]: - errors.append( - f"{cur}: '{g}' out of order — required order is {' > '.join(GROUPS)}" - ) - seen_groups.append(i) - continue - - m = LINKDEF_RE.match(line) - if m: - linkdefs.append(m.group(1)) - continue - - if line.startswith("- ") and in_group is not None: - entry = line[2:].strip() - group_entries.append(entry) - if entry.endswith("."): - warnings.append(f"{cur}: entry ends with a period: {entry[:60]!r}") - - close_group() - - ordered = sorted(releases, key=semver_key, reverse=True) - if releases != ordered: - errors.append(f"releases not sorted latest-first: {' '.join(releases)}") - - for v in releases: - c = linkdefs.count(v) - if c == 0: - errors.append(f"{v}: missing link definition at the bottom of the file") - elif c > 1: - errors.append(f"{v}: {c} link definitions, expected 1") - for d in linkdefs: - if d not in releases: - errors.append(f"orphan link definition [{d}] with no matching release") - - for w in warnings: - print(f"warning: {w}") - for e in errors: - print(f"error: {e}") - - if errors: - print(f"\n{len(errors)} error(s) in {path}") - return 1 - print(f"{path}: OK — {len(releases)} releases, format valid") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index b6bfad2..0000000 --- a/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# Files produced by tooling rather than written by hand. -# -# `linguist-generated` collapses them in GitHub's diff view and drops them from -# the repository language stats, so a sync PR opens on the files a reviewer can -# actually act on. A 2026-07 sync changed 14,000 lines of which 864 were -# hand-written; everything else was regenerated, exported or vendored. -# -# They are still committed and still reviewable — just expand-on-demand. - -# openapi-typescript output. Regenerated wholesale by `npm run generate`. -src/openapi.ts linguist-generated=true - -# Exported from the API repo, never edited here. Review it with -# `sdksync.py spec-diff`, which reports the client-observable changes; the raw -# JSON diff runs to thousands of lines that nobody reads line by line. -openapi/*.json linguist-generated=true - -package-lock.json linguist-generated=true - -# Vendored from seclai/sdk-tools by `sync.sh` via git subtree. Edited upstream, -# never here, so it is noise in a diff for this repo. -.claude/skills/** linguist-generated=true diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md deleted file mode 100644 index 5ff359d..0000000 --- a/.github/copilot-instructions.md +++ /dev/null @@ -1,41 +0,0 @@ -# Copilot Instructions — seclai-javascript - -## Build & Lint Pipeline - -```sh -npm run build # tsup — produces CJS, ESM, and DTS bundles -npm test # vitest -``` - -## Quality gates (must pass to report completion) - -- **ALL tests must pass with ZERO failures. No exceptions.** CI/CD runs the full test suite on every PR. A test failure blocks the build. -- **`npm run build` must succeed with ZERO errors.** The DTS build is strict — type errors in `.d.ts` generation will fail the build even if runtime JS works fine. -- **Do not dismiss test or build failures as pre-existing or unrelated.** The `main` branch CI/CD is green. Any failure on a feature branch was caused by changes on that branch. -- **CRITICAL — NEVER INVESTIGATE ERROR ORIGIN OR BLAME**: When a type, build, or test error appears, **fix it immediately**. Do NOT run `git blame` or use git history to argue that an error is "pre-existing" or not your responsibility. Tools like `git diff`, `git log`, and `git show` may be used to understand and review changes, but never to avoid fixing an error. There is no scenario where knowing the origin of an error changes what you must do: **fix it**. -- **CRITICAL — NEVER PIPE TEST OR BUILD OUTPUT**: Do not append `| tail`, `| head`, `| grep`, or any pipe to `npm test`, `npm run build`, or similar commands. Piping hides errors. Always run with full unfiltered output. - -## Key Rules - -- After ANY change to `openapi/seclai.openapi.json`, run `npm run generate` to regenerate `src/openapi.ts`. Forgetting this causes type errors in the DTS build. -- `src/types.ts` maps user-facing type aliases to `components["schemas"][...]`. Schema names can change between API versions (e.g. `routers__api__*__` prefixes may be added or removed). Verify names against `src/openapi.ts` after regeneration. -- `tsconfig.json` uses `exactOptionalPropertyTypes: true` — optional properties must use `prop?: T | undefined`, not just `prop?: T`. -- The OpenAPI spec here is NOT identical to `seclai-go`/`seclai-python` (different version baseline). Apply equivalent description changes separately. -- OpenAPI specs are generated from the main `seclai` app repo. Description or endpoint changes made here must also be applied upstream, or they will be overwritten on the next generation. -- `.github/copilot-instructions.md` shares common sections (quality gates, git rules, editing rules, self-correction rules) across all SDK repos. When updating shared rules, apply the same change to all repos: `seclai-python`, `seclai-javascript`, `seclai-go`, `seclai-csharp`, `seclai-cli`, `seclai-mcp`. -- `writeSsoCache` uses atomic rename; on Windows, must `fs.unlink` the destination before `fs.rename`. -- Auth: streaming methods must use resolved auth headers, not `this.apiKey` directly. -- Do not run ad-hoc scripts; add tests instead. - -## Git rules - -- **NEVER use `git stash`.** Use `git diff`, `git log`, or `git show` instead. -- Do not run `git checkout` to switch branches, `git reset`, or any other destructive git operation without explicit user approval. - -## Editing rules - -- Do not use CLI text tools (sed/awk). Use the editor-based patch tool. - -## Self-correction rules - -- **NEVER promise to "do better" without updating these instruction files.** If a recurring mistake is identified, edit this file with a concrete rule that prevents the mistake. Do that FIRST, then continue work. diff --git a/.github/workflows/main-build.yaml b/.github/workflows/main-build.yaml deleted file mode 100644 index 2c25e6f..0000000 --- a/.github/workflows/main-build.yaml +++ /dev/null @@ -1,166 +0,0 @@ -name: Release Build - -on: - push: - branches: - - main - -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - -jobs: - npm: - name: Build, Typecheck, and Publish to npm - runs-on: ubuntu-latest - permissions: - id-token: write - contents: write - outputs: - version: ${{ steps.next-tag.outputs.new_tag }} - steps: - - name: Checkout files - uses: actions/checkout@v5 - with: - fetch-depth: "0" - - - name: Determine next version tag - id: next-tag - uses: seclai/github-tag-action@1.75.0 - env: - DEFAULT_BUMP: patch - DRY_RUN: "true" - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: "24" - cache: "npm" - registry-url: "https://registry.npmjs.org" - - - name: Install dependencies - run: npm ci - - - name: Test - run: npm test - - - name: Typecheck - run: npm run typecheck - - - name: Build - run: npm run build - - - name: Publish package to npm - env: - VERSION: ${{ steps.next-tag.outputs.new_tag }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm run publish:ci - - - name: Push tag - run: | - git tag ${{ steps.next-tag.outputs.new_tag }} - git push origin ${{ steps.next-tag.outputs.new_tag }} - - - name: Create release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release create ${{ steps.next-tag.outputs.new_tag }} \ - --title "Release ${{ steps.next-tag.outputs.new_tag }}" \ - --generate-notes - - pages: - name: Publish Docs to GitHub Pages - needs: npm - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deploy-pages.outputs.page_url }} - permissions: - id-token: write - contents: write - pages: write - steps: - - name: Checkout files - uses: actions/checkout@v5 - with: - ref: ${{ needs.npm.outputs.version }} - fetch-depth: "0" - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "npm" - - - name: Install dependencies - run: npm ci - - - name: Generate SDK documentation - env: - VERSION: ${{ needs.npm.outputs.version }} - run: | - set -euo pipefail - - npm run docs - - # typedoc writes to build/docs; stage into versioned folders + latest - rm -rf build/docs_tmp - mv build/docs build/docs_tmp - - mkdir -p "build/docs/${VERSION}" "build/docs/latest" - cp -R build/docs_tmp/* "build/docs/${VERSION}/" - cp -R build/docs_tmp/* build/docs/latest/ - - # root redirect to latest/ - cat > build/docs/index.html <<'EOF' - - - - - Seclai JS SDK Docs -

Go to latest docs

- EOF - - - name: Checkout gh-pages branch - uses: actions/checkout@v5 - with: - ref: gh-pages - path: gh-pages - fetch-depth: 0 - - - name: Publish SDK docs to GitHub Pages (versioned) - env: - VERSION: ${{ needs.npm.outputs.version }} - run: | - set -euo pipefail - - touch gh-pages/.nojekyll - - rm -rf "gh-pages/latest" "gh-pages/${VERSION}" "gh-pages/index.html" - cp -R "build/docs/latest" "gh-pages/latest" - cp -R "build/docs/${VERSION}" "gh-pages/${VERSION}" - cp "build/docs/index.html" "gh-pages/index.html" - - cd gh-pages - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add -A - if git diff --cached --quiet; then - echo "No doc changes to publish." - exit 0 - fi - git commit -m "Docs: ${VERSION}" - git push origin gh-pages - - - name: Configure GitHub Pages - uses: actions/configure-pages@v5 - - - name: Upload GitHub Pages artifact - uses: actions/upload-pages-artifact@v3 - with: - path: gh-pages - - - name: Deploy GitHub Pages - id: deploy-pages - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml deleted file mode 100644 index 1b1be87..0000000 --- a/.github/workflows/pr-build.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Pull Request Build - -on: - pull_request: - types: [opened, synchronize] - -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: Build and Typecheck - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - name: Checkout files - uses: actions/checkout@v5 - with: - fetch-depth: "0" - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "npm" - - - name: Install dependencies - run: npm ci - - - name: Test - run: npm test - - - name: Typecheck - run: npm run typecheck - - - name: Build - run: npm run build - - - name: Generate docs - run: npm run docs diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c68891c..0000000 --- a/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -node_modules -npm-debug.log* -yarn-debug.log* -yarn-error.log* -dist -build -.DS_Store -.version-backup.json -.README.md.bak diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 8358b0f..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,270 +0,0 @@ -# Changelog - -## [1.7.0] - 2026-10-21 - -### Changed - -- **Breaking:** Type `score` and `passed` on `TestDraftEvaluationResponse` as `number | null` and `boolean | null` when `status` is `error`. From `apiVersion` `2026-10-21`, which an account created after it ships gets even without setting `apiVersion`, an evaluator that returns no verdict sends them as `null`. Under `strictNullChecks`, code that reads them without first checking `status` no longer compiles: check `result.status !== "error"` before reading them, after which they are `number` and `boolean` again. See [Upgrading to 1.7](https://github.com/seclai/seclai-javascript#upgrading-to-17) -- Sync the bundled OpenAPI spec and regenerate the types. Existing responses gain properties: `email_address`, `email_allowed_senders`, `feed_attachments`, `document_images` and the `cloud_drive_*` settings on `SourceResponse`, `trigger_id` on `AgentSummaryResponse`, `accepted_attachments` on `AgentAttachmentRefsApiResponse`, `email_run_on_attachment_mismatch` on `EmailTriggerConfigResponse`, `held_for_review` on `SourceContentStatusResponse`, `skipped_attachments` on `ContentDetailResponse`, `error` on `NonManualEvaluationSummaryResponse` and `NonManualEvaluationModeStatResponse`, and `status` on `TestDraftEvaluationResponse` -- Move `SeclaiApiVersion.Latest` to `2026-10-21`. Nothing is sent unless `apiVersion` is set, so a client that passes `SeclaiApiVersion.Latest` now opts into the six versions added below: `2026-10-05` reports an item held for review by a governance policy as `content_status` `completed` instead of `failed`, so code that looks for holds among failed items must read `held_for_review`; `2026-10-13` rejects a `media_types` value other than `images` or `video`, or any value on a source that is not a website or RSS feed, on `createSource()` and `updateSource()` with a 400 where it was dropped; `2026-10-16` accepts an upload of any type as `ready` at once and stops writing its extracted text into a run's `input`; `2026-10-18` defaults a source's `document_images` to `true` on a text-only embedder; `2026-10-19` rejects `polling_max_items` on `createSource()` for any source but an RSS feed with a 400 where it was stored; and `2026-10-21` leaves an evaluation result whose evaluator returned no verdict (`error`) out of `failed` and the rates in `getNonManualEvaluationSummary()` and out of `average_score` in `getEvaluationCriteriaSummary()`, and returns its `score` and `passed` from `testDraftEvaluation()` as `null` instead of 0.5 and `false` - -### Added - -- Add `setAcceptedAttachments()` to declare the named input attachments a trigger accepts, and `accepted_attachments` on `createAgent()` and `updateAgentDefinition()`. A slot's server-defaulted `min` can be omitted: the slots are typed `AcceptedAttachmentSlotInput`, and the request `SetAcceptedAttachmentsInput` -- Add `listContentAttachments()`, `getContentAttachment()`, `listContentAttachmentEmbeddings()` and `downloadContentAttachment()` for the files attached to a content item, with their indexing status, text and embeddings. `downloadContentAttachment()` takes a `signal` -- Add `listEmailSourceRejections()` for the mail an email source refused -- Add `include_reasoning` to the `runStreamingAgent()` request, to receive `stream_reasoning` events. It stays optional although the schema gives it a default. `runStreamingAgentAndWait()`, which returns no such events, does not take it and does not send one passed anyway -- Accept the new source settings on `createSource()` and `updateSource()`: `email_allowed_senders`, `feed_attachments`, `document_images` and `cloud_drive_connection_id`, `cloud_drive_folder_path`, `cloud_drive_path_pattern`, `cloud_drive_content_types` and `cloud_drive_max_file_mb`, and `run_on_attachment_mismatch` on `setEmailTriggerConfig()` -- Add the `SeclaiApiVersion` constants `V2026_10_05`, `V2026_10_13`, `V2026_10_16`, `V2026_10_18`, `V2026_10_19` and `V2026_10_21`, so those versions are accepted as `apiVersion`. The README lists what each one changes -- Accept a `signal` on `downloadSourceExport()` and `downloadAgentRunAttachment()` -- Add the type exports `AcceptedAttachmentSlot`, `AcceptedAttachmentSlotInput`, `AcceptedAttachmentsResponse`, `SetAcceptedAttachmentsRequest`, `SetAcceptedAttachmentsInput`, `ContentAttachmentResponse`, `ContentAttachmentsListResponse`, `ContentAttachmentDetailResponse`, `SkippedAttachmentResponse`, `SkippedAttachmentReason`, `EmailSourceRejectionResponse` and `EmailSourceRejectionListResponse` - -### Fixed - -- Correct `InsufficientCreditsResponse` and `InsufficientCreditsDetail` to the 402 body the API sends: the detail is under `error`, not `detail`, and its machine-readable code is `code`, not `error`. Code that cast a 402 body to this type and read `body.detail.error` threw on every real 402; read `body.error.code` instead - -## [1.6.1] - 2026-10-05 - -### Changed - -- Throw `SeclaiError` from the list methods of version-gated endpoints when a successful response is not a list — an error-shaped object, text, or an empty body. Most of them handed that body back as if it were the list; the cloud-drive listings returned `[]`, which reads as "no results". An explicit `data: null` is still an empty list - -### Fixed - -- Return the declared type from every list method once `apiVersion` is `2026-07-27` or later. The API then answers list endpoints with `{data, pagination}`, and the methods that cast the body handed that object back as their array or keyed type: `getAgentCallers()`, `listModels()`, `listInboundEmailRejections()`, `listGovernanceAiConversations()` and `listSolutionConversations()` returned an object instead of an array, and `listAgentEmailOptOuts()`, `listBlockedEmailSenders()`, `setAutoBlockMode()`, `listAlertConfigs()`, `listOrganizationAlertPreferences()`, `listEmailDomains()`, `listKnowledgeBases()`, `listMemoryBanks()`, `getGenerationTiers()`, `listModelAlerts()` and `listExperiments()` lost their `items`, `configs`, `preferences`, `domains`, `knowledge_bases`, `memory_banks`, `tiers`, `alerts` or `experiments` key. The items are now where each type declares them on both shapes, and `data` and `pagination` stay on the object types, which declare them as optional fields ([#14](https://github.com/seclai/seclai-javascript/issues/14)) -- Fill the flat `total`, `page` and `limit` from `pagination` when `apiVersion` is `2026-07-27` or later, on `listEvaluationResults()`, `listAgentEvaluationResults()`, `listRunEvaluationResults()`, `listEvaluationRuns()`, `listCompatibleRuns()`, `listKnowledgeBases()`, `listMemoryBanks()` and the `total` of the keyed listings above. They were `undefined` although several of those types declare them required ([#14](https://github.com/seclai/seclai-javascript/issues/14)) -- Return an array from `listMemoryBankTemplates()` and `getAgentsUsingMemoryBank()` when `apiVersion` is `2026-07-27` or later, as they do by default. Both are typed `unknown` and returned the `{data, pagination}` object; code that worked around it by reading `.data` must now read the array itself ([#14](https://github.com/seclai/seclai-javascript/issues/14)) -- Reject an unknown `Seclai-Version` passed in the per-request `headers` of `request()` or `requestRaw()` with `SeclaiConfigurationError`, in any letter case. It was sent unchecked, bypassing the guard on `apiVersion`; a caller who relied on that to send a version this release does not know must now set `allowUnknownApiVersion` ([#15](https://github.com/seclai/seclai-javascript/issues/15)) -- Reject an empty `Seclai-Version` in `defaultHeaders` or per-request `headers`. It passed the guard and replaced the configured version with an empty header ([#15](https://github.com/seclai/seclai-javascript/issues/15)) -- Send exactly one value per header on the plain, download, upload and streaming paths. A default or per-request header that differed only in case from another layer's was sent beside it and joined by `fetch`: a default `X-API-Key` went out as `other, real`, a default `Authorization` beside the bearer token, and a per-request `Content-Type` could not replace the JSON one. Which layer wins is unchanged ([#15](https://github.com/seclai/seclai-javascript/issues/15)) -- Keep the multipart boundary on uploads when `defaultHeaders` sets a content type in any case other than `content-type` or `Content-Type` ([#15](https://github.com/seclai/seclai-javascript/issues/15)) -- Correct the README's API-versioning section: `2026-08-03` also rejects a non-zero `max_age_days` on `updateMemoryBank()`; `2026-09-30` breaks code that parses a run's or step's `output` as a JSON manifest; and `SeclaiApiVersion.Latest` moves with each SDK release — `1.6.0` moved it across that `2026-09-30` change — so pin a dated constant to keep behaviour fixed - -## [1.6.0] - 2026-10-04 - -### Changed - -- Sync the bundled OpenAPI spec and regenerate the types. Existing responses gain properties, among them `attachments` on `AgentRunResponse` and `AgentRunStepResponse`, `trace_purged_at` on a run, `warnings` on a step, `strip_quoted_reply_chains` on memory banks, `effort` on playground experiments, `effort_options` and `chat_capable` on `PromptModelResponse`, and `embedder_warning` on `ContentFileUploadResponse` -- Move `SeclaiApiVersion.Latest` to `2026-10-03`. Nothing is sent unless `apiVersion` is set, so a client that passes `SeclaiApiVersion.Latest` now opts into the five versions added below -- Send an array passed in the `query` of `request()` or `requestRaw()` as a repeated parameter, one pair per element. It was joined with commas into a single value - -### Added - -- Add the cloud-drive methods `listCloudDriveProviders()`, `listCloudDrives()`, `getCloudDrive()`, `updateCloudDrive()`, `disconnectCloudDrive()`, `deleteCloudDrive()`, `getAgentsUsingCloudDrive()` and `listCloudDriveRejections()`. The four listings return the items as an array whether the endpoint answers with a bare array or, from `apiVersion` `2026-07-27`, the `{data, pagination}` envelope -- Add `listSourceContents()` and `getSourceContentStatus()` for the indexing status of a source's content. `contentVersionIds` polls a batch of uploads in one request, and an empty array returns an empty page without calling the API -- Add `listEmbeddingModels()` and `listRerankerModels()`. The list is under `models` on every API version, with the defaults and pricing beside it -- Add the `SeclaiApiVersion` constants `V2026_08_03`, `V2026_08_21`, `V2026_09_28`, `V2026_09_30` and `V2026_10_03`, so those versions are accepted as `apiVersion`. The README lists what each one changes -- Add the type exports for those endpoints, including `CloudDriveResponse`, `CloudDriveProviderResponse`, `CloudDriveRejectionResponse`, `CloudDriveUpdateRequest`, `AgentUsingCloudDriveResponse`, `SourceContentStatusResponse`, `SourceContentStatusListResponse`, `ListSourceContentsOptions`, `EmbeddingModelListResponse` and `RerankerModelListResponse`, plus `AgentRunFileResponse` and `EffortOptionsResponse` - -### Fixed - -- Make `paginate()` work with the list methods. It read `items` and `pagination.total_pages`, while they return `data` and `pagination.pages`, so `client.paginate((opts) => client.listSources(opts))` threw `TypeError: result.items is not iterable`. It now reads the `{data, pagination}` envelope and stops on `has_next`, walks the flat `{data, total, page, limit}` shape of the evaluation listings by `total`, yields a bare array once, still accepts a custom fetcher's `{items, pagination: {total_pages}}`, and throws `SeclaiError` on anything else. The fetcher's page type is exported as `PaginatedPage` -- Correct the `Seclai` class example, which destructured an `items` property `listAgents()` does not return - -## [1.5.0] - 2026-07-27 - -### Changed - -- Return typed results from the 20 methods that previously declared `unknown` — alerts, alert configs, model alerts and recommendations, playground experiments, search and the AI assistant acknowledgements. Narrowing `unknown` to a concrete type is source compatible, so no façade is needed here -- Stop sending `severity` from `listAlerts()`. `GET /alerts` declares no such filter, so it never filtered, and it becomes a 422 once `apiVersion` is `2026-07-27` or later. The option is still accepted and ignored -- Accept either wire shape from `listEvaluationCriteria()`. The endpoint is moving from a bare array to a paginated envelope, so the client now reads both and keeps returning `EvaluationCriteriaResponse[]` -- Sync the bundled OpenAPI spec with the API fixes found while updating the SDKs: `agent_id` is now declared on the non-manual evaluation summary, and `page`/`limit` on the evaluation and alert-config listings -- Deprecate `deleteAgentRun()`. It never deleted anything — the endpoint it calls is documented as "Cancel an agent run", and the API has no delete-a-run operation. Use `cancelAgentRun()` - -### Added - -- Add the `SeclaiApiVersion` constants and the `ApiVersion` type. An `apiVersion` this release was not built against throws at construction, since a newer version can reshape responses this client would mis-decode; set `allowUnknownApiVersion` to override -- Add 20 response type exports covering those endpoints, including `AlertResponse`, `AlertDetailResponse`, `AlertConfigResponse`, `ModelAlertResponse`, `ExperimentDetailResponse`, `SearchResponse` and `OkResponse` -- Add `listEvaluationCriteriaPage()` for the canonical `{data, pagination}` envelope, which the endpoint emits once `apiVersion` is `2026-07-27` or later -- Add an `apiVersion` client option, sent as the `Seclai-Version` header, opting into dated API changes released on or before that date. Omitted by default, so upgrading the SDK alone never changes response shapes -- Add `getApiVersion()` and `updateApiVersion()` to read the version a request resolves to and to pin or clear the account's version -- Add the `ApiVersionResponse` type export -- Add the `EvaluationCriteriaListResponse` type export - -### Fixed - -- Validate the merged `Seclai-Version` rather than the first match in `defaultHeaders`. The merge lets the last entry win, so two spellings of the header meant the guard could approve one value and the client send another -- Validate a `Seclai-Version` supplied through `defaultHeaders`, not just the `apiVersion` option. `defaultHeaders` is applied last so it wins, which left the unknown-version guard one header away from being bypassed; a differently-cased key also emitted two wire headers -- Throw from `getAgentAiConversationHistory()` when `opts.stepType` is missing. It was optional and dropped by `buildURL`, so a call without it still 422'd — the failure this method was changed to prevent -- Decode either wire shape in `listRunEvaluationResults()`. The endpoint answers with a bare array, which the declared envelope type could not read, so the method returned nothing; it now also reads the canonical `{data, pagination}` envelope. `listAgentEvaluationResults()` is genuinely flat and is unaffected -- Paginate `listModelAlerts()` with the `offset` the endpoint declares instead of `page`, which it does not accept — every page after the first returned page 1 -- Send `step_type` from `getAgentAiConversationHistory()`, along with `stepId`, `limit` and `offset`. The API marks `step_type` required and the method had no way to supply it, so every call answered 422 -- Request `GET /sources` rather than `GET /sources/`. The trailing-slash form is no longer declared by the API -- Point `cancelAgentRun()` at `DELETE /agents/runs/{run_id}`. It posted to `/agents/runs/{run_id}/cancel`, a path the API has never exposed, so cancelling a run always failed - -## [1.4.0] - 2026-07-25 - -### Changed - -- Sync the bundled OpenAPI spec, adding 22 paths and 22 schemas -- Extend `listModels()` with `supportsInputMedia` and `supportsOutputMedia` capability filters - -### Added - -- Add `getMe()` returning the authenticated user's account id and organization memberships -- Add `disableAgent()`, `enableAgent()`, and `getAgentCallers()` to pause and resume an agent across every trigger path -- Add `setEmailTriggerConfig()` to set the alias, sender allowlist, and inbound-handling flags on an `EMAIL_RECEIVED` trigger -- Add agent-email opt-out methods `listAgentEmailOptOuts()` and `removeAgentEmailOptOut()` -- Add inbound sender blocklist methods `listBlockedEmailSenders()`, `blockEmailSender()`, `unblockEmailSender()`, and `setAutoBlockMode()` -- Add inbound-email observability methods `listInboundEmailRejections()`, `getInboundEmailStatus()`, `cancelQueuedEmailRuns()`, and `resumeInboundEmail()` -- Add email domain management: `listEmailDomains()`, `addEmailDomain()`, `removeEmailDomain()`, `verifyEmailDomain()`, `setPrimaryEmailDomain()`, `useSharedEmailDomain()`, `sendEmailDomainTestEmail()`, and `getDmarcSummary()` -- Add `getGenerationTiers()` mapping each media-generation modality and tier to its model and cost -- Add `searchDocs()` for keyword or semantic search over the Seclai documentation - -### Fixed - -- Return `OrganizationAlertPreferenceResponse` from `updateOrganizationAlertPreference()` instead of `unknown`, so the response fields are reachable without a cast - -## [1.3.0] - 2026-06-05 - -### Changed - -- Accept `MemoryBankAiAssistantRequest` in `aiAssistantMemoryBank()` instead of the solutions request type ([#9](https://github.com/seclai/seclai-javascript/pull/9)) - -### Added - -- Add `getAgentAttachmentReferences()` to read an agent's static attachment-reference contract before staging uploads ([#9](https://github.com/seclai/seclai-javascript/pull/9)) -- Add `downloadAgentRunAttachment()` returning the raw `Response` for a file emitted by a run step ([#9](https://github.com/seclai/seclai-javascript/pull/9)) -- Add `deleteExperiment()` to soft-delete a model playground experiment ([#9](https://github.com/seclai/seclai-javascript/pull/9)) -- Add `InsufficientCreditsResponse` and `InsufficientCreditsDetail` types for HTTP 402 responses ([#9](https://github.com/seclai/seclai-javascript/pull/9)) -- Add `AgentRunToolCallResponse` and `ModalityRateResponse` types ([#9](https://github.com/seclai/seclai-javascript/pull/9)) - -## [1.2.0] - 2026-05-22 - -### Added - -- Add `previewImportAgent()` to dry-run an agent definition import and surface unresolved entity refs ([#8](https://github.com/seclai/seclai-javascript/pull/8)) -- Add agent import types, including `AgentDefinitionImportErrorResponse` with line and column positions into the canonical source echo ([#8](https://github.com/seclai/seclai-javascript/pull/8)) - -## [1.1.5] - 2026-04-24 - -### Added - -- Add `listModels()` and `getModel()` for the model catalog ([#7](https://github.com/seclai/seclai-javascript/pull/7)) -- Add model playground methods `listExperiments()`, `createExperiment()`, `getExperiment()`, and `cancelExperiment()` ([#7](https://github.com/seclai/seclai-javascript/pull/7)) -- Add `SourceIndexMode` and model pricing types ([#7](https://github.com/seclai/seclai-javascript/pull/7)) - -## [1.1.4] - 2026-04-02 - -### Added - -- Add `exportAgent()` returning a portable JSON snapshot of an agent definition ([#6](https://github.com/seclai/seclai-javascript/pull/6)) - -## [1.1.3] - 2026-03-27 - -### Changed - -- Default the SSO domain, client id, and region so a profile only needs `sso_account_id`, and allow overriding each via `SECLAI_SSO_DOMAIN`, `SECLAI_SSO_CLIENT_ID`, and `SECLAI_SSO_REGION` ([#5](https://github.com/seclai/seclai-javascript/pull/5)) -- Make `sso_account_id` optional when loading an SSO profile ([#5](https://github.com/seclai/seclai-javascript/pull/5)) - -### Added - -- Export the SSO helpers `loadSsoProfile()`, `readSsoCache()`, `writeSsoCache()`, `deleteSsoCache()`, and `isTokenValid()`, plus the `DEFAULT_SSO_*` constants ([#5](https://github.com/seclai/seclai-javascript/pull/5)) -- Add `GET /me` to the bundled OpenAPI spec; the corresponding `getMe()` client method arrived in 1.4.0 ([#5](https://github.com/seclai/seclai-javascript/pull/5)) - -## [1.1.2] - 2026-03-26 - -### Changed - -- Update the bundled OpenAPI spec's auth descriptions to match the supported auth options ([`6d534c4`](https://github.com/seclai/seclai-javascript/commit/6d534c4)) - -## [1.1.1] - 2026-03-26 - -### Added - -- Add OAuth SSO authentication with `~/.seclai/config` profiles, an on-disk token cache, and automatic refresh ([#4](https://github.com/seclai/seclai-javascript/pull/4)) -- Add an `accountId` option, sent as the `X-Account-Id` header, to switch organization account context ([#4](https://github.com/seclai/seclai-javascript/pull/4)) -- Add an `accessToken` option accepting either a static bearer token or a provider function called per request ([#4](https://github.com/seclai/seclai-javascript/pull/4)) - -## [1.1.0] - 2026-03-23 - -### Added - -- Expand endpoint coverage to knowledge bases, memory banks, sources, source exports, embedding migrations, content, solutions, alerts, governance, evaluations, and the AI assistants ([#3](https://github.com/seclai/seclai-javascript/pull/3)) -- Add `runStreamingAgent()`, an async iterator yielding every SSE event of a run ([#3](https://github.com/seclai/seclai-javascript/pull/3)) -- Add `runAgentAndPoll()` for environments where SSE is impractical ([#3](https://github.com/seclai/seclai-javascript/pull/3)) -- Add `requestRaw()` as a low-level escape hatch returning the raw `Response` ([#3](https://github.com/seclai/seclai-javascript/pull/3)) -- Add `search()` across all resource types in an account ([#3](https://github.com/seclai/seclai-javascript/pull/3)) - -## [1.0.7] - 2026-01-30 - -### Added - -- Add `uploadFileToContent()` to replace existing content with a file upload ([`729298f`](https://github.com/seclai/seclai-javascript/commit/729298f)) -- Add a `metadata` option to the upload methods, sent as a JSON string form field ([`729298f`](https://github.com/seclai/seclai-javascript/commit/729298f)) - -### Fixed - -- Export the `SourceFileUploadResponse` and `ContentFileUploadResponse` types ([`36bff73`](https://github.com/seclai/seclai-javascript/commit/36bff73)) - -## [1.0.6] - 2026-01-27 - -### Changed - -- Accept a run id alone in `getAgentRun()` and `deleteAgentRun()`; the leading agent id is now an optional overload ([`fcf6ff9`](https://github.com/seclai/seclai-javascript/commit/fcf6ff9)) - -## [1.0.5] - 2026-01-27 - -### Added - -- Add an `includeStepOutputs` option to `getAgentRun()` ([`795fd21`](https://github.com/seclai/seclai-javascript/commit/795fd21)) - -## [1.0.4] - 2026-01-27 - -### Changed - -- Document the 200 MiB upload limit and the supported MIME types on the upload methods ([`bece917`](https://github.com/seclai/seclai-javascript/commit/bece917)) - -### Fixed - -- Point the default base URL at `https://api.seclai.com` instead of `https://seclai.com` ([`bece917`](https://github.com/seclai/seclai-javascript/commit/bece917)) - -## [1.0.3] - 2026-01-13 - -### Fixed - -- Drop the `/api` prefix from request paths so they match the deployed API ([`3d72194`](https://github.com/seclai/seclai-javascript/commit/3d72194)) - -## [1.0.2] - 2026-01-13 - -### Added - -- Add `runStreamingAgentAndWait()` to block until a streaming run completes ([`b55503d`](https://github.com/seclai/seclai-javascript/commit/b55503d)) - -## [1.0.1] - 2026-01-12 - -### Added - -- Add a documentation homepage link to the package metadata ([`3786d9d`](https://github.com/seclai/seclai-javascript/commit/3786d9d)) -- Add a release script that stamps the version into the README ([`3786d9d`](https://github.com/seclai/seclai-javascript/commit/3786d9d)) - -## [1.0.0] - 2026-01-12 - -_Stable release. No functional changes since 0.0.1._ - -## [0.0.1] - 2026-01-12 - -_Initial release._ - -[1.7.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.7.0 -[1.6.1]: https://github.com/seclai/seclai-javascript/releases/tag/1.6.1 -[1.6.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.6.0 -[1.5.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.5.0 -[1.4.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.4.0 -[1.3.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.3.0 -[1.2.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.2.0 -[1.1.5]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.5 -[1.1.4]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.4 -[1.1.3]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.3 -[1.1.2]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.2 -[1.1.1]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.1 -[1.1.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.1.0 -[1.0.7]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.7 -[1.0.6]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.6 -[1.0.5]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.5 -[1.0.4]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.4 -[1.0.3]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.3 -[1.0.2]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.2 -[1.0.1]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.1 -[1.0.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.0.0 -[0.0.1]: https://github.com/seclai/seclai-javascript/releases/tag/0.0.1 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d845663..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Seclai, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 183a515..0000000 --- a/README.md +++ /dev/null @@ -1,1012 +0,0 @@ -# Seclai JavaScript SDK - -The official JavaScript/TypeScript SDK for the [Seclai](https://seclai.com) API. Provides full typed coverage of all API endpoints, file uploads, SSE streaming, polling helpers, and automatic pagination. - -Works in Node.js 18+, Deno, Bun, Cloudflare Workers, and any runtime with a `fetch` implementation. - -## Install - -```bash -npm install @seclai/sdk -``` - -## Quick start - -```ts -import { Seclai } from "@seclai/sdk"; - -const client = new Seclai({ apiKey: process.env.SECLAI_API_KEY }); - -// List all sources -const sources = await client.listSources(); - -// Run an agent and stream the result -const result = await client.runStreamingAgentAndWait( - "agent_id", - { input: "Summarize the latest uploads", metadata: {} }, - { timeoutMs: 120_000 }, -); -console.log(result); -``` - -## Configuration - -| Option | Environment variable | Default | -| --- | --- | --- | -| `apiKey` | `SECLAI_API_KEY` | — | -| `accessToken` | — | — | -| `profile` | `SECLAI_PROFILE` | `"default"` | -| `configDir` | `SECLAI_CONFIG_DIR` | `~/.seclai` | -| `autoRefresh` | — | `true` | -| `accountId` | — | — | -| `baseUrl` | `SECLAI_API_URL` | `https://api.seclai.com` | -| `apiKeyHeader` | — | `x-api-key` | -| `defaultHeaders` | — | `{}` | -| `fetch` | — | `globalThis.fetch` | - -### Authentication - -Credentials are resolved via a chain (first match wins): - -1. Explicit `apiKey` option -2. Explicit `accessToken` option (string or `() => string | Promise`) -3. `SECLAI_API_KEY` environment variable -4. SSO — cached tokens from `~/.seclai/sso/cache/` (requires a prior `seclai auth login`) - -```ts -// API key -const client = new Seclai({ apiKey: "sk-..." }); -``` - -```ts -// Static bearer token -const client = new Seclai({ accessToken: "eyJhbGciOi..." }); -``` - -```ts -// Dynamic bearer token provider (called per request) -const client = new Seclai({ - accessToken: async () => fetchTokenFromVault(), -}); -``` - -```ts -// SSO profile (uses cached tokens, auto-refreshes) -const client = new Seclai({ profile: "my-profile" }); -``` - -```ts -// Environment variable (no options needed) -// export SECLAI_API_KEY="sk-..." -const client = new Seclai(); -``` - -#### SSO authentication - -SSO is the default fallback when no explicit credentials are provided. The SDK -includes built-in production SSO defaults, so `seclai configure sso` is not -required. You only need to log in once to populate the token cache: - -```bash -npx @seclai/cli auth login # authenticate via browser — no prior setup needed -``` - -To customize SSO settings (e.g. for a staging environment), use `seclai configure sso` -or set environment variables: - -| Variable | Description | Default | -|---|---|---| -| `SECLAI_SSO_DOMAIN` | Cognito domain | `auth.seclai.com` | -| `SECLAI_SSO_CLIENT_ID` | Cognito app client ID | `4bgf8v9qmc5puivbaqon9n5lmr` | -| `SECLAI_SSO_REGION` | AWS region | `us-west-2` | - -## API documentation - -Online API documentation (latest): - -https://seclai.github.io/seclai-javascript/latest/ - -Release history is in [`CHANGELOG.md`](CHANGELOG.md). - -## API versioning - -The API dates its backward-incompatible changes. Nothing changes for you until -you opt in, either per client or by pinning the account: - -```ts -const client = new Seclai({ - apiKey: "...", - apiVersion: SeclaiApiVersion.V2026_07_27, // sent as the Seclai-Version header -}); - -const state = await client.getApiVersion(); // what this request resolved to -await client.updateApiVersion(SeclaiApiVersion.V2026_07_27); // pin the whole account -``` - -Leave `apiVersion` unset and the header is omitted, so the account's pinned -baseline applies and responses keep their current shapes. Upgrading this package -alone never changes the wire contract. - -Known versions are on `SeclaiApiVersion` (`V2026_07_01` through `V2026_10_21`, -plus `Default` and `Latest`), imported from `@seclai/sdk`. A version this release was -**not** built against throws at construction: a newer version can reshape -responses, and this client would decode them incorrectly rather than reject them. -The same check applies to a `Seclai-Version` set through `defaultHeaders` or the -per-request `headers` of `request()` / `requestRaw()`, in any letter case, and an -empty value is rejected. Upgrade the package to adopt a new version, or set -`allowUnknownApiVersion` if you have to move first and accept that risk. - -The guard only covers the header. An account pinned server-side can still be -newer than this release — `getApiVersion()` reports the `effective_version` the -request resolved to, and comparing it against `SeclaiApiVersion.Latest` is how -you detect the gap. - -**What `2026-07-27` changes.** Undeclared query parameters become a 422 instead -of being ignored, and every list endpoint that answered with a bare array or -under a per-resource key moves to the canonical `{data, pagination}` envelope. -The methods for those endpoints return their declared type on either shape, so -code written against the default still reads the result after you opt in. Four -of them return fewer rows once you do, covered below the table: - -| Declared return | Methods | From 2026-07-27 | -| --- | --- | --- | -| An array | `listEvaluationCriteria()`, `getAgentCallers()`, `listInboundEmailRejections()`, `listGovernanceAiConversations()`, `listSolutionConversations()`, `listModels()`, `listMemoryBankTemplates()`, `getAgentsUsingMemoryBank()`, `listCloudDriveProviders()`, `listCloudDrives()`, `getAgentsUsingCloudDrive()`, `listCloudDriveRejections()` | Still the array of items; the page metadata is not returned | -| `data`, bare array by default | `listEvaluationCriteriaPage()`, `listRunEvaluationResults()` | `data`, plus `pagination` | -| `data` with flat `total`/`page`/`limit` | `listEvaluationResults()`, `listAgentEvaluationResults()`, `listEvaluationRuns()`, `listCompatibleRuns()` | Unchanged, plus `pagination` | -| A per-resource key | `listAgentEmailOptOuts()` and `listBlockedEmailSenders()` / `setAutoBlockMode()` (`items`), `listAlertConfigs()` (`configs`), `listOrganizationAlertPreferences()` (`preferences`), `listEmailDomains()` (`domains`), `listKnowledgeBases()` (`knowledge_bases`), `listMemoryBanks()` (`memory_banks`), `getGenerationTiers()` (`tiers`), `listModelAlerts()` (`alerts`), `listExperiments()` (`experiments`), `listEmbeddingModels()` and `listRerankerModels()` (`models`) | The same key and any flat `total`/`page`/`limit`, plus `data` and `pagination` | - -Where a type declares flat `total`, `page` or `limit`, the client fills them -from `pagination` after you opt in. `listRunEvaluationResults()` has no counters -on its default bare array, and gains them with `pagination`. Fields that sit -beside a list, such as `auto_block_mode` or the email-domain plan capabilities, -are present on both shapes. - -Opting in also turns paging on for endpoints that returned everything by -default, so the same call can return fewer rows: - -- `listEvaluationCriteria()` and `listRunEvaluationResults()` return every item - by default and one page (20 unless you pass `limit`) after you opt in. The - array from `listEvaluationCriteria()` carries no sign of that; use - `listEvaluationCriteriaPage()` to see `pagination`. -- `listAlertConfigs()` ignores `page` and `limit` by default and returns every - config; after you opt in it returns one page. -- `setAutoBlockMode()` reports the account's full `total` by default, and the - number of rows it returned after you opt in. - -**Later versions.** Each is cumulative. Some change a value you may be reading, -a request that used to succeed, or (from `2026-10-21`) which fields can be -`null`: - -- `2026-09-30` and `2026-10-16` change what a string you may be parsing - contains — a run's `output`, and a run's `input` when it has uploads. -- `2026-10-05` changes a value you may branch on: an item held for review - reports `content_status` `completed` instead of `failed`, so code that looks - for governance holds among `failed` items stops finding them. Check - `held_for_review` instead. -- `2026-10-13` and `2026-10-19` reject with a 400 source settings that were - accepted before. -- `2026-10-21` changes evaluation numbers you may be reading: an `error` result - no longer counts as `failed` or toward the rates, and `testDraftEvaluation()` - returns `null` `score` and `passed` for one. - -| Version | What it changes | -| --- | --- | -| `2026-08-03` | `createMemoryBank()` and `updateMemoryBank()` reject a non-zero `max_age_days` with a 400, and a memory bank's `max_age_days` reads as `null`. On create, an omitted `retention_days` resolves per bank type instead of to 30 | -| `2026-08-21` | `createSource()` rejects an embedding dimension its embedder does not support with a 400 — `listEmbeddingModels()` reports the supported ones | -| `2026-09-28` | Agent-definition writes use the current file-list grammar: an omitted `attachments` keeps the stored list and `[]` means no files | -| `2026-09-30` | **Breaks code that parses `output`.** A run's and a step's `output`, and a step's `input`, are the plain text; below this version an output that has files is a JSON manifest string (`{schema, text, attachments}`). Read files from `attachments`, which is populated on every version | -| `2026-10-03` | A new LLM step written without `attachments` takes its parent's files, and a new retrieval step's matched media are its files | -| `2026-10-05` | An item held for review by an Enforce governance policy reports `content_status` `completed` (with `held_for_review: true`) from `listSourceContents()` and `getSourceContentStatus()`. Below it the item reports `failed` with the hold as the `error` | -| `2026-10-13` | `createSource()` and `updateSource()` reject a `media_types` value other than `images` or `video`, or any value on a source that is not a website or RSS feed, with a 400. Below it an unknown value is dropped | -| `2026-10-16` | `uploadAgentInput()` accepts a file of any type and it is `ready` at once. Each step receives the file itself when its model reads that type, and its text otherwise; a run's `input` carries only a `# filename` heading per file. Below it only a fixed list of extensions is accepted and each file's extracted text is written into `input`, so poll `getAgentInputUploadStatus()` before running | -| `2026-10-18` | A source's `document_images` defaults to `true` on every embedder. Below it it defaults to `false` on a text-only embedder | -| `2026-10-19` | `createSource()` rejects `polling_max_items` on any source type but an RSS feed with a 400. Below it the value is stored | -| `2026-10-21` | An evaluation result whose evaluator returned no verdict (`error`) is left out of `failed` and of `pass_rate` / `failure_rate` in `getNonManualEvaluationSummary()`, and `getEvaluationCriteriaSummary()` averages `average_score` over passed and failed results only. `testDraftEvaluation()` returns `score` and `passed` as `null` for an `error` result. Below it the summary counts `error` results in `failed` and the rates, `average_score` includes their stored scores, and the test draft returns `score` 0.5 and `passed: false`. The summary's `error` count is returned on every version | - -**`Latest` moves with the SDK.** `SeclaiApiVersion.Latest` is the newest version -the installed release knows, so upgrading the package can opt a client that -passes it into every version added since — `1.6.0` moved it from `2026-07-27` to -`2026-10-03`, across the `2026-09-30` output change, and `1.7.0` moves it to -`2026-10-21`, across the `2026-10-05` status change, the `2026-10-13` and -`2026-10-19` source-setting rejections, the `2026-10-16` input change and the -`2026-10-21` evaluation change. Pass a -dated constant such as `SeclaiApiVersion.V2026_07_27` to keep behaviour fixed -across upgrades. - -## Upgrading to 1.7 - -Two type changes can stop existing code compiling. If you pass -`SeclaiApiVersion.Latest`, it now sends `2026-10-21`; the table above lists -what each version changes. - -**`testDraftEvaluation()` can return `null` scores.** When the evaluator -returns no verdict, `status` is `error`. From API version `2026-10-21`, `score` -and `passed` are then `null`. An account created after `2026-10-21` ships gets -that version even without setting `apiVersion`. Check `status` before reading -them, in JavaScript too; under `strictNullChecks` the type enforces it: - - -```ts -const result = await client.testDraftEvaluation("agent_id", { step_output: "...", pass_threshold: 0.7 }); - -// 1.6 and earlier: console.log(result.score.toFixed(2), result.passed); -if (result.status === "error") { - console.log("No verdict:", result.explanation); -} else { - console.log(result.score.toFixed(2), result.passed); // number and boolean here -} -``` - -**`InsufficientCreditsResponse` matches the 402 body.** Read the code at -`error.code`, not `detail.error`. Code that cast a 402 body to this type threw -on every real 402 before, so this only fixes it. - -## Resources - -### Identity - -Discover who the credential belongs to and which organizations it can act for. -Each organization's `account_id` is what you pass as the client's `accountId` -option (sent as the `X-Account-Id` header) to target that org context. - -```ts -const me = await client.getMe(); -console.log(me.account_id); // the user's personal account -for (const org of me.organizations) { - console.log(org.name, org.account_id); -} - -// Act as an organization -const orgClient = new Seclai({ accountId: me.organizations[0].account_id }); -``` - -### Agents - -```ts -// CRUD -const agents = await client.listAgents({ page: 1, limit: 20 }); -const agent = await client.createAgent({ name: "My Agent", description: "..." }); -const fetched = await client.getAgent("agent_id"); -const updated = await client.updateAgent("agent_id", { name: "Renamed" }); -await client.deleteAgent("agent_id"); - -// Pause / resume — a disabled agent stops firing from every trigger path -const callers = await client.getAgentCallers("agent_id"); // live agents calling this one -await client.disableAgent("agent_id"); // 409 if any caller above is still live -await client.enableAgent("agent_id"); - -// Definition (step workflow) -const def = await client.getAgentDefinition("agent_id"); -await client.updateAgentDefinition("agent_id", { steps: [...], change_id: def.change_id }); - -// Export / import an agent -const exported = await client.exportAgent("agent_id"); - -// Validate the payload first to surface unresolved entity refs in this account -const preview = await client.previewImportAgent({ agent_definition: exported }); -const unresolved = (preview.unresolved_refs ?? []) as Array<{ ref_id: string }>; -const entity_remap = Object.fromEntries( - unresolved.map((ref) => [ref.ref_id, /* picked target uuid */ ""]), -); - -// Commit — `entity_remap` substitutes workflow refs before save -const imported = await client.createAgent({ - name: "Imported", - trigger_type: "dynamic_input", - agent_definition: exported, - entity_remap, -}); -// `imported.import_warnings` lists any items that couldn't be applied. -``` - -### Agent runs - -```ts -// Start a run -const run = await client.runAgent("agent_id", { input: "Hello" }); - -// List & search runs -const runs = await client.listAgentRuns("agent_id", { status: "completed" }); -const search = await client.searchAgentRuns({ agent_id: "...", status: ["completed"] }); - -// Fetch run details (optionally with step outputs) -const detail = await client.getAgentRun("run_id", { includeStepOutputs: true }); - -// Cancel or delete -await client.cancelAgentRun("run_id"); -await client.deleteAgentRun("run_id"); -``` - -### Streaming - -The SDK provides two streaming patterns over the SSE `/runs/stream` endpoint: - -**Block until done** — returns the final `done` payload or throws on timeout: - -```ts -const result = await client.runStreamingAgentAndWait( - "agent_id", - { input: "Hello", metadata: {} }, - { timeoutMs: 60_000 }, -); -``` - -**Async iterator** — yields every SSE event as `{ event, data }`: - -```ts -for await (const event of client.runStreamingAgent( - "agent_id", - { input: "Hello" }, - { timeoutMs: 120_000 }, -)) { - console.log(event.event, event.data); - if (event.event === "done") break; -} -``` - -Pass `include_reasoning: true` to also receive `stream_reasoning` events carrying -the model's reasoning while it thinks. They are sent only for a -`streaming_result` step whose author enabled `show_reasoning`, and reasoning is -never part of `output`: - - -```ts -for await (const event of client.runStreamingAgent("agent_id", { - input: "Hello", - include_reasoning: true, -})) { - if (event.event === "stream_reasoning") console.log(event.data); -} -``` - -### Polling - -For environments where SSE is not practical, poll for a completed run: - -```ts -const result = await client.runAgentAndPoll( - "agent_id", - { input: "Hello" }, - { pollIntervalMs: 2_000, timeoutMs: 120_000 }, -); -``` - -### Agent input uploads - - -```ts -// Discover which files (if any) the agent expects before staging uploads -const refs = await client.getAgentAttachmentReferences("agent_id"); -if (refs.requires_uploads) { - // refs.agent lists the exact_names / indexes_max / patterns a run batch must satisfy -} - -const upload = await client.uploadAgentInput("agent_id", { - file: new Uint8Array([/* file bytes */]), - fileName: "input.pdf", -}); -// From API version 2026-10-16 the upload is `ready` at once. Below it, poll -// until `status` is `ready` before running. -let status = await client.getAgentInputUploadStatus("agent_id", upload.id); -while (status.status !== "ready") { - if (status.status === "failed") throw new Error(`Upload failed: ${status.error}`); - await new Promise((resolve) => setTimeout(resolve, 1_000)); - status = await client.getAgentInputUploadStatus("agent_id", upload.id); -} -const run = await client.runAgent("agent_id", { input_upload_id: upload.id, priority: false }); -``` - -Only a `dynamic_input` agent takes uploads; any other agent rejects one with a -400. - -### Agent run attachments - - -```ts -// Download a file emitted by a step in an agent run. The attachment_id is the -// URL-safe-base64 storage_key surfaced in run output manifests / webhooks. -const resp = await client.downloadAgentRunAttachment("run_id", "attachment_id"); -const blob = await resp.blob(); // raw Response — stream or save the bytes -``` - -### Agent email triggers - -Configure the inbound address and handling rules on an agent's `EMAIL_RECEIVED` -trigger. Omitted fields are left unchanged; `null` (or `""` for `alias`) clears them. - -```ts -const config = await client.setEmailTriggerConfig("agent_id", "trigger_id", { - alias: "support", - allowed_senders: ["example.com", "ops@partner.com"], // empty/null accepts any sender - ignore_auto_generated: true, // drop auto-replies/bulk mail to prevent loops - require_sender_auth: true, // require SPF or DMARC even on an open inbox - queue_on_quota: false, // park over-rate mail instead of failing it -}); -console.log(config.email_addresses); // ["support.@agent.seclai.com", ...] -``` - -Set `run_on_attachment_mismatch: true` to run an email whose attachments do not -fit what the agent accepts: files it cannot take are left out and the problems -are listed in the run's `email_attachment_issues` metadata. By default the run fails. - -### Accepted attachments - -Declare the input attachments a trigger accepts. A run's files are each assigned -to one named slot before any step runs, and steps reference a slot as -`{{agent.attachments.}}`. The call replaces the whole declaration, and is -refused with a 400 when the agent references a slot it leaves out. `min` defaults -to 0. The same slots can be set as `accepted_attachments` on `createAgent()` and -`updateAgentDefinition()`. - - -```ts -const agent = await client.getAgent("agent_id"); -const { accepted_attachments } = await client.setAcceptedAttachments("agent_id", agent.trigger_id!, { - accepted_attachments: [ - { name: "invoice", content_types: ["application/pdf"], min: 1, max: 1 }, - { name: "photos", content_types: ["image/*"], label: "Photos of the damage" }, - ], -}); -console.log(accepted_attachments.map((slot) => `${slot.name}: ${slot.min}..${slot.max ?? "any"}`)); -``` - -### Agent email governance - -```ts -// Recipients who opted out of this account's agent emails -const optOuts = await client.listAgentEmailOptOuts({ agentId: "agent_id", limit: 50 }); -await client.removeAgentEmailOptOut("optout_id"); // opt them back in - -// Blocked inbound senders (owner/admin only) -const blocked = await client.listBlockedEmailSenders({ limit: 50, offset: 0 }); -await client.blockEmailSender({ sender_email: "spam.example.com", match_type: "domain" }); -await client.unblockEmailSender("blocked_id"); - -// Auto-block on a governance BLOCK: "disabled" | "input" | "input_and_output" -await client.setAutoBlockMode({ mode: "input_and_output" }); - -// Inbound emails discarded before running an agent -const rejections = await client.listInboundEmailRejections({ agentId: "agent_id" }); - -// Account-wide overload circuit breaker -const status = await client.getInboundEmailStatus(); // { paused, queued_backlog } -await client.cancelQueuedEmailRuns(); // fail all QUEUED (over-quota parked) runs -await client.resumeInboundEmail(); // one-shot override; re-arms if still overloaded -``` - -### Agent AI assistant - -```ts -const steps = await client.generateAgentSteps("agent_id", { user_input: "Build a RAG pipeline" }); -const config = await client.generateStepConfig("agent_id", { step_type: "llm", user_input: "..." }); - -// Conversation history -const history = await client.getAgentAiConversationHistory("agent_id"); -await client.markAgentAiSuggestion("agent_id", "conversation_id", { accepted: true }); -``` - -### Agent evaluations - -```ts -const criteria = await client.listEvaluationCriteria("agent_id", { page: 1, limit: 50 }); -// page/limit only take effect with apiVersion "2026-07-27" or later; the legacy -// response is unpaginated. listEvaluationCriteriaPage() returns the same items -// plus a `pagination` object when opted in. -const created = await client.createEvaluationCriteria("agent_id", { name: "Accuracy", ... }); -const detail = await client.getEvaluationCriteria("criteria_id"); -await client.updateEvaluationCriteria("criteria_id", { ... }); -await client.deleteEvaluationCriteria("criteria_id"); - -// Test a draft. Check status first: an "error" result has no verdict, and its -// score and passed can be null. -const draft = await client.testDraftEvaluation("agent_id", { step_output: "...", pass_threshold: 0.7 }); -if (draft.status !== "error") console.log(draft.score, draft.passed); - -// Results by criteria -const results = await client.listEvaluationResults("criteria_id"); -const summary = await client.getEvaluationCriteriaSummary("criteria_id"); -await client.createEvaluationResult("criteria_id", { ... }); - -// Results by run -const runResults = await client.listRunEvaluationResults("agent_id", "run_id"); - -// Non-manual evaluation summary -const nonManual = await client.getNonManualEvaluationSummary("agent_id"); - -// Compatible runs for a criteria -const compatible = await client.listCompatibleRuns("criteria_id"); -``` - -### Knowledge bases - -```ts -const kbs = await client.listKnowledgeBases(); -const kb = await client.createKnowledgeBase({ name: "Docs KB" }); -const fetched = await client.getKnowledgeBase("kb_id"); -await client.updateKnowledgeBase("kb_id", { name: "Renamed KB" }); -await client.deleteKnowledgeBase("kb_id"); -``` - -### Memory banks - -```ts -const banks = await client.listMemoryBanks(); -const bank = await client.createMemoryBank({ name: "Chat Memory", type: "conversation" }); -const fetched = await client.getMemoryBank("mb_id"); -await client.updateMemoryBank("mb_id", { name: "Renamed" }); -await client.deleteMemoryBank("mb_id"); - -// Stats & compaction -const stats = await client.getMemoryBankStats("mb_id"); -await client.compactMemoryBank("mb_id"); - -// Test compaction -const test = await client.testMemoryBankCompaction("mb_id", { ... }); -const standalone = await client.testCompactionPromptStandalone({ ... }); - -// Templates & agents -const templates = await client.listMemoryBankTemplates(); -const agents = await client.getAgentsUsingMemoryBank("mb_id"); - -// AI assistant -const suggestion = await client.generateMemoryBankConfig({ user_input: "..." }); -const history = await client.getMemoryBankAiLastConversation(); -await client.acceptMemoryBankAiSuggestion("conv_id", { ... }); - -// Source management -await client.deleteMemoryBankSource("mb_id"); -``` - -### Sources - -```ts -const sources = await client.listSources({ page: 1, limit: 20, order: "asc" }); -const source = await client.createSource({ name: "My Source", ... }); -const fetched = await client.getSource("source_id"); -await client.updateSource("source_id", { name: "Renamed" }); -await client.deleteSource("source_id"); -``` - -Indexing status of a source's content, keyed by the `content_version_id` the -upload methods return: - - -```ts -const failed = await client.listSourceContents("source_id", { status: "failed" }); -const batch = await client.listSourceContents("source_id", { - contentVersionIds: ["cv_1", "cv_2"], -}); -console.log(batch.pagination.total, failed.data.map((item) => item.error)); - -const one = await client.getSourceContentStatus("source_id", "cv_1"); -console.log(one.content_status, one.held_for_review); -``` - -An item an Enforce governance policy blocked at import is held for review: -`held_for_review` is `true` until a reviewer releases it. Its `content_status` is -`completed` from API version `2026-10-05`, and `failed` with the hold as the -`error` below it. - -An email source stores mail from `email_allowed_senders` only, and lists what it -refused. Each entry names the sender and the reason, never the subject or body; -adding a refused sender to `email_allowed_senders` helps only when `authenticated` -is `true`. Listing rejections requires an account owner or administrator. - - -```ts -const inbox = await client.createSource({ - name: "Newsletters", - source_type: "email", - email_allowed_senders: ["news@example.com", "example.org"], -}); -console.log(inbox.email_address); // send mail here - -const rejections = await client.listEmailSourceRejections(inbox.id, { page: 1, limit: 50 }); -for (const r of rejections.data) console.log(r.from_address, r.reason, r.authenticated); - -// Index the images inside documents, and an RSS feed's enclosures -await client.updateSource("source_id", { document_images: true, feed_attachments: ["enclosures"] }); -``` - -A `cloud_drive` source takes `cloud_drive_connection_id` (from `listCloudDrives()`) -on create, and `cloud_drive_folder_path`, `cloud_drive_path_pattern`, -`cloud_drive_content_types` and `cloud_drive_max_file_mb` to choose which files -it indexes. - -### Cloud drives - - -```ts -const providers = await client.listCloudDriveProviders(); -const drives = await client.listCloudDrives(); -const drive = await client.getCloudDrive(drives[0].id); -await client.updateCloudDrive(drive.id, { name: "Contracts" }); - -// Which agents depend on it, and which files it skipped and why -const agents = await client.getAgentsUsingCloudDrive(drive.id); -const skipped = await client.listCloudDriveRejections(drive.id, { limit: 20 }); -console.log(providers.length, agents.length, skipped.map((r) => r.reason)); - -const disconnected = await client.disconnectCloudDrive(drive.id); // keeps the connection -console.log(disconnected.connected); -await client.deleteCloudDrive(drive.id); -``` - -### File uploads - -Upload a file to a source (max 200 MiB). The SDK infers MIME type from the file extension when `mimeType` is not provided. - -```ts -import { readFile } from "node:fs/promises"; - -await client.uploadFileToSource("source_id", { - file: await readFile("document.pdf"), - fileName: "document.pdf", - title: "Q4 Report", - metadata: { department: "finance" }, -}); -``` - -Upload inline text: - -```ts -await client.uploadInlineTextToSource("source_id", { - text: "Hello, world!", - title: "Greeting", -}); -``` - -Replace a content version with a new file: - -```ts -await client.uploadFileToContent("content_version_id", { - file: await readFile("updated.pdf"), - fileName: "updated.pdf", - mimeType: "application/pdf", -}); -``` - -### Source exports - -```ts -const exports = await client.listSourceExports("source_id"); -const exp = await client.createSourceExport("source_id", { format: "json" }); -const status = await client.getSourceExport("source_id", exp.id); -const estimate = await client.estimateSourceExport("source_id", {}); -const response = await client.downloadSourceExport("source_id", exp.id); -await client.deleteSourceExport("source_id", exp.id); -await client.cancelSourceExport("source_id", exp.id); -``` - -### Source embedding migrations - -```ts -const migration = await client.getSourceEmbeddingMigration("source_id"); -await client.startSourceEmbeddingMigration("source_id", { target_model: "..." }); -await client.cancelSourceEmbeddingMigration("source_id"); -``` - -### Content - -```ts -const detail = await client.getContentDetail("content_id", { start: 0, end: 1000 }); -const embeddings = await client.listContentEmbeddings("content_id"); -await client.deleteContent("content_id"); - -// Replace content with inline text -await client.replaceContentWithInlineText("content_id", { text: "Updated text", title: "Updated" }); - -// Upload a replacement file -await client.uploadFileToContent("content_id", { - file: await readFile("updated.pdf"), - fileName: "updated.pdf", -}); -``` - -A content item's attachments are the files an agent step, an email, a feed, a -web page's media or a document's images added to it. Each says whether it is -indexed for search and, if indexing failed, why. An email item's -`skipped_attachments` (on `getContentDetail()`) lists the parts that were not -stored, with the reason. - - -```ts -const attachments = await client.listContentAttachments("content_id", { limit: 50 }); -for (const att of attachments.data) { - console.log(att.id, att.content_type, att.indexed, att.indexing_error); -} - -const att = await client.getContentAttachment("content_id", "attachment_id", { start: 0, end: 2000 }); -console.log(att.text_content, att.file_withheld); -const vectors = await client.listContentAttachmentEmbeddings("content_id", "attachment_id"); - -// Raw Response; 403 while the file is withheld (see `file_withheld`). -const file = await client.downloadContentAttachment("content_id", "attachment_id"); -const bytes = new Uint8Array(await file.arrayBuffer()); -``` - -### Solutions - -```ts -const solutions = await client.listSolutions(); -const sol = await client.createSolution({ name: "My Solution" }); -const fetched = await client.getSolution("solution_id"); -await client.updateSolution("solution_id", { name: "Renamed" }); -await client.deleteSolution("solution_id"); - -// Link / unlink resources -await client.linkAgentsToSolution("solution_id", { ids: ["agent_id"] }); -await client.unlinkAgentsFromSolution("solution_id", { ids: ["agent_id"] }); -await client.linkKnowledgeBasesToSolution("solution_id", { ids: ["kb_id"] }); -await client.unlinkKnowledgeBasesFromSolution("solution_id", { ids: ["kb_id"] }); -await client.linkSourceConnectionsToSolution("solution_id", { ids: ["source_id"] }); -await client.unlinkSourceConnectionsFromSolution("solution_id", { ids: ["source_id"] }); - -// AI assistant -const plan = await client.generateSolutionAiPlan("solution_id", { user_input: "Set up a RAG pipeline" }); -await client.acceptSolutionAiPlan("solution_id", "conversation_id", {}); -await client.declineSolutionAiPlan("solution_id", "conversation_id"); - -// AI-generated knowledge base / source within the solution -await client.generateSolutionAiKnowledgeBase("solution_id", { user_input: "..." }); -await client.generateSolutionAiSource("solution_id", { user_input: "..." }); - -// Conversations -const convs = await client.listSolutionConversations("solution_id"); -await client.addSolutionConversationTurn("solution_id", { user_input: "..." }); -await client.markSolutionConversationTurn("solution_id", "conversation_id", { ... }); -``` - -### Governance AI - -```ts -const plan = await client.generateGovernanceAiPlan({ user_input: "Add a toxicity policy" }); -const convs = await client.listGovernanceAiConversations(); -await client.acceptGovernanceAiPlan("conversation_id"); -await client.declineGovernanceAiPlan("conversation_id"); -``` - -### Alerts - -```ts -const alerts = await client.listAlerts({ status: "active" }); -const alert = await client.getAlert("alert_id"); -await client.changeAlertStatus("alert_id", { status: "resolved" }); -await client.addAlertComment("alert_id", { text: "Investigating" }); - -// Subscriptions -await client.subscribeToAlert("alert_id"); -await client.unsubscribeFromAlert("alert_id"); - -// Alert configs -const configs = await client.listAlertConfigs(); -await client.createAlertConfig({ ... }); -await client.getAlertConfig("config_id"); -await client.updateAlertConfig("config_id", { ... }); -await client.deleteAlertConfig("config_id"); - -// Organization preferences -const prefs = await client.listOrganizationAlertPreferences(); -await client.updateOrganizationAlertPreference("org_id", "alert_type", { ... }); -``` - -### Models - -```ts -// List models, optionally filtered by capability -const providers = await client.listModels({ supportsToolUse: true }); -const imageModels = await client.listModels({ supportsOutputMedia: "image" }); -const pdfModels = await client.listModels({ supportsInputMedia: "pdf" }); -const model = await client.getModel("model_id"); - -// Media-generation quality tiers (fast/balanced/thorough) and what each resolves to -const tiers = await client.getGenerationTiers(); - -// Embedding and reranker models, with their pricing -const embedders = await client.listEmbeddingModels({ supportsInputMedia: "image" }); -const rerankers = await client.listRerankerModels(); -console.log(embedders.models, embedders.default_model_type, rerankers.models); - -const alerts = await client.listModelAlerts(); -await client.markModelAlertRead("alert_id"); -await client.markAllModelAlertsRead(); -const unread = await client.getUnreadModelAlertCount(); -const recs = await client.getModelRecommendations("model_id"); - -// Model playground experiments -const experiment = await client.createExperiment({ model_ids: ["model_id"], prompt: "..." }); -const experiments = await client.listExperiments(); -const detail = await client.getExperiment("experiment_id"); -await client.cancelExperiment("experiment_id"); -await client.deleteExperiment("experiment_id"); // soft-delete, preserves audit history -``` - -### Search - -```ts -const results = await client.search({ query: "quarterly report" }); -const filtered = await client.search({ query: "my agent", entityType: "agent", limit: 5 }); -``` - -### Documentation search - -Search the Seclai docs. Results are global (not account-scoped) and each carries a -`doc_slug` plus an optional `anchor` for building a -`https://seclai.com/docs/[#]` link. - -```ts -// Fast title/summary match, no AI cost -const hits = await client.searchDocs({ query: "email triggers" }); - -// Semantic body match — adds a `highlight` with the best matching sentence -const semantic = await client.searchDocs({ - query: "how do I stop auto-reply loops", - mode: "semantic", - limit: 5, -}); -``` - -### Email domains - -Send and receive agent email on your own domain instead of the shared -`agent.seclai.com`. These endpoints require a user-bound credential (an -account-only API key is refused with 403) and, for mutations, an account owner/admin. - - -```ts -// Current domains, their DNS records, and what your plan allows -const { domains, can_add_custom, has_custom } = await client.listEmailDomains(); - -// Add a vanity subdomain (.seclai.com) or your own custom domain -const vanity = await client.addEmailDomain({ kind: "vanity", value: "acme" }); -const custom = await client.addEmailDomain({ - kind: "custom", - value: "agent.mycompany.com", - delegated: true, // let Seclai manage a dedicated Route53 zone -}); - -// Publish custom.dns_records at your DNS provider, then check without waiting -// for the background sweep -const checked = await client.verifyEmailDomain(custom.id); - -// Promote a verified domain, or fall back to the shared domain -await client.setPrimaryEmailDomain(custom.id); -await client.useSharedEmailDomain(); // keeps the domain configured & verified - -// Confirm delivery end-to-end (always sends to the account owner only) -await client.sendEmailDomainTestEmail(custom.id); - -// DMARC aggregate-report summary -const dmarc = await client.getDmarcSummary(custom.id, { days: 30, topSources: 10 }); - -// Removing a delegated domain returns a cleanup_note about the registrar NS record -const { cleanup_note } = await client.removeEmailDomain(custom.id); -``` - -### Top-level AI assistant - -```ts -// Generate plans for different resource types -const kb = await client.aiAssistantKnowledgeBase({ user_input: "Create a docs KB" }); -const src = await client.aiAssistantSource({ user_input: "Add a web source" }); -const sol = await client.aiAssistantSolution({ user_input: "Set up monitoring" }); -const mb = await client.aiAssistantMemoryBank({ user_input: "Create a chat memory" }); - -// Accept or decline the generated plan -await client.acceptAiAssistantPlan("conversation_id", { confirm_deletions: true }); -await client.declineAiAssistantPlan("conversation_id"); - -// Memory bank conversation history -const history = await client.getAiAssistantMemoryBankHistory(); -await client.acceptAiMemoryBankSuggestion("conversation_id", { ... }); - -// Feedback -await client.submitAiFeedback({ ... }); -``` - -## Pagination helper - -Automatically iterate through all pages of a list method: - - -```ts -for await (const source of client.paginate( - (opts) => client.listSources(opts), - { limit: 50 }, -)) { - console.log(source.name); -} -``` - -## Error handling - -All errors extend `SeclaiError`: - -```ts -import { - SeclaiError, - SeclaiConfigurationError, - SeclaiAPIStatusError, - SeclaiAPIValidationError, - SeclaiStreamingError, -} from "@seclai/sdk"; - -try { - await client.getAgent("bad_id"); -} catch (err) { - if (err instanceof SeclaiAPIValidationError) { - console.error("Validation:", err.validationError); - } else if (err instanceof SeclaiAPIStatusError) { - console.error(`HTTP ${err.statusCode}:`, err.responseText); - } else if (err instanceof SeclaiStreamingError) { - console.error("Stream failed for run:", err.runId); - } -} -``` - -## Cancellation (AbortSignal) - -All low-level methods support an `AbortSignal` for request cancellation: - -```ts -const controller = new AbortController(); - -// Cancel after 5 seconds -setTimeout(() => controller.abort(), 5_000); - -const data = await client.request("GET", "/agents", { - signal: controller.signal, -}); -``` - -## Low-level access - -For endpoints not yet covered by a convenience method, use `request` or `requestRaw`: - -```ts -// JSON request/response -const data = await client.request("POST", "/custom/endpoint", { - json: { key: "value" }, - query: { filter: "active" }, -}); - -// Raw Response (e.g. binary downloads) -const response = await client.requestRaw("GET", "/files/download/123"); -const blob = await response.blob(); -``` - -## Development - -### Install dependencies - -```bash -npm install -``` - -### Type checking - -```bash -npm run typecheck -``` - -### Build - -```bash -npm run build -``` - -This also regenerates `src/openapi.ts` from `openapi/seclai.openapi.json`. - -### Run tests - -```bash -npm test -``` - -### Generate docs - -Generate HTML docs into `build/docs/`: - -```bash -npm run docs -``` diff --git a/.claude/skills/seclai-sdk-sync/SKILL.md b/SKILL.md similarity index 93% rename from .claude/skills/seclai-sdk-sync/SKILL.md rename to SKILL.md index 16818d9..0f00507 100644 --- a/.claude/skills/seclai-sdk-sync/SKILL.md +++ b/SKILL.md @@ -142,8 +142,21 @@ diff called 21 JavaScript changes breaking when none were: gone, parameter list changed, or a return type changed in a static language. - **WARN** — compatible but worth checking: a *trailing* optional parameter (source compatible; flagged as binary breaking for C#), `unknown` narrowed to a - concrete type in TypeScript (safe), or a Python return annotation (not enforced - — but confirm the runtime value did not change too). + concrete type in TypeScript (safe), an optional member added to an inline + TypeScript options object such as `opts: { signal?: AbortSignal } = {}` (never + to an empty `{}`, which accepts any value the new type may reject; every + other member unchanged or only widened to accept `undefined`, the parameter's + name and its default unchanged; usually source + compatible, but a caller passing a non-literal object that already carries a + same-named property of another type — `const o = { signal: "abc" }` — no + longer compiles, since excess-property checks only cover literals), an + optional options-object member widened to accept `undefined` + (`x?: T` -> `x?: T | undefined`; source compatible), a TypeScript parameter + type wrapped in `Omit` (usually source compatible: an object literal + that sets an omitted key no longer compiles) or `Partial` (source + compatible) — in each case with every other parameter unchanged, or a + Python return annotation (not enforced — but confirm the runtime value did not + change too). An optional parameter inserted *mid-list* is graded breaking, not a warning: in C# a positional `M(id, token)` then tries to bind `token` to the new parameter. @@ -310,5 +323,6 @@ local conventions (`searchDocs` / `search_docs` / `SearchDocs`). ## Release The version comes from the merge commit message, read by `seclai/github-tag-action` -with `DEFAULT_BUMP: patch`. A sync that adds endpoints needs `#minor` in the PR -title, or it ships as a patch and the changelog heading will not match the tag. +with `DEFAULT_BUMP: patch`. A sync that adds endpoints needs `#minor` in a commit +message (not the PR title), or it ships as a patch and the changelog heading +will not match the tag. diff --git a/.claude/skills/seclai-sdk-sync/docexamples.py b/docexamples.py similarity index 100% rename from .claude/skills/seclai-sdk-sync/docexamples.py rename to docexamples.py diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json deleted file mode 100644 index 0ca4052..0000000 --- a/openapi/seclai.openapi.json +++ /dev/null @@ -1,28030 +0,0 @@ -{ - "components": { - "parameters": { - "Seclai-Version": { - "description": "Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it \u2014 e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key.", - "in": "header", - "name": "Seclai-Version", - "required": false, - "schema": { - "pattern": "^\\d{4}-\\d{2}-\\d{2}$", - "type": "string" - } - }, - "X-Account-Id": { - "description": "Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication \u2014 the key's account is always used.", - "in": "header", - "name": "X-Account-Id", - "required": false, - "schema": { - "format": "uuid", - "type": "string" - } - } - }, - "schemas": { - "AcceptedAttachmentSlot": { - "additionalProperties": false, - "properties": { - "content_types": { - "description": "Accepted types, e.g. ``application/pdf`` or ``image/*``; empty accepts any type.", - "items": { - "type": "string" - }, - "title": "Content Types", - "type": "array" - }, - "label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Shown to people.", - "title": "Label" - }, - "max": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Most files a run may include; empty is no limit.", - "title": "Max" - }, - "min": { - "default": 0, - "description": "Fewest files a run must include; fewer refuses the run, except on an email trigger set to run anyway, which lists the shortfall.", - "title": "Min", - "type": "integer" - }, - "name": { - "description": "Lowercase letters, digits and underscores, starting with a letter. Steps reference the files as ``{{agent.attachments.}}``.", - "title": "Name", - "type": "string" - }, - "name_pattern": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filename glob a file must also match, ignoring case.", - "title": "Name Pattern" - } - }, - "required": [ - "name" - ], - "title": "AcceptedAttachmentSlot", - "type": "object" - }, - "AcceptedAttachmentsResponse": { - "properties": { - "accepted_attachments": { - "items": { - "$ref": "#/components/schemas/AcceptedAttachmentSlot" - }, - "title": "Accepted Attachments", - "type": "array" - }, - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" - }, - "trigger_id": { - "format": "uuid", - "title": "Trigger Id", - "type": "string" - } - }, - "required": [ - "trigger_id", - "agent_id", - "accepted_attachments" - ], - "title": "AcceptedAttachmentsResponse", - "type": "object" - }, - "AddConversationTurnRequest": { - "properties": { - "actions_taken": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Actions taken by the AI", - "title": "Actions Taken" - }, - "ai_response": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI response text", - "title": "Ai Response" - }, - "user_input": { - "description": "User input text", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "AddConversationTurnRequest", - "type": "object" - }, - "AddEmailDomainRequest": { - "properties": { - "delegated": { - "default": false, - "title": "Delegated", - "type": "boolean" - }, - "kind": { - "description": "'vanity' or 'custom'", - "title": "Kind", - "type": "string" - }, - "value": { - "maxLength": 253, - "minLength": 1, - "title": "Value", - "type": "string" - } - }, - "required": [ - "kind", - "value" - ], - "title": "AddEmailDomainRequest", - "type": "object" - }, - "AgentAttachmentRefsApiResponse": { - "description": "The input attachments an agent's trigger declares.\n\nMirrors the MCP ``get_agent_attachment_references`` tool, so API\nconsumers can stage uploads that fit before calling\n``POST /agents/{id}/runs``.", - "properties": { - "accepted_attachments": { - "description": "The attachments the agent's trigger declares. A run's files are each assigned to one; a file none accepts, or an attachment with fewer files than its ``min``, rejects the run with HTTP 400. Steps reference one as ``{{agent.attachments.}}``.", - "items": { - "$ref": "#/components/schemas/AcceptedAttachmentSlot" - }, - "title": "Accepted Attachments", - "type": "array" - }, - "agent": { - "$ref": "#/components/schemas/AttachmentRefsSourceApiSummary", - "description": "Aggregated summary of the agent-file references in the steps. Informational: which files a run accepts is ``accepted_attachments``." - }, - "requires_uploads": { - "description": "When ``false`` the agent takes no files through the API \u2014 it has no ``dynamic_input`` trigger, or that trigger declares no attachments \u2014 and ``POST /agents/{id}/upload-input`` will reject with HTTP 400. When ``true`` ``accepted_attachments`` lists what a run's files must fit.", - "title": "Requires Uploads", - "type": "boolean" - } - }, - "required": [ - "requires_uploads" - ], - "title": "AgentAttachmentRefsApiResponse", - "type": "object" - }, - "AgentCallerApiResponse": { - "description": "One agent that calls another (blocks disabling the callee while live).", - "properties": { - "disabled": { - "title": "Disabled", - "type": "boolean" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name", - "disabled" - ], - "title": "AgentCallerApiResponse", - "type": "object" - }, - "AgentDefinitionImportErrorResponse": { - "description": "422 body for invalid `agent_definition` payloads.\n\nMirrors `AgentDefinitionImportError.to_response_dict`.", - "properties": { - "error": { - "const": "invalid_agent_definition", - "description": "Stable machine-readable error code.", - "title": "Error", - "type": "string" - }, - "errors": { - "items": { - "$ref": "#/components/schemas/ImportFieldErrorModel" - }, - "title": "Errors", - "type": "array" - }, - "message": { - "title": "Message", - "type": "string" - }, - "source": { - "description": "Canonical pretty-printed echo of the supplied payload \u2014 error line/column refer to this string.", - "title": "Source", - "type": "string" - } - }, - "required": [ - "error", - "message", - "errors", - "source" - ], - "title": "AgentDefinitionImportErrorResponse", - "type": "object" - }, - "AgentDefinitionResponse": { - "properties": { - "change_id": { - "description": "Current change ID (use as expected_change_id when updating).", - "title": "Change Id", - "type": "string" - }, - "definition": { - "additionalProperties": true, - "description": "The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, regex_replace, gate, retry, evaluate_step, extract_data, extract_content, add_chat_turn, load_chat_history, add_memory, search_memory, load_memory, streaming_result, send_email, webhook_call, call_agent, write_metadata, write_content_attachment, load_content_attachment, load_content, display_result, merge, for_each, if_else, switch, and others.", - "title": "Definition", - "type": "object" - }, - "schema_version": { - "description": "Agent schema version.", - "title": "Schema Version", - "type": "string" - }, - "warnings": { - "anyOf": [ - { - "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Validation warnings, if any.", - "title": "Warnings" - } - }, - "required": [ - "change_id", - "definition", - "schema_version" - ], - "title": "AgentDefinitionResponse", - "type": "object" - }, - "AgentEmailOptOutListResponse": { - "description": "A page of agent-email opt-outs plus the total (for pagination).", - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/AgentEmailOptOutResponse" - }, - "title": "Items", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "items", - "total" - ], - "title": "AgentEmailOptOutListResponse", - "type": "object" - }, - "AgentEmailOptOutResponse": { - "description": "A recipient's opt-out from an account's agent emails (one agent or all).", - "properties": { - "agent_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "agent_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Name" - }, - "comment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Comment" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Reason" - }, - "recipient_email": { - "title": "Recipient Email", - "type": "string" - } - }, - "required": [ - "id", - "created_at", - "recipient_email", - "agent_id", - "agent_name", - "reason", - "comment" - ], - "title": "AgentEmailOptOutResponse", - "type": "object" - }, - "AgentEvaluationTier": { - "description": "Controls model selection for agent evaluation.\n\nLabels shown in UI:\n FAST \u2192 \"Fast and cheap\"\n BALANCED \u2192 \"Balanced speed and cost\"\n THOROUGH \u2192 \"Slow and thorough\"", - "enum": [ - "fast", - "balanced", - "thorough" - ], - "title": "AgentEvaluationTier", - "type": "string" - }, - "AgentExportResponse": { - "description": "Portable JSON snapshot of an agent definition.", - "properties": { - "agent": { - "additionalProperties": true, - "description": "Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, created_at, updated_at.", - "title": "Agent", - "type": "object" - }, - "alert_configs": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Alert configurations.", - "title": "Alert Configs" - }, - "dependencies": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Resolved dependency manifest. Keys: knowledge_bases, memory_banks, source_connections, agents, users \u2014 each a list of {id, name, description, \u2026}.", - "title": "Dependencies" - }, - "evaluation_criteria": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Evaluation criteria for agent steps.", - "title": "Evaluation Criteria" - }, - "export_version": { - "description": "Schema version of the export format (currently \"5\").", - "title": "Export Version", - "type": "string" - }, - "exported_at": { - "description": "ISO-8601 timestamp of when the export was generated.", - "title": "Exported At", - "type": "string" - }, - "governance_policies": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Agent-scoped governance policies.", - "title": "Governance Policies" - }, - "software_version": { - "description": "Application version that produced this export.", - "title": "Software Version", - "type": "string" - }, - "trigger": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Trigger configuration with schedules.", - "title": "Trigger" - } - }, - "required": [ - "export_version", - "exported_at", - "software_version", - "agent" - ], - "title": "AgentExportResponse", - "type": "object" - }, - "AgentRunAttemptResponse": { - "properties": { - "duration": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Duration of the attempt in seconds.", - "title": "Duration" - }, - "ended_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the attempt ended.", - "title": "Ended At" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if the attempt failed.", - "title": "Error" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the attempt started.", - "title": "Started At" - }, - "status": { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus", - "description": "Status of the agent run attempt." - } - }, - "required": [ - "status", - "started_at", - "ended_at", - "duration", - "error" - ], - "title": "AgentRunAttemptResponse", - "type": "object" - }, - "AgentRunFileResponse": { - "description": "A file in a run's or a step's output.", - "properties": { - "bytes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Size of the file in bytes, when known.", - "title": "Bytes" - }, - "download_url": { - "description": "`GET` URL that streams the file; accepts an API key or OAuth token.", - "title": "Download Url", - "type": "string" - }, - "id": { - "description": "File identifier, used to download it.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "mime": { - "description": "MIME type of the file.", - "title": "Mime", - "type": "string" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The file's name in this run, as sent to email recipients and webhooks and matched by `{{attachments[...]}}` selectors.", - "title": "Name" - } - }, - "required": [ - "id", - "name", - "mime", - "bytes", - "download_url" - ], - "title": "AgentRunFileResponse", - "type": "object" - }, - "AgentRunRequest": { - "properties": { - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input to provide to the agent upon running for agents with dynamic triggers.", - "title": "Input" - }, - "input_upload_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` \u2014 use that field to attach multiple files. May be combined with ``input``: the prompt text leads and the file follows under a ``# {filename}`` heading (before ``Seclai-Version: 2026-10-16``, followed by its extracted text).\n\n**Which steps receive it:** a step that sends or stores files takes the files its ``attachments`` field selects. An LLM step (``prompt_call``, ``extract_data``, ``evaluate_step``) takes the files its ``attachments`` field names, or else the files its plain-text templates reference: ``{{agent.attachments.}}`` for one attachment the trigger declares, or ``{{agent.input}}`` for every upload unless a template also names an agent attachment.\n\n**Per-batch validation:** the batch must fit the trigger's ``accepted_attachments`` \u2014 every file fits one declared attachment and each attachment gets at least its ``min`` files \u2014 or the run is rejected with HTTP 400.", - "title": "Input Upload Id" - }, - "input_upload_ids": { - "anyOf": [ - { - "items": { - "format": "uuid", - "type": "string" - }, - "maxItems": 20, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "IDs of multiple previously uploaded files. Each upload gets a heading in ``input`` (before ``Seclai-Version: 2026-10-16``, followed by its extracted text); each upload reaches steps as a separate file (before ``Seclai-Version: 2026-10-16``, a text upload in the open ``files`` attachment is written into ``input`` instead). Steps choose files as described under ``input_upload_id``. The batch must fit the trigger's ``accepted_attachments``; a mismatch returns HTTP 400 listing what does not fit. Mutually exclusive with ``input_upload_id`` (two spellings of the same batch), but may be combined with ``input`` \u2014 the prompt text leads and the per-file sections follow, so \"a photo plus a sentence about it\" needs no synthetic text upload. Max 20 uploads per run.", - "title": "Input Upload Ids" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/components/schemas/JsonValue" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Metadata to make available for string substitution expressions in agent tasks.", - "title": "Metadata" - }, - "priority": { - "default": false, - "description": "If true, the agent run will be treated as priority execution.", - "title": "Priority", - "type": "boolean" - }, - "replay_of_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Re-run this agent reusing a prior run's uploaded input files. The files are re-resolved server-side from the source run (which must belong to this account and agent) \u2014 you do not re-upload them. Combine with ``input`` to change the text while keeping the files. A fresh upload batch (``input_upload_id(s)``) takes precedence and disables replay. Binaries swept by retention fall back to their extracted text. Files the trigger's ``accepted_attachments`` no longer accepts are left out.", - "title": "Replay Of Run Id" - } - }, - "title": "AgentRunRequest", - "type": "object" - }, - "AgentRunResponse": { - "properties": { - "attachments": { - "description": "Files in the run's output, in order. Empty for runs that produced none, for runs made before files were listed here, and once the run's trace is purged.", - "items": { - "$ref": "#/components/schemas/AgentRunFileResponse" - }, - "title": "Attachments", - "type": "array" - }, - "attempts": { - "description": "List of attempts made for this agent run.", - "items": { - "$ref": "#/components/schemas/AgentRunAttemptResponse" - }, - "title": "Attempts", - "type": "array" - }, - "blocked_policies": { - "description": "Governance policies that produced at least one BLOCK verdict during this run. Deduplicated by policy id.", - "items": { - "$ref": "#/components/schemas/routers__api__agents__GovernancePolicyRefResponse" - }, - "title": "Blocked Policies", - "type": "array" - }, - "credits": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits consumed by the agent run, if applicable. Can still rise briefly after the run ends, while governance screening finishes.", - "title": "Credits" - }, - "error_count": { - "description": "Number of errors encountered during the run.", - "title": "Error Count", - "type": "integer" - }, - "flagged_policies": { - "description": "Governance policies that produced at least one FLAG verdict during this run. Deduplicated by policy id.", - "items": { - "$ref": "#/components/schemas/routers__api__agents__GovernancePolicyRefResponse" - }, - "title": "Flagged Policies", - "type": "array" - }, - "governance_input_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Result of the governance input evaluation: safe, blocked, skipped, or timed_out.", - "title": "Governance Input Status" - }, - "governance_input_wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Milliseconds spent waiting for governance input evaluation.", - "title": "Governance Input Wait Ms" - }, - "hitl_wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cumulative milliseconds the run was parked waiting for a human decision on a human_in_the_loop step. Subtracted from active duration in run-detail and duration-stats responses.", - "title": "Hitl Wait Ms" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input provided to the agent for this run.", - "title": "Input" - }, - "input_scan_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Result of the prompt injection scan: safe, unsafe, skipped, timed_out, or error.", - "title": "Input Scan Status" - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The run's output text; its files are in `attachments`. Below `Seclai-Version: 2026-09-30` an output that has files is instead the manifest JSON `{schema, text, attachments: [{storage_key, mime, name, label, bytes}]}`; `bytes` can be `null` on runs made before that version shipped.", - "title": "Output" - }, - "output_content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "MIME type of `output` \u2014 mirrors the terminal step's `output_content_type`. `text/plain` / `text/*` are free-form text and `application/json` is a JSON document. Below `Seclai-Version: 2026-09-30` an output that has files reads `application/vnd.seclai.manifest+json` (see `output`); the same files are in `attachments` on every version, each with a `download_url`. Null on runs that produced no terminal output or that pre-date this column.", - "title": "Output Content Type" - }, - "priority": { - "description": "Indicates if the run was treated as a priority execution.", - "title": "Priority", - "type": "boolean" - }, - "run_id": { - "description": "Unique identifier for the agent run.", - "title": "Run Id", - "type": "string" - }, - "scan_wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Milliseconds spent waiting for prompt injection scan.", - "title": "Scan Wait Ms" - }, - "status": { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus", - "description": "Current status of the agent run." - }, - "steps": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/AgentRunStepResponse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Step outputs and per-step timing/credits. Only included when requested.", - "title": "Steps" - }, - "trace_purged_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "When this run's trace content was deleted under the account's agent-trace retention window. Non-null means `input`, `output` and every step's and tool call's I/O are null **by design** and will never be available again \u2014 the run aged out, it did not fail. A tool call's `error` may be null as well, so a failed tool call can report its status without a message. Branch on this rather than on a null `output`: a run that genuinely produced nothing looks identical. Status, timing and credits remain accurate.", - "title": "Trace Purged At" - }, - "wait_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cumulative milliseconds the run was parked on standard-mode wait steps. Subtracted from active duration in run-detail and duration-stats responses, exactly like hitl_wait_ms. Priority waits block inline and are not counted here.", - "title": "Wait Ms" - } - }, - "required": [ - "run_id", - "status", - "error_count", - "credits", - "priority", - "input", - "output", - "attempts" - ], - "title": "AgentRunResponse", - "type": "object" - }, - "AgentRunStepResponse": { - "properties": { - "agent_step_id": { - "description": "Agent step identifier.", - "title": "Agent Step Id", - "type": "string" - }, - "attachments": { - "description": "Files in this step's output, in order. Empty for steps that produced none, for steps run before files were listed here, and once the run's trace is purged.", - "items": { - "$ref": "#/components/schemas/AgentRunFileResponse" - }, - "title": "Attachments", - "type": "array" - }, - "credits_used": { - "description": "Credits consumed by this step across every attempt it made. Some charges made outside any step, such as governance screening of the run's input, count toward the run's total but no step's. The timestamps above and the tool calls below describe the latest attempt only.", - "title": "Credits Used", - "type": "number" - }, - "duration_seconds": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Duration of the step attempt in seconds.", - "title": "Duration Seconds" - }, - "ended_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the step attempt ended.", - "title": "Ended At" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input text provided to the step, if any. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step that produced it output files and is not a `for_each`.", - "title": "Input" - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Output text produced by the step, if any; its files are in `attachments`. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step output files and is not a `for_each`.", - "title": "Output" - }, - "output_content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Content type of the step output, if any.", - "title": "Output Content Type" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the step attempt started.", - "title": "Started At" - }, - "status": { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus", - "description": "Status of the step run." - }, - "step_type": { - "description": "Type of the agent step.", - "title": "Step Type", - "type": "string" - }, - "tool_calls": { - "description": "LLM tool calls made during this step (prompt_call steps only), ordered by execution. Empty for steps that invoked no tools.", - "items": { - "$ref": "#/components/schemas/AgentRunToolCallResponse" - }, - "title": "Tool Calls", - "type": "array" - }, - "warnings": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Problems the step ran into, whether or not it then failed, such as a file name selector that matched none of its source's files, or a model that returned no answer.", - "title": "Warnings" - } - }, - "required": [ - "agent_step_id", - "step_type", - "status", - "input", - "output", - "output_content_type", - "started_at", - "ended_at", - "duration_seconds", - "credits_used" - ], - "title": "AgentRunStepResponse", - "type": "object" - }, - "AgentRunStreamRequest": { - "properties": { - "include_reasoning": { - "default": false, - "description": "Receive `stream_reasoning` events carrying the model's reasoning while it thinks. They are sent only for a `streaming_result` step whose author enabled `show_reasoning`, and never when a governance policy redacts that step.", - "title": "Include Reasoning", - "type": "boolean" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Input to provide to the agent upon running for agents with dynamic triggers.", - "title": "Input" - }, - "input_upload_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` \u2014 use that field to attach multiple files. May be combined with ``input``. Must fit the trigger's ``accepted_attachments``, as on the non-streaming endpoint.", - "title": "Input Upload Id" - }, - "input_upload_ids": { - "anyOf": [ - { - "items": { - "format": "uuid", - "type": "string" - }, - "maxItems": 20, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "IDs of multiple previously uploaded files. See the non-streaming endpoint for full semantics, including fitting the trigger's ``accepted_attachments`` (else HTTP 400) and combining the batch with ``input`` prompt text. Max 20.", - "title": "Input Upload Ids" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/components/schemas/JsonValue" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Metadata to make available for string substitution expressions in agent tasks.", - "title": "Metadata" - }, - "replay_of_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Re-run reusing a prior run's uploaded input files (re-resolved server-side from the source run, which must belong to this account and agent). A fresh upload batch takes precedence. Files the trigger's ``accepted_attachments`` no longer accepts are left out.", - "title": "Replay Of Run Id" - } - }, - "title": "AgentRunStreamRequest", - "type": "object" - }, - "AgentRunToolCallResponse": { - "description": "A single LLM tool call made during a prompt_call step.", - "properties": { - "credits_used": { - "default": 0.0, - "description": "Credits consumed by this tool call (0 for tools that don't bill).", - "title": "Credits Used", - "type": "number" - }, - "duration_seconds": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Duration of the tool call in seconds.", - "title": "Duration Seconds" - }, - "ended_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the tool call ended.", - "title": "Ended At" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message when the tool call failed.", - "title": "Error" - }, - "function_name": { - "description": "Name of the tool/function invoked.", - "title": "Function Name", - "type": "string" - }, - "id": { - "description": "Tool call identifier.", - "title": "Id", - "type": "string" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "JSON arguments the LLM passed to the tool, if persisted.", - "title": "Input" - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "JSON result the tool returned to the LLM, if persisted.", - "title": "Output" - }, - "round_index": { - "default": 0, - "description": "0-based tool-loop round this call belonged to.", - "title": "Round Index", - "type": "integer" - }, - "sequence": { - "default": 0, - "description": "0-based ordinal of this call within one attempt of the step, so it repeats across a retried step's attempts. This list holds the latest attempt only.", - "title": "Sequence", - "type": "integer" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the tool call started.", - "title": "Started At" - }, - "succeeded": { - "default": true, - "description": "Whether the tool call completed without error.", - "title": "Succeeded", - "type": "boolean" - } - }, - "required": [ - "id", - "function_name" - ], - "title": "AgentRunToolCallResponse", - "type": "object" - }, - "AgentSummaryResponse": { - "properties": { - "created_at": { - "description": "ISO 8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "default_evaluation_tier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Default evaluation tier: fast, balanced, or thorough.", - "title": "Default Evaluation Tier" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent description.", - "title": "Description" - }, - "disabled": { - "default": false, - "description": "Whether the agent is paused (disabled).", - "title": "Disabled", - "type": "boolean" - }, - "disabled_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ISO 8601 timestamp the agent was paused.", - "title": "Disabled At" - }, - "disabled_reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Why the agent is paused: 'manual' or 'email_overload'.", - "title": "Disabled Reason" - }, - "evaluation_mode": { - "default": "eval_and_retry", - "description": "Evaluation mode: output_expectation, eval_and_retry, or sample_and_flag.", - "title": "Evaluation Mode", - "type": "string" - }, - "id": { - "description": "Unique agent identifier.", - "title": "Id", - "type": "string" - }, - "import_warnings": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/ImportSkipResponse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "One entry per item dropped or substituted during import. Present only on endpoints that accept agent_definition; null on non-import calls; [] when the import had no skips.", - "title": "Import Warnings" - }, - "max_retries": { - "default": 3, - "description": "Max retries for eval_and_retry mode.", - "title": "Max Retries", - "type": "integer" - }, - "name": { - "description": "Agent name.", - "title": "Name", - "type": "string" - }, - "prompt_model_auto_rollback_enabled": { - "default": false, - "description": "Whether automatic rollback is enabled for upgraded models.", - "title": "Prompt Model Auto Rollback Enabled", - "type": "boolean" - }, - "prompt_model_auto_rollback_triggers": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Failure signals that trigger rollback. Defaults to agent_eval_fail, governance_block, agent_run_failed when null.", - "title": "Prompt Model Auto Rollback Triggers" - }, - "prompt_model_auto_upgrade_strategy": { - "default": "none", - "description": "Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter.", - "title": "Prompt Model Auto Upgrade Strategy", - "type": "string" - }, - "retry_on_failure": { - "default": true, - "description": "Whether to retry on evaluation failure.", - "title": "Retry On Failure", - "type": "boolean" - }, - "sampling_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Sampling configuration for sample_and_flag mode.", - "title": "Sampling Config" - }, - "trigger_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the agent's trigger, for the `/agents/{agent_id}/triggers/{trigger_id}/\u2026` endpoints such as `accepted-attachments` and `email-config`.", - "title": "Trigger Id" - }, - "trigger_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Trigger type for the agent.", - "title": "Trigger Type" - }, - "updated_at": { - "description": "ISO 8601 last-updated timestamp.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "description", - "created_at", - "updated_at" - ], - "title": "AgentSummaryResponse", - "type": "object" - }, - "AgentTraceMatchResponse": { - "properties": { - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent ID.", - "title": "Agent Id" - }, - "agent_run_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent run ID.", - "title": "Agent Run Id" - }, - "agent_run_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Status of the agent run.", - "title": "Agent Run Status" - }, - "agent_step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step identifier.", - "title": "Agent Step Id" - }, - "agent_step_run_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent step run ID.", - "title": "Agent Step Run Id" - }, - "agent_step_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Type of the step.", - "title": "Agent Step Type" - }, - "score": { - "description": "Similarity score (0-1, higher is better).", - "title": "Score", - "type": "number" - }, - "text": { - "description": "Matching text chunk.", - "title": "Text", - "type": "string" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title of the indexed entry.", - "title": "Title" - } - }, - "required": [ - "agent_run_id", - "agent_step_run_id", - "agent_id", - "agent_step_id", - "agent_step_type", - "agent_run_status", - "title", - "text", - "score" - ], - "title": "AgentTraceMatchResponse", - "type": "object" - }, - "AgentTraceSearchResponse": { - "properties": { - "matches": { - "description": "List of matching entries.", - "items": { - "$ref": "#/components/schemas/AgentTraceMatchResponse" - }, - "title": "Matches", - "type": "array" - }, - "total": { - "description": "Number of matches returned.", - "title": "Total", - "type": "integer" - } - }, - "required": [ - "matches", - "total" - ], - "title": "AgentTraceSearchResponse", - "type": "object" - }, - "AgentUsingCloudDriveResponseModel": { - "properties": { - "agent_id": { - "description": "Agent identifier.", - "title": "Agent Id", - "type": "string" - }, - "agent_name": { - "description": "Agent name.", - "title": "Agent Name", - "type": "string" - }, - "trigger_types": { - "description": "File-change trigger types bound to this drive.", - "items": { - "type": "string" - }, - "title": "Trigger Types", - "type": "array" - }, - "via_prompt_tool": { - "description": "Uses a prompt_call cloud-drive tool.", - "title": "Via Prompt Tool", - "type": "boolean" - }, - "via_step": { - "description": "Uses a list/read/write cloud-drive step.", - "title": "Via Step", - "type": "boolean" - } - }, - "required": [ - "agent_id", - "agent_name", - "via_step", - "via_prompt_tool", - "trigger_types" - ], - "title": "AgentUsingCloudDriveResponseModel", - "type": "object" - }, - "AiAssistantAcceptResponse": { - "description": "Response from accepting and executing a plan.", - "properties": { - "conversation_id": { - "description": "Conversation ID.", - "format": "uuid", - "title": "Conversation Id", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if failed.", - "title": "Error" - }, - "executed_actions": { - "description": "Results of each executed action.", - "items": { - "$ref": "#/components/schemas/ExecutedActionResponse" - }, - "title": "Executed Actions", - "type": "array" - }, - "solution_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Solution ID when a new solution was auto-created.", - "title": "Solution Id" - }, - "success": { - "default": true, - "description": "Whether execution succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "executed_actions" - ], - "title": "AiAssistantAcceptResponse", - "type": "object" - }, - "AiAssistantFeedbackResponse": { - "description": "Response after submitting feedback.", - "properties": { - "feedback_id": { - "format": "uuid", - "title": "Feedback Id", - "type": "string" - }, - "flag_reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Flag Reason" - }, - "flagged": { - "title": "Flagged", - "type": "boolean" - } - }, - "required": [ - "feedback_id", - "flagged" - ], - "title": "AiAssistantFeedbackResponse", - "type": "object" - }, - "AiAssistantGenerateResponse": { - "description": "Response from an AI assistant generate endpoint.", - "properties": { - "conversation_id": { - "description": "Conversation ID for accept/decline.", - "format": "uuid", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of this AI assistant.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI-generated note about the plan.", - "title": "Note", - "type": "string" - }, - "proposed_actions": { - "description": "List of proposed actions.", - "items": { - "$ref": "#/components/schemas/ProposedActionResponse" - }, - "title": "Proposed Actions", - "type": "array" - }, - "requires_delete_confirmation": { - "default": false, - "description": "Whether destructive actions require explicit confirmation.", - "title": "Requires Delete Confirmation", - "type": "boolean" - }, - "success": { - "default": false, - "description": "Whether plan generation succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "note", - "proposed_actions" - ], - "title": "AiAssistantGenerateResponse", - "type": "object" - }, - "AiConversationHistoryResponse": { - "properties": { - "total": { - "description": "Total number of conversation turns available.", - "title": "Total", - "type": "integer" - }, - "turns": { - "description": "Conversation turns, ordered oldest first.", - "items": { - "$ref": "#/components/schemas/AiConversationTurnResponse" - }, - "title": "Turns", - "type": "array" - } - }, - "required": [ - "turns", - "total" - ], - "title": "AiConversationHistoryResponse", - "type": "object" - }, - "AiConversationTurnResponse": { - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the user accepted this proposal (null if pending).", - "title": "Accepted" - }, - "ai_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI explanation from this turn.", - "title": "Ai Note" - }, - "conversation_id": { - "description": "Unique conversation turn ID.", - "title": "Conversation Id", - "type": "string" - }, - "resulting_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "The proposed configuration from this turn.", - "title": "Resulting Config" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step ID for this conversation.", - "title": "Step Id" - }, - "step_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step type for this conversation.", - "title": "Step Type" - }, - "user_input": { - "description": "User input for this turn.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "conversation_id", - "user_input", - "ai_note", - "accepted", - "resulting_config", - "step_type", - "step_id" - ], - "title": "AiConversationTurnResponse", - "type": "object" - }, - "AlertConfigListResponse": { - "description": "``GET /alerts/configs`` legacy/default shape (header-less clients).\n\n``Seclai-Version: 2026-07-27+`` clients receive the canonical\n``{data, pagination}`` envelope instead (the handler returns a ``JSONResponse``\nthat bypasses this ``response_model``); this documents the default shape.", - "properties": { - "configs": { - "items": { - "$ref": "#/components/schemas/AlertConfigResponse" - }, - "title": "Configs", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "configs", - "total" - ], - "title": "AlertConfigListResponse", - "type": "object" - }, - "AlertConfigResponse": { - "properties": { - "account_id": { - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "cooldown_minutes": { - "title": "Cooldown Minutes", - "type": "integer" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "distribution_type": { - "title": "Distribution Type", - "type": "string" - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "id": { - "title": "Id", - "type": "string" - }, - "last_alerted_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Alerted At" - }, - "recipient_user_ids": { - "items": { - "type": "string" - }, - "title": "Recipient User Ids", - "type": "array" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Connection Id" - }, - "threshold": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Threshold" - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Updated At" - } - }, - "required": [ - "id", - "agent_id", - "source_connection_id", - "account_id", - "alert_type", - "enabled", - "threshold", - "cooldown_minutes", - "last_alerted_at", - "distribution_type", - "recipient_user_ids", - "created_at", - "updated_at" - ], - "title": "AlertConfigResponse", - "type": "object" - }, - "AlertHistoryEntryResponse": { - "properties": { - "changed_by_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Changed By Name" - }, - "changed_by_user_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Changed By User Id" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "id": { - "title": "Id", - "type": "string" - }, - "new_status": { - "title": "New Status", - "type": "string" - }, - "note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Note" - }, - "previous_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Previous Status" - } - }, - "required": [ - "id", - "previous_status", - "new_status", - "changed_by_user_id", - "changed_by_name", - "note", - "created_at" - ], - "title": "AlertHistoryEntryResponse", - "type": "object" - }, - "ApiVersionResponse": { - "properties": { - "default_version": { - "description": "Baseline for an unpinned, header-less caller.", - "title": "Default Version", - "type": "string" - }, - "effective_version": { - "description": "The version THIS request resolved to (header > pin > default).", - "title": "Effective Version", - "type": "string" - }, - "known_versions": { - "description": "All dated versions, oldest first.", - "items": { - "type": "string" - }, - "title": "Known Versions", - "type": "array" - }, - "latest_version": { - "description": "Newest version the server knows about.", - "title": "Latest Version", - "type": "string" - }, - "pinned_version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The account's sticky pinned version, or null when unpinned (the account resolves to the default). Applies to header-less requests.", - "title": "Pinned Version" - } - }, - "required": [ - "pinned_version", - "effective_version", - "default_version", - "latest_version", - "known_versions" - ], - "title": "ApiVersionResponse", - "type": "object" - }, - "AppliedActionResponse": { - "description": "Result of a single executed governance action.", - "properties": { - "action_type": { - "description": "Type of action that was executed.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description of the executed action.", - "title": "Description", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if this action failed, or null.", - "title": "Error" - }, - "policy_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the policy that was created or modified, or null.", - "title": "Policy Id" - }, - "success": { - "description": "Whether this individual action succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "action_type", - "description", - "success" - ], - "title": "AppliedActionResponse", - "type": "object" - }, - "AttachmentRefsSourceApiSummary": { - "description": "Per-source attachment-reference summary.", - "properties": { - "exact_names": { - "items": { - "type": "string" - }, - "title": "Exact Names", - "type": "array" - }, - "indexes_max": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Indexes Max" - }, - "kinds": { - "items": { - "type": "string" - }, - "title": "Kinds", - "type": "array" - }, - "patterns": { - "items": { - "type": "string" - }, - "title": "Patterns", - "type": "array" - } - }, - "title": "AttachmentRefsSourceApiSummary", - "type": "object" - }, - "BlockEmailSenderRequest": { - "description": "Add one sender/domain to the account blocklist (shared REST request).", - "properties": { - "match_type": { - "default": "address", - "title": "Match Type", - "type": "string" - }, - "note": { - "anyOf": [ - { - "maxLength": 500, - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Note" - }, - "sender_email": { - "maxLength": 320, - "minLength": 3, - "title": "Sender Email", - "type": "string" - } - }, - "required": [ - "sender_email" - ], - "title": "BlockEmailSenderRequest", - "type": "object" - }, - "BlockedEmailSenderListResponse": { - "description": "A page of blocked senders + the account's auto-block mode.", - "properties": { - "auto_block_mode": { - "title": "Auto Block Mode", - "type": "string" - }, - "items": { - "items": { - "$ref": "#/components/schemas/BlockedEmailSenderResponse" - }, - "title": "Items", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "items", - "total", - "auto_block_mode" - ], - "title": "BlockedEmailSenderListResponse", - "type": "object" - }, - "BlockedEmailSenderResponse": { - "description": "A single blocked inbound email sender.", - "properties": { - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "match_type": { - "title": "Match Type", - "type": "string" - }, - "note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Note" - }, - "sender_email": { - "title": "Sender Email", - "type": "string" - }, - "source": { - "title": "Source", - "type": "string" - } - }, - "required": [ - "id", - "created_at", - "sender_email", - "match_type", - "source", - "note" - ], - "title": "BlockedEmailSenderResponse", - "type": "object" - }, - "Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post": { - "properties": { - "file": { - "description": "File to upload", - "format": "binary", - "title": "File", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional JSON object string of metadata. Example: `{\"category\":\"docs\",\"author\":\"Ada\"}`. `title` will be merged into this dictionary as `metadata.title` if it is not already present.", - "title": "Metadata" - }, - "title": { - "description": "Optional title for the content", - "title": "Title", - "type": "string" - } - }, - "required": [ - "file" - ], - "title": "Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post", - "type": "object" - }, - "Body_upload_file_to_source_api_sources__source_connection_id__upload_post": { - "properties": { - "file": { - "description": "File to upload", - "format": "binary", - "title": "File", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional JSON object string of metadata. Example: `{\"author\":\"Ada\",\"category\":\"docs\"}`. `title` will be merged into this dictionary as `metadata.title` if it is not already present.", - "title": "Metadata" - }, - "title": { - "description": "Optional title for the content", - "title": "Title", - "type": "string" - } - }, - "required": [ - "file" - ], - "title": "Body_upload_file_to_source_api_sources__source_connection_id__upload_post", - "type": "object" - }, - "CancelExperimentResponse": { - "properties": { - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "status" - ], - "title": "CancelExperimentResponse", - "type": "object" - }, - "CancelQueuedRunsResponse": { - "properties": { - "cancelled": { - "title": "Cancelled", - "type": "integer" - } - }, - "required": [ - "cancelled" - ], - "title": "CancelQueuedRunsResponse", - "type": "object" - }, - "ChangeStatusRequest": { - "properties": { - "note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional note", - "title": "Note" - }, - "status": { - "description": "New alert status", - "title": "Status", - "type": "string" - } - }, - "required": [ - "status" - ], - "title": "ChangeStatusRequest", - "type": "object" - }, - "CloudDriveAccessLevelResponseModel": { - "properties": { - "default": { - "description": "Whether connecting without a choice uses it.", - "title": "Default", - "type": "boolean" - }, - "description": { - "description": "What agents can do at this level.", - "title": "Description", - "type": "string" - }, - "key": { - "description": "Level identifier, e.g. `read_write`/`read_only`.", - "title": "Key", - "type": "string" - }, - "label": { - "description": "Short human-readable name.", - "title": "Label", - "type": "string" - } - }, - "required": [ - "key", - "label", - "description", - "default" - ], - "title": "CloudDriveAccessLevelResponseModel", - "type": "object" - }, - "CloudDriveProviderResponseModel": { - "properties": { - "access_levels": { - "description": "Mutually-exclusive permission bundles offered when connecting. Connecting happens in the app, so this is informational here \u2014 it explains what a connection's `access_level` can be.", - "items": { - "$ref": "#/components/schemas/CloudDriveAccessLevelResponseModel" - }, - "title": "Access Levels", - "type": "array" - }, - "display_name": { - "description": "Human-readable provider name.", - "title": "Display Name", - "type": "string" - }, - "key": { - "description": "Provider key used as `provider` on a connection.", - "title": "Key", - "type": "string" - }, - "scopes": { - "description": "OAuth permissions this provider can request.", - "items": { - "$ref": "#/components/schemas/CloudDriveScopeResponseModel" - }, - "title": "Scopes", - "type": "array" - } - }, - "required": [ - "key", - "display_name", - "scopes", - "access_levels" - ], - "title": "CloudDriveProviderResponseModel", - "type": "object" - }, - "CloudDriveRejectionResponseModel": { - "description": "One file the connection deliberately did not process.", - "properties": { - "created_at": { - "description": "When the file was skipped.", - "title": "Created At", - "type": "string" - }, - "detail": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Extra context, e.g. the cap that was hit.", - "title": "Detail" - }, - "file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The provider's file id, when the file was known.", - "title": "File Id" - }, - "file_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Path of the skipped file, when known.", - "title": "File Path" - }, - "id": { - "description": "Rejection identifier.", - "title": "Id", - "type": "string" - }, - "reason": { - "description": "`too_large`, `download_failed`, or `flood`.", - "title": "Reason", - "type": "string" - } - }, - "required": [ - "id", - "reason", - "created_at" - ], - "title": "CloudDriveRejectionResponseModel", - "type": "object" - }, - "CloudDriveResponseModel": { - "description": "A cloud-drive connection, without any secret material.", - "properties": { - "access_level": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The permission bundle the granted scopes correspond to \u2014 `read_write` or `read_only`. Null when the grant matches no level the provider currently offers; treat that as unknown rather than assuming write access.", - "title": "Access Level" - }, - "connected": { - "description": "True when the connection is usable.", - "title": "Connected", - "type": "boolean" - }, - "created_at": { - "description": "When the connection was created.", - "title": "Created At", - "type": "string" - }, - "drive_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Opaque id of the shared drive the folder resolves to, or null for the user's own drive. Stable across renames \u2014 compare on this rather than on the name in `folder_path`.", - "title": "Drive Id" - }, - "drive_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Display name the shared drive last resolved to. Presentation only; never match on it.", - "title": "Drive Name" - }, - "drive_name_stale": { - "description": "True when `drive_name` could not be re-confirmed (the drive was deleted, access was lost, or the provider was unreachable). The last known name is still reported \u2014 treat it as possibly out of date rather than current.", - "title": "Drive Name Stale", - "type": "boolean" - }, - "external_account_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The provider's own opaque account identifier (never an email).", - "title": "External Account Id" - }, - "folder_path": { - "description": "Watched folder; empty string means the drive root. A folder on a shared drive is written `/Shared drives//`.", - "title": "Folder Path", - "type": "string" - }, - "id": { - "description": "Connection identifier.", - "title": "Id", - "type": "string" - }, - "last_error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Most recent sync or authorization error, if any.", - "title": "Last Error" - }, - "last_synced_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "When the connection last synced successfully.", - "title": "Last Synced At" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human-readable name.", - "title": "Name" - }, - "oauth_scopes": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Space-separated OAuth scopes granted to this connection.", - "title": "Oauth Scopes" - }, - "provider": { - "description": "Provider key, e.g. `dropbox` or `google_drive`.", - "title": "Provider", - "type": "string" - }, - "realtime_updates": { - "description": "True when changes arrive via the provider's push notifications. False means the drive still syncs, but only on the scheduled backstop sweep rather than within seconds of a change.", - "title": "Realtime Updates", - "type": "boolean" - }, - "status": { - "description": "One of `active`, `pending_auth`, `error`, `disconnected`.", - "title": "Status", - "type": "string" - }, - "updated_at": { - "description": "When the connection was last modified.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "provider", - "status", - "folder_path", - "drive_name_stale", - "connected", - "realtime_updates", - "created_at", - "updated_at" - ], - "title": "CloudDriveResponseModel", - "type": "object" - }, - "CloudDriveScopeResponseModel": { - "properties": { - "description": { - "description": "What the scope allows.", - "title": "Description", - "type": "string" - }, - "key": { - "description": "The OAuth scope string sent to the provider.", - "title": "Key", - "type": "string" - }, - "label": { - "description": "Short human-readable name.", - "title": "Label", - "type": "string" - }, - "recommended": { - "description": "Whether this scope is requested by default on connect.", - "title": "Recommended", - "type": "boolean" - } - }, - "required": [ - "key", - "label", - "description", - "recommended" - ], - "title": "CloudDriveScopeResponseModel", - "type": "object" - }, - "CloudDriveUpdateRequest": { - "properties": { - "folder_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New watched folder; empty means the whole drive. A folder on a shared drive is written `/Shared drives//`. Changing it resets the sync cursor, so files already in the new folder are NOT replayed as triggers \u2014 only subsequent changes fire, matching connect-time behaviour. Rejected when the new folder would make an agent that writes there re-trigger itself.", - "title": "Folder Path" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New display name for the connection.", - "title": "Name" - } - }, - "title": "CloudDriveUpdateRequest", - "type": "object" - }, - "CompactionEvaluationModel": { - "description": "Structured LLM-as-judge evaluation result.", - "properties": { - "reasoning": { - "description": "Explanation of the evaluation.", - "title": "Reasoning", - "type": "string" - }, - "score": { - "description": "Quality score from 1 to 5.", - "title": "Score", - "type": "integer" - }, - "verdict": { - "description": "'pass' or 'fail'.", - "title": "Verdict", - "type": "string" - } - }, - "required": [ - "verdict", - "score", - "reasoning" - ], - "title": "CompactionEvaluationModel", - "type": "object" - }, - "CompactionScheduledResponse": { - "description": "Acknowledgement that an on-demand compaction run was scheduled.", - "properties": { - "memory_bank_id": { - "title": "Memory Bank Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "memory_bank_id", - "status" - ], - "title": "CompactionScheduledResponse", - "type": "object" - }, - "CompactionTestResponseModel": { - "description": "Response from a compaction prompt test.", - "properties": { - "compaction_summary": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The generated compaction summary.", - "title": "Compaction Summary" - }, - "evaluation": { - "$ref": "#/components/schemas/CompactionEvaluationModel", - "description": "LLM-as-judge quality evaluation." - }, - "generated": { - "description": "True when entries were LLM-generated rather than real.", - "title": "Generated", - "type": "boolean" - }, - "original_entries": { - "description": "Entries fed into the compactor.", - "items": { - "type": "string" - }, - "title": "Original Entries", - "type": "array" - }, - "surviving_entries": { - "description": "Entries that survived after compaction.", - "items": { - "type": "string" - }, - "title": "Surviving Entries", - "type": "array" - } - }, - "required": [ - "original_entries", - "compaction_summary", - "surviving_entries", - "evaluation", - "generated" - ], - "title": "CompactionTestResponseModel", - "type": "object" - }, - "CompatibleRunListResponse": { - "description": "Paginated list of compatible runs.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/CompatibleRunResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "CompatibleRunListResponse", - "type": "object" - }, - "CompatibleRunResponse": { - "description": "A run that has a completed step matching a criteria's step_id.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "format": "uuid", - "title": "Agent Step Run Id", - "type": "string" - }, - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Completed At" - }, - "input_preview": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Input Preview" - }, - "output_storage_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Output Storage Key" - }, - "run_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Run Status" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started At" - } - }, - "required": [ - "agent_run_id", - "agent_step_run_id", - "completed_at", - "output_storage_key" - ], - "title": "CompatibleRunResponse", - "type": "object" - }, - "ContentAttachmentResponse": { - "description": "A file attached to a content item.", - "properties": { - "content_type": { - "description": "MIME type of the attached file.", - "title": "Content Type", - "type": "string" - }, - "created_at": { - "description": "When the file was first attached.", - "title": "Created At", - "type": "string" - }, - "id": { - "description": "The attachment's id, which the single-attachment endpoints take.", - "title": "Id", - "type": "string" - }, - "indexed": { - "description": "Whether indexing the file for search was asked for.", - "title": "Indexed", - "type": "boolean" - }, - "indexing_error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Why the file was not indexed, when `indexing_status` is `failed`.", - "title": "Indexing Error" - }, - "indexing_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "`pending`, `completed` or `failed`; null when indexing was not asked for. Search finds the file only when `completed`.", - "title": "Indexing Status" - }, - "key": { - "description": "The attachment's key, unique within the item.", - "title": "Key", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "description": "What is known about the file beyond its bytes. An image extracted from a PDF carries its `page_number`, and `page_render: true` when it is a render of the whole page. An image or video from a web page carries `source_url` (the address it was fetched from), `position` (its place among the media the page listed, from 0) and, when the page gave one, `alt_text`. Empty for most files. A retrieval metadata filter matches these keys, except `alt_text`, which is indexed as the attachment's text.", - "title": "Metadata", - "type": "object" - }, - "size_bytes": { - "description": "Size of the attached file in bytes.", - "title": "Size Bytes", - "type": "integer" - }, - "updated_at": { - "description": "When the attachment last changed.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "key", - "content_type", - "size_bytes", - "indexed", - "indexing_status", - "indexing_error", - "created_at", - "updated_at", - "metadata" - ], - "title": "ContentAttachmentResponse", - "type": "object" - }, - "ContentEmbeddingResponse": { - "description": "Response model for content embedding.", - "properties": { - "batch_duration": { - "title": "Batch Duration", - "type": "number" - }, - "batch_size": { - "title": "Batch Size", - "type": "integer" - }, - "id": { - "title": "Id", - "type": "string" - }, - "media_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Media Name" - }, - "page_number": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Page Number" - }, - "source_mime": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Mime" - }, - "source_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Url" - }, - "text": { - "title": "Text", - "type": "string" - }, - "text_end": { - "title": "Text End", - "type": "integer" - }, - "text_start": { - "title": "Text Start", - "type": "integer" - }, - "vector": { - "items": { - "type": "number" - }, - "title": "Vector", - "type": "array" - } - }, - "required": [ - "id", - "text_start", - "text_end", - "text", - "vector", - "batch_size", - "batch_duration" - ], - "title": "ContentEmbeddingResponse", - "type": "object" - }, - "CreateAlertConfigRequest": { - "properties": { - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent ID (for agent alerts)", - "title": "Agent Id" - }, - "alert_type": { - "description": "Alert type", - "title": "Alert Type", - "type": "string" - }, - "cooldown_minutes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cooldown period in minutes. Omit to use the per-alert-type default (1440 for credit alerts, 60 otherwise).", - "title": "Cooldown Minutes" - }, - "distribution_type": { - "default": "owner", - "description": "Distribution type (owner, owner_admins, selected_members)", - "title": "Distribution Type", - "type": "string" - }, - "enabled": { - "default": true, - "description": "Whether the alert config is enabled", - "title": "Enabled", - "type": "boolean" - }, - "recipient_user_ids": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "User IDs for selected_members distribution", - "title": "Recipient User Ids" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source connection ID (for source alerts)", - "title": "Source Connection Id" - }, - "threshold": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Threshold configuration", - "title": "Threshold" - } - }, - "required": [ - "alert_type" - ], - "title": "CreateAlertConfigRequest", - "type": "object" - }, - "CreateEvaluationCriteriaRequest": { - "description": "Request body for creating an evaluation criteria.\n\nThe evaluation mode, retry settings, and sample frequency are set at the\nagent level, not per-criteria.", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "enabled": { - "default": true, - "title": "Enabled", - "type": "boolean" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "pass_threshold": { - "default": 0.5, - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" - }, - "step_id": { - "maxLength": 255, - "minLength": 1, - "title": "Step Id", - "type": "string" - } - }, - "required": [ - "step_id" - ], - "title": "CreateEvaluationCriteriaRequest", - "type": "object" - }, - "CreateEvaluationResultRequest": { - "description": "Request body for recording an evaluation result.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Step Run Id" - }, - "details": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Details" - }, - "flagged": { - "default": false, - "title": "Flagged", - "type": "boolean" - }, - "retry_count": { - "default": 0, - "minimum": 0.0, - "title": "Retry Count", - "type": "integer" - }, - "retry_triggered": { - "default": false, - "title": "Retry Triggered", - "type": "boolean" - }, - "score": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Score" - }, - "status": { - "$ref": "#/components/schemas/EvaluationStatus" - } - }, - "required": [ - "agent_run_id", - "status" - ], - "title": "CreateEvaluationResultRequest", - "type": "object" - }, - "CreateExperimentResponse": { - "properties": { - "experiment_id": { - "title": "Experiment Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "experiment_id", - "status" - ], - "title": "CreateExperimentResponse", - "type": "object" - }, - "CreateKnowledgeBaseBody": { - "description": "Request body for creating a knowledge base.", - "properties": { - "default_score_threshold": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Minimum Rerank Score on a new retrieval step in the editor. Not applied at retrieval time \u2014 the step's own value is used.", - "title": "Default Score Threshold" - }, - "default_top_k": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "maximum": 200.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Top K on a new retrieval step in the editor. Not applied at retrieval time.", - "title": "Default Top K" - }, - "default_top_n": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "maximum": 200.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Top N on a new retrieval step in the editor. Not applied at retrieval time \u2014 the step's own value is used.", - "title": "Default Top N" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description.", - "title": "Description" - }, - "name": { - "description": "Knowledge base name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" - }, - "reranker_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Reranker model to use \u2014 a `model_type` from `GET /models/rerankers`. Pass \"none\" to disable reranking (not a value from that list). Omit it for a default chosen from the sources (\"none\" when every source embeds media natively, whose chunks carry no text for a reranker to score). \"\" is accepted as a synonym for \"none\".", - "title": "Reranker Model" - }, - "source_ids": { - "description": "List of source connection IDs to link.", - "items": { - "type": "string" - }, - "minItems": 1, - "title": "Source Ids", - "type": "array" - } - }, - "required": [ - "name", - "source_ids" - ], - "title": "CreateKnowledgeBaseBody", - "type": "object" - }, - "CreateMemoryBankBody": { - "description": "Request body for creating a memory bank.", - "properties": { - "chunk_overlap": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk overlap (custom mode only).", - "title": "Chunk Overlap" - }, - "chunk_size": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk size (custom mode only).", - "title": "Chunk Size" - }, - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted.", - "title": "Compaction Prompt" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description of the bank's purpose.", - "title": "Description" - }, - "dimensions": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Embedding dimensions (custom mode only).", - "title": "Dimensions" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom embedding model (custom mode only).", - "title": "Embedding Model" - }, - "max_age_days": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "DEPRECATED and no longer applied. Age used to trigger compaction, which duplicated retention_days \u2014 both removed the same entries at the same age. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending Seclai-Version 2026-08-03 or later; accepted and stored but inert for older clients.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max total tokens (per partition) before compaction. Checked inline after each write and by the hourly background sweep.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep.", - "title": "Max Turns" - }, - "mode": { - "default": "fast_and_cheap", - "description": "Embedding quality / cost trade-off. One of: fast_and_cheap, balanced, slow_and_thorough, custom.", - "title": "Mode", - "type": "string" - }, - "name": { - "description": "Memory bank name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" - }, - "retention_days": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention in days \u2014 when entries are deleted outright, text and embeddings. This is the only age-based control; compaction triggers on max_size_tokens and max_turns. For clients sending Seclai-Version 2026-08-03 or later, omitting the field resolves per bank type: 90 days for a conversation bank, indefinite for a general bank. Older clients keep the previous default of 30 days for a conversation bank \u2014 unless a longer max_age_days was sent, which wins, since the window is never lowered beneath the only age the caller expressed \u2014 while a general bank keeps entries indefinitely. Send an explicit value (or null for indefinite) to be unambiguous on every version.", - "title": "Retention Days" - }, - "strip_quoted_reply_chains": { - "default": false, - "description": "Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation.", - "title": "Strip Quoted Reply Chains", - "type": "boolean" - }, - "type": { - "default": "conversation", - "description": "Bank type. 'conversation' for chat-turn data with conversation_key + speaker; 'general' for flat entries with optional group_key.", - "title": "Type", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "CreateMemoryBankBody", - "type": "object" - }, - "CreateSolutionRequest": { - "description": "Request model for creating a new solution", - "properties": { - "description": { - "default": "", - "description": "Description of the solution", - "title": "Description", - "type": "string" - }, - "name": { - "description": "Name of the solution", - "title": "Name", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "CreateSolutionRequest", - "type": "object" - }, - "CreateSourceBody": { - "description": "Request body for creating a content source.", - "properties": { - "chunk_overlap": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk overlap for content processing.", - "title": "Chunk Overlap" - }, - "chunk_size": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk size for content processing.", - "title": "Chunk Size" - }, - "cloud_drive_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Required for a cloud_drive source, and ignored on any other: the id of a connected drive, from GET /cloud-drives.", - "title": "Cloud Drive Connection Id" - }, - "cloud_drive_content_types": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: comma-separated MIME types a file must have to be indexed. Omit for no filter.", - "title": "Cloud Drive Content Types" - }, - "cloud_drive_folder_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: the folder to index, as a path inside the drive. Omit to index the connected drive's own folder.", - "title": "Cloud Drive Folder Path" - }, - "cloud_drive_max_file_mb": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: files larger than this many megabytes are skipped. Omit for no limit of the source's own.", - "title": "Cloud Drive Max File Mb" - }, - "cloud_drive_path_pattern": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: a glob a file's path must match to be indexed, such as `**/*.pdf` or `/reports/*`. Omit for no filter.", - "title": "Cloud Drive Path Pattern" - }, - "content_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Content filter type.", - "title": "Content Filter" - }, - "dimensions": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Embedding dimensions override.", - "title": "Dimensions" - }, - "document_images": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to the item and indexed; on a text-only embedder, by the text in each image. Applies to documents added after it changes. Defaults to true; below Seclai-Version 2026-10-18 it defaults to false on a text-only embedder. On a website or RSS source it is ignored: `media_types` decides.", - "title": "Document Images" - }, - "email_allowed_senders": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Required for an email source, and only valid there: the senders whose mail is stored. Each entry is a full address (news@example.com) or a bare domain (example.com), which also matches its sub-domains. Matched against the message's From address, which must pass DMARC.", - "title": "Email Allowed Senders" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model override \u2014 a `model_type` from `GET /models/embedders`, which also reports each embedder's `supported_input_media`. Defaults to the platform embedder (`default_model_type` on that endpoint) when omitted. Indexing images or video requires an embedder that lists that modality.", - "title": "Embedding Model" - }, - "feed_attachments": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Kinds of file listed beside a feed item's content to attach to the item and index, on an RSS source. Subset of ['enclosures', 'item_image', 'media_rss']; any other value is refused. None are attached unless chosen.", - "title": "Feed Attachments" - }, - "index_mode": { - "anyOf": [ - { - "$ref": "#/components/schemas/SourceIndexMode" - }, - { - "type": "null" - } - ], - "description": "Index mode for custom_index sources: fast_and_cheap (default), balanced, slow_and_thorough, or custom." - }, - "media_types": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Media kinds in a web page's main content to attach to the page's item and index, on a website or RSS source. Subset of ['images', 'video']. From `Seclai-Version: 2026-10-13` any other value, and any kind on another source type, is refused with a 400; older versions drop an unknown value and store the rest. A kind the source's embedder cannot index is stored and not indexed (see `supported_input_media` on GET /models/embedders). 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files. Applies to pages and documents added after it is set.", - "title": "Media Types" - }, - "name": { - "description": "Source name.", - "maxLength": 255, - "minLength": 1, - "title": "Name", - "type": "string" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling interval (e.g. hourly, daily).", - "title": "Polling" - }, - "polling_action": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling action.", - "title": "Polling Action" - }, - "polling_max_items": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "The most new feed items a scheduled poll takes. Read for RSS feeds only: from Seclai-Version 2026-10-19 any other source type rejects it with 400. Earlier versions store it there. An email source rejects it at every version.", - "title": "Polling Max Items" - }, - "retention": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention period in days.", - "title": "Retention" - }, - "source_type": { - "description": "Source type: rss_feed, website, custom_index, cloud_drive or email. The legacy value 'file_uploads' is accepted as an alias for custom_index.", - "title": "Source Type", - "type": "string" - }, - "url_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "URL record ID (required for rss/website sources).", - "title": "Url Id" - } - }, - "required": [ - "name", - "source_type" - ], - "title": "CreateSourceBody", - "type": "object" - }, - "DmarcFailingSourceResponse": { - "properties": { - "failed_count": { - "title": "Failed Count", - "type": "integer" - }, - "header_from": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Header From" - }, - "source_ip": { - "title": "Source Ip", - "type": "string" - } - }, - "required": [ - "source_ip", - "failed_count" - ], - "title": "DmarcFailingSourceResponse", - "type": "object" - }, - "DmarcSummaryResponse": { - "properties": { - "dispositions": { - "additionalProperties": { - "type": "integer" - }, - "title": "Dispositions", - "type": "object" - }, - "failed_messages": { - "title": "Failed Messages", - "type": "integer" - }, - "monitored": { - "default": true, - "title": "Monitored", - "type": "boolean" - }, - "pass_rate": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Pass Rate" - }, - "passed_messages": { - "title": "Passed Messages", - "type": "integer" - }, - "report_count": { - "title": "Report Count", - "type": "integer" - }, - "top_failing_sources": { - "items": { - "$ref": "#/components/schemas/DmarcFailingSourceResponse" - }, - "title": "Top Failing Sources", - "type": "array" - }, - "total_messages": { - "title": "Total Messages", - "type": "integer" - }, - "window_days": { - "title": "Window Days", - "type": "integer" - } - }, - "required": [ - "window_days", - "report_count", - "total_messages", - "passed_messages", - "failed_messages" - ], - "title": "DmarcSummaryResponse", - "type": "object" - }, - "DnsProviderResponse": { - "properties": { - "dashboard_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Dashboard Url" - }, - "key": { - "title": "Key", - "type": "string" - }, - "mx_priority_separate": { - "default": true, - "title": "Mx Priority Separate", - "type": "boolean" - }, - "name": { - "title": "Name", - "type": "string" - }, - "tips": { - "items": { - "type": "string" - }, - "title": "Tips", - "type": "array" - }, - "txt_quotes": { - "default": "strip", - "title": "Txt Quotes", - "type": "string" - } - }, - "required": [ - "key", - "name" - ], - "title": "DnsProviderResponse", - "type": "object" - }, - "DnsRecordResponse": { - "properties": { - "detail": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Detail" - }, - "key": { - "title": "Key", - "type": "string" - }, - "mx_host": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mx Host" - }, - "mx_priority": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Mx Priority" - }, - "name": { - "title": "Name", - "type": "string" - }, - "ok": { - "title": "Ok", - "type": "boolean" - }, - "relative_name": { - "title": "Relative Name", - "type": "string" - }, - "type": { - "title": "Type", - "type": "string" - }, - "value": { - "title": "Value", - "type": "string" - } - }, - "required": [ - "key", - "type", - "name", - "relative_name", - "value", - "ok" - ], - "title": "DnsRecordResponse", - "type": "object" - }, - "DocsSearchResultResponse": { - "properties": { - "anchor": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Anchor" - }, - "doc_slug": { - "title": "Doc Slug", - "type": "string" - }, - "highlight": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Highlight" - }, - "score": { - "title": "Score", - "type": "number" - }, - "snippet": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Snippet" - }, - "title": { - "title": "Title", - "type": "string" - } - }, - "required": [ - "doc_slug", - "title", - "snippet", - "score", - "anchor", - "highlight" - ], - "title": "DocsSearchResultResponse", - "type": "object" - }, - "EffortOptionsResponse": { - "description": "The reasoning-effort values a model accepts.", - "properties": { - "default": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The vendor's default level, when known.", - "title": "Default" - }, - "kind": { - "description": "`levels` today: `values` lists them.", - "title": "Kind", - "type": "string" - }, - "values": { - "description": "Accepted values, weakest first.", - "items": { - "type": "string" - }, - "title": "Values", - "type": "array" - } - }, - "required": [ - "kind" - ], - "title": "EffortOptionsResponse", - "type": "object" - }, - "EmailDomainResponse": { - "properties": { - "delegated": { - "default": false, - "title": "Delegated", - "type": "boolean" - }, - "dns_records": { - "items": { - "$ref": "#/components/schemas/DnsRecordResponse" - }, - "title": "Dns Records", - "type": "array" - }, - "domain": { - "title": "Domain", - "type": "string" - }, - "error_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error Message" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "is_primary": { - "title": "Is Primary", - "type": "boolean" - }, - "kind": { - "title": "Kind", - "type": "string" - }, - "last_checked_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Checked At" - }, - "provider": { - "anyOf": [ - { - "$ref": "#/components/schemas/DnsProviderResponse" - }, - { - "type": "null" - } - ] - }, - "regressing": { - "default": false, - "title": "Regressing", - "type": "boolean" - }, - "status": { - "title": "Status", - "type": "string" - }, - "verified": { - "default": false, - "title": "Verified", - "type": "boolean" - }, - "verified_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Verified At" - }, - "zone_apex": { - "default": "", - "title": "Zone Apex", - "type": "string" - } - }, - "required": [ - "id", - "domain", - "kind", - "status", - "is_primary" - ], - "title": "EmailDomainResponse", - "type": "object" - }, - "EmailDomainsListResponse": { - "properties": { - "can_add_custom": { - "default": false, - "title": "Can Add Custom", - "type": "boolean" - }, - "can_add_vanity": { - "default": false, - "title": "Can Add Vanity", - "type": "boolean" - }, - "custom_plan_names": { - "items": { - "type": "string" - }, - "title": "Custom Plan Names", - "type": "array" - }, - "domains": { - "items": { - "$ref": "#/components/schemas/EmailDomainResponse" - }, - "title": "Domains", - "type": "array" - }, - "has_custom": { - "default": false, - "title": "Has Custom", - "type": "boolean" - }, - "has_vanity": { - "default": false, - "title": "Has Vanity", - "type": "boolean" - }, - "vanity_plan_names": { - "items": { - "type": "string" - }, - "title": "Vanity Plan Names", - "type": "array" - } - }, - "title": "EmailDomainsListResponse", - "type": "object" - }, - "EmailSourceRejectionListResponse": { - "description": "A page of mail an email content source refused.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EmailSourceRejectionResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "EmailSourceRejectionListResponse", - "type": "object" - }, - "EmailSourceRejectionResponse": { - "description": "Mail an email content source refused: who sent it and why, never what\nit said.", - "properties": { - "auth_verdicts": { - "additionalProperties": { - "type": "string" - }, - "description": "The SPF, DKIM and DMARC verdicts reported for the message.", - "title": "Auth Verdicts", - "type": "object" - }, - "authenticated": { - "description": "Whether the message passed DMARC, which is what authenticates its From address. Adding an unauthenticated sender to the allowed senders does not let its mail in.", - "title": "Authenticated", - "type": "boolean" - }, - "created_at": { - "description": "When the mail was refused.", - "title": "Created At", - "type": "string" - }, - "from_address": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The address in the message's From line, which the source's allowed senders are matched against. Null when no single From address could be read from the message unambiguously.", - "title": "From Address" - }, - "id": { - "description": "Unique identifier of the refusal.", - "title": "Id", - "type": "string" - }, - "reason": { - "description": "Why it was refused: sender_not_allowed, unauthenticated_sender, unreadable_from, sender_blocked, spam, virus, unsafe_content, rate_limited, account_not_chargeable or empty_message; or, for a message the source received before, what became of the earlier one: repeat_stored, repeat_held, repeat_deleted or repeat_in_progress.", - "title": "Reason", - "type": "string" - }, - "recipient": { - "description": "The source address it was sent to.", - "title": "Recipient", - "type": "string" - }, - "sender": { - "description": "The envelope sender. For bulk mail this is the delivery provider's bounce address, not the From address.", - "title": "Sender", - "type": "string" - }, - "sender_ip": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "IP address the mail came from.", - "title": "Sender Ip" - } - }, - "required": [ - "id", - "created_at", - "recipient", - "sender", - "sender_ip", - "reason", - "authenticated" - ], - "title": "EmailSourceRejectionResponse", - "type": "object" - }, - "EmailTriggerConfigResponse": { - "description": "An EMAIL_RECEIVED trigger's resolved address(es) and config.", - "properties": { - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" - }, - "email_addresses": { - "items": { - "type": "string" - }, - "title": "Email Addresses", - "type": "array" - }, - "email_alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Email Alias" - }, - "email_allowed_senders": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Email Allowed Senders" - }, - "email_ignore_auto_generated": { - "default": true, - "title": "Email Ignore Auto Generated", - "type": "boolean" - }, - "email_queue_on_quota": { - "default": false, - "title": "Email Queue On Quota", - "type": "boolean" - }, - "email_require_sender_auth": { - "default": true, - "title": "Email Require Sender Auth", - "type": "boolean" - }, - "email_run_on_attachment_mismatch": { - "default": false, - "title": "Email Run On Attachment Mismatch", - "type": "boolean" - }, - "trigger_id": { - "format": "uuid", - "title": "Trigger Id", - "type": "string" - }, - "trigger_type": { - "title": "Trigger Type", - "type": "string" - } - }, - "required": [ - "trigger_id", - "agent_id", - "trigger_type" - ], - "title": "EmailTriggerConfigResponse", - "type": "object" - }, - "EmbeddingModalityRateResponse": { - "description": "Per-modality rate for a multi-modal embedder.\n\nThe default ``credits`` field on :class:`EmbeddingModelResponse` is the\ntext rate (credits per ~1k English words). Embedders that index image or\nvideo chunks natively charge those modalities at a different rate and unit\n\u2014 e.g. Cohere Embed v4 prices images per record; Nova 2 Multimodal prices\nvideo per second. Surfacing the modality and unit lets a caller render an\nhonest cost breakdown alongside the text rate.", - "properties": { - "credits": { - "description": "Rate value in the unit below", - "title": "Credits", - "type": "number" - }, - "modality": { - "description": "Modality kind, e.g. image / video", - "title": "Modality", - "type": "string" - }, - "unit": { - "description": "Billing unit for this rate (credit_per_record / credit_per_second / credit_per_1000_tokens).", - "title": "Unit", - "type": "string" - } - }, - "required": [ - "modality", - "credits", - "unit" - ], - "title": "EmbeddingModalityRateResponse", - "type": "object" - }, - "EmbeddingModelListResponse": { - "description": "Legacy (header-less) response shape for the embedder catalog.", - "properties": { - "default_dimension": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Dimensions used with the default embedding model", - "title": "Default Dimension" - }, - "default_model_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model used when a source does not override it", - "title": "Default Model Type" - }, - "file_processing_credits_per_mb": { - "description": "Credits per MB for file processing at ingest", - "title": "File Processing Credits Per Mb", - "type": "number" - }, - "models": { - "description": "Available embedding models", - "items": { - "$ref": "#/components/schemas/EmbeddingModelResponse" - }, - "title": "Models", - "type": "array" - }, - "storage_credits": { - "description": "Monthly storage credits per dimension count", - "items": { - "$ref": "#/components/schemas/EmbeddingStorageCreditsResponse" - }, - "title": "Storage Credits", - "type": "array" - } - }, - "required": [ - "models", - "storage_credits", - "file_processing_credits_per_mb" - ], - "title": "EmbeddingModelListResponse", - "type": "object" - }, - "EmbeddingModelResponse": { - "description": "Information about an embedding model.", - "properties": { - "credits": { - "description": "Estimated credits per 1,000 English words", - "title": "Credits", - "type": "number" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model description", - "title": "Description" - }, - "dimensions": { - "description": "Dimensions options", - "items": { - "type": "integer" - }, - "title": "Dimensions", - "type": "array" - }, - "is_new": { - "default": false, - "description": "Whether the model is newly released", - "title": "Is New", - "type": "boolean" - }, - "max_input_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max input tokens per request", - "title": "Max Input Tokens" - }, - "model_id": { - "description": "Model identifier", - "title": "Model Id", - "type": "string" - }, - "model_type": { - "description": "Full model type identifier (enum value). This is the value to send as embedding_model when creating a source.", - "title": "Model Type", - "type": "string" - }, - "mteb_retrieval_score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "MTEB retrieval score", - "title": "Mteb Retrieval Score" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human-readable model name", - "title": "Name" - }, - "per_modality_rates": { - "description": "Non-text rates the vendor charges for this embedder (image, video, audio). Empty for text-only embedders.", - "items": { - "$ref": "#/components/schemas/EmbeddingModalityRateResponse" - }, - "title": "Per Modality Rates", - "type": "array" - }, - "provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model provider identifier", - "title": "Provider" - }, - "speed": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model processing speed", - "title": "Speed" - }, - "supported_input_media": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Modalities the embedder accepts on input (short kinds like text / image / video, or full MIMEs). null means text-only. A source only honours a media_types entry its embedder lists here.", - "title": "Supported Input Media" - }, - "supported_languages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Supported languages", - "title": "Supported Languages" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model documentation URL", - "title": "Url" - } - }, - "required": [ - "model_id", - "model_type", - "dimensions", - "credits" - ], - "title": "EmbeddingModelResponse", - "type": "object" - }, - "EmbeddingStorageCreditsResponse": { - "description": "Monthly storage credits per stored record at a dimension count.", - "properties": { - "credits": { - "description": "Credits per record per month", - "title": "Credits", - "type": "integer" - }, - "dimensions": { - "description": "Number of embedding dimensions", - "title": "Dimensions", - "type": "integer" - } - }, - "required": [ - "dimensions", - "credits" - ], - "title": "EmbeddingStorageCreditsResponse", - "type": "object" - }, - "EvaluationCriteriaResponse": { - "description": "Response schema for evaluation criteria.", - "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "evaluation_mode": { - "description": "Runtime behavior mode. output_expectation (manual validation), eval_and_retry (every run + retry), sample_and_flag (sampled monitoring).", - "title": "Evaluation Mode", - "type": "string" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Tier" - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "max_retries": { - "title": "Max Retries", - "type": "integer" - }, - "pass_threshold": { - "description": "Score cutoff for pass/fail, inclusive (0.0 to 1.0).", - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" - }, - "result_summary": { - "additionalProperties": { - "type": "integer" - }, - "title": "Result Summary", - "type": "object" - }, - "retry_on_failure": { - "title": "Retry On Failure", - "type": "boolean" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step Id" - }, - "updated_at": { - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "agent_id", - "account_id", - "description", - "evaluation_mode", - "enabled", - "step_id", - "expectation_config", - "max_retries", - "retry_on_failure", - "evaluation_prompt", - "pass_threshold", - "evaluation_tier", - "created_at", - "updated_at", - "result_summary" - ], - "title": "EvaluationCriteriaResponse", - "type": "object" - }, - "EvaluationResultListResponse": { - "description": "Paginated list of evaluation results.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EvaluationResultResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "EvaluationResultListResponse", - "type": "object" - }, - "EvaluationResultResponse": { - "description": "Response schema for a single evaluation result.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Step Run Id" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "criteria_id": { - "format": "uuid", - "title": "Criteria Id", - "type": "string" - }, - "details": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Evaluation details including explanation and raw LLM response.", - "title": "Details" - }, - "evaluated_at": { - "title": "Evaluated At", - "type": "string" - }, - "flagged": { - "description": "True when the result was flagged for human review.", - "title": "Flagged", - "type": "boolean" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "retry_count": { - "title": "Retry Count", - "type": "integer" - }, - "retry_triggered": { - "title": "Retry Triggered", - "type": "boolean" - }, - "score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "LLM-assigned quality score between 0.0 (worst) and 1.0 (best).", - "title": "Score" - }, - "status": { - "description": "Outcome status: pending, passed, failed, skipped, or error.", - "title": "Status", - "type": "string" - } - }, - "required": [ - "id", - "criteria_id", - "agent_run_id", - "agent_step_run_id", - "status", - "retry_triggered", - "retry_count", - "flagged", - "evaluated_at", - "created_at" - ], - "title": "EvaluationResultResponse", - "type": "object" - }, - "EvaluationResultSummaryResponse": { - "description": "Aggregated pass/fail/error counts and average score for a criteria.", - "properties": { - "average_score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Mean score of the final passed and failed results, or null if none. On /api before Seclai-Version 2026-10-21 it averages every final result's stored score, `error` included.", - "title": "Average Score" - }, - "error": { - "title": "Error", - "type": "integer" - }, - "failed": { - "title": "Failed", - "type": "integer" - }, - "flagged": { - "title": "Flagged", - "type": "integer" - }, - "passed": { - "title": "Passed", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "total", - "passed", - "failed", - "error", - "flagged" - ], - "title": "EvaluationResultSummaryResponse", - "type": "object" - }, - "EvaluationResultWithCriteriaListResponse": { - "description": "Paginated list of evaluation results with criteria context.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "EvaluationResultWithCriteriaListResponse", - "type": "object" - }, - "EvaluationResultWithCriteriaResponse": { - "description": "Evaluation result including criteria context for aggregated listing.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Step Run Id" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "criteria_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Criteria Description" - }, - "criteria_id": { - "format": "uuid", - "title": "Criteria Id", - "type": "string" - }, - "details": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Evaluation details including explanation and raw LLM response.", - "title": "Details" - }, - "evaluated_at": { - "title": "Evaluated At", - "type": "string" - }, - "flagged": { - "description": "True when the result was flagged for human review.", - "title": "Flagged", - "type": "boolean" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "retry_count": { - "title": "Retry Count", - "type": "integer" - }, - "retry_triggered": { - "title": "Retry Triggered", - "type": "boolean" - }, - "score": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "LLM-assigned quality score between 0.0 (worst) and 1.0 (best).", - "title": "Score" - }, - "status": { - "description": "Outcome status: pending, passed, failed, skipped, or error.", - "title": "Status", - "type": "string" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step Id" - } - }, - "required": [ - "id", - "criteria_id", - "agent_run_id", - "agent_step_run_id", - "status", - "retry_triggered", - "retry_count", - "flagged", - "evaluated_at", - "created_at", - "step_id", - "criteria_description" - ], - "title": "EvaluationResultWithCriteriaResponse", - "type": "object" - }, - "EvaluationRunSummaryListResponse": { - "description": "Paginated list of per-run evaluation summaries.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/EvaluationRunSummaryResponse" - }, - "title": "Data", - "type": "array" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "data", - "total", - "page", - "limit" - ], - "title": "EvaluationRunSummaryListResponse", - "type": "object" - }, - "EvaluationRunSummaryResponse": { - "description": "Per-run evaluation summary with pass/fail/error breakdown.", - "properties": { - "agent_run_id": { - "format": "uuid", - "title": "Agent Run Id", - "type": "string" - }, - "error_count": { - "title": "Error Count", - "type": "integer" - }, - "failed_count": { - "title": "Failed Count", - "type": "integer" - }, - "flagged_count": { - "title": "Flagged Count", - "type": "integer" - }, - "passed_count": { - "title": "Passed Count", - "type": "integer" - }, - "run_created_at": { - "title": "Run Created At", - "type": "string" - }, - "run_status": { - "description": "Status of the agent run (processing, completed, failed).", - "title": "Run Status", - "type": "string" - }, - "skipped_count": { - "title": "Skipped Count", - "type": "integer" - }, - "total_evaluations": { - "title": "Total Evaluations", - "type": "integer" - } - }, - "required": [ - "agent_run_id", - "run_status", - "run_created_at", - "total_evaluations", - "passed_count", - "failed_count", - "error_count", - "skipped_count", - "flagged_count" - ], - "title": "EvaluationRunSummaryResponse", - "type": "object" - }, - "EvaluationStatus": { - "description": "Result status of a single evaluation run.", - "enum": [ - "pending", - "passed", - "failed", - "skipped", - "error" - ], - "title": "EvaluationStatus", - "type": "string" - }, - "ExamplePrompt": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "ExecutedActionResponse": { - "description": "A single executed action result.", - "properties": { - "action_type": { - "description": "Type of the executed action.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description.", - "title": "Description", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if failed.", - "title": "Error" - }, - "needs_clarification": { - "default": false, - "description": "True when the action paused for a clarifying question rather than failing. The created resource is kept and the question is in ``description``/``error``.", - "title": "Needs Clarification", - "type": "boolean" - }, - "resource_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the affected resource.", - "title": "Resource Id" - }, - "resource_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Type of the affected resource.", - "title": "Resource Type" - }, - "success": { - "default": true, - "description": "Whether the action succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "action_type", - "description" - ], - "title": "ExecutedActionResponse", - "type": "object" - }, - "ExperimentDetailResponse": { - "properties": { - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Completed At" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "effort": { - "additionalProperties": { - "type": "string" - }, - "description": "The reasoning effort each model was run at, by model ID.", - "title": "Effort", - "type": "object" - }, - "error_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error Message" - }, - "evaluation_complexity": { - "title": "Evaluation Complexity", - "type": "string" - }, - "evaluation_mode": { - "title": "Evaluation Mode", - "type": "string" - }, - "evaluator_model_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluator Model Id" - }, - "id": { - "title": "Id", - "type": "string" - }, - "include_step_output_in_evaluation": { - "title": "Include Step Output In Evaluation", - "type": "boolean" - }, - "json_template": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Json Template" - }, - "progress_current": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Progress Current" - }, - "progress_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Progress Message" - }, - "progress_total": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Progress Total" - }, - "prompt": { - "title": "Prompt", - "type": "string" - }, - "result_data": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Result Data" - }, - "selected_model_ids": { - "items": { - "type": "string" - }, - "title": "Selected Model Ids", - "type": "array" - }, - "selected_step_output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Selected Step Output" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started At" - }, - "status": { - "title": "Status", - "type": "string" - }, - "system_prompt": { - "title": "System Prompt", - "type": "string" - } - }, - "required": [ - "id", - "status", - "created_at", - "selected_model_ids", - "evaluation_mode", - "evaluation_complexity", - "prompt", - "system_prompt", - "evaluator_model_id", - "include_step_output_in_evaluation", - "selected_step_output", - "json_template", - "started_at", - "completed_at", - "error_message", - "progress_current", - "progress_total", - "progress_message", - "result_data" - ], - "title": "ExperimentDetailResponse", - "type": "object" - }, - "ExperimentListResponse": { - "description": "``GET /models/playground/experiments`` legacy/default shape; 2026-07-27+\nclients get the canonical ``{data, pagination}`` envelope.", - "properties": { - "experiments": { - "items": { - "$ref": "#/components/schemas/ExperimentSummaryResponse" - }, - "title": "Experiments", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "experiments", - "total" - ], - "title": "ExperimentListResponse", - "type": "object" - }, - "ExperimentSummaryResponse": { - "properties": { - "created_at": { - "title": "Created At", - "type": "string" - }, - "evaluation_complexity": { - "title": "Evaluation Complexity", - "type": "string" - }, - "evaluation_mode": { - "title": "Evaluation Mode", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string" - }, - "selected_model_ids": { - "items": { - "type": "string" - }, - "title": "Selected Model Ids", - "type": "array" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "required": [ - "id", - "status", - "created_at", - "selected_model_ids", - "evaluation_mode", - "evaluation_complexity" - ], - "title": "ExperimentSummaryResponse", - "type": "object" - }, - "ExportFormat": { - "description": "Supported export file formats.", - "enum": [ - "jsonl", - "csv", - "parquet", - "zip" - ], - "title": "ExportFormat", - "type": "string" - }, - "ExportListResponse": { - "description": "Paginated list of export jobs.", - "properties": { - "data": { - "items": {}, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "ExportListResponse", - "type": "object" - }, - "GenerateAgentStepsRequest": { - "properties": { - "agent_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent description for additional AI context.", - "title": "Agent Description" - }, - "agent_steps": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Current agent step hierarchy for context when modifying.", - "title": "Agent Steps" - }, - "mode": { - "default": "generate_full", - "description": "'generate_full' to create from scratch, 'modify_workflow' to refine.", - "title": "Mode", - "type": "string" - }, - "trigger_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent trigger type for context (e.g. 'dynamic_input', 'content_added').", - "title": "Trigger Type" - }, - "user_input": { - "description": "Natural language description of the desired agent workflow.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "GenerateAgentStepsRequest", - "type": "object" - }, - "GenerateAgentStepsResponse": { - "properties": { - "agent_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Suggested agent-level configuration, if any. For an email_received agent it may carry `email_run_on_attachment_mismatch`, which the caller applies through the trigger's email-config endpoint. For a dynamic_input or email_received agent it may carry `accepted_attachments`, which the caller passes with the steps to `PUT /agents/{agent_id}/definition` so both save together.", - "title": "Agent Config" - }, - "conversation_id": { - "description": "Conversation turn ID for tracking.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given mode.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "intent_assessment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "How the assistant interpreted the request: 'clear' when steps were generated, or an ask-path value (e.g. 'ambiguous_output', 'cannot_build') when it returned no steps and put a clarifying question or blocker in `note`. Mirrors the MCP surface so callers can distinguish a clarification pause from a hard failure.", - "title": "Intent Assessment" - }, - "note": { - "description": "AI explanation of the proposed workflow.", - "title": "Note", - "type": "string" - }, - "steps": { - "description": "Generated agent steps.", - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Steps", - "type": "array" - }, - "success": { - "description": "Whether steps were successfully generated.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "steps", - "note", - "success" - ], - "title": "GenerateAgentStepsResponse", - "type": "object" - }, - "GenerateStepConfigRequest": { - "properties": { - "agent_steps": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Current agent step hierarchy for context.", - "title": "Agent Steps" - }, - "current_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Current step configuration to refine, if any.", - "title": "Current Config" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the specific step to refine. Omit for new steps.", - "title": "Step Id" - }, - "step_type": { - "description": "The step type to generate config for (e.g. 'regex_replace', 'gate', 'text', 'prompt_call', 'retrieval').", - "title": "Step Type", - "type": "string" - }, - "user_input": { - "description": "Natural language description of what the step should do.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "step_type", - "user_input" - ], - "title": "GenerateStepConfigRequest", - "type": "object" - }, - "GenerateStepConfigResponse": { - "properties": { - "conversation_id": { - "description": "Conversation turn ID for tracking.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given step type.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI explanation of the proposed configuration.", - "title": "Note", - "type": "string" - }, - "resulting_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "The proposed step configuration.", - "title": "Resulting Config" - }, - "step_type": { - "description": "The step type that was generated.", - "title": "Step Type", - "type": "string" - }, - "success": { - "description": "Whether a valid configuration was generated.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "step_type", - "note", - "success" - ], - "title": "GenerateStepConfigResponse", - "type": "object" - }, - "GenerationTierListResponse": { - "description": "``GET /models/generation-tiers`` legacy/default shape; 2026-07-27+ clients\nget the canonical ``{data, pagination}`` envelope.", - "properties": { - "tiers": { - "items": { - "$ref": "#/components/schemas/GenerationTierResponse" - }, - "title": "Tiers", - "type": "array" - } - }, - "required": [ - "tiers" - ], - "title": "GenerationTierListResponse", - "type": "object" - }, - "GenerationTierResponse": { - "properties": { - "credits_per_unit": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Credits Per Unit" - }, - "modality": { - "title": "Modality", - "type": "string" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "model_name": { - "title": "Model Name", - "type": "string" - }, - "price_label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Price Label" - }, - "tier": { - "title": "Tier", - "type": "string" - }, - "unit_label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Unit Label" - } - }, - "required": [ - "modality", - "tier", - "model_id", - "model_name", - "credits_per_unit", - "unit_label", - "price_label" - ], - "title": "GenerationTierResponse", - "type": "object" - }, - "GovernanceAiAcceptResponse": { - "description": "Response from accepting a governance AI assistant plan.", - "properties": { - "actions_applied": { - "description": "Results of each action that was executed.", - "items": { - "$ref": "#/components/schemas/AppliedActionResponse" - }, - "title": "Actions Applied", - "type": "array" - }, - "conversation_id": { - "description": "Conversation ID that was accepted.", - "title": "Conversation Id", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Overall error message if the plan failed, or null.", - "title": "Error" - }, - "success": { - "description": "Whether all actions were applied successfully.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "actions_applied", - "success" - ], - "title": "GovernanceAiAcceptResponse", - "type": "object" - }, - "GovernanceAiAssistantResponse": { - "description": "Response from the governance AI assistant generate endpoint.", - "properties": { - "conversation_id": { - "description": "Conversation ID to accept or decline this plan.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of the governance AI assistant.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI-generated summary of the proposed changes.", - "title": "Note", - "type": "string" - }, - "prompt_call_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Prompt call ID for credit tracking, or null.", - "title": "Prompt Call Id" - }, - "proposed_actions": { - "description": "Ordered list of policy actions the AI proposes to execute.", - "items": { - "$ref": "#/components/schemas/ProposedPolicyActionResponse" - }, - "title": "Proposed Actions", - "type": "array" - }, - "success": { - "description": "Whether the plan was generated successfully.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "note", - "proposed_actions", - "success" - ], - "title": "GovernanceAiAssistantResponse", - "type": "object" - }, - "HTTPValidationError": { - "properties": { - "detail": { - "items": { - "$ref": "#/components/schemas/ValidationError" - }, - "title": "Detail", - "type": "array" - } - }, - "title": "HTTPValidationError", - "type": "object" - }, - "ImportFieldErrorModel": { - "description": "Single agent_definition validation error with source position.", - "properties": { - "column": { - "description": "1-indexed column in `source`.", - "title": "Column", - "type": "integer" - }, - "line": { - "description": "1-indexed line in `source`.", - "title": "Line", - "type": "integer" - }, - "message": { - "description": "Human-readable description of the problem.", - "title": "Message", - "type": "string" - }, - "path": { - "description": "Dotted path of the offending field, e.g. `agent.definition.child_steps[0].step_type`.", - "title": "Path", - "type": "string" - } - }, - "required": [ - "line", - "column", - "path", - "message" - ], - "title": "ImportFieldErrorModel", - "type": "object" - }, - "ImportSkipResponse": { - "description": "One item that was not applied during an agent import.\n\nUsed as the element type for ``import_warnings`` on every\nresponse model that accepts an ``agent_definition`` payload.\nSee ``services.agent_definition_import.AgentImportSkip`` for the\nfull category list.\n\nLives here (not on each router) so the authenticated and public\nAPI responses share one definition \u2014 keeping the shape that\nclients (UI modal, MCP, OpenAPI consumers) depend on aligned.", - "properties": { - "category": { - "description": "The kind of item that was skipped or substituted: 'schedule', 'evaluation_criteria', 'alert_config', 'alert_recipient', 'governance_policy', 'governance_kb_link', 'solution_link'.", - "title": "Category", - "type": "string" - }, - "details": { - "additionalProperties": true, - "description": "Category-specific identifiers for the skipped item (step_id, alert_type, kb_name, etc.). Stable keys per category; absent keys are simply not applicable.", - "title": "Details", - "type": "object" - }, - "message": { - "description": "Human-readable explanation of what was skipped and why.", - "title": "Message", - "type": "string" - } - }, - "required": [ - "category", - "message" - ], - "title": "ImportSkipResponse", - "type": "object" - }, - "InboundEmailRejectionResponse": { - "description": "An inbound email that was discarded without running an agent.", - "properties": { - "agent_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "message_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Message Id" - }, - "reason": { - "title": "Reason", - "type": "string" - }, - "recipient": { - "title": "Recipient", - "type": "string" - }, - "sender": { - "title": "Sender", - "type": "string" - }, - "sender_ip": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Sender Ip" - }, - "subject": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Subject" - } - }, - "required": [ - "id", - "created_at", - "recipient", - "sender", - "sender_ip", - "reason", - "message_id", - "agent_id", - "subject" - ], - "title": "InboundEmailRejectionResponse", - "type": "object" - }, - "InboundEmailStatusResponse": { - "properties": { - "paused": { - "title": "Paused", - "type": "boolean" - }, - "queued_backlog": { - "title": "Queued Backlog", - "type": "integer" - } - }, - "required": [ - "paused", - "queued_backlog" - ], - "title": "InboundEmailStatusResponse", - "type": "object" - }, - "InlineTextReplaceRequest": { - "description": "Request model for inline text content replacement.", - "properties": { - "content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "text/plain", - "description": "MIME type for the text content", - "title": "Content Type" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional metadata object", - "title": "Metadata" - }, - "text": { - "description": "Text content to upload", - "title": "Text", - "type": "string" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional title", - "title": "Title" - } - }, - "required": [ - "text" - ], - "title": "InlineTextReplaceRequest", - "type": "object" - }, - "InlineTextUploadRequest": { - "description": "Request model for inline text uploads.", - "properties": { - "content_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "text/plain", - "description": "MIME type for the text content", - "title": "Content Type" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional metadata object", - "title": "Metadata" - }, - "text": { - "description": "Text content to upload", - "title": "Text", - "type": "string" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional title", - "title": "Title" - } - }, - "required": [ - "text" - ], - "title": "InlineTextUploadRequest", - "type": "object" - }, - "InsufficientCreditsDetail": { - "description": "``error`` body of a 402 ``insufficient_credits`` response.", - "properties": { - "account_id": { - "description": "UUID of the account that ran out of credits.", - "title": "Account Id", - "type": "string" - }, - "code": { - "const": "insufficient_credits", - "description": "Stable machine-readable error code.", - "title": "Code", - "type": "string" - }, - "message": { - "description": "Human-readable explanation.", - "title": "Message", - "type": "string" - } - }, - "required": [ - "code", - "message", - "account_id" - ], - "title": "InsufficientCreditsDetail", - "type": "object" - }, - "InsufficientCreditsResponse": { - "description": "402 envelope returned when the account has exhausted its credits.\n\nThe wire shape ``http_exception_handler`` and ``insufficient_credits_exception_handler`` send.", - "properties": { - "error": { - "$ref": "#/components/schemas/InsufficientCreditsDetail" - } - }, - "required": [ - "error" - ], - "title": "InsufficientCreditsResponse", - "type": "object" - }, - "JsonValue": {}, - "KnowledgeBaseListResponseModel": { - "description": "Paginated list of knowledge bases.", - "properties": { - "knowledge_bases": { - "description": "List of knowledge bases on this page.", - "items": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - }, - "title": "Knowledge Bases", - "type": "array" - }, - "limit": { - "description": "Items per page.", - "title": "Limit", - "type": "integer" - }, - "page": { - "description": "Current page number (1-based).", - "title": "Page", - "type": "integer" - }, - "total": { - "description": "Total number of knowledge bases.", - "title": "Total", - "type": "integer" - } - }, - "required": [ - "knowledge_bases", - "page", - "limit", - "total" - ], - "title": "KnowledgeBaseListResponseModel", - "type": "object" - }, - "KnowledgeBaseResponseModel": { - "description": "Response model for a single knowledge base.", - "properties": { - "created_at": { - "description": "ISO-8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "default_score_threshold": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Editor default for a new retrieval step's Minimum Rerank Score.", - "title": "Default Score Threshold" - }, - "default_top_k": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Editor default for a new retrieval step's Top K.", - "title": "Default Top K" - }, - "default_top_n": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Editor default for a new retrieval step's Top N.", - "title": "Default Top N" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description.", - "title": "Description" - }, - "id": { - "description": "Unique knowledge base identifier.", - "title": "Id", - "type": "string" - }, - "name": { - "description": "Human-readable name.", - "title": "Name", - "type": "string" - }, - "readonly": { - "default": false, - "description": "Whether the knowledge base is read-only.", - "title": "Readonly", - "type": "boolean" - }, - "reranker_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Reranker model in use.", - "title": "Reranker Model" - }, - "sources": { - "description": "Linked source connections.", - "items": { - "$ref": "#/components/schemas/SourceConnectionResponseModel" - }, - "title": "Sources", - "type": "array" - }, - "updated_at": { - "description": "ISO-8601 last-update timestamp.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "created_at", - "updated_at" - ], - "title": "KnowledgeBase", - "type": "object" - }, - "LinkResourcesRequest": { - "properties": { - "ids": { - "description": "Resource IDs to link", - "items": { - "format": "uuid", - "type": "string" - }, - "minItems": 1, - "title": "Ids", - "type": "array" - } - }, - "required": [ - "ids" - ], - "title": "LinkResourcesRequest", - "type": "object" - }, - "MarkAiSuggestionRequest": { - "properties": { - "accepted": { - "description": "True to accept the suggestion, false to decline it.", - "title": "Accepted", - "type": "boolean" - } - }, - "required": [ - "accepted" - ], - "title": "MarkAiSuggestionRequest", - "type": "object" - }, - "MarkConversationTurnRequest": { - "properties": { - "accepted": { - "description": "Whether the suggestion was accepted", - "title": "Accepted", - "type": "boolean" - } - }, - "required": [ - "accepted" - ], - "title": "MarkConversationTurnRequest", - "type": "object" - }, - "MeResponse": { - "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "organizations": { - "items": { - "$ref": "#/components/schemas/OrganizationInfoResponse" - }, - "title": "Organizations", - "type": "array" - } - }, - "required": [ - "account_id", - "organizations" - ], - "title": "MeResponse", - "type": "object" - }, - "MemoryBankAiAssistantResponse": { - "description": "Response from the memory bank AI assistant.", - "properties": { - "config": { - "anyOf": [ - { - "$ref": "#/components/schemas/MemoryBankConfigResponse" - }, - { - "type": "null" - } - ], - "description": "Proposed configuration, or null." - }, - "conversation_id": { - "description": "Conversation ID for follow-up.", - "title": "Conversation Id", - "type": "string" - }, - "example_prompts": { - "description": "Example natural-language prompts that demonstrate the capabilities of the memory bank AI assistant.", - "items": { - "$ref": "#/components/schemas/ExamplePrompt" - }, - "title": "Example Prompts", - "type": "array" - }, - "note": { - "description": "AI-generated explanation.", - "title": "Note", - "type": "string" - }, - "prompt_call_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Prompt call ID for credit tracking.", - "title": "Prompt Call Id" - }, - "success": { - "default": false, - "description": "Whether generation succeeded.", - "title": "Success", - "type": "boolean" - } - }, - "required": [ - "conversation_id", - "note" - ], - "title": "MemoryBankAiAssistantResponse", - "type": "object" - }, - "MemoryBankConfigResponse": { - "description": "Suggested memory bank configuration from the AI assistant.", - "properties": { - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Suggested compaction prompt.", - "title": "Compaction Prompt" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Suggested description.", - "title": "Description" - }, - "max_age_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Always null. Age-based compaction is retired \u2014 the assistant never suggests it. Kept so an SDK generated before the change still validates this response.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max size in tokens.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns.", - "title": "Max Turns" - }, - "mode": { - "description": "Memory bank mode.", - "title": "Mode", - "type": "string" - }, - "name": { - "description": "Suggested name.", - "title": "Name", - "type": "string" - }, - "retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention in days.", - "title": "Retention Days" - }, - "type": { - "description": "Memory bank type: conversation or general.", - "title": "Type", - "type": "string" - } - }, - "required": [ - "name", - "type", - "mode" - ], - "title": "MemoryBankConfigResponse", - "type": "object" - }, - "MemoryBankListResponseModel": { - "description": "Paginated list of memory banks.", - "properties": { - "limit": { - "description": "Items per page.", - "title": "Limit", - "type": "integer" - }, - "memory_banks": { - "description": "List of memory banks on this page.", - "items": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - }, - "title": "Memory Banks", - "type": "array" - }, - "page": { - "description": "Current page number (1-based).", - "title": "Page", - "type": "integer" - }, - "total": { - "description": "Total number of memory banks.", - "title": "Total", - "type": "integer" - } - }, - "required": [ - "memory_banks", - "page", - "limit", - "total" - ], - "title": "MemoryBankListResponseModel", - "type": "object" - }, - "MemoryBankResponseModel": { - "description": "Response model for a single memory bank.", - "properties": { - "chunk_overlap": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Character overlap between chunks.", - "title": "Chunk Overlap" - }, - "chunk_size": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Characters per chunk.", - "title": "Chunk Size" - }, - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted.", - "title": "Compaction Prompt" - }, - "created_at": { - "description": "ISO-8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description of the memory bank's purpose.", - "title": "Description" - }, - "dimensions": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Vector embedding dimensions.", - "title": "Dimensions" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model identifier.", - "title": "Embedding Model" - }, - "id": { - "description": "Unique memory bank identifier.", - "title": "Id", - "type": "string" - }, - "max_age_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "DEPRECATED and no longer applied. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Always null for clients sending Seclai-Version 2026-08-03 or later; older clients keep reading whatever value was stored.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max total tokens (per partition) before compaction. Checked both inline after each write and by the hourly background sweep.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns (per partition) before compaction. Checked both inline after each write and by the hourly background sweep.", - "title": "Max Turns" - }, - "mode": { - "description": "Embedding mode: fast_and_cheap, balanced, slow_and_thorough, or custom.", - "title": "Mode", - "type": "string" - }, - "name": { - "description": "Human-readable name.", - "title": "Name", - "type": "string" - }, - "retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Content retention period in days (null = indefinite).", - "title": "Retention Days" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Linked content source ID (null if not yet provisioned).", - "title": "Source Connection Id" - }, - "strip_quoted_reply_chains": { - "default": false, - "description": "Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation.", - "title": "Strip Quoted Reply Chains", - "type": "boolean" - }, - "type": { - "description": "Bank type: conversation (chat-turn with speaker) or general (flat entries).", - "title": "Type", - "type": "string" - }, - "updated_at": { - "description": "ISO-8601 last-update timestamp.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "type", - "mode", - "created_at", - "updated_at" - ], - "title": "MemoryBank", - "type": "object" - }, - "ModalityRateResponse": { - "description": "Per-modality rate for an LLM that prices image/audio/video output\n(or input) at a rate distinct from the default text rate.\n\nExample: Gemini 3.1 Flash Image charges $3/1M output tokens for\ntext but $60/1M output tokens for generated images. The image rate\nsurfaces here with ``modality=\"image\"`` and ``output_credits_per_1000_tokens``\nset; the default text rate stays on the parent model fields.", - "properties": { - "input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Credits Per 1000 Tokens" - }, - "modality": { - "title": "Modality", - "type": "string" - }, - "output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Output Credits Per 1000 Tokens" - } - }, - "required": [ - "modality" - ], - "title": "ModalityRateResponse", - "type": "object" - }, - "OkResponse": { - "description": "A minimal ``{\"ok\": true}`` acknowledgement for state-mutating actions\nthat have no richer resource to return (e.g. accept/decline a suggestion).", - "properties": { - "ok": { - "title": "Ok", - "type": "boolean" - } - }, - "required": [ - "ok" - ], - "title": "OkResponse", - "type": "object" - }, - "OrganizationAlertPreferenceListResponse": { - "properties": { - "preferences": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__OrganizationAlertPreferenceResponse" - }, - "title": "Preferences", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "preferences", - "total" - ], - "title": "OrganizationAlertPreferenceListResponse", - "type": "object" - }, - "OrganizationInfoResponse": { - "properties": { - "account_id": { - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name", - "account_id" - ], - "title": "OrganizationInfoResponse", - "type": "object" - }, - "PaginationResponse": { - "description": "Pagination information.", - "properties": { - "has_next": { - "title": "Has Next", - "type": "boolean" - }, - "has_prev": { - "title": "Has Prev", - "type": "boolean" - }, - "limit": { - "title": "Limit", - "type": "integer" - }, - "page": { - "title": "Page", - "type": "integer" - }, - "pages": { - "title": "Pages", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "page", - "limit", - "total", - "pages", - "has_next", - "has_prev" - ], - "title": "PaginationResponse", - "type": "object" - }, - "PendingProcessingCompletedFailedStatus": { - "enum": [ - "pending", - "processing", - "completed", - "failed", - "queued", - "waiting_human", - "waiting_scheduled" - ], - "title": "PendingProcessingCompletedFailedStatus", - "type": "string" - }, - "PlaygroundCreateRequest": { - "description": "Create a model playground experiment via the public API.", - "properties": { - "effort": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Reasoning effort per model id, each one of that model's `effort_options` values. Not combinable with `json_template`.", - "title": "Effort" - }, - "evaluation_complexity": { - "default": "medium", - "description": "simple, medium, or complex", - "enum": [ - "simple", - "medium", - "complex" - ], - "title": "Evaluation Complexity", - "type": "string" - }, - "evaluation_mode": { - "default": "manual", - "description": "manual or prompt", - "enum": [ - "manual", - "prompt" - ], - "title": "Evaluation Mode", - "type": "string" - }, - "evaluator_model_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Evaluator model ID when evaluation_mode is prompt.", - "title": "Evaluator Model Id" - }, - "include_step_output_in_evaluation": { - "default": false, - "description": "Whether to include selected step output as evaluator context.", - "title": "Include Step Output In Evaluation", - "type": "boolean" - }, - "json_template": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional JSON template for advanced mode.", - "title": "Json Template" - }, - "model_ids": { - "description": "Selected model IDs (1-10).", - "items": { - "type": "string" - }, - "maxItems": 10, - "minItems": 1, - "title": "Model Ids", - "type": "array" - }, - "prompt": { - "description": "Prompt text for the experiment.", - "title": "Prompt", - "type": "string" - }, - "selected_step_output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional step output text for evaluator context.", - "title": "Selected Step Output" - }, - "system_prompt": { - "default": "", - "description": "Optional system prompt.", - "title": "System Prompt", - "type": "string" - } - }, - "required": [ - "model_ids", - "prompt" - ], - "title": "PlaygroundCreateRequest", - "type": "object" - }, - "PromptModelAutoUpgradeStrategy": { - "enum": [ - "none", - "early_adopter", - "middle_of_road", - "cautious_adopter" - ], - "title": "PromptModelAutoUpgradeStrategy", - "type": "string" - }, - "PromptToolResponse": { - "description": "Response model for a prompt tool.", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "documentation_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Documentation Url" - }, - "example": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Example" - }, - "headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Headers" - }, - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "notes": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Notes" - }, - "tool_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Tool Name" - }, - "tool_type": { - "title": "Tool Type", - "type": "string" - }, - "tool_type_pattern": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Tool Type Pattern" - } - }, - "required": [ - "id", - "tool_type", - "name" - ], - "title": "PromptToolResponse", - "type": "object" - }, - "ProposedActionResponse": { - "description": "A single proposed action.", - "properties": { - "action_type": { - "description": "Type of the proposed action.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description of the action.", - "title": "Description", - "type": "string" - }, - "is_destructive": { - "default": false, - "description": "Whether the action is destructive.", - "title": "Is Destructive", - "type": "boolean" - }, - "params": { - "additionalProperties": true, - "description": "Parameters for the action.", - "title": "Params", - "type": "object" - }, - "preview": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Planning-time dry-run preview attached by the solution AI assistant for create_agent / update_agent actions. Contains ``steps`` (the generated step tree), ``step_count``, ``warnings`` (a mix of heuristic structural issues \u2014 e.g. brittle JSONPath, pass-through ``regex_replace``, ``prompt_call`` missing a model \u2014 and deterministic resource-usage issues: every pre-bound knowledge base / memory bank must be referenced by at least one step, and no step may reference an unknown id), and ``skipped`` / ``skipped_reason`` when preview couldn't run (e.g. the action depends on resources created earlier in the same plan). ``None`` for non-agent actions or when generation failed.", - "title": "Preview" - } - }, - "required": [ - "action_type", - "params", - "description" - ], - "title": "ProposedActionResponse", - "type": "object" - }, - "ProposedPolicyActionResponse": { - "description": "A single proposed governance policy action.", - "properties": { - "action_type": { - "description": "Type of action: create, update, delete, enable, or disable.", - "title": "Action Type", - "type": "string" - }, - "description": { - "description": "Human-readable description of what this action will do.", - "title": "Description", - "type": "string" - }, - "params": { - "additionalProperties": true, - "description": "Parameters for the action (e.g. policy_document_id, thresholds).", - "title": "Params", - "type": "object" - } - }, - "required": [ - "action_type", - "description", - "params" - ], - "title": "ProposedPolicyActionResponse", - "type": "object" - }, - "RemoveEmailDomainResponse": { - "properties": { - "cleanup_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Cleanup Note" - }, - "removed": { - "default": true, - "title": "Removed", - "type": "boolean" - } - }, - "title": "RemoveEmailDomainResponse", - "type": "object" - }, - "RerankerModelListResponse": { - "description": "Legacy (header-less) response shape for the reranker catalog.", - "properties": { - "default_model_type": { - "description": "Reranker used when a knowledge base does not choose one", - "title": "Default Model Type", - "type": "string" - }, - "models": { - "description": "Available reranker models", - "items": { - "$ref": "#/components/schemas/RerankerModelResponse" - }, - "title": "Models", - "type": "array" - }, - "search_processing_credits": { - "description": "Credits charged for processing a search request", - "title": "Search Processing Credits", - "type": "number" - } - }, - "required": [ - "models", - "default_model_type", - "search_processing_credits" - ], - "title": "RerankerModelListResponse", - "type": "object" - }, - "RerankerModelResponse": { - "description": "Information about a reranker model.", - "properties": { - "credits_per_action": { - "description": "Credits charged per rerank action", - "title": "Credits Per Action", - "type": "number" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model description", - "title": "Description" - }, - "is_default": { - "description": "Whether this is the platform default reranker", - "title": "Is Default", - "type": "boolean" - }, - "is_new": { - "default": false, - "description": "Whether the model is newly released", - "title": "Is New", - "type": "boolean" - }, - "max_input_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max input tokens per request", - "title": "Max Input Tokens" - }, - "model_type": { - "description": "Full model type identifier. This is the value to send as reranker_model on a knowledge base; send \"none\" or an empty string to disable reranking.", - "title": "Model Type", - "type": "string" - }, - "name": { - "description": "Human-readable model name", - "title": "Name", - "type": "string" - }, - "provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model provider identifier", - "title": "Provider" - }, - "supported_languages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Supported languages", - "title": "Supported Languages" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model documentation URL", - "title": "Url" - } - }, - "required": [ - "model_type", - "name", - "credits_per_action", - "is_default" - ], - "title": "RerankerModelResponse", - "type": "object" - }, - "ResumeInboundResponse": { - "properties": { - "resumed": { - "title": "Resumed", - "type": "boolean" - } - }, - "required": [ - "resumed" - ], - "title": "ResumeInboundResponse", - "type": "object" - }, - "SendTestEmailResponse": { - "properties": { - "sent": { - "default": true, - "title": "Sent", - "type": "boolean" - } - }, - "title": "SendTestEmailResponse", - "type": "object" - }, - "ServiceUnavailableError": { - "properties": { - "error": { - "properties": { - "code": { - "enum": [ - "database_unavailable", - "vector_store_unavailable" - ], - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - } - }, - "required": [ - "error" - ], - "title": "ServiceUnavailableError", - "type": "object" - }, - "SetAcceptedAttachmentsRequest": { - "properties": { - "accepted_attachments": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/AcceptedAttachmentSlot" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The input attachments the trigger accepts; ``null`` accepts any files (one attachment named ``files``). Only ``dynamic_input`` and ``email_received`` triggers take files.", - "title": "Accepted Attachments" - } - }, - "required": [ - "accepted_attachments" - ], - "title": "SetAcceptedAttachmentsRequest", - "type": "object" - }, - "SetAutoBlockModeRequest": { - "description": "Set the account's governance auto-block mode (shared REST request).", - "properties": { - "mode": { - "title": "Mode", - "type": "string" - } - }, - "required": [ - "mode" - ], - "title": "SetAutoBlockModeRequest", - "type": "object" - }, - "SkippedAttachmentReason": { - "enum": [ - "displayed_in_body", - "over_cap", - "no_filename", - "undecodable" - ], - "title": "SkippedAttachmentReason", - "type": "string" - }, - "SkippedAttachmentResponse": { - "description": "A part of an email that was not stored as an attachment.", - "properties": { - "content_type": { - "description": "The part's declared media type.", - "title": "Content Type", - "type": "string" - }, - "filename": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The file name the part is listed under; null when it had none.", - "title": "Filename" - }, - "reason": { - "$ref": "#/components/schemas/SkippedAttachmentReason", - "description": "Why the part was not stored." - }, - "size_bytes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Decoded size in bytes.", - "title": "Size Bytes" - } - }, - "required": [ - "filename", - "content_type", - "size_bytes", - "reason" - ], - "title": "SkippedAttachmentResponse", - "type": "object" - }, - "SolutionSourceConnectionResponse": { - "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "title": "SolutionSourceConnectionResponse", - "type": "object" - }, - "SolutionSummaryResponse": { - "description": "Response model for solution summary.", - "properties": { - "agent_count": { - "description": "Number of linked agents.", - "title": "Agent Count", - "type": "integer" - }, - "created_at": { - "description": "Timestamp when the solution was created.", - "title": "Created At", - "type": "string" - }, - "description": { - "description": "Description of the solution.", - "title": "Description", - "type": "string" - }, - "id": { - "description": "Unique identifier for the solution.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "knowledge_base_count": { - "description": "Number of linked knowledge bases.", - "title": "Knowledge Base Count", - "type": "integer" - }, - "memory_bank_count": { - "description": "Number of linked memory banks.", - "title": "Memory Bank Count", - "type": "integer" - }, - "name": { - "description": "Name of the solution.", - "title": "Name", - "type": "string" - }, - "source_connection_count": { - "description": "Number of linked source connections.", - "title": "Source Connection Count", - "type": "integer" - }, - "updated_at": { - "description": "Timestamp when the solution was last updated.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "description", - "agent_count", - "knowledge_base_count", - "source_connection_count", - "memory_bank_count", - "created_at", - "updated_at" - ], - "title": "SolutionSummaryResponse", - "type": "object" - }, - "SourceConnectionResponseModel": { - "description": "Nested source connection summary within a knowledge base response.", - "properties": { - "id": { - "description": "Source connection identifier.", - "title": "Id", - "type": "string" - }, - "name": { - "description": "Source connection name.", - "title": "Name", - "type": "string" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling configuration.", - "title": "Polling" - }, - "source_type": { - "description": "Type of source (rss, website, etc.).", - "title": "Source Type", - "type": "string" - }, - "url": { - "description": "Source URL.", - "title": "Url", - "type": "string" - } - }, - "required": [ - "id", - "name", - "url", - "source_type" - ], - "title": "SourceConnectionResponseModel", - "type": "object" - }, - "SourceContentStatusListResponse": { - "description": "Response model for a paginated per-item indexing status list.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/SourceContentStatusResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "SourceContentStatusListResponse", - "type": "object" - }, - "SourceContentStatusResponse": { - "description": "Response model for one content item's indexing status.", - "properties": { - "awaiting_reindex": { - "default": false, - "description": "True when the item is linked and reports completed but its content is not yet embedded under the index the source connection currently uses, because it still sits under the index that connection used before an embedding migration switched it. Anything ingested while a migration ran can land in this state. Semantic and content search will not match it until it is re-embedded; a title keyword match can still return it, so the item may appear in results while its body is unsearchable. It clears on its own \u2014 a reconciliation pass re-embeds the item under the current index, typically within minutes of the migration finishing, and a daily sweep retries whatever is still outstanding, so a large backlog can take more than one sweep to drain. The re-embedding is not charged to your account: nothing you did caused it, so Seclai absorbs the cost. Never true for an item that is simply still indexing; content_status covers that.", - "title": "Awaiting Reindex", - "type": "boolean" - }, - "content_status": { - "description": "Indexing status: pending, fetching, transcribing, scanning, indexing, completed, or failed.", - "title": "Content Status", - "type": "string" - }, - "content_token_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Extracted token count.", - "title": "Content Token Count" - }, - "content_type": { - "description": "Content type group: text, audio, video, image, or document.", - "title": "Content Type", - "type": "string" - }, - "content_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Internal URL identifying the item. Uploaded files use a `file-upload://` URL.", - "title": "Content Url" - }, - "content_version_id": { - "description": "ID of the content version. This is the `content_version_id` returned by the upload endpoints, so it is what you match an upload against.", - "title": "Content Version Id", - "type": "string" - }, - "content_word_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Extracted word count.", - "title": "Content Word Count" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Why the item failed, when `content_status` is `failed`.", - "title": "Error" - }, - "extracted_media_capped": { - "default": false, - "description": "True when extraction stopped with media still unread, so the item references more media than was attached and media search will not match anything past the cut. The cause is a web page that ran out of the budget for fetching remote assets or listed more media than is recorded, or a web page or document that could not be read to the end.", - "title": "Extracted Media Capped", - "type": "boolean" - }, - "extracted_media_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Number of images / videos in this web page's main content, or of images inside this PDF or Office document, that were attached to the item on this source; a file over the per-file size limit, listed as a failed attachment, is not counted. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container or this source's settings, or found nothing. Treat null as 'unknown', never as zero.", - "title": "Extracted Media Count" - }, - "extracted_media_limit": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "The bound that was reached, when extracted_media_capped is true and the stop was a bound \u2014 a number of fetch attempts, of seconds, of bytes, or of media listed. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired.", - "title": "Extracted Media Limit" - }, - "held_for_review": { - "default": false, - "description": "An ENFORCE governance policy blocked this item at import. It is held for review and is not retrievable: resolving its blocking evaluations releases it into the source, and it is purged when the hold window ends.", - "title": "Held For Review", - "type": "boolean" - }, - "indexed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the item finished indexing and became retrievable. `null` until then.", - "title": "Indexed At" - }, - "mime_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "MIME type the item was ingested as, when known.", - "title": "Mime Type" - }, - "published_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Publication timestamp of the item, when known.", - "title": "Published At" - }, - "pulled_at": { - "description": "Timestamp when the item was uploaded or pulled.", - "title": "Pulled At", - "type": "string" - }, - "source_connection_content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID to pass to `GET /contents/{id}`. `null` until the item has finished indexing \u2014 an item that is still processing, or that failed, has no retrievable content and keeps this `null`.", - "title": "Source Connection Content Version Id" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title of the content item.", - "title": "Title" - } - }, - "required": [ - "content_version_id", - "source_connection_content_version_id", - "title", - "content_url", - "content_type", - "mime_type", - "content_status", - "error", - "content_word_count", - "content_token_count", - "pulled_at", - "published_at", - "indexed_at" - ], - "title": "SourceContentStatusResponse", - "type": "object" - }, - "SourceEmbeddingMigrationResponse": { - "description": "Response model for source embedding migration status.", - "properties": { - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Completed At" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "failure_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Failure Message" - }, - "id": { - "title": "Id", - "type": "string" - }, - "notification_recipients": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Notification Recipients" - }, - "phase": { - "title": "Phase", - "type": "string" - }, - "progress_current": { - "title": "Progress Current", - "type": "integer" - }, - "progress_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Progress Message" - }, - "progress_total": { - "title": "Progress Total", - "type": "integer" - }, - "source_connection_id": { - "title": "Source Connection Id", - "type": "string" - }, - "source_id_new": { - "title": "Source Id New", - "type": "string" - }, - "source_id_old": { - "title": "Source Id Old", - "type": "string" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started At" - }, - "status": { - "title": "Status", - "type": "string" - }, - "target_dimensions": { - "title": "Target Dimensions", - "type": "integer" - }, - "target_embedding_model": { - "title": "Target Embedding Model", - "type": "string" - }, - "task_execution_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Task Execution Id" - }, - "updated_at": { - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "source_connection_id", - "source_id_old", - "source_id_new", - "target_embedding_model", - "target_dimensions", - "status", - "phase", - "progress_current", - "progress_total", - "progress_message", - "failure_message", - "notification_recipients", - "task_execution_id", - "started_at", - "completed_at", - "created_at", - "updated_at" - ], - "title": "SourceEmbeddingMigrationResponse", - "type": "object" - }, - "SourceIndexMode": { - "description": "Embedding quality / cost trade-off preset for custom_index sources.\n\nEach preset controls the default embedding dimensions, chunk size, and\nchunk overlap. The embedding model is always the account-level default\n(currently ``AWS_BEDROCK_AMAZON_NOVA_2_MULTIMODAL``).\n\nPresets:\n FAST_AND_CHEAP: 256 dimensions, 3 000 char chunks, 500 char overlap.\n BALANCED: 384 dimensions, 1 500 char chunks, 300 char overlap.\n SLOW_AND_THOROUGH: 1 024 dimensions, 1 000 char chunks, 200 char overlap.\n CUSTOM: Caller supplies embedding model, dimensions, and chunk config.", - "enum": [ - "fast_and_cheap", - "balanced", - "slow_and_thorough", - "custom" - ], - "title": "SourceIndexMode", - "type": "string" - }, - "SourceResponse": { - "description": "Response model for source data.", - "properties": { - "account_id": { - "description": "Account ID associated with the source.", - "format": "uuid", - "title": "Account Id", - "type": "string" - }, - "avg_episodes_per_month": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Average number of episodes per month.", - "title": "Avg Episodes Per Month" - }, - "avg_words_per_episode": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Average number of words per episode.", - "title": "Avg Words Per Episode" - }, - "chunk_language": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Language used for chunking content.", - "title": "Chunk Language" - }, - "chunk_overlap": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk overlap for content processing.", - "title": "Chunk Overlap" - }, - "chunk_regex_separators": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Indicates if chunk separators are regex patterns.", - "title": "Chunk Regex Separators" - }, - "chunk_separators": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Chunk separators used for content processing.", - "title": "Chunk Separators" - }, - "chunk_size": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Chunk size for content processing.", - "title": "Chunk Size" - }, - "cloud_drive_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: the id of the connected drive it indexes. Null for every other source type.", - "title": "Cloud Drive Connection Id" - }, - "cloud_drive_content_types": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: the comma-separated MIME types a file must have to be indexed. Null when there is no filter.", - "title": "Cloud Drive Content Types" - }, - "cloud_drive_folder_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: the folder it indexes. Null when it indexes the connected drive's own folder.", - "title": "Cloud Drive Folder Path" - }, - "cloud_drive_max_file_mb": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: the size in megabytes above which a file is skipped. Null when the source sets no limit of its own.", - "title": "Cloud Drive Max File Mb" - }, - "cloud_drive_path_pattern": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: the glob a file's path must match to be indexed. Null when there is none.", - "title": "Cloud Drive Path Pattern" - }, - "content_count": { - "default": 0, - "description": "Number of content items associated with the source connection.", - "title": "Content Count", - "type": "integer" - }, - "content_filter": { - "description": "Content filter for the source connection.", - "title": "Content Filter", - "type": "string" - }, - "created_at": { - "description": "Timestamp when the source connection was created.", - "title": "Created At", - "type": "string" - }, - "dimensions": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Dimensions of the embedding model.", - "title": "Dimensions" - }, - "document_images": { - "default": true, - "description": "Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to the item and indexed; on a source that follows no web pages and has a text-only embedder, by the text in each image. Applies to documents added after it changes. On a website or RSS source it reports whether `media_types` holds 'images', and the images are attached only when the source's embedder indexes images.", - "title": "Document Images", - "type": "boolean" - }, - "email_address": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For an email source: the address to send mail to. Null for every other source type.", - "title": "Email Address" - }, - "email_allowed_senders": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "For an email source: the addresses and domains whose mail is stored. Null for every other source type.", - "title": "Email Allowed Senders" - }, - "embedding_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Embedding model used for the source connection.", - "title": "Embedding Model" - }, - "embedding_model_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Type of the embedding model.", - "title": "Embedding Model Type" - }, - "feed_attachments": { - "description": "Kinds of file listed beside a feed item's content that an RSS source attaches to the item and indexes (subset of ['enclosures', 'item_image', 'media_rss']).", - "items": { - "type": "string" - }, - "title": "Feed Attachments", - "type": "array" - }, - "free_retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Number of days content is stored for free before billing applies.", - "title": "Free Retention Days" - }, - "has_historical_data": { - "default": false, - "description": "Indicates if the source connection has historical data.", - "title": "Has Historical Data", - "type": "boolean" - }, - "id": { - "description": "Unique identifier for the source connection.", - "title": "Id", - "type": "string" - }, - "index_mode": { - "anyOf": [ - { - "$ref": "#/components/schemas/SourceIndexMode" - }, - { - "type": "null" - } - ], - "description": "Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom." - }, - "media_types": { - "description": "Media kinds in a web page's main content that are attached to the page's item and indexed (subset of ['images', 'video']). On a website or RSS source 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files.", - "items": { - "type": "string" - }, - "title": "Media Types", - "type": "array" - }, - "name": { - "description": "Name of the source connection.", - "title": "Name", - "type": "string" - }, - "next_poll_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp for the next scheduled poll.", - "title": "Next Poll At" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling configuration for the source connection.", - "title": "Polling" - }, - "polling_action": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Polling action for the source connection.", - "title": "Polling Action" - }, - "polling_max_items": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "The most new feed items a scheduled poll takes. Read for RSS feeds only.", - "title": "Polling Max Items" - }, - "pulled_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when content was last pulled.", - "title": "Pulled At" - }, - "readonly": { - "default": false, - "description": "Indicates if the source connection is read-only.", - "title": "Readonly", - "type": "boolean" - }, - "retention": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Retention period for the source connection.", - "title": "Retention" - }, - "source_type": { - "description": "Type of the source connection.", - "title": "Source Type", - "type": "string" - }, - "system_managed": { - "default": false, - "description": "Indicates if this source is automatically managed by the system (e.g., agent traces).", - "title": "System Managed", - "type": "boolean" - }, - "updated_at": { - "description": "Timestamp when the source connection was last updated.", - "title": "Updated At", - "type": "string" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "URL of the source connection.", - "title": "Url" - } - }, - "required": [ - "id", - "account_id", - "name", - "url", - "source_type", - "polling", - "polling_action", - "polling_max_items", - "content_filter", - "retention", - "pulled_at", - "next_poll_at", - "created_at", - "updated_at" - ], - "title": "SourceResponse", - "type": "object" - }, - "StandaloneTestCompactionRequest": { - "description": "Request body for testing a compaction prompt *without* an existing bank.\n\nUsed on the create-memory-bank page where no bank ID exists yet.\n``compaction_prompt`` is required (no bank to fall back to).\nContent must come from ``sample_entries`` or ``generate_direction``\n(no existing entries to fetch).", - "properties": { - "bank_type": { - "default": "conversation", - "description": "Memory bank type ('conversation' or 'general') \u2014 controls the style of generated entries.", - "title": "Bank Type", - "type": "string" - }, - "compaction_prompt": { - "description": "Compaction prompt to test.", - "minLength": 1, - "title": "Compaction Prompt", - "type": "string" - }, - "entry_count": { - "default": 5, - "description": "Number of entries to generate when using generate_direction.", - "maximum": 20.0, - "minimum": 2.0, - "title": "Entry Count", - "type": "integer" - }, - "generate_direction": { - "anyOf": [ - { - "maxLength": 2000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Direction for the LLM to generate sample entries.", - "title": "Generate Direction" - }, - "sample_entries": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "maxItems": 20, - "minItems": 1, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Explicit sample entries to compact.", - "title": "Sample Entries" - } - }, - "required": [ - "compaction_prompt" - ], - "title": "StandaloneTestCompactionRequest", - "type": "object" - }, - "StartSourceEmbeddingMigrationRequest": { - "description": "Request payload to start a source embedding migration.", - "properties": { - "chunk_language": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Language-specific chunking language code", - "title": "Chunk Language" - }, - "chunk_overlap": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Override chunk overlap (characters)", - "title": "Chunk Overlap" - }, - "chunk_regex_separators": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether chunk separators are regex patterns", - "title": "Chunk Regex Separators" - }, - "chunk_separators": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom chunk separators (JSON-encoded list)", - "title": "Chunk Separators" - }, - "chunk_size": { - "anyOf": [ - { - "exclusiveMinimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Override chunk size (characters per chunk)", - "title": "Chunk Size" - }, - "notification_recipients": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Optional notification recipient emails", - "title": "Notification Recipients" - }, - "target_dimensions": { - "description": "Target embedding dimensions", - "exclusiveMinimum": 0.0, - "title": "Target Dimensions", - "type": "integer" - }, - "target_embedding_model": { - "description": "Target embedding model \u2014 a `model_type` from `GET /models/embedders`, which also reports the `dimensions` each embedder supports and the modalities it can index.", - "title": "Target Embedding Model", - "type": "string" - } - }, - "required": [ - "target_embedding_model", - "target_dimensions" - ], - "title": "StartSourceEmbeddingMigrationRequest", - "type": "object" - }, - "TestCompactionRequest": { - "description": "Request body for testing a compaction prompt against an existing bank.\n\nThe user may supply a ``compaction_prompt`` to override (or provide when\nthe bank has none). Content can come from three sources:\n\n1. Existing entries in the bank (default when neither field is set).\n2. ``sample_entries`` \u2013 caller-provided list of strings.\n3. ``generate_direction`` \u2013 an instruction to the LLM to generate sample\n memory entries. Useful for trying a prompt before any real data\n exists.\n\nAt most one of ``sample_entries`` / ``generate_direction`` may be given.", - "properties": { - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Compaction prompt to test. Falls back to the bank's current prompt when omitted.", - "title": "Compaction Prompt" - }, - "entry_count": { - "default": 5, - "description": "Number of entries to generate when using generate_direction.", - "maximum": 20.0, - "minimum": 2.0, - "title": "Entry Count", - "type": "integer" - }, - "generate_direction": { - "anyOf": [ - { - "maxLength": 2000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Direction for the LLM to generate sample entries (e.g. 'Generate 5 entries about a customer support interaction').", - "title": "Generate Direction" - }, - "sample_entries": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "maxItems": 20, - "minItems": 1, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Explicit sample entries to compact.", - "title": "Sample Entries" - } - }, - "title": "TestCompactionRequest", - "type": "object" - }, - "TestDraftEvaluationRequest": { - "description": "Request body for ephemeral (non-persisted) evaluation testing.\n\nProvide either ``step_output`` (raw text) **or** ``agent_step_run_id``\n(to load output from storage). Exactly one must be supplied.", - "properties": { - "agent_input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The original agent run input for context. When agent_step_run_id is supplied this is loaded automatically from the parent run if omitted.", - "title": "Agent Input" - }, - "agent_step_run_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Load step output from this completed step run instead of supplying text.", - "title": "Agent Step Run Id" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "pass_threshold": { - "default": 0.5, - "maximum": 1.0, - "minimum": 0.0, - "title": "Pass Threshold", - "type": "number" - }, - "step_output": { - "anyOf": [ - { - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The step output text to evaluate. Omit if agent_step_run_id is supplied.", - "title": "Step Output" - } - }, - "title": "TestDraftEvaluationRequest", - "type": "object" - }, - "TestDraftEvaluationResponse": { - "description": "Response for an ephemeral evaluation test.", - "properties": { - "explanation": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Explanation" - }, - "passed": { - "title": "Passed", - "type": "boolean" - }, - "score": { - "title": "Score", - "type": "number" - }, - "status": { - "$ref": "#/components/schemas/EvaluationStatus", - "description": "`passed`, `failed`, or `error` when the evaluator returned no verdict." - } - }, - "required": [ - "status", - "score", - "passed", - "explanation" - ], - "title": "TestDraftEvaluationResponse", - "type": "object" - }, - "UnlinkResourcesRequest": { - "properties": { - "ids": { - "description": "Resource IDs to unlink", - "items": { - "format": "uuid", - "type": "string" - }, - "minItems": 1, - "title": "Ids", - "type": "array" - } - }, - "required": [ - "ids" - ], - "title": "UnlinkResourcesRequest", - "type": "object" - }, - "UnreadCountResponse": { - "properties": { - "count": { - "title": "Count", - "type": "integer" - } - }, - "required": [ - "count" - ], - "title": "UnreadCountResponse", - "type": "object" - }, - "UpdateAgentDefinitionRequest": { - "properties": { - "accepted_attachments": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/AcceptedAttachmentSlot" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "When given, declared on the main branch's file-taking triggers in the same save, so the steps may read its slots as `{{agent.attachments.}}`; omitted, the triggers keep theirs.", - "title": "Accepted Attachments" - }, - "definition": { - "additionalProperties": true, - "description": "The full agent definition (name, description, tags, steps). Steps form a tree workflow. Each step has a `step_type`, `id`, `name`, and type-specific config. Content enrichment steps (write_metadata, write_content_attachment, load_content_attachment, load_content) require content-triggered agents.", - "title": "Definition", - "type": "object" - }, - "expected_change_id": { - "description": "The change_id from the last GET, for optimistic locking.", - "title": "Expected Change Id", - "type": "string" - } - }, - "required": [ - "expected_change_id", - "definition" - ], - "title": "UpdateAgentDefinitionRequest", - "type": "object" - }, - "UpdateAlertConfigRequest": { - "properties": { - "cooldown_minutes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Cooldown period in minutes", - "title": "Cooldown Minutes" - }, - "distribution_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Distribution type", - "title": "Distribution Type" - }, - "enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the alert config is enabled", - "title": "Enabled" - }, - "recipient_user_ids": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "User IDs for selected_members distribution", - "title": "Recipient User Ids" - }, - "threshold": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Threshold configuration", - "title": "Threshold" - } - }, - "title": "UpdateAlertConfigRequest", - "type": "object" - }, - "UpdateApiVersionRequest": { - "properties": { - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "A YYYY-MM-DD date to pin the account to, or null to clear the pin (revert to the default baseline).", - "title": "Version" - } - }, - "title": "UpdateApiVersionRequest", - "type": "object" - }, - "UpdateEvaluationCriteriaRequest": { - "description": "Request body for updating an evaluation criteria.\n\nRetry settings and sample frequency are set at the agent level.", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "Enabled" - }, - "evaluation_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Evaluation Prompt" - }, - "evaluation_tier": { - "anyOf": [ - { - "$ref": "#/components/schemas/AgentEvaluationTier" - }, - { - "type": "null" - } - ] - }, - "expectation_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Expectation Config" - }, - "pass_threshold": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": 0.0, - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Pass Threshold" - }, - "step_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step Id" - } - }, - "title": "UpdateEvaluationCriteriaRequest", - "type": "object" - }, - "UpdateKnowledgeBaseBody": { - "description": "Request body for updating a knowledge base.", - "properties": { - "default_score_threshold": { - "anyOf": [ - { - "maximum": 1.0, - "minimum": -1.0, - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Minimum Rerank Score on a new retrieval step (-1 to clear).", - "title": "Default Score Threshold" - }, - "default_top_k": { - "anyOf": [ - { - "maximum": 200.0, - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Top K on a new retrieval step (0 to clear).", - "title": "Default Top K" - }, - "default_top_n": { - "anyOf": [ - { - "maximum": 200.0, - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Prefilled into Top N on a new retrieval step (0 to clear).", - "title": "Default Top N" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New description.", - "title": "Description" - }, - "name": { - "anyOf": [ - { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name.", - "title": "Name" - }, - "reranker_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New reranker model \u2014 a `model_type` from `GET /models/rerankers`. Pass \"none\" to turn reranking off (not a value from that list). Omitting the field (or sending null) leaves the current reranker in place \u2014 it does NOT turn it off. \"\" is accepted as a synonym for \"none\", but prefer \"none\": an empty string does not survive every client's serialization.", - "title": "Reranker Model" - }, - "source_ids": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "New list of source connection IDs.", - "title": "Source Ids" - } - }, - "title": "UpdateKnowledgeBaseBody", - "type": "object" - }, - "UpdateMemoryBankBody": { - "description": "Request body for updating a memory bank.\n\nOmitted fields are left unchanged. To **clear** a field back to null,\nsend a zero-value sentinel: ``0`` for integers, ``\"\"`` for strings.", - "properties": { - "compaction_prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted. Send empty string \"\" to clear and disable summarisation.", - "title": "Compaction Prompt" - }, - "description": { - "anyOf": [ - { - "maxLength": 1000, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description. Send empty string \"\" to clear.", - "title": "Description" - }, - "max_age_days": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "DEPRECATED and no longer applied. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending Seclai-Version 2026-08-03 or later, except 0, which clears a value stored earlier. Accepted and stored but inert for older clients.", - "title": "Max Age Days" - }, - "max_size_tokens": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max total tokens (per partition) before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable.", - "title": "Max Size Tokens" - }, - "max_turns": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable.", - "title": "Max Turns" - }, - "name": { - "anyOf": [ - { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name.", - "title": "Name" - }, - "retention_days": { - "anyOf": [ - { - "minimum": 0.0, - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Content source retention in days. Send 0 to clear (indefinite).", - "title": "Retention Days" - }, - "strip_quoted_reply_chains": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation.", - "title": "Strip Quoted Reply Chains" - } - }, - "title": "UpdateMemoryBankBody", - "type": "object" - }, - "UpdateSolutionRequest": { - "description": "Request model for updating a solution", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Description of the solution", - "title": "Description" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Name of the solution", - "title": "Name" - } - }, - "title": "UpdateSolutionRequest", - "type": "object" - }, - "UpdateSourceBody": { - "description": "Request body for updating a content source.", - "properties": { - "cloud_drive_content_types": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: comma-separated MIME types a file must have to be indexed. Send an empty string to clear it; omit to leave it unchanged.", - "title": "Cloud Drive Content Types" - }, - "cloud_drive_folder_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: the folder to index, as a path inside the drive. Send an empty string to index the connected drive's own folder; omit to leave it unchanged.", - "title": "Cloud Drive Folder Path" - }, - "cloud_drive_max_file_mb": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: files larger than this many megabytes are skipped. Send 0 to clear the source's own limit; omit to leave it unchanged.", - "title": "Cloud Drive Max File Mb" - }, - "cloud_drive_path_pattern": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "For a cloud_drive source: a glob a file's path must match to be indexed, such as `**/*.pdf` or `/reports/*`. Send an empty string to clear it; omit to leave it unchanged.", - "title": "Cloud Drive Path Pattern" - }, - "document_images": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to the item and indexed; on a text-only embedder, by the text in each image. Applies to documents added after it changes. Omit the field to leave it unchanged. On a website or RSS source it is ignored: `media_types` decides.", - "title": "Document Images" - }, - "email_allowed_senders": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "For an email source: replaces the allowed senders. Each entry is a full address or a bare domain. The list cannot be emptied. Omit to leave it unchanged.", - "title": "Email Allowed Senders" - }, - "feed_attachments": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Kinds of file listed beside a feed item's content to attach to the item and index, on an RSS source. Subset of ['enclosures', 'item_image', 'media_rss']; any other value is refused. [] attaches none. Applies to items added after it changes. Omit the field to leave it unchanged.", - "title": "Feed Attachments" - }, - "media_types": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Media kinds in a web page's main content to attach to the page's item and index, on a website or RSS source. Subset of ['images', 'video']. From `Seclai-Version: 2026-10-13` any other value, and any kind on another source type, is refused with a 400; older versions drop an unknown value and store the rest. A kind the source's embedder cannot index is stored and not indexed (see `supported_input_media` on GET /models/embedders). [] attaches no media from web pages. 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files. Applies to pages and documents added after it changes.", - "title": "Media Types" - }, - "name": { - "anyOf": [ - { - "maxLength": 255, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name.", - "title": "Name" - }, - "polling": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New polling interval.", - "title": "Polling" - }, - "retention_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "New retention period in days \u2014 content older than this is deleted permanently. Send null to clear the window: content is then kept indefinitely. Omit the field to leave it unchanged.", - "title": "Retention Days" - } - }, - "title": "UpdateSourceBody", - "type": "object" - }, - "UploadAgentInputApiResponse": { - "properties": { - "content_type": { - "description": "Resolved MIME type.", - "title": "Content Type", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if status is failed.", - "title": "Error" - }, - "file_size": { - "description": "Size in bytes.", - "title": "File Size", - "type": "integer" - }, - "filename": { - "description": "Original filename.", - "title": "Filename", - "type": "string" - }, - "id": { - "description": "Unique identifier for the upload.", - "title": "Id", - "type": "string" - }, - "status": { - "description": "processing, ready, or failed.", - "title": "Status", - "type": "string" - } - }, - "required": [ - "id", - "status", - "filename", - "content_type", - "file_size" - ], - "title": "UploadAgentInputApiResponse", - "type": "object" - }, - "ValidationError": { - "properties": { - "loc": { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - }, - "title": "Location", - "type": "array" - }, - "msg": { - "title": "Message", - "type": "string" - }, - "type": { - "title": "Error Type", - "type": "string" - } - }, - "required": [ - "loc", - "msg", - "type" - ], - "title": "ValidationError", - "type": "object" - }, - "VariantCategoryResponse": { - "description": "Response model for a variant category", - "properties": { - "category": { - "title": "Category", - "type": "string" - }, - "configurable": { - "title": "Configurable", - "type": "boolean" - }, - "description": { - "title": "Description", - "type": "string" - }, - "options": { - "items": { - "$ref": "#/components/schemas/VariantOptionResponse" - }, - "title": "Options", - "type": "array" - }, - "title": { - "title": "Title", - "type": "string" - } - }, - "required": [ - "category", - "title", - "description", - "configurable", - "options" - ], - "title": "VariantCategoryResponse", - "type": "object" - }, - "VariantOptionResponse": { - "description": "Response model for a variant option", - "properties": { - "default": { - "title": "Default", - "type": "boolean" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "input_1h_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 1-hour prompt cache.", - "title": "Input 1H Cache Write Credits Per 1000 Tokens" - }, - "input_30m_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 30-minute prompt cache.", - "title": "Input 30M Cache Write Credits Per 1000 Tokens" - }, - "input_5m_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 5-minute prompt cache.", - "title": "Input 5M Cache Write Credits Per 1000 Tokens" - }, - "input_cache_hit_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens read from a prompt cache.", - "title": "Input Cache Hit Credits Per 1000 Tokens" - }, - "input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Credits Per 1000 Tokens" - }, - "long_context_input_cache_hit_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens read from a prompt cache, on a call whose input exceeds `long_context_threshold` tokens.", - "title": "Long Context Input Cache Hit Credits Per 1000 Tokens" - }, - "long_context_input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Long Context Input Credits Per 1000 Tokens" - }, - "long_context_output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Long Context Output Credits Per 1000 Tokens" - }, - "long_context_threshold": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Long Context Threshold" - }, - "output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Output Credits Per 1000 Tokens" - }, - "title": { - "title": "Title", - "type": "string" - }, - "value": { - "title": "Value", - "type": "string" - } - }, - "required": [ - "value", - "title", - "default" - ], - "title": "VariantOptionResponse", - "type": "object" - }, - "routers__api__agents__AgentImportPreviewRequest": { - "description": "Dry-run import request \u2014 same payload shape as the export endpoint.", - "properties": { - "agent_definition": { - "additionalProperties": true, - "description": "Payload in the same shape as GET /agents/{agent_id}/export.", - "title": "Agent Definition", - "type": "object" - } - }, - "required": [ - "agent_definition" - ], - "title": "AgentImportPreviewRequest", - "type": "object" - }, - "routers__api__agents__AgentImportPreviewResponse": { - "description": "Summary of a successfully validated import payload (no DB writes).\n\nCounts are derived from the validated payload as supplied \u2014 they\nreflect what was requested, not what would eventually be persisted\n(cross-account skips for recipients and KB names happen later, only\non commit).", - "properties": { - "agent_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Imported agent name, if any.", - "title": "Agent Name" - }, - "alert_configs": { - "description": "Number of alert configs in the payload.", - "title": "Alert Configs", - "type": "integer" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Imported agent description, if any.", - "title": "Description" - }, - "evaluation_criteria": { - "description": "Number of evaluation criteria in the payload.", - "title": "Evaluation Criteria", - "type": "integer" - }, - "governance_policies": { - "description": "Number of agent-scoped governance policies in the payload.", - "title": "Governance Policies", - "type": "integer" - }, - "ok": { - "description": "Always true on a 200 response; failures use HTTP 422.", - "title": "Ok", - "type": "boolean" - }, - "payload_export_version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Export-format version the payload claims (or ``null`` for legacy payloads). When this differs from ``supported_export_version``, fields may have been silently dropped or defaulted on import.", - "title": "Payload Export Version" - }, - "schedules": { - "description": "Number of trigger schedules in the payload.", - "title": "Schedules", - "type": "integer" - }, - "solutions": { - "default": 0, - "description": "Number of solutions the source agent belonged to. On import these are matched by name in the target account; unmatched names are silently skipped.", - "title": "Solutions", - "type": "integer" - }, - "step_count": { - "description": "Total number of steps in the workflow tree (recursive).", - "title": "Step Count", - "type": "integer" - }, - "supported_export_version": { - "default": "2", - "description": "Export-format version this server understands. Compare against ``payload_export_version`` to detect cross-version imports.", - "title": "Supported Export Version", - "type": "string" - }, - "unresolved_refs": { - "description": "Entity references in the imported workflow that don't exist in the target account. Each entry: {category, ref_id, ref_name?, locations:[step:], alternatives:[{id, name, description?}]}. Pass {source_uuid: target_uuid} as ``entity_remap`` on the create/update call to substitute these references before save.", - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Unresolved Refs", - "type": "array" - } - }, - "required": [ - "ok", - "agent_name", - "description", - "step_count", - "schedules", - "alert_configs", - "evaluation_criteria", - "governance_policies" - ], - "title": "AgentImportPreviewResponse", - "type": "object" - }, - "routers__api__agents__AgentListResponse": { - "properties": { - "data": { - "description": "List of agents.", - "items": { - "$ref": "#/components/schemas/AgentSummaryResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AgentListResponse", - "type": "object" - }, - "routers__api__agents__AgentRunListResponse": { - "properties": { - "data": { - "description": "List of agent runs.", - "items": { - "$ref": "#/components/schemas/AgentRunResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AgentRunListResponse", - "type": "object" - }, - "routers__api__agents__AgentTraceSearchRequest": { - "properties": { - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by agent ID.", - "title": "Agent Id" - }, - "query": { - "description": "Search query text.", - "title": "Query", - "type": "string" - }, - "run_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by run status.", - "title": "Run Status" - }, - "step_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by step type.", - "title": "Step Type" - }, - "top_n": { - "default": 10, - "description": "Maximum number of results.", - "maximum": 100.0, - "minimum": 1.0, - "title": "Top N", - "type": "integer" - } - }, - "required": [ - "query" - ], - "title": "AgentTraceSearchRequest", - "type": "object" - }, - "routers__api__agents__CreateAgentRequest": { - "properties": { - "accepted_attachments": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/AcceptedAttachmentSlot" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The input attachments the trigger accepts. Omitted, the ``agent_definition`` trigger's declaration is kept when the export carries one and both trigger types take files; otherwise a dynamic_input or email_received trigger accepts any files (one attachment named ``files``), and any other trigger none.", - "title": "Accepted Attachments" - }, - "agent_definition": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional payload in the same format produced by GET /agents/{id}/export. When provided, replaces any template-derived workflow and pre-fills metadata/trigger fields the request does not specify explicitly. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload.", - "title": "Agent Definition" - }, - "agent_template": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Template to initialize the agent from. Values: blank, retrieval_example, simple_qa, summarizer, json_extractor, content_change_notifier, scheduled_report, webhook_pipeline.", - "title": "Agent Template" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional description.", - "title": "Description" - }, - "entity_remap": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional UUID-substitution map applied to the imported workflow before save. Each key is a source-account UUID (as returned by /agents/preview-import's ``unresolved_refs``); each value is the target-account UUID to substitute. Used to relink knowledge bases, memory banks, source connections, and sub-agents on cross-account imports.", - "title": "Entity Remap" - }, - "name": { - "description": "Name for the new agent.", - "title": "Name", - "type": "string" - }, - "trigger_type": { - "default": "dynamic_input", - "description": "Trigger type: dynamic_input, template_input, schedule, new_content, email_received.", - "title": "Trigger Type", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "CreateAgentRequest", - "type": "object" - }, - "routers__api__agents__GovernancePolicyRefResponse": { - "description": "Reference to a governance policy by id and name.", - "properties": { - "policy_id": { - "description": "Governance policy identifier.", - "title": "Policy Id", - "type": "string" - }, - "policy_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Display name of the policy at evaluation time. May be null when the policy has been deleted.", - "title": "Policy Name" - } - }, - "required": [ - "policy_id" - ], - "title": "GovernancePolicyRefResponse", - "type": "object" - }, - "routers__api__agents__SetEmailTriggerConfigRequest": { - "description": "Alias and/or sender allowlist for an EMAIL_RECEIVED trigger.\n\nA field omitted is left unchanged; passing ``null`` (or ``\"\"`` for\n``alias``) clears it.", - "properties": { - "alias": { - "anyOf": [ - { - "maxLength": 32, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Custom alias, unique per account, answering as `.@agent.seclai.com` and as `@` on each verified account email domain (alphanumeric plus '+', '.', '-'; 1\u201332 chars; not starting/ending with '+', '.', '-'; not UUID-shaped). Pass null/empty to clear.", - "title": "Alias" - }, - "allowed_senders": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Allowlist of full sender addresses and/or bare domains (a bare domain also matches sub-domains). Empty/null accepts any sender.", - "title": "Allowed Senders" - }, - "ignore_auto_generated": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "When true (default for new triggers), machine-generated inbound mail (auto-replies, bulk/list mail, bounces) is dropped before a run to prevent auto-reply loops. Set false to process automated mail.", - "title": "Ignore Auto Generated" - }, - "queue_on_quota": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "When true (default false), inbound mail that exceeds the account's hourly email-trigger rate is parked in a QUEUED run and drained later by the catch-up sweep instead of being failed; when false, over-rate mail fails immediately.", - "title": "Queue On Quota" - }, - "require_sender_auth": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "When true (default for new triggers), the envelope sender must pass SPF or DMARC even on an open inbox (no allowlist); unauthenticated, spoofable mail is rejected. Set false to accept fully unauthenticated mail on an open inbox.", - "title": "Require Sender Auth" - }, - "run_on_attachment_mismatch": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "When true (default false), an email whose attachments don't fit what the agent expects still runs: files the agent can't take are left out and the problems are listed in the `email_attachment_issues` run metadata. When false, the run fails.", - "title": "Run On Attachment Mismatch" - } - }, - "title": "SetEmailTriggerConfigRequest", - "type": "object" - }, - "routers__api__agents__UpdateAgentRequest": { - "properties": { - "agent_definition": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional payload in the same format produced by GET /agents/{id}/export. When provided, agent metadata fields the request does not set explicitly are taken from the payload, and the agent's workflow is replaced from `agent.definition`. The previous version is preserved in history. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload.", - "title": "Agent Definition" - }, - "default_evaluation_tier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Default evaluation tier: 'fast', 'balanced', or 'thorough'.", - "title": "Default Evaluation Tier" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New description for the agent.", - "title": "Description" - }, - "entity_remap": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Optional UUID-substitution map applied to the imported workflow before save (same shape as on POST /agents).", - "title": "Entity Remap" - }, - "evaluation_mode": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'.", - "title": "Evaluation Mode" - }, - "max_retries": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Max retries for eval_and_retry mode (1-10).", - "title": "Max Retries" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "New name for the agent.", - "title": "Name" - }, - "prompt_model_auto_rollback_enabled": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Enable or disable automatic rollback for upgraded models.", - "title": "Prompt Model Auto Rollback Enabled" - }, - "prompt_model_auto_rollback_triggers": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Failure signals that trigger rollback: agent_eval_fail, governance_flag, governance_block, agent_run_failed.", - "title": "Prompt Model Auto Rollback Triggers" - }, - "prompt_model_auto_upgrade_strategy": { - "anyOf": [ - { - "$ref": "#/components/schemas/PromptModelAutoUpgradeStrategy" - }, - { - "type": "null" - } - ], - "description": "Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter." - }, - "retry_on_failure": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether to retry on evaluation failure.", - "title": "Retry On Failure" - }, - "sampling_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Sampling configuration for sample_and_flag mode. Format: {combinator: 'and'|'or', rules: [...]}.", - "title": "Sampling Config" - }, - "set_default_evaluation_tier": { - "default": false, - "description": "When true and default_evaluation_tier is omitted, clears the tier to null (system default).", - "title": "Set Default Evaluation Tier", - "type": "boolean" - }, - "set_prompt_model_auto_rollback_triggers": { - "default": false, - "description": "When true and prompt_model_auto_rollback_triggers is omitted, clears the list to null (revert to system defaults).", - "title": "Set Prompt Model Auto Rollback Triggers", - "type": "boolean" - }, - "set_sampling_config": { - "default": false, - "description": "When true and sampling_config is omitted, clears the config to null.", - "title": "Set Sampling Config", - "type": "boolean" - } - }, - "title": "UpdateAgentRequest", - "type": "object" - }, - "routers__api__ai_assistant__AiAssistantFeedbackRequest": { - "description": "Request body for submitting AI assistant feedback.", - "properties": { - "agent_conversation_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Agent conversation ID, if applicable.", - "title": "Agent Conversation Id" - }, - "comment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional comment.", - "title": "Comment" - }, - "context": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Additional context.", - "title": "Context" - }, - "conversation_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Conversation ID for the interaction.", - "title": "Conversation Id" - }, - "feature": { - "description": "Feature name (e.g. 'source', 'solution').", - "title": "Feature", - "type": "string" - }, - "governance_conversation_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Governance conversation ID, if applicable.", - "title": "Governance Conversation Id" - }, - "prompt_call_id": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Prompt call ID for credit tracking.", - "title": "Prompt Call Id" - }, - "rating": { - "description": "Rating: 'thumbs_up' or 'thumbs_down'.", - "title": "Rating", - "type": "string" - } - }, - "required": [ - "feature", - "rating" - ], - "title": "AiAssistantFeedbackRequest", - "type": "object" - }, - "routers__api__alerts__AddCommentRequest": { - "properties": { - "body": { - "description": "Comment text", - "title": "Body", - "type": "string" - } - }, - "required": [ - "body" - ], - "title": "AddCommentRequest", - "type": "object" - }, - "routers__api__alerts__AlertCommentResponse": { - "properties": { - "body": { - "title": "Body", - "type": "string" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "id": { - "title": "Id", - "type": "string" - }, - "user_id": { - "title": "User Id", - "type": "string" - }, - "user_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "User Name" - } - }, - "required": [ - "id", - "user_id", - "user_name", - "body", - "created_at" - ], - "title": "AlertCommentResponse", - "type": "object" - }, - "routers__api__alerts__AlertDetailResponse": { - "properties": { - "alert": { - "$ref": "#/components/schemas/routers__api__alerts__AlertResponse" - }, - "comments": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__AlertCommentResponse" - }, - "title": "Comments", - "type": "array" - }, - "history": { - "items": { - "$ref": "#/components/schemas/AlertHistoryEntryResponse" - }, - "title": "History", - "type": "array" - }, - "subscribers": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__AlertSubscriberResponse" - }, - "title": "Subscribers", - "type": "array" - } - }, - "required": [ - "alert", - "history", - "comments", - "subscribers" - ], - "title": "AlertDetailResponse", - "type": "object" - }, - "routers__api__alerts__AlertListResponse": { - "description": "``GET /alerts`` \u2014 always the canonical ``{data, pagination}`` envelope.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/routers__api__alerts__AlertResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "AlertListResponse", - "type": "object" - }, - "routers__api__alerts__AlertResponse": { - "properties": { - "account_id": { - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "agent_run_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Run Id" - }, - "alert_config_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Alert Config Id" - }, - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "comment_count": { - "title": "Comment Count", - "type": "integer" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "details": { - "title": "Details" - }, - "id": { - "title": "Id", - "type": "string" - }, - "is_subscribed": { - "title": "Is Subscribed", - "type": "boolean" - }, - "mcp_client_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mcp Client Id" - }, - "source_connection_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Connection Id" - }, - "source_connection_pull_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Connection Pull Id" - }, - "status": { - "title": "Status", - "type": "string" - }, - "subscriber_count": { - "title": "Subscriber Count", - "type": "integer" - }, - "title": { - "title": "Title", - "type": "string" - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Updated At" - } - }, - "required": [ - "id", - "account_id", - "alert_config_id", - "alert_type", - "title", - "description", - "status", - "agent_id", - "agent_run_id", - "source_connection_id", - "source_connection_pull_id", - "mcp_client_id", - "subscriber_count", - "comment_count", - "is_subscribed", - "created_at", - "updated_at" - ], - "title": "AlertResponse", - "type": "object" - }, - "routers__api__alerts__AlertSubscriberResponse": { - "properties": { - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "id": { - "title": "Id", - "type": "string" - }, - "user_id": { - "title": "User Id", - "type": "string" - }, - "user_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "User Name" - } - }, - "required": [ - "id", - "user_id", - "user_name", - "created_at" - ], - "title": "AlertSubscriberResponse", - "type": "object" - }, - "routers__api__alerts__OrganizationAlertPreferenceResponse": { - "properties": { - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "is_override": { - "title": "Is Override", - "type": "boolean" - }, - "organization_id": { - "title": "Organization Id", - "type": "string" - }, - "subscribed": { - "title": "Subscribed", - "type": "boolean" - } - }, - "required": [ - "organization_id", - "alert_type", - "subscribed", - "is_override" - ], - "title": "OrganizationAlertPreferenceResponse", - "type": "object" - }, - "routers__api__alerts__UpdateOrganizationAlertPreferenceRequest": { - "properties": { - "subscribed": { - "description": "Whether the user should receive this alert for the organization", - "title": "Subscribed", - "type": "boolean" - } - }, - "required": [ - "subscribed" - ], - "title": "UpdateOrganizationAlertPreferenceRequest", - "type": "object" - }, - "routers__api__contents__ContentAttachmentDetailResponse": { - "description": "One attached file, with the text indexed from it.", - "properties": { - "content_type": { - "description": "MIME type of the attached file.", - "title": "Content Type", - "type": "string" - }, - "created_at": { - "description": "When the file was first attached.", - "title": "Created At", - "type": "string" - }, - "file_withheld": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Why the file's bytes are not served, or null when they are: `blocked_by_governance_policy`, `redacted_by_governance_policy` (any text below is the redacted text), or `pending_screening`.", - "title": "File Withheld" - }, - "id": { - "description": "The attachment's id, which the single-attachment endpoints take.", - "title": "Id", - "type": "string" - }, - "indexed": { - "description": "Whether indexing the file for search was asked for.", - "title": "Indexed", - "type": "boolean" - }, - "indexing_error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Why the file was not indexed, when `indexing_status` is `failed`.", - "title": "Indexing Error" - }, - "indexing_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "`pending`, `completed` or `failed`; null when indexing was not asked for. Search finds the file only when `completed`.", - "title": "Indexing Status" - }, - "key": { - "description": "The attachment's key, unique within the item.", - "title": "Key", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "description": "What is known about the file beyond its bytes. An image extracted from a PDF carries its `page_number`, and `page_render: true` when it is a render of the whole page. An image or video from a web page carries `source_url` (the address it was fetched from), `position` (its place among the media the page listed, from 0) and, when the page gave one, `alt_text`. Empty for most files. A retrieval metadata filter matches these keys, except `alt_text`, which is indexed as the attachment's text.", - "title": "Metadata", - "type": "object" - }, - "size_bytes": { - "description": "Size of the attached file in bytes.", - "title": "Size Bytes", - "type": "integer" - }, - "text_content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The requested range of the text the file is indexed by; null when the file has no completed index or was indexed without text.", - "title": "Text Content" - }, - "text_content_end": { - "title": "Text Content End", - "type": "integer" - }, - "text_content_start": { - "title": "Text Content Start", - "type": "integer" - }, - "text_content_total_length": { - "title": "Text Content Total Length", - "type": "integer" - }, - "updated_at": { - "description": "When the attachment last changed.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "key", - "content_type", - "size_bytes", - "indexed", - "indexing_status", - "indexing_error", - "created_at", - "updated_at", - "metadata", - "file_withheld", - "text_content", - "text_content_start", - "text_content_end", - "text_content_total_length" - ], - "title": "ContentAttachmentDetailResponse", - "type": "object" - }, - "routers__api__contents__ContentAttachmentsListResponse": { - "description": "Response model for a content item's attachments.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ContentAttachmentResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "ContentAttachmentsListResponse", - "type": "object" - }, - "routers__api__contents__ContentDetailResponse": { - "description": "Response model for content detail.", - "properties": { - "content_duration": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Duration of the content in seconds.", - "title": "Content Duration" - }, - "content_duration_display": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Display string for content duration.", - "title": "Content Duration Display" - }, - "content_status": { - "description": "Status of the content.", - "title": "Content Status", - "type": "string" - }, - "content_type": { - "description": "Type of the content.", - "title": "Content Type", - "type": "string" - }, - "content_type_display": { - "description": "Display name of the content type.", - "title": "Content Type Display", - "type": "string" - }, - "content_url": { - "description": "URL of the content.", - "title": "Content Url", - "type": "string" - }, - "content_word_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Word count of the content.", - "title": "Content Word Count" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Description of the content.", - "title": "Description" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message, if any.", - "title": "Error" - }, - "extracted_media_capped": { - "default": false, - "description": "True when extraction stopped with media still unread, so the item references more media than was attached and media search will not match anything past the cut. The cause is a web page that ran out of the budget for fetching remote assets or listed more media than is recorded, or a web page or document that could not be read to the end.", - "title": "Extracted Media Capped", - "type": "boolean" - }, - "extracted_media_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Number of images / videos in this web page's main content, or of images inside this PDF or Office document, that were attached to the item on this source; a file over the per-file size limit, listed as a failed attachment, is not counted. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container or this source's settings, or found nothing. Treat null as 'unknown', never as zero.", - "title": "Extracted Media Count" - }, - "extracted_media_limit": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "The bound that was reached, when extracted_media_capped is true and the stop was a bound \u2014 a number of fetch attempts, of seconds, of bytes, or of media listed. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired.", - "title": "Extracted Media Limit" - }, - "id": { - "description": "Unique identifier for the content version.", - "title": "Id", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Metadata associated with the content.", - "title": "Metadata" - }, - "published_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Timestamp when the content was published.", - "title": "Published At" - }, - "pulled_at": { - "description": "Timestamp when the content was pulled.", - "title": "Pulled At", - "type": "string" - }, - "skipped_attachments": { - "description": "Parts of an email delivered to an email content source that were not stored as attachments of this item, each with the reason: displayed_in_body (an image the message body shows, such as a signature logo), over_cap (beyond the per-message attachment limit), no_filename, or undecodable. size_bytes is null for a part that was never decoded. Empty for every other item.", - "items": { - "$ref": "#/components/schemas/SkippedAttachmentResponse" - }, - "title": "Skipped Attachments", - "type": "array" - }, - "source_connection_content_version_id": { - "description": "ID of the source connection content version.", - "title": "Source Connection Content Version Id", - "type": "string" - }, - "source_connection_id": { - "description": "ID of the source connection.", - "title": "Source Connection Id", - "type": "string" - }, - "source_name": { - "description": "Name of the source.", - "title": "Source Name", - "type": "string" - }, - "source_type": { - "description": "Type of the source.", - "title": "Source Type", - "type": "string" - }, - "text_content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Text content.", - "title": "Text Content" - }, - "text_content_end": { - "description": "End position of the text content.", - "title": "Text Content End", - "type": "integer" - }, - "text_content_start": { - "description": "Start position of the text content.", - "title": "Text Content Start", - "type": "integer" - }, - "text_content_total_length": { - "description": "Total length of the text content.", - "title": "Text Content Total Length", - "type": "integer" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title of the content.", - "title": "Title" - } - }, - "required": [ - "id", - "source_connection_content_version_id", - "source_connection_id", - "source_name", - "source_type", - "title", - "content_url", - "content_type", - "content_type_display", - "content_status", - "content_word_count", - "content_duration", - "content_duration_display", - "pulled_at", - "published_at", - "description", - "text_content", - "text_content_start", - "text_content_end", - "text_content_total_length", - "metadata", - "error" - ], - "title": "ContentDetailResponse", - "type": "object" - }, - "routers__api__contents__ContentEmbeddingsListResponse": { - "description": "Response model for paginated content embeddings.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ContentEmbeddingResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "ContentEmbeddingsListResponse", - "type": "object" - }, - "routers__api__contents__FileUploadResponse": { - "description": "Response model for content file replacement upload.", - "properties": { - "content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the newly created content version. A replacement creates a new version rather than overwriting the previous one.", - "title": "Content Version Id" - }, - "embedder_warning": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Set when the file's type is not embedded directly on this source, so indexing relies on extracted text. Content with none (e.g. a photograph) will be marked FAILED.", - "title": "Embedder Warning" - }, - "filename": { - "description": "Original filename", - "title": "Filename", - "type": "string" - }, - "source_connection_content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the source connection content version. Unchanged by a replacement, so it stays a stable handle for the content.", - "title": "Source Connection Content Version Id" - }, - "status": { - "description": "Always `uploaded`. Unlike the create endpoints, a replacement is never rejected as a duplicate of another item.", - "title": "Status", - "type": "string" - } - }, - "required": [ - "content_version_id", - "source_connection_content_version_id", - "filename", - "status" - ], - "title": "FileUploadResponse", - "type": "object" - }, - "routers__api__docs_search__DocsSearchResponse": { - "description": "Ranked results, NOT a paginated collection \u2014 the ``{results}`` shape is a\ndeliberate carve-out matching the MCP ``search_docs`` tool.", - "properties": { - "results": { - "items": { - "$ref": "#/components/schemas/DocsSearchResultResponse" - }, - "title": "Results", - "type": "array" - } - }, - "required": [ - "results" - ], - "title": "DocsSearchResponse", - "type": "object" - }, - "routers__api__governance__GovernanceAiAssistantRequest": { - "description": "Request body for the governance AI assistant.", - "properties": { - "user_input": { - "description": "Natural-language request for the governance AI assistant.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "GovernanceAiAssistantRequest", - "type": "object" - }, - "routers__api__governance__GovernanceConversationResponse": { - "description": "A governance AI assistant conversation entry.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "True if accepted, false if declined, null if pending.", - "title": "Accepted" - }, - "ai_response": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The AI assistant's response note, or null.", - "title": "Ai Response" - }, - "created_at": { - "description": "ISO 8601 creation timestamp.", - "title": "Created At", - "type": "string" - }, - "id": { - "description": "Conversation ID.", - "title": "Id", - "type": "string" - }, - "proposed_actions": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "JSON of proposed actions, or null.", - "title": "Proposed Actions" - }, - "user_input": { - "description": "The original user request.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "id", - "user_input", - "ai_response", - "proposed_actions", - "accepted", - "created_at" - ], - "title": "GovernanceConversationResponse", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankAcceptRequest": { - "description": "Accept or decline a memory bank AI suggestion.", - "properties": { - "accepted": { - "description": "Whether the user accepted the proposed configuration.", - "title": "Accepted", - "type": "boolean" - } - }, - "required": [ - "accepted" - ], - "title": "MemoryBankAcceptRequest", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankAiAssistantRequest": { - "description": "Request body for the memory bank AI assistant.", - "properties": { - "current_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Current configuration to refine, if any.", - "title": "Current Config" - }, - "history_since": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional ISO 8601 timestamp. When set, only conversation turns created at or after this timestamp are loaded as context, scoping history to the current session so the assistant remembers earlier turns in a multi-turn refinement.", - "title": "History Since" - }, - "user_input": { - "description": "Natural-language description of the memory bank.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "MemoryBankAiAssistantRequest", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankConversationTurnResponse": { - "description": "A single turn of memory bank AI assistant conversation.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the user accepted this proposal.", - "title": "Accepted" - }, - "ai_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI note from this turn.", - "title": "Ai Note" - }, - "conversation_id": { - "description": "Unique ID for this conversation turn.", - "title": "Conversation Id", - "type": "string" - }, - "resulting_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "The proposed configuration from this turn.", - "title": "Resulting Config" - }, - "user_input": { - "description": "User input for this turn.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input", - "conversation_id" - ], - "title": "MemoryBankConversationTurnResponse", - "type": "object" - }, - "routers__api__memory_banks__MemoryBankLastConversationResponse": { - "description": "Response for fetching memory bank conversation history.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the user accepted the last proposal.", - "title": "Accepted" - }, - "ai_note": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI note from the most recent turn.", - "title": "Ai Note" - }, - "total": { - "default": 0, - "description": "Total conversation turns.", - "title": "Total", - "type": "integer" - }, - "turns": { - "description": "Recent conversation turns (oldest first).", - "items": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankConversationTurnResponse" - }, - "title": "Turns", - "type": "array" - }, - "user_input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Most recent user input.", - "title": "User Input" - } - }, - "title": "MemoryBankLastConversationResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelAlertListResponse": { - "description": "``GET /models/alerts`` legacy/default shape; 2026-07-27+ clients get the\ncanonical ``{data, pagination}`` envelope (bypasses this ``response_model``).", - "properties": { - "alerts": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelAlertResponse" - }, - "title": "Alerts", - "type": "array" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "alerts", - "total" - ], - "title": "ModelAlertListResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelAlertResponse": { - "properties": { - "account_id": { - "title": "Account Id", - "type": "string" - }, - "agent_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Agent Id" - }, - "alert_type": { - "title": "Alert Type", - "type": "string" - }, - "created_at": { - "title": "Created At", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string" - }, - "message": { - "title": "Message", - "type": "string" - }, - "model_name": { - "title": "Model Name", - "type": "string" - }, - "prompt_model_id": { - "title": "Prompt Model Id", - "type": "string" - }, - "read_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Read At" - }, - "successor_model_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Successor Model Name" - } - }, - "required": [ - "id", - "account_id", - "agent_id", - "prompt_model_id", - "model_name", - "alert_type", - "message", - "read_at", - "successor_model_name", - "created_at" - ], - "title": "ModelAlertResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelRecommendationResponse": { - "properties": { - "deprecated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Deprecated At" - }, - "description": { - "title": "Description", - "type": "string" - }, - "effort_options": { - "anyOf": [ - { - "$ref": "#/components/schemas/EffortOptionsResponse" - }, - { - "type": "null" - } - ] - }, - "family": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Family" - }, - "family_generation": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Family Generation" - }, - "id": { - "title": "Id", - "type": "string" - }, - "max_context_tokens": { - "title": "Max Context Tokens", - "type": "integer" - }, - "max_output_tokens": { - "title": "Max Output Tokens", - "type": "integer" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "provider": { - "title": "Provider", - "type": "string" - }, - "reason": { - "title": "Reason", - "type": "string" - }, - "recommendation_type": { - "title": "Recommendation Type", - "type": "string" - }, - "released_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Released At" - }, - "sunset_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Sunset At" - }, - "supports_openai_arguments": { - "title": "Supports Openai Arguments", - "type": "boolean" - }, - "supports_streaming": { - "title": "Supports Streaming", - "type": "boolean" - }, - "supports_structured_output": { - "title": "Supports Structured Output", - "type": "boolean" - }, - "supports_thinking": { - "title": "Supports Thinking", - "type": "boolean" - }, - "supports_tool_use": { - "title": "Supports Tool Use", - "type": "boolean" - } - }, - "required": [ - "id", - "model_id", - "name", - "provider", - "description", - "max_context_tokens", - "max_output_tokens", - "supports_tool_use", - "supports_structured_output", - "supports_thinking", - "supports_openai_arguments", - "supports_streaming", - "recommendation_type", - "reason" - ], - "title": "ModelRecommendationResponse", - "type": "object" - }, - "routers__api__model_lifecycle__ModelRecommendationsResponse": { - "properties": { - "alternatives": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - "title": "Alternatives", - "type": "array" - }, - "current_model_id": { - "title": "Current Model Id", - "type": "string" - }, - "current_model_name": { - "title": "Current Model Name", - "type": "string" - }, - "same_provider": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - "title": "Same Provider", - "type": "array" - }, - "successor": { - "anyOf": [ - { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - { - "type": "null" - } - ] - }, - "upgrades": { - "items": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationResponse" - }, - "title": "Upgrades", - "type": "array" - } - }, - "required": [ - "current_model_id", - "current_model_name", - "upgrades", - "same_provider", - "alternatives" - ], - "title": "ModelRecommendationsResponse", - "type": "object" - }, - "routers__api__search__SearchResponse": { - "description": "Ranked results, NOT a paginated collection \u2014 the ``{results}`` shape is a\ndeliberate carve-out matching the MCP ``search_resources`` tool.", - "properties": { - "results": { - "items": { - "$ref": "#/components/schemas/routers__api__search__SearchResultResponse" - }, - "title": "Results", - "type": "array" - } - }, - "required": [ - "results" - ], - "title": "SearchResponse", - "type": "object" - }, - "routers__api__search__SearchResultResponse": { - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" - }, - "entity_type": { - "title": "Entity Type", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "entity_type", - "name", - "description" - ], - "title": "SearchResultResponse", - "type": "object" - }, - "routers__api__solutions__AiAssistantAcceptRequest": { - "description": "Request body for accepting a proposed plan.", - "properties": { - "confirm_deletions": { - "default": false, - "description": "Must be true when the plan contains destructive actions", - "title": "Confirm Deletions", - "type": "boolean" - }, - "solution_description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "When running in standalone mode (no pre-existing solution), provide a description for the auto-created solution.", - "title": "Solution Description" - }, - "solution_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "When running in standalone mode (no pre-existing solution), provide a name to auto-create a solution and link resources.", - "title": "Solution Name" - } - }, - "title": "AiAssistantAcceptRequest", - "type": "object" - }, - "routers__api__solutions__AiAssistantGenerateRequest": { - "description": "Request body for AI assistant generate endpoints.", - "properties": { - "history_since": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional ISO 8601 timestamp. When set, only conversation turns created at or after this timestamp are loaded as context, scoping history to the current session so the assistant remembers earlier turns in a create flow.", - "title": "History Since" - }, - "user_input": { - "description": "User input describing what to do", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "user_input" - ], - "title": "AiAssistantGenerateRequest", - "type": "object" - }, - "routers__api__solutions__SolutionAgentResponse": { - "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "knowledge_base_ids": { - "description": "Knowledge base IDs connected to this agent via triggers.", - "items": { - "format": "uuid", - "type": "string" - }, - "title": "Knowledge Base Ids", - "type": "array" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "title": "SolutionAgentResponse", - "type": "object" - }, - "routers__api__solutions__SolutionConversationResponse": { - "description": "Response model for a conversation turn.", - "properties": { - "accepted": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether the suggestion was accepted or declined.", - "title": "Accepted" - }, - "actions_taken": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Actions taken by the AI.", - "title": "Actions Taken" - }, - "ai_response": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "AI response text.", - "title": "Ai Response" - }, - "created_at": { - "description": "Timestamp when the conversation was created.", - "title": "Created At", - "type": "string" - }, - "id": { - "description": "Unique identifier for the conversation turn.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "user_input": { - "description": "User input text.", - "title": "User Input", - "type": "string" - } - }, - "required": [ - "id", - "user_input", - "ai_response", - "actions_taken", - "accepted", - "created_at" - ], - "title": "SolutionConversationResponse", - "type": "object" - }, - "routers__api__solutions__SolutionKnowledgeBaseResponse": { - "properties": { - "id": { - "format": "uuid", - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "source_connection_ids": { - "description": "Source connection IDs linked to this knowledge base.", - "items": { - "format": "uuid", - "type": "string" - }, - "title": "Source Connection Ids", - "type": "array" - } - }, - "required": [ - "id", - "name" - ], - "title": "SolutionKnowledgeBaseResponse", - "type": "object" - }, - "routers__api__solutions__SolutionListResponse": { - "description": "Response model for paginated solution list.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/SolutionSummaryResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "SolutionListResponse", - "type": "object" - }, - "routers__api__solutions__SolutionResponse": { - "description": "Response model for solution data.", - "properties": { - "agents": { - "description": "Agents linked to the solution.", - "items": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionAgentResponse" - }, - "title": "Agents", - "type": "array" - }, - "created_at": { - "description": "Timestamp when the solution was created.", - "title": "Created At", - "type": "string" - }, - "description": { - "description": "Description of the solution.", - "title": "Description", - "type": "string" - }, - "id": { - "description": "Unique identifier for the solution.", - "format": "uuid", - "title": "Id", - "type": "string" - }, - "knowledge_bases": { - "description": "Knowledge bases linked to the solution.", - "items": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionKnowledgeBaseResponse" - }, - "title": "Knowledge Bases", - "type": "array" - }, - "name": { - "description": "Name of the solution.", - "title": "Name", - "type": "string" - }, - "source_connections": { - "description": "Source connections linked to the solution.", - "items": { - "$ref": "#/components/schemas/SolutionSourceConnectionResponse" - }, - "title": "Source Connections", - "type": "array" - }, - "updated_at": { - "description": "Timestamp when the solution was last updated.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "name", - "description", - "agents", - "knowledge_bases", - "source_connections", - "created_at", - "updated_at" - ], - "title": "SolutionResponse", - "type": "object" - }, - "routers__api__source_exports__CreateExportRequest": { - "description": "Parameters for creating a new export job.", - "properties": { - "date_from": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or after this timestamp.", - "title": "Date From" - }, - "date_to": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or before this timestamp.", - "title": "Date To" - }, - "format": { - "$ref": "#/components/schemas/ExportFormat", - "description": "Output file format (jsonl, csv, parquet, zip)." - }, - "metadata_filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "JSONB containment filter applied to content metadata.", - "title": "Metadata Filter" - }, - "query_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title substring filter (case-insensitive ILIKE).", - "title": "Query Filter" - } - }, - "required": [ - "format" - ], - "title": "CreateExportRequest", - "type": "object" - }, - "routers__api__source_exports__EstimateExportRequest": { - "description": "Parameters for estimating export size.", - "properties": { - "date_from": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or after this timestamp.", - "title": "Date From" - }, - "date_to": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Only include content created on or before this timestamp.", - "title": "Date To" - }, - "format": { - "$ref": "#/components/schemas/ExportFormat", - "description": "Output file format." - }, - "metadata_filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "JSONB containment filter applied to content metadata.", - "title": "Metadata Filter" - }, - "query_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Title substring filter (case-insensitive ILIKE).", - "title": "Query Filter" - } - }, - "required": [ - "format" - ], - "title": "EstimateExportRequest", - "type": "object" - }, - "routers__api__source_exports__EstimateExportResponse": { - "description": "Rough size estimate for a potential export.", - "properties": { - "estimated_size_bytes": { - "description": "Estimated export file size in bytes.", - "title": "Estimated Size Bytes", - "type": "integer" - }, - "source_connection_id": { - "description": "Source connection ID.", - "title": "Source Connection Id", - "type": "string" - } - }, - "required": [ - "estimated_size_bytes", - "source_connection_id" - ], - "title": "EstimateExportResponse", - "type": "object" - }, - "routers__api__source_exports__ExportResponse": { - "description": "Status and metadata for a content source export job.", - "properties": { - "account_id": { - "description": "Owning account ID.", - "title": "Account Id", - "type": "string" - }, - "completed_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Completion time.", - "title": "Completed At" - }, - "created_at": { - "description": "Creation time.", - "title": "Created At", - "type": "string" - }, - "date_from": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Date-from filter applied to this export.", - "title": "Date From" - }, - "date_to": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Date-to filter applied to this export.", - "title": "Date To" - }, - "destination": { - "description": "Storage destination.", - "title": "Destination", - "type": "string" - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Error message if failed.", - "title": "Error" - }, - "estimated_size_bytes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Pre-run size estimate.", - "title": "Estimated Size Bytes" - }, - "expires_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Download expiry time.", - "title": "Expires At" - }, - "file_size_bytes": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "File size in bytes.", - "title": "File Size Bytes" - }, - "format": { - "description": "Output format.", - "title": "Format", - "type": "string" - }, - "id": { - "description": "Export job ID.", - "title": "Id", - "type": "string" - }, - "item_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Items exported.", - "title": "Item Count" - }, - "metadata_filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Metadata filter applied to this export.", - "title": "Metadata Filter" - }, - "progress_current": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Items processed so far.", - "title": "Progress Current" - }, - "progress_total": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Total items to process.", - "title": "Progress Total" - }, - "query_filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Query filter applied to this export.", - "title": "Query Filter" - }, - "requested_by_user_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the user who requested this export.", - "title": "Requested By User Id" - }, - "requested_by_user_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Name of the user who requested this export.", - "title": "Requested By User Name" - }, - "source_connection_id": { - "description": "Source connection ID.", - "title": "Source Connection Id", - "type": "string" - }, - "started_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Processing start time.", - "title": "Started At" - }, - "status": { - "description": "Job status.", - "title": "Status", - "type": "string" - }, - "storage_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "S3 key of exported file.", - "title": "Storage Key" - }, - "updated_at": { - "description": "Last update time.", - "title": "Updated At", - "type": "string" - } - }, - "required": [ - "id", - "source_connection_id", - "account_id", - "format", - "destination", - "status", - "created_at", - "updated_at" - ], - "title": "ExportResponse", - "type": "object" - }, - "routers__api__sources__FileUploadResponse": { - "description": "Response model for file upload", - "properties": { - "content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the created content version, and what the source content status endpoints take. Set when `status` is `uploaded`; `null` when `status` is `duplicate`, because no new version was created.", - "title": "Content Version Id" - }, - "embedder_warning": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Set when a file that is not text is indexed from its extracted text alone rather than embedded whole: the item is FAILED if no text can be extracted. Says so when the images inside a document are attached to the item and indexed as well.", - "title": "Embedder Warning" - }, - "filename": { - "description": "Original filename", - "title": "Filename", - "type": "string" - }, - "source_connection_content_version_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID of the existing, already-indexed item this file duplicates, and what `GET /contents/{id}` takes. Set only when `status` is `duplicate`; `null` on a new upload, which has no such id until it finishes indexing.", - "title": "Source Connection Content Version Id" - }, - "status": { - "description": "`uploaded` for a new item, or `duplicate` when this exact file is already on the source.", - "title": "Status", - "type": "string" - } - }, - "required": [ - "content_version_id", - "source_connection_content_version_id", - "filename", - "status" - ], - "title": "FileUploadResponse", - "type": "object" - }, - "routers__api__sources__SourceListResponse": { - "description": "Response model for paginated source list", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/SourceResponse" - }, - "title": "Data", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponse" - } - }, - "required": [ - "data", - "pagination" - ], - "title": "SourceListResponse", - "type": "object" - }, - "schemas__model_responses__PromptModelResponse": { - "description": "Response model for prompt model data", - "properties": { - "chat_capable": { - "default": true, - "description": "Whether this model can serve a chat request (`prompt_call`, `extract_data`). True for every plain text LLM, and for a dual-capability model that generates media AND holds a conversation; false for a dedicated generator (Imagen, Veo, a TTS voice), which bills per produced unit and has no chat interface. Authoritative: consumers must read this rather than inferring it from `generation_params` or `supported_output_media`, because the answer also depends on which inference interface serves the model \u2014 something no response field exposes.", - "title": "Chat Capable", - "type": "boolean" - }, - "default": { - "title": "Default", - "type": "boolean" - }, - "deprecated_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Deprecated At" - }, - "description": { - "title": "Description", - "type": "string" - }, - "effort_options": { - "anyOf": [ - { - "$ref": "#/components/schemas/EffortOptionsResponse" - }, - { - "type": "null" - } - ], - "description": "The reasoning-effort values a prompt_call or extract_data step may set as `effort` with this model. Null when the model takes none." - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "family": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Family" - }, - "family_generation": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Family Generation" - }, - "generation_credits_per_unit": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Per-unit credit cost for a dedicated media-generation model, in the unit named by ``generation_params.pricing_unit`` (per image / per second / per character / per output token). Multiply by the produced unit count (images, seconds, characters) for the run cost. None for models with no generation descriptor. This rate applies when the model is used in a generate_image/audio/video step; a model that also serves the chat path is billed per token there instead, using the input/output token rates on this same record. When `generation_params.price_varies_by` is set the model has one rate per value of that option and this is the **highest** of them \u2014 read `generation_credits_per_variant` for the real spread rather than presenting this as the price.", - "title": "Generation Credits Per Unit" - }, - "generation_credits_per_variant": { - "anyOf": [ - { - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Per-unit credit cost keyed by the value of the option named in `generation_params.price_varies_by` (e.g. `{'720p': 1330, '1080p': 1995}`). None for a model with a single rate, where `generation_credits_per_unit` already describes it exactly.", - "title": "Generation Credits Per Variant" - }, - "generation_params": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Media-generation descriptor (modality, pricing_unit, and modality-specific constraints). NULL for text LLMs; present for image/audio/video generation models. See schemas.generation_params. A present descriptor does NOT imply the model is generation-only: some models serve both paths (they generate media AND hold a chat conversation). Read `chat_capable` to tell whether a model with a descriptor can also be used as a chat model \u2014 do not branch on this field being non-null alone, and do not re-derive the answer from `supported_output_media`.", - "title": "Generation Params" - }, - "generation_unit_label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human suffix for the per-unit generation rate (e.g. ``/image``, ``/second``, ``/1k chars``, ``/1k tokens``) \u2014 single-sourced from the pricing unit so clients render cost without re-deriving the mapping. None for non-generation models. Char/token rates are shown per 1,000 (the ``/1k \u2026`` suffix), so scale ``generation_credits_per_unit`` accordingly for those units.", - "title": "Generation Unit Label" - }, - "id": { - "title": "Id", - "type": "string" - }, - "image_generation_tool_credits_per_image": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Per-image credit cost of using the built-in image_generation tool (it runs gpt-image-1). Set only for models that actually support the tool (tool-use capable); None otherwise.", - "title": "Image Generation Tool Credits Per Image" - }, - "input_1h_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 1-hour prompt cache.", - "title": "Input 1H Cache Write Credits Per 1000 Tokens" - }, - "input_30m_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 30-minute prompt cache.", - "title": "Input 30M Cache Write Credits Per 1000 Tokens" - }, - "input_5m_cache_write_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens written to a 5-minute prompt cache.", - "title": "Input 5M Cache Write Credits Per 1000 Tokens" - }, - "input_cache_hit_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "Credits per 1,000 input tokens read from a prompt cache.", - "title": "Input Cache Hit Credits Per 1000 Tokens" - }, - "input_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Input Credits Per 1000 Tokens" - }, - "is_new": { - "default": false, - "title": "Is New", - "type": "boolean" - }, - "last_used": { - "default": false, - "title": "Last Used", - "type": "boolean" - }, - "max_context_tokens": { - "title": "Max Context Tokens", - "type": "integer" - }, - "max_conversation_length": { - "title": "Max Conversation Length", - "type": "integer" - }, - "max_output_tokens": { - "title": "Max Output Tokens", - "type": "integer" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "output_credits_per_1000_tokens": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Output Credits Per 1000 Tokens" - }, - "payload_schema": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "Model-specific JSON schema for advanced prompt_call json_template payloads.", - "title": "Payload Schema" - }, - "payload_schema_source_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Source URL used to derive payload_schema guidance for this model.", - "title": "Payload Schema Source Url" - }, - "per_modality_rates": { - "items": { - "$ref": "#/components/schemas/ModalityRateResponse" - }, - "title": "Per Modality Rates", - "type": "array" - }, - "provider": { - "title": "Provider", - "type": "string" - }, - "released_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Released At" - }, - "schema_documentation_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Model documentation URL with request/response payload details.", - "title": "Schema Documentation Url" - }, - "schema_notes": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Human-readable notes about request payload compatibility.", - "title": "Schema Notes" - }, - "successor_model_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Successor Model Id" - }, - "sunset_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Sunset At" - }, - "supported_input_media": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Supported Input Media" - }, - "supported_languages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Supported Languages" - }, - "supported_output_media": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Supported Output Media" - }, - "supports_openai_arguments": { - "default": false, - "title": "Supports Openai Arguments", - "type": "boolean" - }, - "supports_streaming": { - "default": false, - "title": "Supports Streaming", - "type": "boolean" - }, - "supports_structured_output": { - "default": true, - "title": "Supports Structured Output", - "type": "boolean" - }, - "supports_thinking": { - "default": false, - "title": "Supports Thinking", - "type": "boolean" - }, - "supports_tool_use": { - "default": true, - "title": "Supports Tool Use", - "type": "boolean" - }, - "tools_disabled": { - "items": { - "$ref": "#/components/schemas/PromptToolResponse" - }, - "title": "Tools Disabled", - "type": "array" - }, - "tools_enabled": { - "items": { - "$ref": "#/components/schemas/PromptToolResponse" - }, - "title": "Tools Enabled", - "type": "array" - }, - "training_cutoff_at": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Training Cutoff At" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Url" - }, - "variants": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/VariantCategoryResponse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Variants" - } - }, - "required": [ - "id", - "model_id", - "name", - "description", - "enabled", - "default", - "provider", - "max_context_tokens", - "max_output_tokens", - "max_conversation_length" - ], - "title": "PromptModelResponse", - "type": "object" - }, - "schemas__model_responses__ProviderGroupResponse": { - "description": "Response model for provider group with models", - "properties": { - "models": { - "items": { - "$ref": "#/components/schemas/schemas__model_responses__PromptModelResponse" - }, - "title": "Models", - "type": "array" - }, - "provider": { - "title": "Provider", - "type": "string" - } - }, - "required": [ - "provider", - "models" - ], - "title": "ProviderGroupResponse", - "type": "object" - }, - "schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse": { - "description": "Per-mode rollup for evaluation activity.", - "properties": { - "error": { - "description": "Results whose evaluator returned no verdict.", - "title": "Error", - "type": "integer" - }, - "failed": { - "title": "Failed", - "type": "integer" - }, - "failure_rate": { - "title": "Failure Rate", - "type": "number" - }, - "flagged": { - "title": "Flagged", - "type": "integer" - }, - "mode": { - "title": "Mode", - "type": "string" - }, - "pass_rate": { - "title": "Pass Rate", - "type": "number" - }, - "passed": { - "title": "Passed", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "mode", - "total", - "passed", - "failed", - "error", - "flagged", - "pass_rate", - "failure_rate" - ], - "title": "NonManualEvaluationModeStatResponse", - "type": "object" - }, - "schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse": { - "description": "Account-level summary for evaluations.", - "properties": { - "by_mode": { - "items": { - "$ref": "#/components/schemas/schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse" - }, - "title": "By Mode", - "type": "array" - }, - "error": { - "description": "Results whose evaluator returned no verdict.", - "title": "Error", - "type": "integer" - }, - "failed": { - "title": "Failed", - "type": "integer" - }, - "failure_rate": { - "title": "Failure Rate", - "type": "number" - }, - "flagged": { - "title": "Flagged", - "type": "integer" - }, - "pass_rate": { - "title": "Pass Rate", - "type": "number" - }, - "passed": { - "title": "Passed", - "type": "integer" - }, - "total": { - "title": "Total", - "type": "integer" - } - }, - "required": [ - "total", - "passed", - "failed", - "error", - "flagged", - "pass_rate", - "failure_rate", - "by_mode" - ], - "title": "NonManualEvaluationSummaryResponse", - "type": "object" - } - }, - "securitySchemes": { - "ApiKeyAuth": { - "description": "API key issued from the Seclai dashboard.", - "in": "header", - "name": "X-API-Key", - "type": "apiKey" - }, - "BearerAuth": { - "bearerFormat": "JWT", - "description": "OAuth2 access token from AWS Cognito.", - "scheme": "bearer", - "type": "http" - } - } - }, - "info": { - "description": "Main API service for Seclai", - "title": "Seclai API", - "version": "local" - }, - "openapi": "3.1.0", - "paths": { - "/agents": { - "get": { - "description": "List agents for the account with pagination.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "list_agents_api_agents_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List agents", - "tags": [ - "agents" - ] - }, - "post": { - "description": "Create a new agent.\n\nTrigger types:\n- `dynamic_input`: triggered via API with user-provided input\n- `template_input`: triggered via API with a predefined template\n- `schedule`: triggered on a schedule\n- `new_content`: triggered when new content arrives\n- `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`, using the `trigger_id` this response returns.\n\nTemplates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline`\n\nImporting an existing agent:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; items that don't resolve in this account are reported in the response's `import_warnings` array.\n- Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: target_uuid}` on this call to substitute them before save.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account.", - "operationId": "create_agent_api_agents_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__CreateAgentRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "Plan limit exceeded \u2014 the account has reached the maximum number of agents allowed by its subscription plan." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" - } - } - }, - "description": "The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`)." - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create an agent", - "tags": [ - "agents" - ] - } - }, - "/agents/agent-email-optouts": { - "get": { - "description": "List recipients who have opted out of this account's agent emails (filter to one agent via `agent_id`; account-wide opt-outs always apply). Paginated via `limit`/`offset`; returns the page plus the `total` count.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "list_agent_email_optouts_api_api_agents_agent_email_optouts_get", - "parameters": [ - { - "description": "Filter to one agent (account-wide opt-outs still apply)", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to one agent (account-wide opt-outs still apply)", - "title": "Agent Id" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentEmailOptOutListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List agent-email opt-outs", - "tags": [ - "agents" - ] - } - }, - "/agents/agent-email-optouts/{optout_id}": { - "delete": { - "description": "Revoke an opt-out (opt the recipient back in to agent emails).\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the opt-out must belong to the key's account.", - "operationId": "remove_agent_email_optout_api_api_agents_agent_email_optouts__optout_id__delete", - "parameters": [ - { - "in": "path", - "name": "optout_id", - "required": true, - "schema": { - "title": "Optout Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Revoke an agent-email opt-out", - "tags": [ - "agents" - ] - } - }, - "/agents/blocked-email-senders": { - "get": { - "description": "List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus the governance `auto_block_mode`.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "list_blocked_email_senders_api_api_agents_blocked_email_senders_get", - "parameters": [ - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List blocked inbound email senders + the auto-block mode", - "tags": [ - "agents" - ] - }, - "post": { - "description": "Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is `address` (default) or `domain`).\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "block_email_sender_api_api_agents_blocked_email_senders_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockEmailSenderRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Block an inbound email sender or domain", - "tags": [ - "agents" - ] - } - }, - "/agents/blocked-email-senders/mode": { - "put": { - "description": "Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the blocklist (`disabled`, `input`, or `input_and_output`); returns the updated list.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SetAutoBlockModeRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BlockedEmailSenderListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Set the governance auto-block mode", - "tags": [ - "agents" - ] - } - }, - "/agents/blocked-email-senders/{blocked_id}": { - "delete": { - "description": "Remove a blocked sender by id.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; the blocked sender must belong to the key's account.", - "operationId": "unblock_email_sender_api_api_agents_blocked_email_senders__blocked_id__delete", - "parameters": [ - { - "in": "path", - "name": "blocked_id", - "required": true, - "schema": { - "title": "Blocked Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Unblock an inbound email sender", - "tags": [ - "agents" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}": { - "delete": { - "description": "Delete an evaluation criteria and all associated evaluation results.\n\nThis action is permanent and cannot be undone. All historical result\nrecords tied to the criteria are removed as well.", - "operationId": "delete_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__delete", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - }, - "get": { - "description": "Get a single evaluation criteria by ID.\n\nReturns the full criteria configuration including type-specific fields,\ncurrent enabled state, and a summary of recent evaluation results.", - "operationId": "get_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - }, - "patch": { - "description": "Update an evaluation criteria.\n\nAccepts a partial update \u2013 only the fields included in the request body\nare modified. Use this to toggle enabled/disabled, change the\nevaluation prompt, adjust retries, or rename the criteria.", - "operationId": "update_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__patch", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateEvaluationCriteriaRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}/compatible-runs": { - "get": { - "description": "List agent runs that have a completed step matching the criteria's target step.\n\nReturns runs whose step output can be used for testing or replaying the\nevaluation criteria. Results are ordered newest-first and paginated.", - "operationId": "list_compatible_runs_api_agents_evaluation_criteria__criteria_id__compatible_runs_get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "in": "query", - "name": "started_after", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Started After" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompatibleRunListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Compatible Runs", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}/results": { - "get": { - "description": "List evaluation results for a criteria with optional filtering.\n\nSupports filtering by status (pending, passed, failed, skipped, error),\nflagged-only mode, and an optional time range. Results are paginated\nwith configurable page size.", - "operationId": "list_evaluation_results_api_agents_evaluation_criteria__criteria_id__results_get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status" - } - }, - { - "in": "query", - "name": "flagged_only", - "required": false, - "schema": { - "default": false, - "title": "Flagged Only", - "type": "boolean" - } - }, - { - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time From" - } - }, - { - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time To" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Evaluation Results", - "tags": [ - "agent-evaluations" - ] - }, - "post": { - "description": "Record an evaluation result for a criteria.\n\nUse this endpoint to push results from external test harnesses, CI/CD\npipelines, or custom evaluation logic. Each result is linked to an\nagent run and optionally a specific step run.", - "operationId": "create_evaluation_result_api_agents_evaluation_criteria__criteria_id__results_post", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateEvaluationResultRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Evaluation Result", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-criteria/{criteria_id}/summary": { - "get": { - "description": "Get an aggregated summary of evaluation results for a criteria.\n\nReturns total, passed, failed, error, and flagged counts alongside the\naverage score, giving a quick overview of how the criteria is performing.\nWith ``2026-10-21`` or later, ``average_score`` averages only passed and failed\nresults; earlier versions average every stored score, ``error`` included.", - "operationId": "get_evaluation_summary_api_agents_evaluation_criteria__criteria_id__summary_get", - "parameters": [ - { - "in": "path", - "name": "criteria_id", - "required": true, - "schema": { - "title": "Criteria Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Evaluation Summary", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/evaluation-results/non-manual-summary": { - "get": { - "description": "Get an evaluation summary for API key clients.\n\nReturns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag).\n\nWith ``2026-10-21`` or later, ``error`` results (the evaluator returned no\nverdict) are left out of ``failed``, and the rates are over passed and\nfailed results. Earlier versions count them in ``failed`` and rate over\nevery result. ``error`` is returned on every version.\n\nThe ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset\n(opt in via the ``Seclai-Version`` header). Clients on the legacy baseline\nalways receive the account-wide rollup; ``agent_id`` is ignored for them so\nthe endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary\nis scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist).", - "operationId": "get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get", - "parameters": [ - { - "description": "Scope the summary to a single agent. Omit for account-wide.", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Scope the summary to a single agent. Omit for account-wide.", - "title": "Agent Id" - } - }, - { - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "maximum": 730, - "minimum": 1, - "title": "Days", - "type": "integer" - } - }, - { - "in": "query", - "name": "start_date", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Start Date" - } - }, - { - "in": "query", - "name": "end_date", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "End Date" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Non Manual Evaluation Summary", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/inbound-email-rejections": { - "get": { - "description": "List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, unknown alias, spam/virus, flood-shed) for this account's agents.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get", - "parameters": [ - { - "description": "Filter to a single agent's rejections", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to a single agent's rejections", - "title": "Agent Id" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/InboundEmailRejectionResponse" - }, - "title": "Response List Inbound Email Rejections Api Api Agents Inbound Email Rejections Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List discarded inbound emails", - "tags": [ - "agents" - ] - } - }, - "/agents/inbound-email-status": { - "get": { - "description": "Whether the account-wide overload circuit breaker has currently paused new inbound email (all inbound turned away until the queued backlog drains), plus the size of the QUEUED (over-quota parked) run backlog.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account.", - "operationId": "get_inbound_email_status_api_api_agents_inbound_email_status_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InboundEmailStatusResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Account inbound-email overload status", - "tags": [ - "agents" - ] - } - }, - "/agents/inbound-email-status/cancel-queued": { - "post": { - "description": "Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run has consumed no quota, so this merely fails them. Returns the count cancelled.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CancelQueuedRunsResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Cancel all queued inbound-email runs", - "tags": [ - "agents" - ] - } - }, - "/agents/inbound-email-status/resume": { - "post": { - "description": "Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the breaker re-arms on the next evaluation \u2014 this is a one-shot override, not a permanent disable.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account.", - "operationId": "resume_inbound_email_api_api_agents_inbound_email_status_resume_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResumeInboundResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Manually resume paused inbound email", - "tags": [ - "agents" - ] - } - }, - "/agents/preview-import": { - "post": { - "description": "Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) without creating or modifying any agent. On success returns a summary the client can show before commit (counts of steps, schedules, alert configs, evaluation criteria, governance policies). On failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can render line/column-anchored errors.\n\nCoverage: everything decidable from the payload itself \u2014 schema, step ids, nesting depth, text lengths, attachment references, prompt-tool declarations, step-graph cycles, racing step references, and `for_each` aggregation. Rules that depend on account state (email recipients, memory-bank types, cloud-drive connections, the agent's own trigger) can only run at save time, so `POST /agents` may still reject a payload this endpoint accepts.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. No DB writes.", - "operationId": "preview_import_agent_api_agents_preview_import_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentImportPreviewRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentImportPreviewResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" - } - } - }, - "description": "The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`)." - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Preview an agent_definition import", - "tags": [ - "agents" - ] - } - }, - "/agents/runs/search": { - "post": { - "description": "Search agent traces using semantic similarity.\n\nFinds step-run outputs that are most semantically similar to the query.\nResults include the matching text, agent/step metadata, and a similarity score.\n\nAgent traces are automatically indexed when runs complete. The first 7 days of storage are free; extended retention is billed.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Searches only within your account's traces.", - "operationId": "search_agent_runs_api_agents_runs_search_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentTraceSearchRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentTraceSearchResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Search agent traces", - "tags": [ - "agents" - ] - } - }, - "/agents/runs/{run_id}": { - "delete": { - "description": "Cancel an in-flight (`processing`) or queued (`queued`) agent run.\n\nA `queued` run is an inbound-email run parked by the per-plan rate quota that has not yet been dispatched; it has consumed no quota.\n\nIf the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only cancel runs belonging to your account.", - "operationId": "delete_agent_run_api_agents_runs__run_id__delete", - "parameters": [ - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "title": "Run Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Cancel an agent run", - "tags": [ - "agents" - ] - }, - "get": { - "description": "Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST /agents/{agent_id}/runs/stream`.\n\nThe response includes `status`, `error_count`, and `output` once the run completes. Use `include_step_outputs=true` to include per-step outputs, timing, durations, and credits.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access runs belonging to your account.", - "operationId": "get_agent_run_api_agents_runs__run_id__get", - "parameters": [ - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "title": "Run Id", - "type": "string" - } - }, - { - "description": "If true, include per-step outputs with timing, durations, and credits.", - "in": "query", - "name": "include_step_outputs", - "required": false, - "schema": { - "default": false, - "description": "If true, include per-step outputs with timing, durations, and credits.", - "title": "Include Step Outputs", - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get an agent run", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}": { - "delete": { - "description": "Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only delete agents belonging to your account.", - "operationId": "delete_agent_api_agents__agent_id__delete", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete an agent", - "tags": [ - "agents" - ] - }, - "get": { - "description": "Fetch an agent's metadata (name, description, trigger type, timestamps).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account.", - "operationId": "get_agent_metadata_api_agents__agent_id__get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get an agent", - "tags": [ - "agents" - ] - }, - "put": { - "description": "Update an agent's name, description, evaluation settings, and model lifecycle settings.\n\nEvaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, `sampling_config`.\n\nModel lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', 'governance_block', 'agent_run_failed').\n\nReplacing the workflow from an export:\n- Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only touches the workflow + agent metadata \u2014 alert_configs, evaluation_criteria, governance_policies, schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints for those, or `POST /agents` to import as a new agent).\n- `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same shape as `POST /agents`).\n\nAt least one field must be provided.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account.", - "operationId": "update_agent_api_agents__agent_id__put", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__UpdateAgentRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionImportErrorResponse" - } - } - }, - "description": "The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`)." - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update agent metadata", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/conversations": { - "get": { - "description": "Fetch the AI assistant conversation history for a specific step of an agent.\n\nReturns past conversation turns (user inputs, AI responses, accept/decline status) ordered oldest first. Use `step_type` to filter by step type, and optionally `step_id` to narrow to a specific step instance.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be queried.", - "operationId": "get_ai_conversation_history_api_agents__agent_id__ai_assistant_conversations_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "description": "Step type to look up.", - "in": "query", - "name": "step_type", - "required": true, - "schema": { - "description": "Step type to look up.", - "title": "Step Type", - "type": "string" - } - }, - { - "description": "Step ID to filter by.", - "in": "query", - "name": "step_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Step ID to filter by.", - "title": "Step Id" - } - }, - { - "description": "Max turns to return.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 10, - "description": "Max turns to return.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Number of recent turns to skip.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Number of recent turns to skip.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiConversationHistoryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get AI conversation history", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/generate-steps": { - "post": { - "description": "Use the AI assistant to generate a full agent step workflow from a natural language description.\n\nProvide a description of what the agent should do, along with optional context (current steps, trigger type). The AI produces a complete set of agent steps.\nUse mode 'generate_full' for new workflows or 'modify_workflow' to refine existing ones.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used.", - "operationId": "generate_agent_steps_api_agents__agent_id__ai_assistant_generate_steps_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateAgentStepsRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateAgentStepsResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate agent workflow", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/step-config": { - "post": { - "description": "Use the AI assistant to generate or refine a single step's configuration.\n\nProvide the step type, a natural language instruction, and optionally the current configuration. The AI will produce a proposed configuration along with an explanation. The suggestion is stored as a conversation turn that can be accepted or declined separately via the mark endpoint.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used.", - "operationId": "generate_step_config_api_agents__agent_id__ai_assistant_step_config_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateStepConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateStepConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate step configuration", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/ai-assistant/{conversation_id}": { - "patch": { - "description": "Accept or decline a proposed AI assistant configuration for a conversation turn.\n\nThis only updates the tracking status on the conversation record. To actually apply the proposed configuration, use the agent definition update endpoint separately.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The conversation must belong to one of your agents.", - "operationId": "mark_ai_suggestion_api_agents__agent_id__ai_assistant__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MarkAiSuggestionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept or decline suggestion", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/attachment-references": { - "get": { - "description": "Return the input attachments the agent's dynamic_input trigger declares \u2014 the files a run may carry.\n\nCall this BEFORE staging uploads so you know whether the agent accepts files at all (``requires_uploads``), and which attachments its trigger declares (``accepted_attachments``). Batches that do not fit them are rejected at run time with HTTP 400.", - "operationId": "api_get_agent_attachment_references_api_agents__agent_id__attachment_references_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentAttachmentRefsApiResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get agent attachment-reference contract", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/callers": { - "get": { - "description": "List the live agents that call this agent via a `call_agent` step. They must be disabled before this agent can be paused.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the agent must belong to the key's account.", - "operationId": "get_agent_callers_api_api_agents__agent_id__callers_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/AgentCallerApiResponse" - }, - "title": "Response Get Agent Callers Api Api Agents Agent Id Callers Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List agents that call this agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/definition": { - "get": { - "description": "Fetch the current agent definition from the main branch.\n\nThe response includes `change_id` which must be provided when updating the definition (optimistic locking).\n\nThe definition contains the agent's step workflow. Available step types:\n- `prompt_call`: Call an LLM with a prompt template\n- `retrieval`: Search a knowledge base\n- `regex_replace`: Reshape text via ordered regex find/replace rules\n- `gate`: Evaluate conditions, stop or continue child execution\n- `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1\u201310))\n- `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional `evaluation_tier`, optional `expectation_config`)\n- `extract_data`: Progressively read and analyze large input\n- `extract_content`: Extract structured data (JSON, HTML, XML)\n- `add_chat_turn` / `load_chat_history`: Record a turn or load running history from a conversation memory bank\n- `add_memory` / `search_memory` / `load_memory`: Write, semantic-search, or load entries on a general memory bank\n- `send_email`: Send email with step output\n- `webhook_call`: POST data to an external URL\n- `write_aws_s3_object`: Write output to S3\n- `call_agent`: Invoke another agent\n- `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents only. Fields: `metadata_key`, `content`)\n- `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, `indexed`)\n- `load_content_attachment`: Load a previously written attachment (content-triggered agents only. Fields: `attachment_key`)\n- `load_content`: Load the full text body of a source document (typically used with content-triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` optional)\n- `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of `prompt_call`; requires `dynamic_input` or `template_input` trigger; `priority: true` enables real-time streaming). To stream **and** return a schema-validated payload, add a sibling branch `extract_content` (`expected_format: \"json\"` + `json_schema`) \u2192 `display_result` under the same `prompt_call` \u2014 a `display_result` takes precedence over the stream regardless of which finishes first, so its validated output becomes the run's result while the tokens act as a progress channel\n- `display_result`: Show output to the user\n- `join`: Merge parallel branches\n- `merge`: Combine multiple inputs into a single templated output\n- `text`: Static text literal\n- `for_each`: Iterate a body over a list of items (body lives in `body[]`)\n- `if_else`: Conditional dispatch. Evaluates `conditions` (same shape as `gate`) and runs `then_steps` on match, otherwise the optional `else_steps`. The chosen branch's output flows to the if_else step's own `child_steps` (post-branch continuation chain). **`display_result` and `streaming_result` are not allowed inside `then_steps` / `else_steps`** \u2014 end each branch with a content-producing step (e.g. `text`, `prompt_call`) and place the single `display_result` in `child_steps`.\n- `switch`: Single-discriminator dispatch. Renders `discriminator` (default `{{input}}`) and routes to the first matching `cases[]` entry (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when nothing matches. The chosen case's output flows to the switch step's own `child_steps`. **`display_result` and `streaming_result` are not allowed inside `cases[].steps` or `else_steps`** \u2014 end each case with a content-producing step and place the single `display_result` in `child_steps`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account.", - "operationId": "get_agent_definition_api_agents__agent_id__definition_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get agent definition", - "tags": [ - "agents" - ] - }, - "put": { - "description": "Update the agent's definition on the main branch.\n\nUses **optimistic locking**: provide `expected_change_id` from the last `GET /agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your last read.\n\nThe definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, `regex_replace`, `gate`, `retry`, `evaluate_step`, `extract_data`, `extract_content`, `add_chat_turn`, `load_chat_history`, `add_memory`, `search_memory`, `load_memory`, `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, `display_result`, `join`, `merge`, `text`, `for_each`, `if_else`, and `switch`. Non-composite step types (`display_result`, `join`, `retry`, `streaming_result`) cannot contain child steps.\n\n**Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with `target_step_id` (ancestor step ID) and `max_retries` (1\u201310). Best practice: place a `gate` step before the retry to make retries conditional.\n\n**if_else** runs `then_steps` when its `conditions` (same shape as `gate`) match, otherwise its optional `else_steps`. Either branch's output flows to the if_else step's own `child_steps` (the post-branch continuation chain).\n\n**switch** dispatches on a `discriminator` template (default `{{input}}`) to the first matching case (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when no case matches. Cases own their own `steps` subtrees; the chosen branch's output flows to the switch step's own `child_steps`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account.", - "operationId": "update_agent_definition_api_agents__agent_id__definition_put", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateAgentDefinitionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentDefinitionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update agent definition", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/disable": { - "post": { - "description": "Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is turned away, scheduled/content triggers are skipped).\n\nReturns **409** with the blocking callers when other live agents still call this one via a `call_agent` step \u2014 disable those first.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user is recorded); the agent must belong to the key's account.", - "operationId": "disable_agent_api_api_agents__agent_id__disable_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Pause (disable) an agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/enable": { - "post": { - "description": "Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by the inbound-email overload safeguard).\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user is recorded); the agent must belong to the key's account.", - "operationId": "enable_agent_api_api_agents__agent_id__enable_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Resume (enable) a paused agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/evaluation-criteria": { - "get": { - "description": "List evaluation criteria configured for an agent.\n\nResponse shape is version-gated by the ``Seclai-Version`` header:\n\n- **Default / legacy** (no header, or a date before ``2026-07-27``): a bare\n JSON array of criteria (unpaginated \u2014 every criterion for the agent).\n- **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated\n envelope ``{data, pagination: {page, limit, total, pages, has_next,\n has_prev}}``.\n\nEach criterion carries its type, configuration, and a summary of results\n(pass / fail counts). Criteria can be filtered client-side by type or\nenabled status.", - "operationId": "list_evaluation_criteria_api_agents__agent_id__evaluation_criteria_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - }, - "title": "Response List Evaluation Criteria Api Agents Agent Id Evaluation Criteria Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - }, - "post": { - "description": "Create new step evaluation settings for an agent.\n\nThe evaluation mode, retry settings, and sample frequency are inherited\nfrom the agent and stored on the criteria row for historical reference.", - "operationId": "create_evaluation_criteria_api_agents__agent_id__evaluation_criteria_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateEvaluationCriteriaRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationCriteriaResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Evaluation Criteria", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/evaluation-criteria/test-draft": { - "post": { - "description": "Run an ephemeral evaluation against provided step output without persisting results.\n\nUse this to interactively test evaluation prompts and expectation\nconfigurations while editing criteria. The evaluation is a billed LLM\ncall; only its result goes unrecorded.\n\n``status`` is ``error`` when the evaluator returned no verdict. With\n``Seclai-Version: 2026-10-21`` or later, ``score`` and ``passed`` are then\n``null``; earlier versions return ``score`` 0.5 and ``passed`` false.", - "operationId": "test_draft_evaluation_api_agents__agent_id__evaluation_criteria_test_draft_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestDraftEvaluationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestDraftEvaluationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Test Draft Evaluation", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/evaluation-results": { - "get": { - "description": "List evaluation results across all criteria configured on an agent.\n\nReturns a paginated list of evaluation results with optional filtering by status, criteria, and date range. Results include score, pass/fail status, and details.", - "operationId": "list_agent_evaluation_results_api_agents__agent_id__evaluation_results_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status" - } - }, - { - "in": "query", - "name": "step", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step" - } - }, - { - "in": "query", - "name": "flagged_only", - "required": false, - "schema": { - "default": false, - "title": "Flagged Only", - "type": "boolean" - } - }, - { - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time From" - } - }, - { - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time To" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Agent Evaluation Results", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/evaluation-runs": { - "get": { - "description": "List evaluation results grouped by agent run.\n\nReturns paginated per-run summaries with pass/fail counts and optional\nfiltering by evaluation outcome, step, or date range.", - "operationId": "list_evaluation_runs_api_agents__agent_id__evaluation_runs_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status" - } - }, - { - "in": "query", - "name": "step", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Step" - } - }, - { - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time From" - } - }, - { - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Time To" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluationRunSummaryListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Evaluation Runs", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/export": { - "get": { - "description": "Export an agent definition as a portable JSON snapshot.\n\nThe response contains the full definition, trigger configuration with schedules, alert configs, evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps every referenced external entity UUID to its human-readable name.\n\nResponse shape:\n- `export_version`: schema version (currently `\"5\"`)\n- `exported_at`: ISO-8601 timestamp\n- `agent`: name, description, schema_version, definition, timestamps\n- `trigger`: trigger type, input template, schedules\n- `alert_configs`: alert type, thresholds, recipients\n- `evaluation_criteria`: evaluation settings per step\n- `governance_policies`: agent-scoped governance policies\n- `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users\n\nQuery params:\n- `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the response as a file download.\n\nAuth & scoping:\n- Requires `X-API-Key`. You can only export agents belonging to your account.", - "operationId": "export_agent_api_agents__agent_id__export_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "description": "Return as file download", - "in": "query", - "name": "download", - "required": false, - "schema": { - "default": true, - "description": "Return as file download", - "title": "Download", - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Export agent definition", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/input-uploads/{upload_id}": { - "get": { - "description": "Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`.\n\nPossible `status` values: `processing`, `ready`, `failed`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "api_get_agent_input_upload_status_api_agents__agent_id__input_uploads__upload_id__get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "upload_id", - "required": true, - "schema": { - "title": "Upload Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UploadAgentInputApiResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get upload status", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/runs": { - "get": { - "description": "List runs for a specific agent (most recent first), with pagination.\n\nTypical use cases:\n- Build a traces UI for an agent.\n- Debug recent executions and inspect terminal statuses.\n\nNotes:\n- This endpoint returns a summary list. Fetch full details with `GET /agents/runs/{run_id}`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only list runs for agents in your account.", - "operationId": "list_agent_runs_api_agents__agent_id__runs_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Filter runs by status", - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/PendingProcessingCompletedFailedStatus" - }, - { - "type": "null" - } - ], - "description": "Filter runs by status", - "title": "Status" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__AgentRunListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List agent runs", - "tags": [ - "agents" - ] - }, - "post": { - "description": "Start an agent run.\n\nAn *agent* is an automated workflow that can monitor content from your sources, process it with AI, and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve status and output.\n\nWhen to use:\n- Use this endpoint for request/response style integrations where polling is acceptable.\n- Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE.\n\nKey fields:\n- `input`: text input for agents with a `dynamic_input` trigger.\n- `input_upload_id` / `input_upload_ids`: reference one or more files previously uploaded via `POST /agents/{agent_id}/upload-input`. Send them **with** `input` to pair prompt text with the files (the text leads, each file follows under its heading); only the two upload fields are mutually exclusive with each other.\n- `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but without live token streaming.\n- `metadata`: a JSON object that becomes available to agent steps for string substitution.\n\nAfter starting:\n- Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`.\n- Use `include_step_outputs=true` to include per-step outputs, timing, and credits.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "run_agent_api_agents__agent_id__runs_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InsufficientCreditsResponse" - } - } - }, - "description": "Insufficient credits \u2014 the account has exhausted its credits." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Run an agent", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/runs/stream": { - "post": { - "description": "Start a **priority** agent run and stream run events using Server-Sent Events (SSE).\n\nThis is the best option for interactive UIs where you want progress updates as the run executes.\n\nHow it works:\n- The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`.\n- Subsequent events are forwarded from the run event stream (status changes, step events, etc).\n- If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion.\n- With `include_reasoning=true`, `stream_reasoning` events (with a `text` field) carry the model's reasoning while it thinks, when the `streaming_result` step's author enabled `show_reasoning`. Reasoning is never part of `output`.\n- The final `done` event contains the terminal snapshot (including `output` and `credits` when available).\n\nInput options (for `dynamic_input` triggers):\n- `input`: text input passed directly.\n- `input_upload_id` / `input_upload_ids`: reference one or more files uploaded via `POST /agents/{agent_id}/upload-input`. Combine either with `input` to send prompt text alongside the files; only the two upload fields are mutually exclusive with each other.\n\nClient guidance:\n- Keep the connection open and handle keepalive comments.\n- On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET /agents/runs/{run_id}`.\n- `stream_token` events carry the model's raw output. When the agent pairs `streaming_result` with a sibling `extract_content`/`display_result` branch, that branch's `display_result` takes precedence over the stream, so the `done` snapshot's `output` is the validated payload and the tokens are a progress channel \u2014 render tokens live, but read the result from `done`. Check `done.status` first: the streamed text is already the run's output when the stream ends, so a run that FAILED its validation step still carries that raw text in `output`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "run_streaming_agent_api_agents__agent_id__runs_stream_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentRunStreamRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": {} - }, - "text/event-stream": { - "example": ": keepalive\n\nevent: init\ndata: {\"run_id\":\"...\",\"status\":\"pending\",\"error_count\":0,\"credits\":0.0,\"priority\":true,\"input\":\"...\",\"output\":null,\"attempts\":[]}\n\nevent: done\ndata: {\"run_id\":\"...\",\"status\":\"completed\",\"error_count\":0,\"credits\":0.0,\"priority\":true,\"input\":\"...\",\"output\":\"...\",\"attempts\":[]}\n\n", - "schema": { - "type": "string" - } - } - }, - "description": "Streams agent run events via Server-Sent Events (SSE); run is always created as priority.\n\nSSE events:\n- `event: init` \u2014 `data` is an `AgentRunResponse` snapshot (includes `run_id`).\n- `event: done` \u2014 `data` is the final `AgentRunResponse` snapshot (includes `output`, `credits`, etc).\n- Other events (e.g. `status`, step events) are forwarded from the run event stream.\n- On `timeout` / `error`, the payload includes `run_id` so clients can fetch status via `GET /agents/runs/{run_id}`." - }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InsufficientCreditsResponse" - } - } - }, - "description": "Insufficient credits \u2014 the account has exhausted its credits." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Run an agent (stream events)", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/runs/{run_id}/evaluation-results": { - "get": { - "description": "List evaluation results recorded for a specific agent run.\n\nResponse shape is version-gated by the ``Seclai-Version`` header:\n\n- **Default / legacy** (no header, or a date before ``2026-07-27``): a bare\n JSON array of results (unpaginated \u2014 every result for the run).\n- **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated\n envelope ``{data, pagination: {page, limit, total, pages, has_next,\n has_prev}}``.\n\nResults span all evaluation criteria for the given run, useful for getting a\ncomplete quality snapshot of a single execution.", - "operationId": "list_run_evaluation_results_api_agents__agent_id__runs__run_id__evaluation_results_get", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "title": "Run Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/EvaluationResultWithCriteriaResponse" - }, - "title": "Response List Run Evaluation Results Api Agents Agent Id Runs Run Id Evaluation Results Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Run Evaluation Results", - "tags": [ - "agent-evaluations" - ] - } - }, - "/agents/{agent_id}/triggers/{trigger_id}/accepted-attachments": { - "put": { - "description": "Replace the input attachments a trigger accepts. A run's files are each assigned to one declared attachment before any step runs; steps reference one as ``{{agent.attachments.}}``. Rejected with HTTP 400 when the agent references an attachment the new declaration leaves out. `trigger_id` is the one `GET /agents/{agent_id}` returns.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account.", - "operationId": "set_accepted_attachments_api_api_agents__agent_id__triggers__trigger_id__accepted_attachments_put", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "trigger_id", - "required": true, - "schema": { - "title": "Trigger Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SetAcceptedAttachmentsRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AcceptedAttachmentsResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Declare the input attachments a trigger accepts", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/triggers/{trigger_id}/email-config": { - "put": { - "description": "Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, `require_sender_auth`, `queue_on_quota`, `run_on_attachment_mismatch`) on an agent's EMAIL_RECEIVED trigger, and return its computed email address(es). `trigger_id` is the one `GET /agents/{agent_id}` returns. Omitted fields are left unchanged.\n\nAuth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account.", - "operationId": "set_email_trigger_config_api_api_agents__agent_id__triggers__trigger_id__email_config_put", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "in": "path", - "name": "trigger_id", - "required": true, - "schema": { - "title": "Trigger Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__agents__SetEmailTriggerConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailTriggerConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Configure an EMAIL_RECEIVED trigger", - "tags": [ - "agents" - ] - } - }, - "/agents/{agent_id}/upload-input": { - "post": { - "description": "Upload a file to use as input for a `dynamic_input` agent run. Any other agent rejects the upload with HTTP 400.\n\n**Size limit:** 200 MB per file.\n\nFrom `Seclai-Version: 2026-10-16` a file of any type is accepted and is `ready` at once: pass `input_upload_id` to `POST /agents/{agent_id}/runs`. Each step receives the file itself when its model reads that type, and otherwise its text (OCR, extraction or transcript), made once for the steps that need it; a type nothing reads or converts is passed on as a file only. `input` carries a `# filename` heading per file.\n\nEarlier versions accept only these extensions: avi, bmp, csv, docx, epub, flac, gif, html, jpg, json, m4a, markdown, md, mov, mp3, mp4, msg, ogg, pdf, png, ppt, pptx, svg, tiff, txt, wav, webp, xls, xlsx, xml, zip. They write each file's text into `input`, so poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready` before running.\n\nThe agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention (the agent-traces source's retention period; free default 7 days).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "api_upload_agent_input_api_agents__agent_id__upload_input_post", - "parameters": [ - { - "in": "path", - "name": "agent_id", - "required": true, - "schema": { - "title": "Agent Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UploadAgentInputApiResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Upload file input", - "tags": [ - "agents" - ] - } - }, - "/ai-assistant/feedback": { - "post": { - "description": "Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is analyzed for concerning issues.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_feedback_api_ai_assistant_feedback_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__ai_assistant__AiAssistantFeedbackRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantFeedbackResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Submit AI assistant feedback", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/knowledge-base": { - "post": { - "description": "Generate a knowledge base creation/modification plan without requiring an existing solution. May also propose prerequisite source creation actions.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_knowledge_base_api_ai_assistant_knowledge_base_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a knowledge base plan (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/memory-bank": { - "post": { - "description": "Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_memory_bank_api_ai_assistant_memory_bank_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAiAssistantRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankAiAssistantResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a memory bank configuration (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/memory-bank/last-conversation": { - "get": { - "description": "Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. Returns turns in oldest-first order with a total count for pagination via limit/offset query parameters.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get", - "parameters": [ - { - "description": "Max turns.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 5, - "description": "Max turns.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Skip count.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Skip count.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankLastConversationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Fetch memory bank AI conversation history", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/memory-bank/{conversation_id}": { - "patch": { - "description": "Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_memory_bank_accept_api_ai_assistant_memory_bank__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept or decline a memory bank AI suggestion", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/solution": { - "post": { - "description": "Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an existing solution. Supports SSE streaming when ``Accept: text/event-stream`` is set.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_solution_api_ai_assistant_solution_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a solution plan (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/source": { - "post": { - "description": "Generate a content source creation/modification plan without requiring an existing solution. The AI proposes actions for the user to review before any changes are made.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_source_api_ai_assistant_source_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a source plan (standalone)", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/{conversation_id}/accept": { - "post": { - "description": "Accept and execute a previously proposed standalone plan. If the plan contains destructive actions (deletions), ``confirm_deletions`` must be set to true.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_accept_api_ai_assistant__conversation_id__accept_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantAcceptResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept and execute a standalone plan", - "tags": [ - "ai-assistant" - ] - } - }, - "/ai-assistant/{conversation_id}/decline": { - "post": { - "description": "Decline a previously proposed standalone plan. No resources are modified. The conversation is marked as declined.\n\nAuth: requires ``X-API-Key`` header or OAuth Bearer token.", - "operationId": "api_ai_decline_api_ai_assistant__conversation_id__decline_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Decline a standalone plan", - "tags": [ - "ai-assistant" - ] - } - }, - "/alerts": { - "get": { - "description": "List alerts for the account with optional filters.\n\nFilters:\n- `status`: triggered, acknowledged, resolved, dismissed\n- `agent_id`: filter by agent\n- `source_connection_id`: filter by source\n- `time_from` / `time_to`: ISO 8601 date range\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.", - "operationId": "list_alerts_api_alerts_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Filter by alert status", - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by alert status", - "title": "Status" - } - }, - { - "description": "Filter by agent ID", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by agent ID", - "title": "Agent Id" - } - }, - { - "description": "Filter by source connection ID", - "in": "query", - "name": "source_connection_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by source connection ID", - "title": "Source Connection Id" - } - }, - { - "description": "From (ISO 8601)", - "in": "query", - "name": "time_from", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "From (ISO 8601)", - "title": "Time From" - } - }, - { - "description": "To (ISO 8601)", - "in": "query", - "name": "time_to", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "To (ISO 8601)", - "title": "Time To" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List alerts", - "tags": [ - "alerts" - ] - } - }, - "/alerts/configs": { - "get": { - "description": "List alert configurations.\n\nFilters:\n- `agent_id`: list configs for a specific agent\n- `source_connection_id`: list configs for a specific source\n- Neither: list account-level agent alert configs\n- `scope=source`: list account-level source alert configs\n\nCredits alerts (`credits_low_threshold`, `credits_runout_prediction`, `credits_usage_spike`) are account-level alert configs. They are evaluated by the credits alert sweep and default-enabled configs may be auto-created for active accounts at runtime.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "list_alert_configs_api_alerts_configs_get", - "parameters": [ - { - "description": "Filter by agent ID", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by agent ID", - "title": "Agent Id" - } - }, - { - "description": "Filter by source connection ID", - "in": "query", - "name": "source_connection_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by source connection ID", - "title": "Source Connection Id" - } - }, - { - "description": "Set to 'source' to list account-level source alert configs", - "in": "query", - "name": "scope", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Set to 'source' to list account-level source alert configs", - "title": "Scope" - } - }, - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List alert configs", - "tags": [ - "alerts" - ] - }, - "post": { - "description": "Create a new alert configuration.\n\nAgent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, model_deprecated, model_sunset.\nSource alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike.\n\nDistribution types: owner, owner_admins, selected_members. Organization accounts are normalized to owner_admins.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "create_alert_config_api_alerts_configs_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateAlertConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create alert config", - "tags": [ - "alerts" - ] - } - }, - "/alerts/configs/{config_id}": { - "delete": { - "description": "Delete an alert configuration. This permanently removes the config and stops any future alerts of this type from being triggered.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "delete_alert_config_api_alerts_configs__config_id__delete", - "parameters": [ - { - "in": "path", - "name": "config_id", - "required": true, - "schema": { - "title": "Config Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete alert config", - "tags": [ - "alerts" - ] - }, - "get": { - "description": "Get a specific alert configuration by ID.\n\nReturns all fields including type, enabled state, threshold, cooldown, distribution type, and recipient list.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_alert_config_api_alerts_configs__config_id__get", - "parameters": [ - { - "in": "path", - "name": "config_id", - "required": true, - "schema": { - "title": "Config Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get alert config", - "tags": [ - "alerts" - ] - }, - "patch": { - "description": "Update an alert configuration. Only provided fields are updated.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "update_alert_config_api_alerts_configs__config_id__patch", - "parameters": [ - { - "in": "path", - "name": "config_id", - "required": true, - "schema": { - "title": "Config Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateAlertConfigRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlertConfigResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update alert config", - "tags": [ - "alerts" - ] - } - }, - "/alerts/organization-preferences/list": { - "get": { - "description": "List per-organization alert delivery preferences for the authenticated user.\n\nBy default, only explicit override rows are returned. Set `include_defaults=true` to return the effective subscribed state for every alert type in every organization the user can manage.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- Only organizations where the user is an owner or administrator are included.", - "operationId": "list_organization_preferences_api_alerts_organization_preferences_list_get", - "parameters": [ - { - "description": "Optional organization filter", - "in": "query", - "name": "organization_id", - "required": false, - "schema": { - "anyOf": [ - { - "format": "uuid", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional organization filter", - "title": "Organization Id" - } - }, - { - "description": "Include default subscribed entries for all alert types", - "in": "query", - "name": "include_defaults", - "required": false, - "schema": { - "default": false, - "description": "Include default subscribed entries for all alert types", - "title": "Include Defaults", - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OrganizationAlertPreferenceListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List organization alert delivery preferences", - "tags": [ - "alerts" - ] - } - }, - "/alerts/organization-preferences/{organization_id}/{alert_type}": { - "patch": { - "description": "Update the authenticated user's personal delivery preference for one alert type in one organization.\n\nSetting `subscribed=false` stores an explicit opt-out override. Setting `subscribed=true` removes the override and restores the default subscribed behavior.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- Only owners and administrators can update preferences for an organization.", - "operationId": "update_organization_preference_api_alerts_organization_preferences__organization_id___alert_type__patch", - "parameters": [ - { - "in": "path", - "name": "organization_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Organization Id", - "type": "string" - } - }, - { - "in": "path", - "name": "alert_type", - "required": true, - "schema": { - "title": "Alert Type", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__UpdateOrganizationAlertPreferenceRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__OrganizationAlertPreferenceResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update organization alert delivery preference", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}": { - "get": { - "description": "Get full alert detail including history, comments, and subscribers.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_alert_detail_api_alerts__alert_id__get", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get alert detail", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/comments": { - "post": { - "description": "Add a comment to an alert. Comments are visible to all subscribers and are included in the alert detail response.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "add_alert_comment_api_alerts__alert_id__comments_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AddCommentRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Add alert comment", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/status": { - "post": { - "description": "Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "change_alert_status_api_alerts__alert_id__status_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChangeStatusRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Change alert status", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/subscribe": { - "post": { - "description": "Subscribe the current user to an alert. Subscribed users receive email notifications when the alert status changes or new comments are added, for as long as they remain an owner or administrator of the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "subscribe_to_alert_api_alerts__alert_id__subscribe_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Subscribe to alert", - "tags": [ - "alerts" - ] - } - }, - "/alerts/{alert_id}/unsubscribe": { - "post": { - "description": "Unsubscribe the current user from an alert. The user will no longer receive email notifications for status changes or new comments on this alert.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "unsubscribe_from_alert_api_alerts__alert_id__unsubscribe_post", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__alerts__AlertDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Unsubscribe from alert", - "tags": [ - "alerts" - ] - } - }, - "/cloud-drives": { - "get": { - "description": "List the account's cloud-drive connections. Use a connection's `id` as `cloud_drive_connection_id` when creating a `cloud_drive` content source or binding a file-change agent trigger. `realtime_updates` reports whether changes arrive within seconds or on the scheduled backstop sweep.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "list_cloud_drives_api_api_cloud_drives_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/CloudDriveResponseModel" - }, - "title": "Response List Cloud Drives Api Api Cloud Drives Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List the account's cloud-drive connections", - "tags": [ - "cloud_drives" - ] - } - }, - "/cloud-drives/providers": { - "get": { - "description": "List the cloud-drive providers whose OAuth app is configured on this deployment (e.g. Dropbox, Google Drive), with the permissions each requests. A provider missing from this list cannot be connected here.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "list_cloud_drive_providers_api_api_cloud_drives_providers_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/CloudDriveProviderResponseModel" - }, - "title": "Response List Cloud Drive Providers Api Api Cloud Drives Providers Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List configured cloud-drive providers", - "tags": [ - "cloud_drives" - ] - } - }, - "/cloud-drives/{connection_id}": { - "delete": { - "description": "Soft-delete a connection and clear its tokens. Refused with **409** while anything still depends on it \u2014 a live agent trigger, or a `cloud_drive` content source ingesting into a knowledge base. `GET /{connection_id}/agents` shows which agents reference it, but does NOT list content sources, so treat the 409 as the authoritative check rather than a clean /agents response.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "delete_cloud_drive_api_api_cloud_drives__connection_id__delete", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete a cloud-drive connection", - "tags": [ - "cloud_drives" - ] - }, - "get": { - "description": "Fetch a single cloud-drive connection by id.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "get_cloud_drive_api_api_cloud_drives__connection_id__get", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CloudDriveResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get a cloud-drive connection", - "tags": [ - "cloud_drives" - ] - }, - "patch": { - "description": "Rename a connection and/or change the folder it watches. Changing the folder resets the sync cursor, so existing files in the new folder are not replayed as triggers.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "update_cloud_drive_api_api_cloud_drives__connection_id__patch", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CloudDriveUpdateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CloudDriveResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update a cloud-drive connection", - "tags": [ - "cloud_drives" - ] - } - }, - "/cloud-drives/{connection_id}/agents": { - "get": { - "description": "Agents that reference this connection \u2014 via a cloud-drive step, a `prompt_call` cloud-drive tool, or a file-change trigger. Check this before disconnecting or deleting a connection.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "get_agents_using_cloud_drive_api_api_cloud_drives__connection_id__agents_get", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/AgentUsingCloudDriveResponseModel" - }, - "title": "Response Get Agents Using Cloud Drive Api Api Cloud Drives Connection Id Agents Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List agents using a cloud-drive connection", - "tags": [ - "cloud_drives" - ] - } - }, - "/cloud-drives/{connection_id}/disconnect": { - "post": { - "description": "Revoke and clear the stored tokens and stop change notifications, keeping the connection row so it can be reconnected from the app. Agents bound to it stop firing until it is reconnected.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "disconnect_cloud_drive_api_api_cloud_drives__connection_id__disconnect_post", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CloudDriveResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Disconnect a cloud-drive connection", - "tags": [ - "cloud_drives" - ] - } - }, - "/cloud-drives/{connection_id}/rejections": { - "get": { - "description": "Recent files the connection deliberately skipped, newest first, with the reason: `too_large` (above the size cap), `download_failed` (the provider would not serve the bytes), or `flood` (the per-sync or per-account run cap was hit, so remaining changes were dropped).\n\nThis is the answer to \"why didn't my agent run for that file?\" \u2014 a skipped file fires no trigger and appears nowhere else.\n\nRequires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned.", - "operationId": "list_cloud_drive_rejections_api_api_cloud_drives__connection_id__rejections_get", - "parameters": [ - { - "in": "path", - "name": "connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Connection Id", - "type": "string" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "maximum": 200, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/CloudDriveRejectionResponseModel" - }, - "title": "Response List Cloud Drive Rejections Api Api Cloud Drives Connection Id Rejections Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List files this connection did not process", - "tags": [ - "cloud_drives" - ] - } - }, - "/contents/{source_connection_content_version}": { - "delete": { - "description": "Delete a content item (a `SourceConnectionContentVersion`).\n\nUse this to remove an uploaded or indexed item from your account. Deleting content can affect agents and knowledge base workflows that reference this item.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account.\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.", - "operationId": "delete_content_api_contents__source_connection_content_version__delete", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "403": { - "description": "The key's user is a member of the account but not an owner or administrator (`error.code` is `permission_denied`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete content", - "tags": [ - "contents" - ] - }, - "get": { - "description": "Get detailed information about a specific content item (a `SourceConnectionContentVersion`).\n\nThis is useful when you want to:\n- Inspect the extracted text for debugging or review.\n- Display content details in a UI.\n\nText range:\n- `start` and `end` control the character range returned in `text_content` so clients can page through large documents.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account.", - "operationId": "get_content_detail_api_contents__source_connection_content_version__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "in": "query", - "name": "start", - "required": false, - "schema": { - "default": 0, - "title": "Start", - "type": "integer" - } - }, - { - "in": "query", - "name": "end", - "required": false, - "schema": { - "default": 5000, - "title": "End", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__ContentDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get content details", - "tags": [ - "contents" - ] - }, - "put": { - "description": "Replace a content version using a small inline text payload.\n\n**Maximum payload size:** 8192 bytes (UTF-8).\n\n**Supported content types:**\n- `application/json`\n- `application/xml`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.\n- The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version.", - "operationId": "replace_content_with_inline_text_api_contents__source_connection_content_version__put", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InlineTextReplaceRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Replace a content version with inline text", - "tags": [ - "contents" - ] - } - }, - "/contents/{source_connection_content_version}/attachments": { - "get": { - "description": "List the files attached to a content item, with pagination.\n\nAn agent's `write_content_attachment` step attaches a file, and an email content source attaches the files sent with a message. An RSS source attaches the kinds of feed file chosen in its `feed_attachments`. The images and video in a web page's main content are attached on a source with media indexing on. The images inside a PDF, DOCX, PPTX or XLSX item or attachment are attached too, on a source that indexes document images. Each entry says whether the file is indexed for search and, when indexing failed, why.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account.", - "operationId": "list_content_attachments_api_contents__source_connection_content_version__attachments_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__ContentAttachmentsListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List content attachments", - "tags": [ - "contents" - ] - } - }, - "/contents/{source_connection_content_version}/attachments/{attachment_id}": { - "get": { - "description": "Get one file attached to a content item: its indexing status and reason, its metadata, and the text it is indexed by.\n\n`attachment_id` is the `id` of an entry in the item's attachment list. Use `start` and `end` to page through long text. A file that was not indexed has no text.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account.", - "operationId": "get_content_attachment_api_contents__source_connection_content_version__attachments__attachment_id__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "in": "path", - "name": "attachment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Attachment Id", - "type": "string" - } - }, - { - "in": "query", - "name": "start", - "required": false, - "schema": { - "default": 0, - "minimum": 0, - "title": "Start", - "type": "integer" - } - }, - { - "in": "query", - "name": "end", - "required": false, - "schema": { - "default": 5000, - "minimum": 0, - "title": "End", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__ContentAttachmentDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "The account has no credits left (`error.code` is `insufficient_credits`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get a content attachment", - "tags": [ - "contents" - ] - } - }, - "/contents/{source_connection_content_version}/attachments/{attachment_id}/embeddings": { - "get": { - "description": "List the embeddings (chunk vectors) an attached file is indexed by, with pagination. The list is empty for a file that has no completed index.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account.", - "operationId": "list_content_attachment_embeddings_api_contents__source_connection_content_version__attachments__attachment_id__embeddings_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "in": "path", - "name": "attachment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Attachment Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__ContentEmbeddingsListResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "The account has no credits left (`error.code` is `insufficient_credits`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List a content attachment's embeddings", - "tags": [ - "contents" - ] - } - }, - "/contents/{source_connection_content_version}/attachments/{attachment_id}/file": { - "get": { - "description": "Download an attached file's bytes.\n\nImages, audio, video, PDF and plain text are served with their own type; an SVG that cannot be sanitized, and anything else, is served as `application/octet-stream`.\n\nAnswers 403 when the file is withheld: a governance policy blocked or redacted it, or it arrived from outside and is still being indexed. The attachment's `file_withheld` field says which before you ask.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account.", - "operationId": "get_content_attachment_file_api_contents__source_connection_content_version__attachments__attachment_id__file_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "in": "path", - "name": "attachment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Attachment Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "application/pdf": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "audio/*": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "image/*": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "text/plain": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "video/*": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "The file's bytes." - }, - "402": { - "description": "The account has no credits left (`error.code` is `insufficient_credits`)." - }, - "403": { - "description": "The file is withheld; `error.code` says why." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Download a content attachment", - "tags": [ - "contents" - ] - } - }, - "/contents/{source_connection_content_version}/embeddings": { - "get": { - "description": "List the embeddings (chunk vectors) for a content item, with pagination.\n\nEmbeddings are used for semantic search and retrieval in knowledge base workflows. This endpoint is primarily useful for debugging chunking, indexing, and vector contents.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access embeddings for content belonging to your account.", - "operationId": "list_content_embeddings_api_contents__source_connection_content_version__embeddings_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__ContentEmbeddingsListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List content embeddings", - "tags": [ - "contents" - ] - } - }, - "/contents/{source_connection_content_version}/upload": { - "post": { - "description": "Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`.\n\nThis behaves like a source file upload, but it targets an existing content version ID. This is useful when you want to correct or update an uploaded document while keeping references stable.\n\n**Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored).\n\n**Supported MIME types:**\n- `application/atom+xml`\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/rss+xml`\n- `application/rtf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/x-ipynb+json`\n- `application/xhtml+xml`\n- `application/xml`\n- `application/zip`\n- `audio/aac`\n- `audio/amr`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/opus`\n- `audio/wav`\n- `audio/webm`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/svg+xml`\n- `image/tiff`\n- `image/webp`\n- `message/rfc822`\n- `text/calendar`\n- `text/csv`\n- `text/html`\n- `text/javascript`\n- `text/markdown`\n- `text/plain`\n- `text/tab-separated-values`\n- `text/vcard`\n- `text/vtt`\n- `text/x-c`\n- `text/x-c++`\n- `text/x-csharp`\n- `text/x-go`\n- `text/x-ini`\n- `text/x-java`\n- `text/x-log`\n- `text/x-markdown`\n- `text/x-php`\n- `text/x-python`\n- `text/x-ruby`\n- `text/x-rust`\n- `text/x-shellscript`\n- `text/x-sql`\n- `text/x-subrip`\n- `text/x-tex`\n- `text/x-toml`\n- `text/x-typescript`\n- `text/xml`\n- `text/yaml`\n- `video/3gpp`\n- `video/mp2t`\n- `video/mp4`\n- `video/mpeg`\n- `video/quicktime`\n- `video/webm`\n- `video/x-matroska`\n- `video/x-msvideo`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version.\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your account.", - "operationId": "upload_file_to_content_api_contents__source_connection_content_version__upload_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_content_version", - "required": true, - "schema": { - "title": "Source Connection Content Version", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__contents__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Replace a content version with a new upload", - "tags": [ - "contents" - ] - } - }, - "/docs-search": { - "get": { - "description": "Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page titles and summaries (fast, no AI cost); `mode=semantic` matches page body content by meaning (uses an embedding). Each result carries a `doc_slug` and an optional section `anchor` for building a `https://seclai.com/docs/[#]` link, a `score` (relevance; not comparable across modes), and \u2014 in semantic mode \u2014 a `highlight` (best matching verbatim sentence; `null` for keyword). Documentation is global, so results are not account-scoped.", - "operationId": "docs_search_api_docs_search_get", - "parameters": [ - { - "description": "Search query", - "in": "query", - "name": "q", - "required": true, - "schema": { - "description": "Search query", - "maxLength": 200, - "minLength": 1, - "title": "Q", - "type": "string" - } - }, - { - "description": "Search strategy", - "in": "query", - "name": "mode", - "required": false, - "schema": { - "default": "keyword", - "description": "Search strategy", - "enum": [ - "keyword", - "semantic" - ], - "title": "Mode", - "type": "string" - } - }, - { - "description": "Maximum results", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 8, - "description": "Maximum results", - "maximum": 20, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__docs_search__DocsSearchResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Search documentation", - "tags": [ - "search" - ] - } - }, - "/email-domains": { - "get": { - "description": "List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email domains with their verification status, the DNS records the customer must publish, and the plan capabilities (`can_add_vanity`/`can_add_custom`) plus whether one of each kind already exists (`has_vanity`/`has_custom` \u2014 the per-kind limit is 1).\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "list_email_domains_api_api_email_domains_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainsListResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List the account's email domains + plan capabilities", - "tags": [ - "email-domains" - ] - }, - "post": { - "description": "Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, `value=agent.mycompany.com`; optional `delegated=true` to let Seclai manage a dedicated Route53 zone). Stands up the SES identity + DNS and returns the records the customer must publish. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "add_email_domain_api_api_email_domains_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddEmailDomainRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Add + provision an email domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/use-shared-domain": { - "post": { - "description": "Clear the account's primary domain so agent email reverts to the shared `agent.seclai.com` sending domain, WITHOUT removing the configured domain(s) \u2014 they stay verified and can be promoted again later. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "use_shared_domain_api_api_email_domains_use_shared_domain_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Revert to the shared agent.seclai.com sending domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}": { - "delete": { - "description": "Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a `cleanup_note` when the removed domain was Seclai-managed (delegated), reminding the caller to delete the registrar NS delegation record (dangling-delegation / subdomain-takeover guard). Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "remove_email_domain_api_api_email_domains__domain_id__delete", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RemoveEmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Remove an email domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/dmarc": { - "get": { - "description": "Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the DMARC `rua` aggregate reports over the last `days` (clamped by the service). Populated for domains whose DNS zone Seclai controls (vanity + delegated custom); a self-managed custom domain keeps its own DMARC reporting and returns an all-zero summary.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "get_dmarc_summary_api_api_email_domains__domain_id__dmarc_get", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "title": "Days", - "type": "integer" - } - }, - { - "in": "query", - "name": "top_sources", - "required": false, - "schema": { - "default": 10, - "title": "Top Sources", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DmarcSummaryResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "DMARC aggregate-report summary for a domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/primary": { - "post": { - "description": "Promote a verified domain to the account's primary domain \u2014 agent email then sends FROM this domain and shows its addresses on it (`@`, `@`) instead of the shared `agent.seclai.com`; addresses keep resolving on the account's other verified domains and the shared form. The domain must be verified. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "set_primary_email_domain_api_api_email_domains__domain_id__primary_post", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Make a verified domain the account's primary sending domain", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/test-email": { - "post": { - "description": "Send a test message FROM the verified domain (`noreply@`) TO the account owner's email, to confirm end-to-end that the domain actually sends (SES verified, DKIM/SPF aligned). Never sends to any other address, so it can't be used as an open relay. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "send_test_email_api_api_email_domains__domain_id__test_email_post", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SendTestEmailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Send a test email from a verified domain to the account owner", - "tags": [ - "email-domains" - ] - } - }, - "/email-domains/{domain_id}/verify": { - "post": { - "description": "Re-poll SES + DNS for this domain right now instead of waiting for the background verification sweep, and return its updated status + DNS-record check results. Useful right after publishing the required records. Owner/admin only.\n\nAuth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account.", - "operationId": "verify_email_domain_api_api_email_domains__domain_id__verify_post", - "parameters": [ - { - "in": "path", - "name": "domain_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Domain Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailDomainResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Run a verification check immediately ('Check now')", - "tags": [ - "email-domains" - ] - } - }, - "/governance/ai-assistant": { - "post": { - "description": "Send a natural-language request to the governance AI assistant to generate a plan of policy changes. Returns a conversation with proposed actions that can be accepted or declined.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "governance_ai_generate_api_governance_ai_assistant_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__governance__GovernanceAiAssistantRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GovernanceAiAssistantResponse" - } - } - }, - "description": "Successful Response" - }, - "400": { - "description": "AI assistant error." - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a governance plan", - "tags": [ - "governance" - ] - } - }, - "/governance/ai-assistant/conversations": { - "get": { - "description": "Return recent governance AI assistant conversations for the account, ordered by most recent first.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "list_governance_ai_conversations_api_governance_ai_assistant_conversations_get", - "parameters": [ - { - "description": "Number of conversations.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Number of conversations.", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/routers__api__governance__GovernanceConversationResponse" - }, - "title": "Response List Governance Ai Conversations Api Governance Ai Assistant Conversations Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List AI assistant conversations", - "tags": [ - "governance" - ] - } - }, - "/governance/ai-assistant/{conversation_id}/accept": { - "post": { - "description": "Execute the proposed policy changes from a governance AI assistant conversation. Each action is applied in order and results are returned.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "governance_ai_accept_api_governance_ai_assistant__conversation_id__accept_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GovernanceAiAcceptResponse" - } - } - }, - "description": "Successful Response" - }, - "400": { - "description": "Plan already accepted/declined or AI error." - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept a governance plan", - "tags": [ - "governance" - ] - } - }, - "/governance/ai-assistant/{conversation_id}/decline": { - "post": { - "description": "Reject a previously proposed governance AI assistant plan without applying any changes. The conversation is marked as declined and no policy modifications are made.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token with governance access.", - "operationId": "governance_ai_decline_api_governance_ai_assistant__conversation_id__decline_post", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "400": { - "description": "Plan already accepted/declined or AI error." - }, - "403": { - "description": "Plan does not include governance access." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Decline a governance plan", - "tags": [ - "governance" - ] - } - }, - "/knowledge_bases": { - "get": { - "description": "List knowledge bases for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "list_knowledge_bases_api_knowledge_bases_get", - "parameters": [ - { - "description": "Page number (1-based).", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number (1-based).", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page.", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field. One of: created_at, updated_at, name.", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field. One of: created_at, updated_at, name.", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort direction: asc or desc.", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort direction: asc or desc.", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseListResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Knowledge Bases", - "tags": [ - "knowledge_bases" - ] - }, - "post": { - "description": "Create a new knowledge base.\n\nAt least one `source_id` is required. The source connections must belong to the same account.", - "operationId": "create_knowledge_base_api_knowledge_bases_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateKnowledgeBaseBody" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "Insufficient credits or no active subscription \u2014 the account has exhausted its credits or does not have a valid subscription." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Knowledge Base", - "tags": [ - "knowledge_bases" - ] - } - }, - "/knowledge_bases/{knowledge_base_id}": { - "delete": { - "description": "Soft-delete a knowledge base. This action cannot be undone.\n\nFails if the knowledge base is referenced by any agent definitions. Remove the knowledge base from agents first.", - "operationId": "delete_knowledge_base_api_knowledge_bases__knowledge_base_id__delete", - "parameters": [ - { - "in": "path", - "name": "knowledge_base_id", - "required": true, - "schema": { - "title": "Knowledge Base Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Knowledge Base", - "tags": [ - "knowledge_bases" - ] - }, - "get": { - "description": "Fetch a knowledge base by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access knowledge bases belonging to your account.", - "operationId": "get_knowledge_base_api_knowledge_bases__knowledge_base_id__get", - "parameters": [ - { - "in": "path", - "name": "knowledge_base_id", - "required": true, - "schema": { - "title": "Knowledge Base Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Knowledge Base", - "tags": [ - "knowledge_bases" - ] - }, - "put": { - "description": "Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only update knowledge bases belonging to your account.", - "operationId": "update_knowledge_base_api_knowledge_bases__knowledge_base_id__put", - "parameters": [ - { - "in": "path", - "name": "knowledge_base_id", - "required": true, - "schema": { - "title": "Knowledge Base Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateKnowledgeBaseBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KnowledgeBaseResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update Knowledge Base", - "tags": [ - "knowledge_bases" - ] - } - }, - "/me": { - "get": { - "description": "Returns the authenticated user's personal account ID and a list of organisations they belong to. Each organisation entry includes the organisation's own id, display name, and account_id. Useful for CLI tooling that needs to let the user pick an org context.", - "operationId": "get_me_api_me_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MeResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get current user identity", - "tags": [ - "identity" - ] - } - }, - "/memory_banks": { - "get": { - "description": "List memory banks for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account.", - "operationId": "list_memory_banks_api_memory_banks_get", - "parameters": [ - { - "description": "Page number (1-based).", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number (1-based).", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page.", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field. One of: created_at, updated_at, name.", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field. One of: created_at, updated_at, name.", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort direction: asc or desc.", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort direction: asc or desc.", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "Filter by bank type: conversation or general.", - "in": "query", - "name": "type", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by bank type: conversation or general.", - "title": "Type" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankListResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Memory Banks", - "tags": [ - "memory_banks" - ] - }, - "post": { - "description": "Create a new memory bank.\n\nModes: `fast_and_cheap` (256-dim), `balanced` (512-dim), `slow_and_thorough` (1024-dim), or `custom` (supply your own embedding params).", - "operationId": "create_memory_bank_api_memory_banks_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateMemoryBankBody" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Memory Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/ai-assistant": { - "post": { - "description": "Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings based on the user's description.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "memory_bank_ai_generate_api_memory_banks_ai_assistant_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAiAssistantRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankAiAssistantResponse" - } - } - }, - "description": "Successful Response" - }, - "400": { - "description": "AI assistant error." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate a memory bank configuration", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/ai-assistant/last-conversation": { - "get": { - "description": "Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports pagination via limit/offset.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get", - "parameters": [ - { - "description": "Max turns to return.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 5, - "description": "Max turns to return.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Number of most-recent turns to skip.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Number of most-recent turns to skip.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankLastConversationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Fetch memory bank AI conversation history", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/ai-assistant/{conversation_id}": { - "patch": { - "description": "Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes.\n\nAuth: requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "memory_bank_ai_accept_api_memory_banks_ai_assistant__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__memory_banks__MemoryBankAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept or decline a memory bank AI suggestion", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/templates": { - "get": { - "description": "Return pre-built template configurations for common memory bank use cases.\n\nEach template includes a name, description, suggested use case, and full default settings that can be used directly with the create endpoint.", - "operationId": "list_templates_api_memory_banks_templates_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "title": "Response List Templates Api Memory Banks Templates Get" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Templates", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/test-compaction": { - "post": { - "description": "Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning.", - "operationId": "test_compaction_prompt_standalone_api_memory_banks_test_compaction_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StandaloneTestCompactionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompactionTestResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Test Compaction Prompt Standalone", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}": { - "delete": { - "description": "Soft-delete a memory bank. This action is permanent and cannot be undone.\n\nThe linked content source and all stored conversation memory entries will also be removed.", - "operationId": "delete_memory_bank_api_memory_banks__memory_bank_id__delete", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Memory Bank", - "tags": [ - "memory_banks" - ] - }, - "get": { - "description": "Fetch a memory bank by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to your account.", - "operationId": "get_memory_bank_api_memory_banks__memory_bank_id__get", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Memory Bank", - "tags": [ - "memory_banks" - ] - }, - "put": { - "description": "Update a memory bank's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nNote: the embedding `mode` cannot be changed after creation because it determines the vector dimensions used to store entries.", - "operationId": "update_memory_bank_api_memory_banks__memory_bank_id__put", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateMemoryBankBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MemoryBankResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update Memory Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/agents": { - "get": { - "description": "List agents whose current definition references this memory bank.\n\nReturns an array of `{agent_id, agent_name}` objects.", - "operationId": "get_agents_using_bank_api_memory_banks__memory_bank_id__agents_get", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "title": "Response Get Agents Using Bank Api Memory Banks Memory Bank Id Agents Get" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Agents Using Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/compact": { - "post": { - "description": "Trigger an on-demand compaction run for a memory bank.\n\nThe bank must have at least one compaction threshold configured (max_turns or max_size_tokens). Age no longer triggers compaction \u2014 use retention_days to remove entries by age. Compaction runs asynchronously \u2014 the response confirms scheduling, not completion.", - "operationId": "compact_memory_bank_api_memory_banks__memory_bank_id__compact_post", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompactionScheduledResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Compact Memory Bank", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/source": { - "delete": { - "description": "Delete the content source linked to a memory bank, removing all stored memory entries.\n\nA new content source is automatically created on the next write. Use this to reset a bank's data without deleting the bank itself.", - "operationId": "delete_memory_bank_source_api_memory_banks__memory_bank_id__source_delete", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Memory Bank Source", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/stats": { - "get": { - "description": "Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per-key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters.", - "operationId": "get_memory_bank_entry_stats_api_memory_banks__memory_bank_id__stats_get", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "maximum": 730, - "minimum": 1, - "title": "Days", - "type": "integer" - } - }, - { - "in": "query", - "name": "start_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Start Date" - } - }, - { - "in": "query", - "name": "end_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "title": "End Date" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "additionalProperties": true, - "title": "Response Get Memory Bank Entry Stats Api Memory Banks Memory Bank Id Stats Get", - "type": "object" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Memory Bank Entry Stats", - "tags": [ - "memory_banks" - ] - } - }, - "/memory_banks/{memory_bank_id}/test-compaction": { - "post": { - "description": "Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning.", - "operationId": "test_compaction_prompt_api_memory_banks__memory_bank_id__test_compaction_post", - "parameters": [ - { - "in": "path", - "name": "memory_bank_id", - "required": true, - "schema": { - "title": "Memory Bank Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestCompactionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompactionTestResponseModel" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Test Compaction Prompt", - "tags": [ - "memory_banks" - ] - } - }, - "/models": { - "get": { - "description": "List the enabled LLM models with full details.\n\nReturns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status.\n\nA model whose credit rate has not been published yet is omitted, so you are never offered a model that cannot be billed and therefore cannot be run. Such a model may appear later without any other change.\n\nOptional query parameters:\n- `provider`: filter by provider (e.g. 'anthropic', 'openai')\n- `supports_tool_use`: filter to models with tool calling support\n- `supports_thinking`: filter to models with extended thinking support\n- `supports_input_media`: filter to models accepting an input modality (`image`/`audio`/`video`/`pdf` or a full MIME)\n- `supports_output_media`: filter to models producing an output modality (`image`/`audio`/`video`) \u2014 e.g. to find generation models\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "list_models_api_models_get", - "parameters": [ - { - "description": "Filter by provider name", - "in": "query", - "name": "provider", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by provider name", - "title": "Provider" - } - }, - { - "description": "Filter to models that support tool use", - "in": "query", - "name": "supports_tool_use", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Filter to models that support tool use", - "title": "Supports Tool Use" - } - }, - { - "description": "Filter to models that support extended thinking", - "in": "query", - "name": "supports_thinking", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Filter to models that support extended thinking", - "title": "Supports Thinking" - } - }, - { - "description": "Filter to models that accept this input modality \u2014 a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME.", - "in": "query", - "name": "supports_input_media", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to models that accept this input modality \u2014 a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME.", - "title": "Supports Input Media" - } - }, - { - "description": "Filter to models that produce this output modality \u2014 a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find image/audio/video generation models.", - "in": "query", - "name": "supports_output_media", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to models that produce this output modality \u2014 a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find image/audio/video generation models.", - "title": "Supports Output Media" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/schemas__model_responses__ProviderGroupResponse" - }, - "title": "Response List Models Api Models Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Models", - "tags": [ - "models" - ] - } - }, - "/models/alerts": { - "get": { - "description": "List model lifecycle alerts for the account.\n\nReturns in-app notifications about model deprecations, sunsets, and newer model availability. Supports filtering by agent, unread-only, and pagination.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account.", - "operationId": "list_alerts_api_models_alerts_get", - "parameters": [ - { - "description": "Filter alerts to a specific agent UUID.", - "in": "query", - "name": "agent_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter alerts to a specific agent UUID.", - "title": "Agent Id" - } - }, - { - "description": "When true, only return unread alerts.", - "in": "query", - "name": "unread_only", - "required": false, - "schema": { - "default": false, - "description": "When true, only return unread alerts.", - "title": "Unread Only", - "type": "boolean" - } - }, - { - "description": "Maximum number of alerts to return (1-100).", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 50, - "description": "Maximum number of alerts to return (1-100).", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Pagination offset.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Pagination offset.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelAlertListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Alerts", - "tags": [ - "models" - ] - } - }, - "/models/alerts/mark-all-read": { - "post": { - "description": "Mark all model lifecycle alerts as read for the account.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Scoped to the caller's account.", - "operationId": "mark_all_read_api_models_alerts_mark_all_read_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Mark All Read", - "tags": [ - "models" - ] - } - }, - "/models/alerts/unread-count": { - "get": { - "description": "Get the count of unread model lifecycle alerts.\n\nUseful for badge indicators in UIs and dashboards.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account.", - "operationId": "get_alert_unread_count_api_models_alerts_unread_count_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnreadCountResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Alert Unread Count", - "tags": [ - "models" - ] - } - }, - "/models/alerts/{alert_id}/read": { - "patch": { - "description": "Mark a single model lifecycle alert as read (dismissed).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account.", - "operationId": "mark_read_api_models_alerts__alert_id__read_patch", - "parameters": [ - { - "in": "path", - "name": "alert_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Alert Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Mark Read", - "tags": [ - "models" - ] - } - }, - "/models/embedders": { - "get": { - "description": "List the embedding models a source can be created with.\n\nEach entry carries the `model_type` to pass as `embedding_model` when creating a source, the `dimensions` it supports, and \u2014 most importantly for multi-modal indexing \u2014 `supported_input_media`: the modalities that embedder can actually index. A source only honours a `media_types` entry its embedder lists here; a kind it does not list is stored and not indexed, so check this before choosing an embedder for a knowledge base of images or video.\n\nText-only embedders report `supported_input_media` as null. Pricing is reported as `credits` (per ~1,000 English words of text) plus `per_modality_rates` for the non-text modalities a multi-modal embedder bills differently.\n\nAn embedder whose credit rate has not been published yet is omitted, so you are never offered one that cannot be billed.\n\nOptional query parameters:\n- `supports_input_media`: keep only embedders that can index this modality (`text`/`image`/`video`/`audio` or a full MIME)\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical for every account.", - "operationId": "list_embedding_models_api_models_embedders_get", - "parameters": [ - { - "description": "Filter to embedders that can index this input modality \u2014 a coarse kind (text, image, video, audio) or a full MIME.", - "in": "query", - "name": "supports_input_media", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to embedders that can index this input modality \u2014 a coarse kind (text, image, video, audio) or a full MIME.", - "title": "Supports Input Media" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmbeddingModelListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Embedding Models", - "tags": [ - "models" - ] - } - }, - "/models/generation-tiers": { - "get": { - "description": "List the media-generation quality tiers and the model + cost each resolves to.\n\nOn a prompt_call's `media_generation` tool \u2014 and the dedicated generate_* steps via tier routing \u2014 the author/LLM chooses a *tier* (fast/balanced/thorough), never a model. This is the surface that maps each `(modality, tier)` to its concrete generator, raw `credits_per_unit`, `unit_label`, and a human-readable scaled `price_label`. Global routing/pricing (the same for every account); read-only. REST parity with the `list_generation_tiers` MCP tool.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_generation_tiers_api_models_generation_tiers_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerationTierListResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Generation Tiers", - "tags": [ - "models" - ] - } - }, - "/models/playground/experiments": { - "get": { - "description": "List model playground experiments for the account.\n\nReturns a paginated, time-filtered list of experiments ordered by creation date descending.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account and, when the credential is bound to a user, to that user.", - "operationId": "list_experiments_api_models_playground_experiments_get", - "parameters": [ - { - "description": "Look-back window in days.", - "in": "query", - "name": "days", - "required": false, - "schema": { - "default": 30, - "description": "Look-back window in days.", - "maximum": 730, - "minimum": 1, - "title": "Days", - "type": "integer" - } - }, - { - "description": "Explicit start date (overrides days).", - "in": "query", - "name": "start_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Explicit start date (overrides days).", - "title": "Start Date" - } - }, - { - "description": "Explicit end date (overrides days).", - "in": "query", - "name": "end_date", - "required": false, - "schema": { - "anyOf": [ - { - "format": "date", - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Explicit end date (overrides days).", - "title": "End Date" - } - }, - { - "description": "Page size.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Page size.", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Pagination offset.", - "in": "query", - "name": "offset", - "required": false, - "schema": { - "default": 0, - "description": "Pagination offset.", - "minimum": 0, - "title": "Offset", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExperimentListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Experiments", - "tags": [ - "models" - ] - }, - "post": { - "description": "Create and schedule a model playground experiment.\n\nRuns the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an LLM judge.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- When the credential is bound to a user, the experiment belongs to that user; only that user or an account-scoped key can cancel or delete it.", - "operationId": "create_experiment_api_models_playground_experiments_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PlaygroundCreateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateExperimentResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Experiment", - "tags": [ - "models" - ] - } - }, - "/models/playground/experiments/{experiment_id}": { - "delete": { - "description": "Soft-delete a model playground experiment.\n\nRemoves the experiment from list/detail views while preserving audit history.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404.", - "operationId": "delete_experiment_endpoint_api_models_playground_experiments__experiment_id__delete", - "parameters": [ - { - "in": "path", - "name": "experiment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Experiment Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Experiment Endpoint", - "tags": [ - "models" - ] - }, - "get": { - "description": "Get details and results for a specific model playground experiment.\n\nReturns the full experiment payload including prompt, model outputs, and evaluation results (if available).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404.", - "operationId": "get_experiment_api_models_playground_experiments__experiment_id__get", - "parameters": [ - { - "in": "path", - "name": "experiment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Experiment Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExperimentDetailResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Experiment", - "tags": [ - "models" - ] - } - }, - "/models/playground/experiments/{experiment_id}/cancel": { - "post": { - "description": "Cancel a running or pending model playground experiment.\n\nMarks the experiment as canceled. An experiment that has not started never runs. One that is running starts no further model calls, and records each model it did not call with the error `Canceled`. A model call or evaluation already in progress is not interrupted by the cancel: it continues and is billed, and its result is recorded on the canceled experiment. Canceling may therefore not shorten the run or reduce its cost.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404.", - "operationId": "cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post", - "parameters": [ - { - "in": "path", - "name": "experiment_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Experiment Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CancelExperimentResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Cancel Experiment Endpoint", - "tags": [ - "models" - ] - } - }, - "/models/rerankers": { - "get": { - "description": "List the reranker models a knowledge base can be created with.\n\nA reranker re-scores the top results of a vector search for relevance. Each entry carries the `model_type` to pass as `reranker_model` on a knowledge base, its `credits_per_action`, and whether it is the platform default (`is_default`, used when you omit `reranker_model`).\n\nTo disable reranking, send `\"none\"` or an empty string as `reranker_model` rather than a value from this list. Reranking scores text, so a knowledge base whose sources all embed media natively \u2014 whose chunks carry no text \u2014 defaults to no reranker.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical for every account.", - "operationId": "list_reranker_models_api_models_rerankers_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RerankerModelListResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List Reranker Models", - "tags": [ - "models" - ] - } - }, - "/models/{model_id}/details": { - "get": { - "description": "Get detailed information about a specific model.\n\nReturns full model details including capabilities, credit pricing, tool support, variant tiers, and lifecycle status.\n\nThe `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6').\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_model_api_models__model_id__details_get", - "parameters": [ - { - "in": "path", - "name": "model_id", - "required": true, - "schema": { - "title": "Model Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/schemas__model_responses__PromptModelResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Model", - "tags": [ - "models" - ] - } - }, - "/models/{model_id}/recommendations": { - "get": { - "description": "Get replacement/upgrade recommendations for a model.\n\nReturns a designated successor (if any), same-family upgrades, and cross-provider/cross-family alternatives.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.", - "operationId": "get_recommendations_api_models__model_id__recommendations_get", - "parameters": [ - { - "in": "path", - "name": "model_id", - "required": true, - "schema": { - "title": "Model Id", - "type": "string" - } - }, - { - "description": "Only recommend models that support tool use.", - "in": "query", - "name": "require_tool_use", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Only recommend models that support tool use.", - "title": "Require Tool Use" - } - }, - { - "description": "Only recommend models that support structured output.", - "in": "query", - "name": "require_structured_output", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Only recommend models that support structured output.", - "title": "Require Structured Output" - } - }, - { - "description": "Only recommend models that support thinking/reasoning.", - "in": "query", - "name": "require_thinking", - "required": false, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Only recommend models that support thinking/reasoning.", - "title": "Require Thinking" - } - }, - { - "description": "Minimum context window size in tokens.", - "in": "query", - "name": "min_context_tokens", - "required": false, - "schema": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Minimum context window size in tokens.", - "title": "Min Context Tokens" - } - }, - { - "description": "Minimum output token limit.", - "in": "query", - "name": "min_output_tokens", - "required": false, - "schema": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "Minimum output token limit.", - "title": "Min Output Tokens" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__model_lifecycle__ModelRecommendationsResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Recommendations", - "tags": [ - "models" - ] - } - }, - "/search": { - "get": { - "description": "Search across all resource types in your account. Accepts a free-text keyword query or a UUID. UUIDs are matched exactly; keywords are matched by name and description (case-insensitive substring). Results are ranked: name-prefix > name-substring > description-substring. Searchable types: agent, knowledge_base, source_connection, solution, memory_bank, alert, api_key, governance_policy, mcp_client.", - "operationId": "search_api_search_get", - "parameters": [ - { - "description": "Search query", - "in": "query", - "name": "q", - "required": true, - "schema": { - "description": "Search query", - "maxLength": 200, - "minLength": 1, - "title": "Q", - "type": "string" - } - }, - { - "description": "Maximum results", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 10, - "description": "Maximum results", - "maximum": 50, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Optional entity type filter (e.g. 'agent', 'knowledge_base')", - "in": "query", - "name": "entity_type", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional entity type filter (e.g. 'agent', 'knowledge_base')", - "title": "Entity Type" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__search__SearchResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Search resources", - "tags": [ - "search" - ] - } - }, - "/solutions": { - "get": { - "description": "List solutions for your account.\n\nA *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Use solutions to organise related resources and leverage AI assistants for automated setup.\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc).\n- Filtering: `search` to filter by solution name (case-insensitive partial match).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.", - "operationId": "list_solutions_api_solutions_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort order", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort order", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "Filter by solution name (case-insensitive partial match)", - "in": "query", - "name": "search", - "required": false, - "schema": { - "anyOf": [ - { - "maxLength": 200, - "minLength": 1, - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter by solution name (case-insensitive partial match)", - "title": "Search" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List solutions", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Create a new solution for the caller's account.\n\nA *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a `name` and optional `description` in the request body.", - "operationId": "create_solution_api_solutions_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSolutionRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create a solution", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}": { - "delete": { - "description": "Delete a solution by its ID.\n\nThis permanently removes the solution and all its resource associations (agent links, knowledge base links, source connection links). The underlying resources themselves are not deleted.", - "operationId": "delete_solution_api_solutions__solution_id__delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete a solution", - "tags": [ - "solutions" - ] - }, - "get": { - "description": "Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections.\n\nReturns the full solution detail with nested resource information.", - "operationId": "get_solution_api_solutions__solution_id__get", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get a solution", - "tags": [ - "solutions" - ] - }, - "patch": { - "description": "Update an existing solution's name or description.\n\nPass the fields you wish to change in the request body. Fields not included remain unchanged.", - "operationId": "update_solution_api_solutions__solution_id__patch", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateSolutionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update a solution", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/agents": { - "delete": { - "description": "Unlink one or more agents from a solution by their IDs.\n\nPass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are silently ignored. Returns the updated solution with remaining linked resources.", - "operationId": "unlink_agents_api_solutions__solution_id__agents_delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnlinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Unlink agents", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Link one or more agents to a solution by their IDs.\n\nPass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. Returns the updated solution with all linked resources.", - "operationId": "link_agents_api_solutions__solution_id__agents_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Link agents", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/generate": { - "post": { - "description": "Generate a comprehensive solution management plan via the solution AI assistant.\n\nThis is the most powerful assistant \u2014 it can propose changes across sources, knowledge bases, and agents. Describe your goal in natural language and the assistant will create a multi-step plan. Review the proposed actions and use the accept or decline endpoint.\n\nSupports SSE streaming when `Accept: text/event-stream` is set.", - "operationId": "ai_assistant_generate_api_solutions__solution_id__ai_assistant_generate_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate solution plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/knowledge-base": { - "post": { - "description": "Generate a knowledge base plan via the KB AI assistant.\n\nDescribe what knowledge bases you need in natural language and the assistant will propose a plan with create, update, or delete actions. The assistant may also propose creating new sources if needed. Review the proposed actions and use the accept or decline endpoint.", - "operationId": "ai_assistant_knowledge_base_api_solutions__solution_id__ai_assistant_knowledge_base_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate knowledge base plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/source": { - "post": { - "description": "Generate a content source plan via the source AI assistant.\n\nDescribe what sources you need in natural language and the assistant will propose a plan with create, update, or delete actions. Review the proposed actions and use the accept or decline endpoint to execute or discard the plan.", - "operationId": "ai_assistant_source_api_solutions__solution_id__ai_assistant_source_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantGenerateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantGenerateResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Generate source plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/{conversation_id}/accept": { - "post": { - "description": "Accept and execute a proposed plan generated by one of the AI assistant endpoints.\n\nExecutes all proposed actions in the plan and returns the results of each action. If the plan contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the request body. Returns a summary of executed actions with success/failure status.", - "operationId": "ai_assistant_accept_api_solutions__solution_id__ai_assistant__conversation_id__accept_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__AiAssistantAcceptRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiAssistantAcceptResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Accept plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/ai-assistant/{conversation_id}/decline": { - "post": { - "description": "Decline a proposed plan generated by one of the AI assistant endpoints.\n\nMarks the conversation as declined without executing any actions. The conversation history is preserved for reference. You can generate a new plan afterwards if needed.", - "operationId": "ai_assistant_decline_api_solutions__solution_id__ai_assistant__conversation_id__decline_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Decline plan", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/conversations": { - "get": { - "description": "List AI assistant conversation history for a solution.\n\nReturns all conversation turns for the given solution, including user inputs, AI responses, proposed actions, and acceptance status.", - "operationId": "list_conversations_api_solutions__solution_id__conversations_get", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionConversationResponse" - }, - "title": "Response List Conversations Api Solutions Solution Id Conversations Get", - "type": "array" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List conversations", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Add a conversation turn to a solution's AI assistant history.\n\nRecords a user input and optional AI response and actions taken. This is typically called internally by AI assistant endpoints, but can also be used to manually log interactions.", - "operationId": "add_conversation_turn_api_solutions__solution_id__conversations_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddConversationTurnRequest" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionConversationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Add conversation turn", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/conversations/{conversation_id}": { - "patch": { - "description": "Mark a conversation turn as accepted or declined.\n\nUpdates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed plan to record whether it was accepted or declined by the user.", - "operationId": "mark_conversation_turn_api_solutions__solution_id__conversations__conversation_id__patch", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "in": "path", - "name": "conversation_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Conversation Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MarkConversationTurnRequest" - } - } - }, - "required": true - }, - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Mark conversation turn", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/knowledge-bases": { - "delete": { - "description": "Unlink one or more knowledge bases from a solution by their IDs.\n\nPass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not currently linked are silently ignored. Returns the updated solution.", - "operationId": "unlink_knowledge_bases_api_solutions__solution_id__knowledge_bases_delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnlinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Unlink knowledge bases", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Link one or more knowledge bases to a solution by their IDs.\n\nPass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are silently ignored. Returns the updated solution with all linked resources.", - "operationId": "link_knowledge_bases_api_solutions__solution_id__knowledge_bases_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Link knowledge bases", - "tags": [ - "solutions" - ] - } - }, - "/solutions/{solution_id}/source-connections": { - "delete": { - "description": "Unlink one or more source connections from a solution by their IDs.\n\nPass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently linked are silently ignored. Returns the updated solution.", - "operationId": "unlink_source_connections_api_solutions__solution_id__source_connections_delete", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnlinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Unlink source connections", - "tags": [ - "solutions" - ] - }, - "post": { - "description": "Link one or more source connections to a solution by their IDs.\n\nPass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently ignored. Returns the updated solution with all linked resources.", - "operationId": "link_source_connections_api_solutions__solution_id__source_connections_post", - "parameters": [ - { - "in": "path", - "name": "solution_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Solution Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LinkResourcesRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__solutions__SolutionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Link source connections", - "tags": [ - "solutions" - ] - } - }, - "/sources": { - "get": { - "description": "List content sources for your account.\n\nA *source* is where Seclai pulls or receives content from \u2014 RSS feeds, websites, or content stores (``custom_index``). Content stores support file uploads and API-driven content ingestion with configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``).\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc).\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account.\n- The optional `account_id` query param is only allowed when it matches the caller's account.", - "operationId": "list_sources_api_sources_get", - "parameters": [ - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort order", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort order", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "List sources for the given account. Defaults to the caller's account.", - "in": "query", - "name": "account_id", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "List sources for the given account. Defaults to the caller's account.", - "title": "Account Id" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__sources__SourceListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List sources", - "tags": [ - "sources" - ] - }, - "post": { - "description": "Create a new content source.\n\nSource types: `rss_feed`, `website`, `custom_index`, `cloud_drive`, `email`.\n\nFor RSS and website sources, provide the URL. For custom index sources, the URL is created automatically.\n\nAn `email` source takes no URL and requires `email_allowed_senders`; the response's `email_address` is where to send mail.\n\nA `cloud_drive` source takes no URL and requires `cloud_drive_connection_id`, the id of a drive connected in the app (`GET /cloud-drives` lists them).\n\nFor custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`.", - "operationId": "create_source_api_sources_post", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSourceBody" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceResponse" - } - } - }, - "description": "Successful Response" - }, - "402": { - "description": "Insufficient credits or no active subscription \u2014 the account has exhausted its credits or does not have a valid subscription." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create Source", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}": { - "delete": { - "description": "Soft-delete a content source. This action cannot be undone.\n\nSystem-managed sources (such as agent history or conversation memory) cannot be deleted through this endpoint.", - "operationId": "delete_source_api_sources__source_connection_id__delete", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete Source", - "tags": [ - "sources" - ] - }, - "get": { - "description": "Fetch a content source by ID.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access sources belonging to your account.", - "operationId": "get_source_api_sources__source_connection_id__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Source", - "tags": [ - "sources" - ] - }, - "post": { - "description": "Upload a small text payload to a content source (no multipart/form-data required).\n\n**Maximum payload size:** 8192 bytes (UTF-8).\n\n**Supported content types:**\n- `application/json`\n- `application/xml`\n- `text/csv`\n- `text/html`\n- `text/markdown`\n- `text/plain`\n- `text/x-markdown`\n- `text/xml`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- Use this endpoint for small text payloads; larger files should use `/upload`.\n- `title` is merged into `metadata.title` when not already present.\n\nTracking indexing progress:\n- **Which id you get back depends on `status`, and they are not interchangeable:**\n - `uploaded` \u2014 a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns.\n - `duplicate` \u2014 this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll.\n- For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=\u2026&content_version_id=\u2026` for a whole batch, to follow each item through to `completed` or `failed`.\n- On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes.\n- An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is not in the source and its id stays `null` unless a reviewer releases it, so stop polling.", - "operationId": "upload_inline_text_to_source_api_sources__source_connection_id__post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InlineTextUploadRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__sources__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Upload inline text to a content source", - "tags": [ - "sources" - ] - }, - "put": { - "description": "Update a content source's configuration. Only provided fields are changed; omitted fields are left unchanged.\n\nSystem-managed sources only allow `retention_days` updates.", - "operationId": "update_source_api_sources__source_connection_id__put", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateSourceBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Update Source", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/contents": { - "get": { - "description": "List every content item this source has attempted to index, with the status of each.\n\nUnlike the source's `content_count`, which only counts finished items, this listing includes items that are still processing and items that failed \u2014 so a bulk upload can report per-item progress and point at the specific items that did not make it.\n\nCorrelating with an upload:\n- Each item is keyed by `content_version_id`, which is what the upload endpoints return. Pass those ids as repeated `content_version_id` query parameters to poll exactly the items you uploaded.\n- `source_connection_content_version_id` is `null` until an item finishes indexing; once set, it is the id `GET /contents/{id}` takes.\n- `content_status` reaches `completed` on success and `failed` on error, with the reason in `error`. The intermediate values are `pending`, `fetching`, `transcribing`, `scanning`, and `indexing`.\n- An item an Enforce governance policy blocked at import is held for review: `held_for_review` is `true` and `source_connection_content_version_id` stays `null` until a reviewer releases it. With `Seclai-Version: 2026-10-05` or later it reports `completed`; earlier versions report it as `failed` with the hold as the `error`. The `status` filter matches the item under `completed` on every version.\n\nParameters:\n- Pagination: `page` and `limit`.\n- Sorting: `sort` (created_at/title/status) and `order` (asc/desc). `created_at` sorts on when the item was uploaded or pulled.\n- Filtering: `status` and repeatable `content_version_id`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only list content for sources belonging to your account.", - "operationId": "list_source_contents_api_sources__source_connection_id__contents_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "description": "Page number", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "description": "Sort field (created_at/title/status)", - "in": "query", - "name": "sort", - "required": false, - "schema": { - "default": "created_at", - "description": "Sort field (created_at/title/status)", - "title": "Sort", - "type": "string" - } - }, - { - "description": "Sort order", - "in": "query", - "name": "order", - "required": false, - "schema": { - "default": "desc", - "description": "Sort order", - "pattern": "^(asc|desc)$", - "title": "Order", - "type": "string" - } - }, - { - "description": "Filter to one status: pending, fetching, transcribing, scanning, indexing, completed, or failed. Use `failed` to list only the items that could not be indexed.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Filter to one status: pending, fetching, transcribing, scanning, indexing, completed, or failed. Use `failed` to list only the items that could not be indexed.", - "title": "Status" - } - }, - { - "description": "Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. The ids travel in the query string, so keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches the API. The API itself accepts at most 500 \u2014 beyond either limit, split the poll or page through the unfiltered listing.", - "in": "query", - "name": "content_version_id", - "required": false, - "schema": { - "anyOf": [ - { - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. The ids travel in the query string, so keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches the API. The API itself accepts at most 500 \u2014 beyond either limit, split the poll or page through the unfiltered listing.", - "title": "Content Version Id" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceContentStatusListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List content items and their indexing status", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/contents/{content_version_id}": { - "get": { - "description": "Get the indexing status of a single content item, addressed by the `content_version_id` the upload endpoints return.\n\nUse this to follow one uploaded file through indexing. To follow many at once, use `GET /sources/{id}/contents` with repeated `content_version_id` parameters instead of polling this endpoint per item.\n\nAn item held for review by an Enforce governance policy reports `held_for_review: true`. With `Seclai-Version: 2026-10-05` or later its `content_status` is `completed`; earlier versions report `failed` with the hold as the `error`.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account.", - "operationId": "get_source_content_status_endpoint_api_sources__source_connection_id__contents__content_version_id__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "content_version_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Content Version Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceContentStatusResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get one content item's indexing status", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/email-rejections": { - "get": { - "description": "List mail that an email content source refused, newest first. Each entry says who sent the message and why it was refused, never its subject or body. A message refused as `unsafe_content` also has a prompt-scan record, which keeps the scanned text.\n\nTo accept a refused sender, add its `from_address` or that address's domain to the source's `email_allowed_senders`. That only helps when `authenticated` is true. A `repeat_*` reason marks a message the source received before; allowing its sender does not store it.\n\nRequires an account owner or administrator: a key or token bound to another member gets 403. Returns 404 for a source that is not an email source.", - "operationId": "list_email_source_rejections_api_api_sources__source_connection_id__email_rejections_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "description": "Page number.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "description": "Page number.", - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "description": "Items per page.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "description": "Items per page.", - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EmailSourceRejectionListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List mail an email source refused", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/embedding-migration": { - "get": { - "description": "Get the latest embedding migration status for a custom-index source.\n\nReturns `null` when no migration has ever been started for this source.", - "operationId": "get_source_embedding_migration_api_sources__source_connection_id__embedding_migration_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SourceEmbeddingMigrationResponse" - }, - { - "type": "null" - } - ], - "title": "Response Get Source Embedding Migration Api Sources Source Connection Id Embedding Migration Get" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get Source Embedding Migration", - "tags": [ - "sources" - ] - }, - "post": { - "description": "Start an embedding model migration for a custom-index source.\n\nThe migration runs asynchronously in the background. Poll `GET /sources/{id}/embedding-migration` to track progress.\n\nOptionally override chunking configuration (`chunk_size`, `chunk_overlap`, `chunk_language`, `chunk_separators`, `chunk_regex_separators`). When a chunking field is omitted (null), the current source's value is preserved.\n\nConstraints:\n- Only `custom_index` source types support migration.\n- A migration cannot be started while another is already active.\n- The target model + dimensions must differ from the source's current settings.", - "operationId": "start_source_embedding_migration_api_sources__source_connection_id__embedding_migration_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StartSourceEmbeddingMigrationRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceEmbeddingMigrationResponse" - } - } - }, - "description": "Successful Response" - }, - "409": { - "description": "A migration is already active for this source, or the target matches the current settings." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Start Source Embedding Migration", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/embedding-migration/cancel": { - "post": { - "description": "Cancel an active embedding migration for a custom-index source.\n\nOnly pending and running migrations can be cancelled. A migration that has reached the switching phase is committing its switch-over in a single transaction, so there is no half-applied state to back out of and cancel is refused.", - "operationId": "cancel_source_embedding_migration_api_sources__source_connection_id__embedding_migration_cancel_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceEmbeddingMigrationResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Cancel Source Embedding Migration", - "tags": [ - "sources" - ] - } - }, - "/sources/{source_connection_id}/exports": { - "get": { - "description": "List all export jobs for a source connection, ordered newest first. Supports pagination via ``page`` and ``limit`` query parameters. Returns status, progress, and file metadata for each export.", - "operationId": "list_source_exports_api_sources__source_connection_id__exports_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "title": "Page", - "type": "integer" - } - }, - { - "in": "query", - "name": "limit", - "required": false, - "schema": { - "default": 20, - "maximum": 100, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExportListResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "List exports", - "tags": [ - "source-exports" - ] - }, - "post": { - "description": "Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, then use /download to retrieve the file. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected.", - "operationId": "create_source_export_api_sources__source_connection_id__exports_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__CreateExportRequest" - } - } - }, - "required": true - }, - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__ExportResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Create export", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/estimate": { - "post": { - "description": "Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use this to show users how large the download will be before they commit to running the export.", - "operationId": "estimate_source_export_api_sources__source_connection_id__exports_estimate_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__EstimateExportRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__EstimateExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Estimate export size", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/{export_id}": { - "delete": { - "description": "Delete an export job and remove the associated file from S3. This is a soft-delete: the database record is retained for audit purposes but the backing file is permanently removed. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected.", - "operationId": "delete_source_export_api_sources__source_connection_id__exports__export_id__delete", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "204": { - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Delete export", - "tags": [ - "source-exports" - ] - }, - "get": { - "description": "Retrieve the current status and progress of an export job. Returns all metadata including progress counters, file size, item count, and expiration time once completed.", - "operationId": "get_source_export_api_sources__source_connection_id__exports__export_id__get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__ExportResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get export status", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/{export_id}/cancel": { - "post": { - "description": "Cancel a pending or running export. The background task will stop at the next chunk boundary. Completed, failed, expired, or already-cancelled exports cannot be cancelled. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected.", - "operationId": "cancel_source_export_api_sources__source_connection_id__exports__export_id__cancel_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__source_exports__ExportResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Cancel export", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/exports/{export_id}/download": { - "get": { - "description": "Stream the completed export file. Returns the file content with appropriate Content-Type and Content-Disposition headers. Returns 409 if the export is not yet completed and 410 if it has expired.", - "operationId": "download_source_export_api_sources__source_connection_id__exports__export_id__download_get", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Source Connection Id", - "type": "string" - } - }, - { - "in": "path", - "name": "export_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Export Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": {} - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Download export", - "tags": [ - "source-exports" - ] - } - }, - "/sources/{source_connection_id}/upload": { - "post": { - "description": "Upload a file to a content source.\n\n**Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored).\n\n**Supported MIME types:**\n- `application/atom+xml`\n- `application/epub+zip`\n- `application/json`\n- `application/pdf`\n- `application/rss+xml`\n- `application/rtf`\n- `application/vnd.ms-excel`\n- `application/vnd.ms-outlook`\n- `application/vnd.ms-powerpoint`\n- `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `application/x-ipynb+json`\n- `application/xhtml+xml`\n- `application/xml`\n- `application/zip`\n- `audio/aac`\n- `audio/amr`\n- `audio/flac`\n- `audio/mp4`\n- `audio/mpeg`\n- `audio/ogg`\n- `audio/opus`\n- `audio/wav`\n- `audio/webm`\n- `image/bmp`\n- `image/gif`\n- `image/jpeg`\n- `image/png`\n- `image/svg+xml`\n- `image/tiff`\n- `image/webp`\n- `message/rfc822`\n- `text/calendar`\n- `text/csv`\n- `text/html`\n- `text/javascript`\n- `text/markdown`\n- `text/plain`\n- `text/tab-separated-values`\n- `text/vcard`\n- `text/vtt`\n- `text/x-c`\n- `text/x-c++`\n- `text/x-csharp`\n- `text/x-go`\n- `text/x-ini`\n- `text/x-java`\n- `text/x-log`\n- `text/x-markdown`\n- `text/x-php`\n- `text/x-python`\n- `text/x-ruby`\n- `text/x-rust`\n- `text/x-shellscript`\n- `text/x-sql`\n- `text/x-subrip`\n- `text/x-tex`\n- `text/x-toml`\n- `text/x-typescript`\n- `text/xml`\n- `text/yaml`\n- `video/3gpp`\n- `video/mp2t`\n- `video/mp4`\n- `video/mpeg`\n- `video/quicktime`\n- `video/webm`\n- `video/x-matroska`\n- `video/x-msvideo`\n\nNotes:\n- A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected.\n- If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension.\n- Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={\"author\":\"Ada\",\"category\":\"docs\"}`).\n- `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`).\n- For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`.\n\nResponse:\n- `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source.\n\nTracking indexing progress:\n- **Which id you get back depends on `status`, and they are not interchangeable:**\n - `uploaded` \u2014 a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns.\n - `duplicate` \u2014 this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll.\n- For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=\u2026&content_version_id=\u2026` for a whole batch, to follow each item through to `completed` or `failed`.\n- On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes.\n- An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is not in the source and its id stays `null` unless a reviewer releases it, so stop polling.", - "operationId": "upload_file_to_source_api_sources__source_connection_id__upload_post", - "parameters": [ - { - "in": "path", - "name": "source_connection_id", - "required": true, - "schema": { - "title": "Source Connection Id", - "type": "string" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/Body_upload_file_to_source_api_sources__source_connection_id__upload_post" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/routers__api__sources__FileUploadResponse" - } - } - }, - "description": "Successful Response" - }, - "403": { - "description": "The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Upload a file to a content source", - "tags": [ - "sources" - ] - } - }, - "/v2/agent-runs/{run_id}/attachments/{attachment_id}": { - "get": { - "description": "Streams the bytes of a file of the given agent run: one a step emitted, or one the run started with. ``attachment_id`` is the ``id`` of an entry in the run's or a step's ``attachments``, or the URL-safe-base64-encoded storage key, which webhook and email links carry.\n\nAuth & scoping:\n- Requires `X-API-Key` header or OAuth Bearer token.\n- The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft-deleted agent, a run whose trace was purged, a file not in the run) all collapse to a single 404 to prevent cross-tenant existence enumeration.\n\nMIME handling:\n- Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, application/vnd.seclai.manifest+json) are served with their declared type.\n- Everything else is served as ``application/octet-stream`` with an attachment disposition to prevent stored-XSS.", - "operationId": "serve_agent_run_attachment_api_v2_agent_runs__run_id__attachments__attachment_id__get", - "parameters": [ - { - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "format": "uuid", - "title": "Run Id", - "type": "string" - } - }, - { - "in": "path", - "name": "attachment_id", - "required": true, - "schema": { - "title": "Attachment Id", - "type": "string" - } - }, - { - "in": "query", - "name": "download_name", - "required": false, - "schema": { - "anyOf": [ - { - "maxLength": 255, - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Download Name" - } - }, - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "application/pdf": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "application/vnd.seclai.manifest+json": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "audio/*": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "image/*": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "text/plain": { - "schema": { - "format": "binary", - "type": "string" - } - }, - "video/*": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "Attachment bytes streamed with the resolved MIME type (inline-safe types keep their declared type; everything else is ``application/octet-stream``)." - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Download an agent-run attachment", - "tags": [ - "agent_run_attachments" - ] - } - }, - "/version": { - "get": { - "description": "Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request resolved to, and the default/latest/known versions. Pin your account with `PUT /version` or override per request with the `Seclai-Version` header.", - "operationId": "get_api_version_api_version_get", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiVersionResponse" - } - } - }, - "description": "Successful Response" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Get the account's API version", - "tags": [ - "version" - ] - }, - "put": { - "description": "Sets the account's sticky `Seclai-Version` to the given `YYYY-MM-DD` date, or clears it with `null`. The new pin applies to subsequent header-less requests; a `Seclai-Version` request header still overrides it. Owner/admin only. `effective_version` in the response reflects the current request, not the new pin.", - "operationId": "update_api_version_api_version_put", - "parameters": [ - { - "$ref": "#/components/parameters/X-Account-Id" - }, - { - "$ref": "#/components/parameters/Seclai-Version" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateApiVersionRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiVersionResponse" - } - } - }, - "description": "Successful Response" - }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "503": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - }, - "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator.", - "headers": { - "Retry-After": { - "description": "Seconds to wait before retrying. Sent only with `database_unavailable`.", - "schema": { - "type": "integer" - } - } - } - } - }, - "summary": "Pin (or clear) the account's API version", - "tags": [ - "version" - ] - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "BearerAuth": [] - } - ], - "x-seclai-versions": { - "default": "2026-07-01", - "known": [ - "2026-07-01", - "2026-07-27", - "2026-08-03", - "2026-08-21", - "2026-09-28", - "2026-09-30", - "2026-10-03", - "2026-10-05", - "2026-10-13", - "2026-10-16", - "2026-10-18", - "2026-10-19", - "2026-10-21" - ], - "latest": "2026-10-21" - } -} diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 98ce96b..0000000 --- a/package-lock.json +++ /dev/null @@ -1,2937 +0,0 @@ -{ - "name": "@seclai/sdk", - "version": "0.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@seclai/sdk", - "version": "0.0.0", - "license": "MIT", - "devDependencies": { - "openapi-typescript": "^7.9.1", - "tsup": "^8.5.0", - "typedoc": "^0.27.6", - "typescript": "^5.7.3", - "vitest": "^2.1.9" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", - "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.27.1", - "js-tokens": "^4.0.0", - "picocolors": "^1.1.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", - "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz", - "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz", - "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz", - "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz", - "integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz", - "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz", - "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz", - "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz", - "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz", - "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz", - "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz", - "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz", - "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz", - "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz", - "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz", - "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz", - "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz", - "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz", - "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz", - "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz", - "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz", - "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz", - "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz", - "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz", - "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz", - "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@gerrit0/mini-shiki": { - "version": "1.27.2", - "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.27.2.tgz", - "integrity": "sha512-GeWyHz8ao2gBiUW4OJnQDxXQnFgZQwwQk05t/CVVgNBN7/rK8XZ7xY6YhLVv9tH3VppWWmr9DCl3MwemB/i+Og==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/engine-oniguruma": "^1.27.2", - "@shikijs/types": "^1.27.2", - "@shikijs/vscode-textmate": "^10.0.1" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@redocly/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-EDtsGZS964mf9zAUXAl9Ew16eYbeyAFWhsPr0fX6oaJxgd8rApYlPBf0joyhnUHz88WxrigyFtTaqqzXNzPgqw==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/@redocly/config": { - "version": "0.22.2", - "resolved": "https://registry.npmjs.org/@redocly/config/-/config-0.22.2.tgz", - "integrity": "sha512-roRDai8/zr2S9YfmzUfNhKjOF0NdcOIqF7bhf4MVC5UxpjIysDjyudvlAiVbpPHp3eDRWbdzUgtkK1a7YiDNyQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@redocly/openapi-core": { - "version": "1.34.6", - "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.34.6.tgz", - "integrity": "sha512-2+O+riuIUgVSuLl3Lyh5AplWZyVMNuG2F98/o6NrutKJfW4/GTZdPpZlIphS0HGgcOHgmWcCSHj+dWFlZaGSHw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@redocly/ajv": "^8.11.2", - "@redocly/config": "^0.22.0", - "colorette": "^1.2.0", - "https-proxy-agent": "^7.0.5", - "js-levenshtein": "^1.1.6", - "js-yaml": "^4.1.0", - "minimatch": "^5.0.1", - "pluralize": "^8.0.0", - "yaml-ast-parser": "0.0.43" - }, - "engines": { - "node": ">=18.17.0", - "npm": ">=9.5.0" - } - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.55.1.tgz", - "integrity": "sha512-9R0DM/ykwfGIlNu6+2U09ga0WXeZ9MRC2Ter8jnz8415VbuIykVuc6bhdrbORFZANDmTDvq26mJrEVTl8TdnDg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.55.1.tgz", - "integrity": "sha512-eFZCb1YUqhTysgW3sj/55du5cG57S7UTNtdMjCW7LwVcj3dTTcowCsC8p7uBdzKsZYa8J7IDE8lhMI+HX1vQvg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.55.1.tgz", - "integrity": "sha512-p3grE2PHcQm2e8PSGZdzIhCKbMCw/xi9XvMPErPhwO17vxtvCN5FEA2mSLgmKlCjHGMQTP6phuQTYWUnKewwGg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.55.1.tgz", - "integrity": "sha512-rDUjG25C9qoTm+e02Esi+aqTKSBYwVTaoS1wxcN47/Luqef57Vgp96xNANwt5npq9GDxsH7kXxNkJVEsWEOEaQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.55.1.tgz", - "integrity": "sha512-+JiU7Jbp5cdxekIgdte0jfcu5oqw4GCKr6i3PJTlXTCU5H5Fvtkpbs4XJHRmWNXF+hKmn4v7ogI5OQPaupJgOg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.55.1.tgz", - "integrity": "sha512-V5xC1tOVWtLLmr3YUk2f6EJK4qksksOYiz/TCsFHu/R+woubcLWdC9nZQmwjOAbmExBIVKsm1/wKmEy4z4u4Bw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.55.1.tgz", - "integrity": "sha512-Rn3n+FUk2J5VWx+ywrG/HGPTD9jXNbicRtTM11e/uorplArnXZYsVifnPPqNNP5BsO3roI4n8332ukpY/zN7rQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.55.1.tgz", - "integrity": "sha512-grPNWydeKtc1aEdrJDWk4opD7nFtQbMmV7769hiAaYyUKCT1faPRm2av8CX1YJsZ4TLAZcg9gTR1KvEzoLjXkg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.55.1.tgz", - "integrity": "sha512-a59mwd1k6x8tXKcUxSyISiquLwB5pX+fJW9TkWU46lCqD/GRDe9uDN31jrMmVP3feI3mhAdvcCClhV8V5MhJFQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.55.1.tgz", - "integrity": "sha512-puS1MEgWX5GsHSoiAsF0TYrpomdvkaXm0CofIMG5uVkP6IBV+ZO9xhC5YEN49nsgYo1DuuMquF9+7EDBVYu4uA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.55.1.tgz", - "integrity": "sha512-r3Wv40in+lTsULSb6nnoudVbARdOwb2u5fpeoOAZjFLznp6tDU8kd+GTHmJoqZ9lt6/Sys33KdIHUaQihFcu7g==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.55.1.tgz", - "integrity": "sha512-MR8c0+UxAlB22Fq4R+aQSPBayvYa3+9DrwG/i1TKQXFYEaoW3B5b/rkSRIypcZDdWjWnpcvxbNaAJDcSbJU3Lw==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.55.1.tgz", - "integrity": "sha512-3KhoECe1BRlSYpMTeVrD4sh2Pw2xgt4jzNSZIIPLFEsnQn9gAnZagW9+VqDqAHgm1Xc77LzJOo2LdigS5qZ+gw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.55.1.tgz", - "integrity": "sha512-ziR1OuZx0vdYZZ30vueNZTg73alF59DicYrPViG0NEgDVN8/Jl87zkAPu4u6VjZST2llgEUjaiNl9JM6HH1Vdw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.55.1.tgz", - "integrity": "sha512-uW0Y12ih2XJRERZ4jAfKamTyIHVMPQnTZcQjme2HMVDAHY4amf5u414OqNYC+x+LzRdRcnIG1YodLrrtA8xsxw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.55.1.tgz", - "integrity": "sha512-u9yZ0jUkOED1BFrqu3BwMQoixvGHGZ+JhJNkNKY/hyoEgOwlqKb62qu+7UjbPSHYjiVy8kKJHvXKv5coH4wDeg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.55.1.tgz", - "integrity": "sha512-/0PenBCmqM4ZUd0190j7J0UsQ/1nsi735iPRakO8iPciE7BQ495Y6msPzaOmvx0/pn+eJVVlZrNrSh4WSYLxNg==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.55.1.tgz", - "integrity": "sha512-a8G4wiQxQG2BAvo+gU6XrReRRqj+pLS2NGXKm8io19goR+K8lw269eTrPkSdDTALwMmJp4th2Uh0D8J9bEV1vg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.55.1.tgz", - "integrity": "sha512-bD+zjpFrMpP/hqkfEcnjXWHMw5BIghGisOKPj+2NaNDuVT+8Ds4mPf3XcPHuat1tz89WRL+1wbcxKY3WSbiT7w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.55.1.tgz", - "integrity": "sha512-eLXw0dOiqE4QmvikfQ6yjgkg/xDM+MdU9YJuP4ySTibXU0oAvnEWXt7UDJmD4UkYialMfOGFPJnIHSe/kdzPxg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ] - }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.55.1.tgz", - "integrity": "sha512-xzm44KgEP11te3S2HCSyYf5zIzWmx3n8HDCc7EE59+lTcswEWNpvMLfd9uJvVX8LCg9QWG67Xt75AuHn4vgsXw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.55.1.tgz", - "integrity": "sha512-yR6Bl3tMC/gBok5cz/Qi0xYnVbIxGx5Fcf/ca0eB6/6JwOY+SRUcJfI0OpeTpPls7f194as62thCt/2BjxYN8g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.55.1.tgz", - "integrity": "sha512-3fZBidchE0eY0oFZBnekYCfg+5wAB0mbpCBuofh5mZuzIU/4jIVkbESmd2dOsFNS78b53CYv3OAtwqkZZmU5nA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.55.1.tgz", - "integrity": "sha512-xGGY5pXj69IxKb4yv/POoocPy/qmEGhimy/FoTpTSVju3FYXUQQMFCaZZXJVidsmGxRioZAwpThl/4zX41gRKg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.55.1.tgz", - "integrity": "sha512-SPEpaL6DX4rmcXtnhdrQYgzQ5W2uW3SCJch88lB2zImhJRhIIK44fkUrgIV/Q8yUNfw5oyZ5vkeQsZLhCb06lw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@shikijs/engine-oniguruma": { - "version": "1.29.2", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.29.2.tgz", - "integrity": "sha512-7iiOx3SG8+g1MnlzZVDYiaeHe7Ez2Kf2HrJzdmGwkRisT7r4rak0e655AcM/tF9JG/kg5fMNYlLLKglbN7gBqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/types": "1.29.2", - "@shikijs/vscode-textmate": "^10.0.1" - } - }, - "node_modules/@shikijs/types": { - "version": "1.29.2", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.29.2.tgz", - "integrity": "sha512-VJjK0eIijTZf0QSTODEXCqinjBn0joAHQ+aPSBzrv4O2d/QSbsMw+ZeSRx03kV34Hy7NzUvV/7NqfYGRLrASmw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/vscode-textmate": "^10.0.1", - "@types/hast": "^3.0.4" - } - }, - "node_modules/@shikijs/vscode-textmate": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", - "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@vitest/expect": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", - "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "2.1.9", - "@vitest/utils": "2.1.9", - "chai": "^5.1.2", - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/mocker": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz", - "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "2.1.9", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.12" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^5.0.0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } - }, - "node_modules/@vitest/pretty-format": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz", - "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz", - "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/utils": "2.1.9", - "pathe": "^1.1.2" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner/node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@vitest/snapshot": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz", - "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "2.1.9", - "magic-string": "^0.30.12", - "pathe": "^1.1.2" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot/node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@vitest/spy": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz", - "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyspy": "^3.0.2" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/utils": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz", - "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "2.1.9", - "loupe": "^3.1.2", - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/acorn": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", - "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "dev": true, - "license": "MIT" - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/bundle-require": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", - "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", - "dev": true, - "license": "MIT", - "dependencies": { - "load-tsconfig": "^0.2.3" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "peerDependencies": { - "esbuild": ">=0.18" - } - }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/chai": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", - "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "assertion-error": "^2.0.1", - "check-error": "^2.1.1", - "deep-eql": "^5.0.1", - "loupe": "^3.1.0", - "pathval": "^2.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/change-case": { - "version": "5.4.4", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", - "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", - "dev": true, - "license": "MIT" - }, - "node_modules/check-error": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", - "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 16" - } - }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/colorette": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", - "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", - "dev": true, - "license": "MIT" - }, - "node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/confbox": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", - "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/consola": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", - "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.18.0 || >=16.10.0" - } - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-eql": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", - "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/es-module-lexer": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", - "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", - "dev": true, - "license": "MIT" - }, - "node_modules/esbuild": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz", - "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.2", - "@esbuild/android-arm": "0.27.2", - "@esbuild/android-arm64": "0.27.2", - "@esbuild/android-x64": "0.27.2", - "@esbuild/darwin-arm64": "0.27.2", - "@esbuild/darwin-x64": "0.27.2", - "@esbuild/freebsd-arm64": "0.27.2", - "@esbuild/freebsd-x64": "0.27.2", - "@esbuild/linux-arm": "0.27.2", - "@esbuild/linux-arm64": "0.27.2", - "@esbuild/linux-ia32": "0.27.2", - "@esbuild/linux-loong64": "0.27.2", - "@esbuild/linux-mips64el": "0.27.2", - "@esbuild/linux-ppc64": "0.27.2", - "@esbuild/linux-riscv64": "0.27.2", - "@esbuild/linux-s390x": "0.27.2", - "@esbuild/linux-x64": "0.27.2", - "@esbuild/netbsd-arm64": "0.27.2", - "@esbuild/netbsd-x64": "0.27.2", - "@esbuild/openbsd-arm64": "0.27.2", - "@esbuild/openbsd-x64": "0.27.2", - "@esbuild/openharmony-arm64": "0.27.2", - "@esbuild/sunos-x64": "0.27.2", - "@esbuild/win32-arm64": "0.27.2", - "@esbuild/win32-ia32": "0.27.2", - "@esbuild/win32-x64": "0.27.2" - } - }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/expect-type": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", - "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", - "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/fix-dts-default-cjs-exports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", - "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "magic-string": "^0.30.17", - "mlly": "^1.7.4", - "rollup": "^4.34.8" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/index-to-position": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.2.0.tgz", - "integrity": "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/joycon": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", - "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/js-levenshtein": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", - "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "license": "MIT" - }, - "node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true, - "license": "MIT" - }, - "node_modules/linkify-it": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", - "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "uc.micro": "^2.0.0" - } - }, - "node_modules/load-tsconfig": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", - "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/loupe": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", - "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true, - "license": "MIT" - }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, - "node_modules/markdown-it": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", - "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1", - "entities": "^4.4.0", - "linkify-it": "^5.0.0", - "mdurl": "^2.0.0", - "punycode.js": "^2.3.1", - "uc.micro": "^2.1.0" - }, - "bin": { - "markdown-it": "bin/markdown-it.mjs" - } - }, - "node_modules/mdurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", - "dev": true, - "license": "MIT" - }, - "node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mlly": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", - "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.15.0", - "pathe": "^2.0.3", - "pkg-types": "^1.3.1", - "ufo": "^1.6.1" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/openapi-typescript": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-7.10.1.tgz", - "integrity": "sha512-rBcU8bjKGGZQT4K2ekSTY2Q5veOQbVG/lTKZ49DeCyT9z62hM2Vj/LLHjDHC9W7LJG8YMHcdXpRZDqC1ojB/lw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@redocly/openapi-core": "^1.34.5", - "ansi-colors": "^4.1.3", - "change-case": "^5.4.4", - "parse-json": "^8.3.0", - "supports-color": "^10.2.2", - "yargs-parser": "^21.1.1" - }, - "bin": { - "openapi-typescript": "bin/cli.js" - }, - "peerDependencies": { - "typescript": "^5.x" - } - }, - "node_modules/parse-json": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", - "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.26.2", - "index-to-position": "^1.1.0", - "type-fest": "^4.39.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, - "node_modules/pathval": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", - "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.16" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pirates": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", - "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/pkg-types": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", - "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "confbox": "^0.1.8", - "mlly": "^1.7.4", - "pathe": "^2.0.1" - } - }, - "node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.11", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-load-config": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", - "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "lilconfig": "^3.1.1" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "jiti": ">=1.21.0", - "postcss": ">=8.0.9", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - }, - "postcss": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/punycode.js": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", - "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/rollup": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.55.1.tgz", - "integrity": "sha512-wDv/Ht1BNHB4upNbK74s9usvl7hObDnvVzknxqY/E/O3X6rW1U1rV1aENEfJ54eFZDTNo7zv1f5N4edCluH7+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.8" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.55.1", - "@rollup/rollup-android-arm64": "4.55.1", - "@rollup/rollup-darwin-arm64": "4.55.1", - "@rollup/rollup-darwin-x64": "4.55.1", - "@rollup/rollup-freebsd-arm64": "4.55.1", - "@rollup/rollup-freebsd-x64": "4.55.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.55.1", - "@rollup/rollup-linux-arm-musleabihf": "4.55.1", - "@rollup/rollup-linux-arm64-gnu": "4.55.1", - "@rollup/rollup-linux-arm64-musl": "4.55.1", - "@rollup/rollup-linux-loong64-gnu": "4.55.1", - "@rollup/rollup-linux-loong64-musl": "4.55.1", - "@rollup/rollup-linux-ppc64-gnu": "4.55.1", - "@rollup/rollup-linux-ppc64-musl": "4.55.1", - "@rollup/rollup-linux-riscv64-gnu": "4.55.1", - "@rollup/rollup-linux-riscv64-musl": "4.55.1", - "@rollup/rollup-linux-s390x-gnu": "4.55.1", - "@rollup/rollup-linux-x64-gnu": "4.55.1", - "@rollup/rollup-linux-x64-musl": "4.55.1", - "@rollup/rollup-openbsd-x64": "4.55.1", - "@rollup/rollup-openharmony-arm64": "4.55.1", - "@rollup/rollup-win32-arm64-msvc": "4.55.1", - "@rollup/rollup-win32-ia32-msvc": "4.55.1", - "@rollup/rollup-win32-x64-gnu": "4.55.1", - "@rollup/rollup-win32-x64-msvc": "4.55.1", - "fsevents": "~2.3.2" - } - }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true, - "license": "ISC" - }, - "node_modules/source-map": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", - "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">= 12" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true, - "license": "MIT" - }, - "node_modules/std-env": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", - "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", - "dev": true, - "license": "MIT" - }, - "node_modules/sucrase": { - "version": "3.35.1", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", - "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.2", - "commander": "^4.0.0", - "lines-and-columns": "^1.1.6", - "mz": "^2.7.0", - "pirates": "^4.0.1", - "tinyglobby": "^0.2.11", - "ts-interface-checker": "^0.1.9" - }, - "bin": { - "sucrase": "bin/sucrase", - "sucrase-node": "bin/sucrase-node" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/supports-color": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", - "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tinybench": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", - "dev": true, - "license": "MIT" - }, - "node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", - "dev": true, - "license": "MIT" - }, - "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.3" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/tinypool": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", - "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.0.0 || >=20.0.0" - } - }, - "node_modules/tinyrainbow": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", - "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", - "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true, - "license": "MIT", - "bin": { - "tree-kill": "cli.js" - } - }, - "node_modules/ts-interface-checker": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/tsup": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", - "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", - "dev": true, - "license": "MIT", - "dependencies": { - "bundle-require": "^5.1.0", - "cac": "^6.7.14", - "chokidar": "^4.0.3", - "consola": "^3.4.0", - "debug": "^4.4.0", - "esbuild": "^0.27.0", - "fix-dts-default-cjs-exports": "^1.0.0", - "joycon": "^3.1.1", - "picocolors": "^1.1.1", - "postcss-load-config": "^6.0.1", - "resolve-from": "^5.0.0", - "rollup": "^4.34.8", - "source-map": "^0.7.6", - "sucrase": "^3.35.0", - "tinyexec": "^0.3.2", - "tinyglobby": "^0.2.11", - "tree-kill": "^1.2.2" - }, - "bin": { - "tsup": "dist/cli-default.js", - "tsup-node": "dist/cli-node.js" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@microsoft/api-extractor": "^7.36.0", - "@swc/core": "^1", - "postcss": "^8.4.12", - "typescript": ">=4.5.0" - }, - "peerDependenciesMeta": { - "@microsoft/api-extractor": { - "optional": true - }, - "@swc/core": { - "optional": true - }, - "postcss": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/type-fest": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", - "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typedoc": { - "version": "0.27.9", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.9.tgz", - "integrity": "sha512-/z585740YHURLl9DN2jCWe6OW7zKYm6VoQ93H0sxZ1cwHQEQrUn5BJrEnkWhfzUdyO+BLGjnKUZ9iz9hKloFDw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@gerrit0/mini-shiki": "^1.24.0", - "lunr": "^2.3.9", - "markdown-it": "^14.1.0", - "minimatch": "^9.0.5", - "yaml": "^2.6.1" - }, - "bin": { - "typedoc": "bin/typedoc" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x" - } - }, - "node_modules/typedoc/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/uc.micro": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", - "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", - "dev": true, - "license": "MIT" - }, - "node_modules/ufo": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.2.tgz", - "integrity": "sha512-heMioaxBcG9+Znsda5Q8sQbWnLJSl98AFDXTO80wELWEzX3hordXsTdxrIfMQoO9IY1MEnoGoPjpoKpMj+Yx0Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/vite": { - "version": "5.4.21", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", - "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "^0.21.3", - "postcss": "^8.4.43", - "rollup": "^4.20.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "sass-embedded": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } - } - }, - "node_modules/vite-node": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz", - "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.7", - "es-module-lexer": "^1.5.4", - "pathe": "^1.1.2", - "vite": "^5.0.0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/vite-node/node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/vite/node_modules/@esbuild/aix-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", - "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/android-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", - "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/android-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", - "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/android-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", - "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/darwin-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", - "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/darwin-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", - "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", - "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/freebsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", - "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", - "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", - "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", - "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-loong64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", - "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-mips64el": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", - "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", - "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-riscv64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", - "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-s390x": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", - "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/linux-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", - "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/netbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", - "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/openbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", - "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/sunos-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", - "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/win32-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", - "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/win32-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", - "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/@esbuild/win32-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", - "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/vite/node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" - } - }, - "node_modules/vitest": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz", - "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/expect": "2.1.9", - "@vitest/mocker": "2.1.9", - "@vitest/pretty-format": "^2.1.9", - "@vitest/runner": "2.1.9", - "@vitest/snapshot": "2.1.9", - "@vitest/spy": "2.1.9", - "@vitest/utils": "2.1.9", - "chai": "^5.1.2", - "debug": "^4.3.7", - "expect-type": "^1.1.0", - "magic-string": "^0.30.12", - "pathe": "^1.1.2", - "std-env": "^3.8.0", - "tinybench": "^2.9.0", - "tinyexec": "^0.3.1", - "tinypool": "^1.0.1", - "tinyrainbow": "^1.2.0", - "vite": "^5.0.0", - "vite-node": "2.1.9", - "why-is-node-running": "^2.3.0" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.9", - "@vitest/ui": "2.1.9", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } - } - }, - "node_modules/vitest/node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/why-is-node-running": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", - "dev": true, - "license": "MIT", - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yaml": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", - "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - }, - "node_modules/yaml-ast-parser": { - "version": "0.0.43", - "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", - "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index 2f7ddc1..0000000 --- a/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "@seclai/sdk", - "version": "0.0.0", - "description": "Seclai JavaScript SDK", - "keywords": ["Seclai", "ai", "agent", "vector", "knowledge base", "cloud"], - "license": "MIT", - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" - } - }, - "files": [ - "dist", - "LICENSE", - "README.md", - "CHANGELOG.md" - ], - "homepage": "https://seclai.github.io/seclai-javascript/latest/", - "bugs": { - "url": "https://github.com/seclai/seclai-javascript/issues", - "email": "support@seclai.com" - }, - "repository": "github:seclai/seclai-javascript", - "scripts": { - "version:apply": "node scripts/set-version.mjs apply && node scripts/set-readme-version.mjs apply", - "version:restore": "node scripts/set-readme-version.mjs restore && node scripts/set-version.mjs restore", - "generate": "openapi-typescript openapi/seclai.openapi.json -o src/openapi.ts", - "build": "npm run generate && tsup src/index.ts --format esm,cjs --dts", - "build:versioned": "npm run version:apply && npm run build && npm run version:restore", - "publish:ci": "npm run version:apply && npm run build && npm publish --provenance --access public --ignore-scripts && npm run version:restore", - "docs": "npm run generate && typedoc", - "test": "vitest run", - "test:watch": "vitest", - "typecheck": "tsc -p tsconfig.json --noEmit" - }, - "devDependencies": { - "openapi-typescript": "^7.9.1", - "typedoc": "^0.27.6", - "tsup": "^8.5.0", - "vitest": "^2.1.9", - "typescript": "^5.7.3" - } -} diff --git a/scripts/set-readme-version.mjs b/scripts/set-readme-version.mjs deleted file mode 100644 index 456a336..0000000 --- a/scripts/set-readme-version.mjs +++ /dev/null @@ -1,44 +0,0 @@ -import fs from "node:fs"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; - -const mode = process.argv[2]; -if (mode !== "apply" && mode !== "restore") { - console.error("Usage: node scripts/set-readme-version.mjs "); - process.exit(2); -} - -const repoRoot = path.resolve(fileURLToPath(new URL("..", import.meta.url))); -const readmePath = path.join(repoRoot, "README.md"); -const backupPath = path.join(repoRoot, ".README.md.bak"); - -const DOCS_LATEST = "https://seclai.github.io/seclai-javascript/latest/"; - -if (mode === "apply") { - const version = process.env.VERSION; - if (!version) { - console.error("Missing VERSION env var."); - process.exit(2); - } - - if (!fs.existsSync(backupPath)) { - fs.copyFileSync(readmePath, backupPath); - } - - const original = fs.readFileSync(readmePath, "utf8"); - const versioned = `https://seclai.github.io/seclai-javascript/${version}/`; - - // Replace only the canonical docs link. Keep other "latest" mentions untouched. - const updated = original.includes(DOCS_LATEST) - ? original.replaceAll(DOCS_LATEST, versioned) - : original; - - fs.writeFileSync(readmePath, updated); -} - -if (mode === "restore") { - if (fs.existsSync(backupPath)) { - fs.copyFileSync(backupPath, readmePath); - fs.rmSync(backupPath); - } -} diff --git a/scripts/set-version.mjs b/scripts/set-version.mjs deleted file mode 100644 index 49dcd75..0000000 --- a/scripts/set-version.mjs +++ /dev/null @@ -1,56 +0,0 @@ -import fs from "node:fs"; -import path from "node:path"; - -const ROOT = path.resolve(process.cwd()); -const PACKAGE_JSON = path.join(ROOT, "package.json"); -const BACKUP = path.join(ROOT, ".version-backup.json"); - -function readJson(filePath) { - return JSON.parse(fs.readFileSync(filePath, "utf8")); -} - -function writeJson(filePath, value) { - fs.writeFileSync(filePath, JSON.stringify(value, null, 2) + "\n", "utf8"); -} - -function normalizeVersion(v) { - if (typeof v !== "string") return undefined; - const trimmed = v.trim(); - if (!trimmed) return undefined; - return trimmed.startsWith("v") ? trimmed.slice(1) : trimmed; -} - -const command = process.argv[2]; - -if (command === "apply") { - const envVersion = normalizeVersion(process.env.VERSION); - if (!envVersion) process.exit(0); - - const pkg = readJson(PACKAGE_JSON); - - if (!fs.existsSync(BACKUP)) { - writeJson(BACKUP, { version: pkg.version }); - } - - pkg.version = envVersion; - writeJson(PACKAGE_JSON, pkg); - process.exit(0); -} - -if (command === "restore") { - if (!fs.existsSync(BACKUP)) process.exit(0); - - const backup = readJson(BACKUP); - const pkg = readJson(PACKAGE_JSON); - - if (typeof backup.version === "string") { - pkg.version = backup.version; - writeJson(PACKAGE_JSON, pkg); - } - - fs.unlinkSync(BACKUP); - process.exit(0); -} - -console.error('Usage: node scripts/set-version.mjs '); -process.exit(2); diff --git a/.claude/skills/seclai-sdk-sync/sdksync.py b/sdksync.py similarity index 83% rename from .claude/skills/seclai-sdk-sync/sdksync.py rename to sdksync.py index 6a9d205..b3299db 100755 --- a/.claude/skills/seclai-sdk-sync/sdksync.py +++ b/sdksync.py @@ -47,14 +47,29 @@ # "this method sends no params" — a silent false pass. # helpers — positional helper calls that expand to a fixed, ordered key list. # Expansion is arity-aware: only as many keys as arguments supplied. +# Signatures, used by `surface`: +# sig_re — a public method's head, ending on its opening `(`. The +# parameter list is then sliced by paren matching, never by a +# `[^)]*` class: a callback type or a `(default: 2000)` doc +# comment would end it early, the method would drop out of the +# surface and be reported REMOVED. +# sig_tail_re — matched straight after the closing `)` (the return type). +# sig_groups — head groups, then "params", then tail groups. +# line_comment — the line-comment marker; `public_surface` strips these, and +# `/* */` too when it is `//`, from the whole file. Default `//`. # Endpoint helpers, used by `params` and `returns` (see `request_blocks`): # helper_re — a NON-public method declaration on the client, name captured. # helper_call — how the client calls one of its own methods; `{name}` is filled # in. Receiver-qualified so `_client.X(` and `t.c.x(` — a typed # façade calling in from another class — are not followed. +_JS_HELPER_RE = (r"^ (?:(?:private|protected) (?:static )?(?:async )?\*?|(?:async )?\*?#)" + r"([a-zA-Z_][a-zA-Z0-9_]*)\s*[(<]") + LANGS = { "python": { - "sig_re": r"\n (?:async )?def ([a-z]\w*)\(([^)]*)\)\s*->\s*([^:]+):", + "sig_re": r"\n (?:async )?def ([a-z]\w*)\(", + "sig_tail_re": r"\s*->\s*([^:]+):", + "line_comment": "#", "sig_groups": ("name", "params", "ret"), "detect": "seclai/seclai.py", "sources": ["seclai/seclai.py"], @@ -72,7 +87,8 @@ "skip": {"request", "request_raw", "stream", "paginate"}, }, "javascript": { - "sig_re": r"\n (?:async )?(\w+)\(([^)]*)\)\s*:\s*([^{\n]+?)\s*\{", + "sig_re": r"\n (?:async )?(\w+)\(", + "sig_tail_re": r"\s*:\s*([^{\n]+?)\s*\{", "sig_groups": ("name", "params", "ret"), "detect": "src/client.ts", "sources": ["src/client.ts"], @@ -91,13 +107,16 @@ "dict_key_re": r'["\']?([a-zA-Z_][a-zA-Z0-9_]*)["\']?\s*:', # `private`/`protected`/`#name` members only. An unmodified `_name(` is # matched by method_re and already audited as a block of its own. - "helper_re": (r"^ (?:(?:private|protected) (?:static )?(?:async )?\*?|(?:async )?\*?#)" - r"([a-zA-Z_][a-zA-Z0-9_]*)\s*[(<]"), + "helper_re": _JS_HELPER_RE, + # method_re skips helpers, so without this a method's block runs on into + # the helper below it and takes that helper's request as its own. + "boundary_re": _JS_HELPER_RE, "helper_call": r"\bthis\.#?{name}\s*[(<]", "skip": {"request", "requestRaw", "uploadFile", "paginate"}, }, "go": { - "sig_re": r"func \(c \*Client\) (\w+)\(([^)]*)\) \(([^)]*)\)", + "sig_re": r"func \(c \*Client\) (\w+)\(", + "sig_tail_re": r" \(([^)]*)\)", "sig_groups": ("name", "params", "ret"), "detect": "client.go", "sources": ["*.go"], @@ -124,7 +143,7 @@ "skip": {"Do", "buildURL"}, }, "csharp": { - "sig_re": r"public (?:async )?([\w<>,?\[\]. ]+?) ([A-Z]\w*)\(([^)]*)\)", + "sig_re": r"public (?:async )?([\w<>,?\[\]. ]+?) ([A-Z]\w*)\(", "sig_groups": ("ret", "name", "params"), "detect": "src/Seclai/SeclaiClient.cs", "sources": ["src/Seclai/*.cs"], @@ -216,20 +235,50 @@ def load_spec(ref: str | None, path: str, repo: Path) -> dict: # ── params ─────────────────────────────────────────────────────────────────── +def _quoted_end(text: str, i: int) -> int | None: + """Index just past the string literal opening at `text[i]`, or None. + + Only a literal that closes on the same line counts. Every scanner below runs + over raw source, comments included, so an apostrophe in `// don't` must stay + an ordinary character rather than open a string that swallows the rest of + the block. A backslash escapes the next character. + """ + q = text[i] + j = i + 1 + while j < len(text): + ch = text[j] + if ch == "\\": + j += 2 + continue + if ch == q: + return j + 1 + if ch == "\n": + return None + j += 1 + return None + + def balanced_slice(text: str, at: int, opener: str = "{", closer: str = "}") -> str | None: - """Return the brace-delimited literal starting at or after `at`. + """Return the bracket-delimited literal starting at or after `at`. Regex cannot do this: query literals span lines and nest, and a non-greedy - match silently truncates at the first inner `}`. + match silently truncates at the first inner `}`. Brackets inside a string + literal (`fmt?: "{id}"`, `sep = ")"`) are text, not structure. """ i = text.find(opener, at) if i == -1: return None depth, j = 0, i while j < len(text): - if text[j] == opener: + ch = text[j] + if ch in "\"'`": + end = _quoted_end(text, j) + if end is not None: + j = end + continue + if ch == opener: depth += 1 - elif text[j] == closer: + elif ch == closer: depth -= 1 if depth == 0: return text[i + 1: j] @@ -237,26 +286,70 @@ def balanced_slice(text: str, at: int, opener: str = "{", closer: str = "}") -> return None -def split_args(sig: str) -> list[str]: +def strip_comments(text: str, line: str = "//") -> str: + """`text` with `/* ... */` and `line`-to-end-of-line comments replaced by a + space. String literals are left intact, so `"https://x"` is not a comment. + + Python passes `line="#"` and has no block comments; `/*` there would be + an operator sequence, never a comment, so it is only honoured for `//`. + """ + out, j, n = [], 0, len(text) + while j < n: + ch = text[j] + if ch in "\"'`": + end = _quoted_end(text, j) + if end is not None: + out.append(text[j:end]) + j = end + continue + if line == "//" and text.startswith("/*", j): + end = text.find("*/", j + 2) + j = n if end == -1 else end + 2 + out.append(" ") + continue + if text.startswith(line, j): + end = text.find("\n", j) + j = n if end == -1 else end + out.append(" ") + continue + out.append(ch) + j += 1 + return "".join(out) + + +def split_args(sig: str, seps: str = ",") -> list[str]: """Split a comma-separated argument or parameter list at depth 0. A naive `split(",")` turns `Dictionary q` into two entries, which over-counts arity for the query helpers and reports a phantom - signature change for `surface`. + signature change for `surface`. The `>` of a TypeScript arrow `=>` is not a + closing bracket: counting it would split `cb: (a: A, b: B) => void` after + the arrow. `seps` lets an object-literal type body split on `;` too. + Separators and brackets inside string literals are text. """ - out, depth, cur = [], 0, "" - for ch in sig: + out, depth, cur, prev = [], 0, [], "" + j, n = 0, len(sig) + while j < n: + ch = sig[j] + if ch in "\"'`": + end = _quoted_end(sig, j) + if end is not None: + cur.append(sig[j:end]) + j = end + continue if ch in "<([{": depth += 1 - elif ch in ">)]}": + elif ch in ")]}" or (ch == ">" and prev != "="): depth -= 1 - if ch == "," and depth == 0: - out.append(cur.strip()) - cur = "" + prev = ch + if ch in seps and depth == 0: + out.append("".join(cur).strip()) + cur = [] else: - cur += ch - if cur.strip(): - out.append(cur.strip()) + cur.append(ch) + j += 1 + if "".join(cur).strip(): + out.append("".join(cur).strip()) return [p for p in out if p and p != "*"] @@ -1013,8 +1106,19 @@ def public_surface(text: str, cfg: dict) -> dict[str, set[tuple[str, str]]]: def norm(x: str | None) -> str: return " ".join((x or "").split()) + tail_re = re.compile(cfg.get("sig_tail_re", ""), re.S) + # Comments are not signature, and stripped before slicing so a `)` or an + # apostrophe in one cannot end the parameter list early. + text = strip_comments(text, cfg.get("line_comment", "//")) for m in re.finditer(cfg["sig_re"], text, re.S): - parts = dict(zip(order, m.groups())) + open_paren = m.end() - 1 + params = balanced_slice(text, open_paren, "(", ")") + if params is None: + continue + tail = tail_re.match(text, open_paren + len(params) + 2) + if tail is None: + continue + parts = dict(zip(order, m.groups() + (params,) + tail.groups())) out.setdefault(norm(parts["name"]), set()).add((norm(parts["ret"]), norm(parts["params"]))) return out @@ -1024,6 +1128,162 @@ def norm(x: str | None) -> str: _params = split_args +def _ts_inline_object(param: str) -> tuple[str, str, str] | None: + """(prefix, body, suffix) when a TypeScript parameter's type is an inline + object literal: `opts: { a?: string } = {}` -> ("opts:", "a?: string", "= {}"). + + The `{` must follow the annotation colon directly, so a default value such as + `x = {}` or a generic `Partial<{...}>` never qualifies. None otherwise. + """ + m = re.match(r"\s*[\w$]+\s*\??\s*:\s*\{", param) + if not m: + return None + start = m.end() - 1 + body = balanced_slice(param, start) + if body is None: + return None + end = start + len(body) + 1 + return (" ".join(param[:start].split()), body, " ".join(param[end + 1:].split())) + + +def _ts_object_members(body: str) -> dict[str, tuple[bool, str]] | None: + """member name -> (optional, normalised text) for an object-literal type body, + split on depth-0 `;` or `,`. None when any member cannot be named (index + signatures, call signatures, spread-like text) or a name repeats — the caller + then refuses to call the change compatible. Comments are dropped first: + seclai-javascript documents each member with `/** ... */`, which would + otherwise hide the member's name, and a `,` or `;` inside one would split it. + """ + parts = split_args(strip_comments(body), ";,") + out: dict[str, tuple[bool, str]] = {} + for raw in parts: + text = " ".join(raw.split()) + if not text: + continue + m = re.match(r"(?:readonly\s+)?([\w$]+|\"[^\"]*\"|'[^']*')\s*(\?)?\s*[:(]", text) + if not m or m.group(1) in out: + return None + out[m.group(1)] = (bool(m.group(2)), text) + return out + + +_TS_MEMBER_RE = re.compile(r"(?:readonly\s+)?([\w$]+|\"[^\"]*\"|'[^']*')\s*(\?)?\s*:\s*(.*)$", re.S) + + +def _ts_union(t: str) -> list[str]: + """Top-level `|` members of a type, whitespace-normalised and sorted.""" + return sorted(" ".join(x.split()) for x in split_args(t, "|")) + + +def _ts_widened_to_undefined(old: str, new: str) -> bool: + """`x?: T` -> `x?: T | undefined` (or `undefined | T`). Both optional, same + name, and the new union is exactly the old one plus `undefined`. Under + exactOptionalPropertyTypes that admits an explicit `undefined`; without it + the type is unchanged. Either way every old value and old use still fits.""" + mo, mn = _TS_MEMBER_RE.match(old), _TS_MEMBER_RE.match(new) + if not mo or not mn or mo.group(1) != mn.group(1) or not (mo.group(2) and mn.group(2)): + return False + old_u = _ts_union(mo.group(3)) + return "undefined" not in old_u and _ts_union(mn.group(3)) == sorted(old_u + ["undefined"]) + + +def _ts_options_change(o: str, n: str) -> set[str] | None: + """Kinds of compatible change between two inline options-object parameters, + or None when the change is not provably compatible. Same name, optionality + and default; every old member unchanged, in any order ("same"), or only + widened to accept `undefined`; every added member optional, and none added to an empty `{}`.""" + po, pn = _ts_inline_object(o), _ts_inline_object(n) + if po is None or pn is None or po[0] != pn[0] or po[2] != pn[2]: + return None + mo, mn = _ts_object_members(po[1]), _ts_object_members(pn[1]) + if mo is None or mn is None: + return None + # `{}` accepts any non-null value; a weak type such as `{ a?: T }` does not (TS2559). + if not mo and mn: + return None + kinds: set[str] = set() + for k, (opt, text) in mo.items(): + if k not in mn: + return None + if mn[k] == (opt, text): + continue + if not _ts_widened_to_undefined(text, mn[k][1]): + return None + kinds.add("undefined") + added = [v for k, v in mn.items() if k not in mo] + if not all(opt for opt, _ in added): + return None + if added: + kinds.add("props") + return kinds or {"same"} + + +def _ts_wrapped_type(o: str, n: str) -> str | None: + """"omit" or "partial" when the parameter's type `T` became `Omit` + (keys a union of string literals) or `Partial`, with `T`, the name, the + optionality and the default textually unchanged. Every old argument still + fits both. None otherwise — including `Pick<>` and an `Omit<>` of another + type.""" + ho = re.match(r"\s*([\w$]+\s*\??\s*:\s*)", o) + hn = re.match(r"\s*([\w$]+\s*\??\s*:\s*)", n) + if not ho or not hn or " ".join(ho.group(1).split()) != " ".join(hn.group(1).split()): + return None + rest_o, rest_n = o[ho.end():], n[hn.end():] + w = re.match(r"(Omit|Partial)\s*<", rest_n) + if not w: + return None + inner = balanced_slice(rest_n, w.end() - 1, "<", ">") + if inner is None: + return None + after = rest_n[w.end() + len(inner) + 1:] + args = split_args(inner) + kind = w.group(1).lower() + if kind == "omit": + if len(args) != 2: + return None + keys = split_args(args[1], "|") + if not keys or not all(re.fullmatch(r"\"[^\"]*\"|'[^']*'", k) for k in keys): + return None + elif len(args) != 1: + return None + norm = lambda x: " ".join(x.split()) # noqa: E731 + return kind if norm(rest_o) == norm(args[0] + after) else None + + +_TS_COMPATIBLE_LABELS = { + "props": ("optional property added to an options object — usually source compatible, " + "but breaks a caller passing a non-literal object whose same-named property " + "has another type"), + "undefined": "optional property widened to accept undefined — source compatible", + "omit": ("parameter type wrapped in Omit<…> — usually source compatible: every old value " + "still fits, but an object literal that sets an omitted key no longer compiles"), + "partial": "parameter type wrapped in Partial<…> — source compatible: every old value still fits", + "same": "options object unchanged apart from member order or separators", +} + + +def _ts_compatible_change(old: list[str], new: list[str]) -> str | None: + """Label when every changed TypeScript parameter changed in one of the + provably compatible ways above, with the same count, order and every other + parameter textually unchanged. None — graded breaking — otherwise.""" + if len(old) != len(new) or old == new: + return None + kinds: set[str] = set() + for o, n in zip(old, new): + if o == n: + continue + k = _ts_options_change(o, n) + if k is None: + w = _ts_wrapped_type(o, n) + if w is None: + return None + k = {w} + kinds |= k + if len(kinds) > 1: + kinds.discard("same") + return "; ".join(_TS_COMPATIBLE_LABELS[k] for k in _TS_COMPATIBLE_LABELS if k in kinds) + + def classify_change(lang: str, old: tuple[str, str], new: tuple[str, str]) -> tuple[str, str]: """(severity, label) for one signature change. severity is 'break' or 'warn'. @@ -1038,6 +1298,10 @@ def classify_change(lang: str, old: tuple[str, str], new: tuple[str, str]) -> tu new_ret, new_par = new if old_par != new_par: op, np_ = split_args(old_par), split_args(new_par) + if lang == "javascript" and old_ret == new_ret: + label = _ts_compatible_change(op, np_) + if label: + return "warn", label # `len(np_) > len(op)` matters: `split_args` drops Python's bare `*`, so # `f(self, a, b)` -> `f(self, a, *, b)` yields two IDENTICAL lists, the # empty tail passes `all()` vacuously, and making a parameter diff --git a/src/auth.ts b/src/auth.ts deleted file mode 100644 index 47aaf8f..0000000 --- a/src/auth.ts +++ /dev/null @@ -1,602 +0,0 @@ -/** - * @module - * - * SSO credential resolution: config file parsing, token caching, and automatic - * token refresh against AWS Cognito. - * - * @internal — not part of the public API surface. Consumed by {@link Seclai}. - */ -import type { FetchLike } from "./client"; - -// ─── Types ─────────────────────────────────────────────────────────────────── - -/** Resolved SSO profile settings. */ -export interface SsoProfile { - ssoAccountId?: string | undefined; - ssoRegion: string; - ssoClientId: string; - ssoDomain: string; -} - -/** Contents of a single SSO cache file. */ -export interface SsoCacheEntry { - accessToken: string; - refreshToken?: string; - idToken?: string | undefined; - expiresAt: string; // ISO-8601 - clientId: string; - region: string; - cognitoDomain: string; -} - -// ─── Constants ─────────────────────────────────────────────────────────────── - -const DEFAULT_CONFIG_DIR = ".seclai"; -const SSO_CACHE_DIR = "sso/cache"; -const CONFIG_FILE = "config"; -const EXPIRY_BUFFER_MS = 30_000; // 30 seconds -const DEFAULT_API_KEY_HEADER = "x-api-key"; - -/** Default SSO domain (production Cognito). Override with `SECLAI_SSO_DOMAIN` or config file. */ -export const DEFAULT_SSO_DOMAIN = "auth.seclai.com"; -/** Default SSO client ID (production public client). Override with `SECLAI_SSO_CLIENT_ID` or config file. */ -export const DEFAULT_SSO_CLIENT_ID = "4bgf8v9qmc5puivbaqon9n5lmr"; -/** Default SSO region. Override with `SECLAI_SSO_REGION` or config file. */ -export const DEFAULT_SSO_REGION = "us-west-2"; - -// ─── Environment helpers ───────────────────────────────────────────────────── - -function getEnv(name: string): string | undefined { - const p = (globalThis as any)?.process; - return p?.env?.[name]; -} - -function getHomeDir(): string | undefined { - const p = (globalThis as any)?.process; - return p?.env?.HOME ?? p?.env?.USERPROFILE; -} - -// ─── SHA-1 hash ────────────────────────────────────────────────────────────── - -async function sha1Hex(input: string): Promise { - // Prefer Node.js crypto when available - try { - // @ts-expect-error -- resolved at runtime; no @types/node in this package - const { createHash } = await import("node:crypto"); - return createHash("sha1").update(input).digest("hex"); - } catch { - // Fall back to Web Crypto API - const encoded = new TextEncoder().encode(input); - const buffer = await crypto.subtle.digest("SHA-1", encoded); - return Array.from(new Uint8Array(buffer)) - .map((b) => b.toString(16).padStart(2, "0")) - .join(""); - } -} - -/** - * Compute the cache filename for a given domain + clientId. - * - * @param domain - The Cognito domain (e.g. `"auth.example.com"`). - * @param clientId - The Cognito app client ID. - * @returns SHA-1 hex digest of `"domain|clientId"`. - */ -export async function cacheFileName(domain: string, clientId: string): Promise { - return sha1Hex(`${domain}|${clientId}`); -} - -// ─── INI parser ────────────────────────────────────────────────────────────── - -/** - * Minimal INI parser matching AWS config format: - * - `[default]` section - * - `[profile ]` sections - * - `key = value` pairs - * - Lines starting with `#` or `;` are comments - * - * @param content - Raw INI file content. - * @returns Map of section names to key-value pairs. - */ -export function parseIni(content: string): Record> { - const sections: Record> = {}; - let currentSection: string | null = null; - - for (const rawLine of content.split(/\r?\n/)) { - const line = rawLine.trim(); - - if (!line || line.startsWith("#") || line.startsWith(";")) continue; - - const sectionMatch = line.match(/^\[(.+)\]$/); - if (sectionMatch) { - const raw = sectionMatch[1]!.trim(); - // `[default]` stays as "default", `[profile foo]` becomes "foo" - currentSection = raw.startsWith("profile ") - ? raw.slice("profile ".length).trim() - : raw; - sections[currentSection] ??= {}; - continue; - } - - if (currentSection !== null) { - const eqIdx = line.indexOf("="); - if (eqIdx > 0) { - const key = line.slice(0, eqIdx).trim(); - const value = line.slice(eqIdx + 1).trim(); - sections[currentSection]![key] = value; - } - } - } - - return sections; -} - -// ─── File system (Node.js only) ────────────────────────────────────────────── - -interface FsModule { - readFileSync(path: string, encoding: string): string; - writeFileSync(path: string, data: string, options?: { mode?: number }): void; - mkdirSync(path: string, options?: { recursive?: boolean; mode?: number }): void; - existsSync(path: string): boolean; - unlinkSync(path: string): void; - renameSync(oldPath: string, newPath: string): void; -} - -interface PathModule { - join(...parts: string[]): string; -} - -let _fs: FsModule | null = null; -let _path: PathModule | null = null; - -async function getFs(): Promise { - if (!_fs) { - // @ts-expect-error -- resolved at runtime; no @types/node in this package - _fs = (await import("node:fs")) as unknown as FsModule; - } - return _fs; -} - -async function getPath(): Promise { - if (!_path) { - // @ts-expect-error -- resolved at runtime; no @types/node in this package - _path = (await import("node:path")) as unknown as PathModule; - } - return _path; -} - -// ─── Config dir resolution ─────────────────────────────────────────────────── - -/** - * Resolve the config directory path. - * - * @param override - Explicit directory path (highest priority). - * @returns Resolved absolute path to the config directory. - * @throws {Error} If the home directory cannot be determined and no override is provided. - */ -export async function resolveConfigDir(override?: string): Promise { - if (override) return override; - - const envDir = getEnv("SECLAI_CONFIG_DIR"); - if (envDir) return envDir; - - const home = getHomeDir(); - if (!home) { - throw new Error("Cannot determine home directory. Set SECLAI_CONFIG_DIR."); - } - - const pathMod = await getPath(); - return pathMod.join(home, DEFAULT_CONFIG_DIR); -} - -// ─── Profile resolution ───────────────────────────────────────────────────── - -/** - * Load and resolve an SSO profile from the config file. - * Non-default profiles inherit unset keys from `[default]`. - * All profiles fall back to built-in defaults and environment variable overrides. - * - * **Node.js only** — this function uses `node:fs` and `node:path` internally - * and will throw in browser/edge-worker runtimes. - * - * @param configDir - Resolved config directory path. - * @param profileName - Profile name to look up (`"default"` or a named profile). - * @returns The resolved profile. Always returns a valid profile using built-in defaults. - */ -export async function loadSsoProfile( - configDir: string, - profileName: string, -): Promise { - const fs = await getFs(); - const pathMod = await getPath(); - - let merged: Record = {}; - - const configPath = pathMod.join(configDir, CONFIG_FILE); - if (fs.existsSync(configPath)) { - const content = fs.readFileSync(configPath, "utf-8"); - const sections = parseIni(content); - - const defaultSection = sections["default"] ?? {}; - const profileSection = profileName === "default" ? defaultSection : sections[profileName]; - - if (profileSection) { - merged = profileName === "default" ? profileSection : { ...defaultSection, ...profileSection }; - } - } - - // Environment variables override config file values - const ssoDomain = getEnv("SECLAI_SSO_DOMAIN") ?? merged["sso_domain"] ?? DEFAULT_SSO_DOMAIN; - const ssoClientId = getEnv("SECLAI_SSO_CLIENT_ID") ?? merged["sso_client_id"] ?? DEFAULT_SSO_CLIENT_ID; - const ssoRegion = getEnv("SECLAI_SSO_REGION") ?? merged["sso_region"] ?? DEFAULT_SSO_REGION; - const ssoAccountId = merged["sso_account_id"] || undefined; - - return { ssoAccountId, ssoRegion, ssoClientId, ssoDomain }; -} - -// ─── Cache I/O ─────────────────────────────────────────────────────────────── - -/** - * Read a cached SSO token from disk. - * - * @param configDir - Resolved config directory path. - * @param profile - SSO profile (used to derive the cache filename). - * @returns The cached entry, or `null` if not found or unreadable. - */ -/** Resolve the full path to a profile's SSO cache file. */ -async function resolveCachePath( - configDir: string, - profile: SsoProfile, -): Promise { - const pathMod = await getPath(); - const hash = await cacheFileName(profile.ssoDomain, profile.ssoClientId); - return pathMod.join(configDir, SSO_CACHE_DIR, `${hash}.json`); -} - -export async function readSsoCache( - configDir: string, - profile: SsoProfile, -): Promise { - const fs = await getFs(); - - const cachePath = await resolveCachePath(configDir, profile); - - if (!fs.existsSync(cachePath)) return null; - - try { - const raw = fs.readFileSync(cachePath, "utf-8"); - return JSON.parse(raw) as SsoCacheEntry; - } catch { - return null; - } -} - -/** - * Write a cached SSO token to disk atomically. - * Creates the cache directory if it doesn't exist. - * - * @param configDir - Resolved config directory path. - * @param profile - SSO profile (used to derive the cache filename). - * @param entry - Token data to persist. - */ -export async function writeSsoCache( - configDir: string, - profile: SsoProfile, - entry: SsoCacheEntry, -): Promise { - const fs = await getFs(); - const pathMod = await getPath(); - - const cacheDir = pathMod.join(configDir, SSO_CACHE_DIR); - fs.mkdirSync(cacheDir, { recursive: true, mode: 0o700 }); - - const cachePath = await resolveCachePath(configDir, profile); - const tmpPath = `${cachePath}.tmp`; - - fs.writeFileSync(tmpPath, JSON.stringify(entry, null, 2), { mode: 0o600 }); - // On Windows, renameSync fails if destination exists — delete first (best-effort) - if (fs.existsSync(cachePath)) { - try { fs.unlinkSync(cachePath); } catch { /* let renameSync throw if needed */ } - } - fs.renameSync(tmpPath, cachePath); -} - -/** - * Delete a cached SSO token file. - * - * @param configDir - Resolved config directory path. - * @param profile - SSO profile (used to derive the cache filename). - */ -export async function deleteSsoCache( - configDir: string, - profile: SsoProfile, -): Promise { - const fs = await getFs(); - - const cachePath = await resolveCachePath(configDir, profile); - - if (fs.existsSync(cachePath)) { - fs.unlinkSync(cachePath); - } -} - -// ─── Token validation ──────────────────────────────────────────────────────── - -/** - * Check if a cached token is still valid (with 30s buffer). - * - * @param entry - The cached token entry to check. - * @returns `true` if the token expires more than 30 seconds in the future. - */ -export function isTokenValid(entry: SsoCacheEntry): boolean { - const expiresAt = new Date(entry.expiresAt).getTime(); - return Date.now() + EXPIRY_BUFFER_MS < expiresAt; -} - -// ─── Token refresh ─────────────────────────────────────────────────────────── - -/** - * Refresh an access token using a Cognito refresh_token grant. - * - * @param profile - SSO profile with Cognito domain and client ID. - * @param refreshTokenValue - The refresh token to exchange. - * @param fetcher - A `fetch`-compatible function for making HTTP requests. - * @returns A fresh {@link SsoCacheEntry} with the new tokens. - * @throws {Error} If the Cognito token endpoint returns a non-OK status. - */ -export async function refreshToken( - profile: SsoProfile, - refreshTokenValue: string, - fetcher: FetchLike, -): Promise { - const tokenUrl = `https://${profile.ssoDomain}/oauth2/token`; - - const body = new URLSearchParams({ - grant_type: "refresh_token", - client_id: profile.ssoClientId, - refresh_token: refreshTokenValue, - }); - - const response = await fetcher(tokenUrl, { - method: "POST", - headers: { "content-type": "application/x-www-form-urlencoded" }, - body: body.toString(), - }); - - if (!response.ok) { - const text = await response.text().catch(() => ""); - throw new Error(`Token refresh failed (HTTP ${response.status}): ${text}`); - } - - const data = (await response.json()) as { - access_token: string; - id_token?: string; - refresh_token?: string; - expires_in: number; - }; - - const expiresAt = new Date(Date.now() + data.expires_in * 1000).toISOString(); - - return { - accessToken: data.access_token, - refreshToken: data.refresh_token ?? refreshTokenValue, - idToken: data.id_token ?? undefined, - expiresAt, - clientId: profile.ssoClientId, - region: profile.ssoRegion, - cognitoDomain: profile.ssoDomain, - }; -} - -// ─── Credential chain resolver ─────────────────────────────────────────────── - -/** Options for resolving the credential chain. */ -export interface CredentialChainOptions { - /** Explicit API key (highest priority). */ - apiKey?: string | undefined; - /** Explicit static bearer token. */ - accessToken?: string | undefined; - /** Dynamic bearer token provider. */ - accessTokenProvider?: (() => string | Promise) | undefined; - /** Name of the profile from ~/.seclai/config. */ - profile?: string | undefined; - /** Override config directory path. */ - configDir?: string | undefined; - /** Whether to auto-refresh expired SSO tokens. Defaults to true. */ - autoRefresh?: boolean | undefined; - /** Account ID override (takes precedence over profile's sso_account_id). */ - accountId?: string | undefined; - /** Header name for API key auth. */ - apiKeyHeader?: string | undefined; - /** fetch implementation for token refresh. */ - fetch?: FetchLike | undefined; -} - -/** - * Resolved authentication state used throughout the client lifecycle. - * Created once by {@link resolveCredentialChain} and passed to - * {@link resolveAuthHeaders} on every request. - */ -export interface AuthState { - mode: "apiKey" | "bearerStatic" | "bearerProvider" | "sso"; - apiKey?: string; - apiKeyHeader: string; - accessToken?: string; - accessTokenProvider?: () => string | Promise; - accountId?: string | undefined; - ssoProfile?: SsoProfile; - configDir?: string; - autoRefresh: boolean; - fetcher?: FetchLike | undefined; - /** @internal Coalesces concurrent SSO token refresh attempts. */ - _refreshPromise?: Promise | undefined; -} - -/** - * Resolve the credential chain and return an AuthState. - * This is called once at client construction time. - * - * Resolution order: - * 1. Explicit `apiKey` option - * 2. Explicit `accessToken` option - * 3. Explicit `accessTokenProvider` option - * 4. `SECLAI_API_KEY` environment variable - * 5. SSO profile from `~/.seclai/config` - * - * @param opts - Credential chain options. - * @returns Resolved authentication state. - * @throws {Error} If no credentials are found. - */ -export async function resolveCredentialChain( - opts: CredentialChainOptions, -): Promise { - const apiKeyHeader = opts.apiKeyHeader ?? DEFAULT_API_KEY_HEADER; - - // 1. Explicit apiKey option - if (opts.apiKey) { - return { - mode: "apiKey", - apiKey: opts.apiKey, - apiKeyHeader, - accountId: opts.accountId, - autoRefresh: false, - }; - } - - // 2. Explicit accessToken (mutual exclusion already checked by caller) - if (opts.accessToken) { - return { - mode: "bearerStatic", - accessToken: opts.accessToken, - apiKeyHeader, - accountId: opts.accountId, - autoRefresh: false, - }; - } - - // 3. Explicit accessTokenProvider - if (opts.accessTokenProvider) { - return { - mode: "bearerProvider", - accessTokenProvider: opts.accessTokenProvider, - apiKeyHeader, - accountId: opts.accountId, - autoRefresh: false, - }; - } - - // 4. SECLAI_API_KEY env var - const envApiKey = getEnv("SECLAI_API_KEY"); - if (envApiKey) { - return { - mode: "apiKey", - apiKey: envApiKey, - apiKeyHeader, - accountId: opts.accountId, - autoRefresh: false, - }; - } - - // 5. Profile-based SSO resolution - try { - const configDir = await resolveConfigDir(opts.configDir); - const profileName = opts.profile ?? getEnv("SECLAI_PROFILE") ?? "default"; - const ssoProfile = await loadSsoProfile(configDir, profileName); - - return { - mode: "sso", - apiKeyHeader, - accountId: opts.accountId ?? ssoProfile.ssoAccountId, - ssoProfile, - configDir, - autoRefresh: opts.autoRefresh !== false, - fetcher: opts.fetch, - }; - } catch { - // Config dir not found — fall through - } - - // 6. Nothing found - throw new Error( - "Missing credentials. Provide apiKey, accessToken, set SECLAI_API_KEY, or run `seclai auth login`.", - ); -} - -/** - * Resolve authentication headers from the current AuthState. - * Called per-request to handle dynamic token providers and SSO cache refresh. - * - * @param state - The resolved authentication state. - * @returns Headers object with the appropriate auth header(s) set. - */ -export async function resolveAuthHeaders( - state: AuthState, -): Promise> { - const headers: Record = {}; - - switch (state.mode) { - case "apiKey": - headers[state.apiKeyHeader] = state.apiKey!; - break; - - case "bearerStatic": - headers["authorization"] = `Bearer ${state.accessToken!}`; - break; - - case "bearerProvider": { - const token = await Promise.resolve(state.accessTokenProvider!()); - headers["authorization"] = `Bearer ${token}`; - break; - } - - case "sso": { - const token = await resolveSsoToken(state); - headers["authorization"] = `Bearer ${token}`; - break; - } - } - - if (state.accountId) { - headers["x-account-id"] = state.accountId; - } - - return headers; -} - -/** Resolve a valid SSO token, refreshing from cache if needed. */ -async function resolveSsoToken(state: AuthState): Promise { - const profile = state.ssoProfile!; - const configDir = state.configDir!; - - const cached = await readSsoCache(configDir, profile); - - if (cached && isTokenValid(cached)) { - return cached.accessToken; - } - - if (cached?.refreshToken && state.autoRefresh) { - // Coalesce concurrent refresh attempts - if (state._refreshPromise) { - return state._refreshPromise; - } - - const fetcher = state.fetcher ?? (globalThis.fetch as FetchLike | undefined); - if (!fetcher) { - throw new Error("No fetch implementation available for token refresh."); - } - - state._refreshPromise = (async () => { - try { - const refreshed = await refreshToken(profile, cached.refreshToken!, fetcher); - await writeSsoCache(configDir, profile, refreshed); - return refreshed.accessToken; - } finally { - state._refreshPromise = undefined; - } - })(); - return state._refreshPromise; - } - - throw new Error( - `SSO token expired. Run \`seclai auth login\` to re-authenticate.`, - ); -} diff --git a/src/client.ts b/src/client.ts deleted file mode 100644 index 038541c..0000000 --- a/src/client.ts +++ /dev/null @@ -1,3734 +0,0 @@ -/** - * @module - * - * Main SDK client for the Seclai API. - * - * Exports the {@link Seclai} class which provides typed convenience methods for - * every API endpoint, plus low-level {@link Seclai.request | request()} and - * {@link Seclai.requestRaw | requestRaw()} escape hatches, streaming helpers, - * and automatic pagination. - */ -import { - SeclaiAPIStatusError, - SeclaiAPIValidationError, - SeclaiConfigurationError, - SeclaiError, - SeclaiStreamingError, -} from "./errors"; -import type { ApiVersion } from "./versions"; -import { KNOWN_API_VERSIONS } from "./versions"; -import type { AuthState } from "./auth"; -import { resolveCredentialChain, resolveAuthHeaders } from "./auth"; -import type { - AgentRunEvent, - AddEmailDomainInput, - AgentAttachmentRefsApiResponse, - AcceptedAttachmentsResponse, - SetAcceptedAttachmentsInput, - ContentAttachmentsListResponse, - ContentAttachmentDetailResponse, - EmailSourceRejectionListResponse, - AgentCallerApiResponse, - AgentDefinitionImportErrorResponse, - AgentDefinitionResponse, - AgentEmailOptOutListResponse, - AgentExportResponse, - AgentImportPreviewRequest, - AgentImportPreviewResponse, - AgentListResponse, - AgentRunListResponse, - AgentRunRequest, - AgentRunResponse, - AgentRunStreamRequest, - AgentSummaryResponse, - AgentUsingCloudDriveResponse, - CloudDriveProviderResponse, - CloudDriveRejectionResponse, - CloudDriveResponse, - CloudDriveUpdateRequest, - EmbeddingModelListResponse, - ListSourceContentsOptions, - RerankerModelListResponse, - SourceContentStatusListResponse, - SourceContentStatusResponse, - AgentTraceSearchRequest, - AgentTraceSearchResponse, - AiAssistantAcceptRequest, - AiAssistantAcceptResponse, - AiAssistantFeedbackRequest, - AiAssistantFeedbackResponse, - AiAssistantGenerateRequest, - AiAssistantGenerateResponse, - AiConversationHistoryResponse, - AddCommentRequest, - AddConversationTurnRequest, - BlockEmailSenderRequest, - BlockedEmailSenderListResponse, - BlockedEmailSenderResponse, - CancelQueuedRunsResponse, - ChangeStatusRequest, - CompatibleRunListResponse, - CompactionTestResponse, - ContentDetailResponse, - ContentEmbeddingsListResponse, - ContentFileUploadResponse, - CreateAgentRequest, - CreateAlertConfigRequest, - CreateEvaluationCriteriaRequest, - CreateEvaluationResultRequest, - CreateExportRequest, - CreateKnowledgeBaseBody, - CreateMemoryBankBody, - CreateSolutionRequest, - CreateSourceBody, - DmarcSummaryResponse, - EmailDomainResponse, - EmailDomainsListResponse, - EmailTriggerConfigResponse, - EstimateExportRequest, - EstimateExportResponse, - EvaluationCriteriaResponse, - EvaluationCriteriaListResponse, - ApiVersionResponse, - AlertDetailResponse, - AlertCommentResponse, - AlertSubscriberResponse, - UnreadCountResponse, - ModelRecommendationsResponse, - ModelRecommendationResponse, - ExperimentListResponse, - ExperimentSummaryResponse, - ExperimentDetailResponse, - CreateExperimentResponse, - CancelExperimentResponse, - SearchResponse, - SearchResultResponse, - OkResponse, - AlertResponse, - AlertConfigResponse, - ModelAlertResponse, - AlertListResponse, - AlertConfigListResponse, - ModelAlertListResponse, - EvaluationResultListResponse, - EvaluationResultResponse, - EvaluationResultSummaryResponse, - EvaluationResultWithCriteriaListResponse, - EvaluationRunSummaryListResponse, - ExportListResponse, - ExportResponse, - FileUploadResponse, - GenerateAgentStepsRequest, - GenerateAgentStepsResponse, - GenerateStepConfigRequest, - GenerateStepConfigResponse, - GovernanceAiAcceptResponse, - GovernanceAiAssistantRequest, - GovernanceAiAssistantResponse, - GovernanceConversationResponse, - InboundEmailRejectionResponse, - InboundEmailStatusResponse, - InlineTextReplaceRequest, - InlineTextUploadRequest, - KnowledgeBaseListResponse, - KnowledgeBaseResponse, - LinkResourcesRequest, - ListOptions, - MarkAiSuggestionRequest, - MarkConversationTurnRequest, - MemoryBankAcceptRequest, - MemoryBankAiAssistantRequest, - MemoryBankAiAssistantResponse, - MemoryBankLastConversationResponse, - MeResponse, - MemoryBankListResponse, - MemoryBankResponse, - NonManualEvaluationSummaryResponse, - OrganizationAlertPreferenceListResponse, - OrganizationAlertPreferenceResponse, - PlaygroundCreateRequest, - CreateExperimentInput, - PromptModelResponse, - ProviderGroupResponse, - RemoveEmailDomainResponse, - ResumeInboundResponse, - SendTestEmailResponse, - SetAutoBlockModeRequest, - SetEmailTriggerConfigRequest, - SolutionConversationResponse, - SolutionListResponse, - SolutionResponse, - SortableListOptions, - SourceEmbeddingMigrationResponse, - SourceListResponse, - SourceResponse, - StandaloneTestCompactionRequest, - StartSourceEmbeddingMigrationRequest, - TestCompactionRequest, - TestDraftEvaluationRequest, - TestDraftEvaluationResponse, - UnlinkResourcesRequest, - UpdateAgentDefinitionRequest, - UpdateAgentRequest, - UpdateAlertConfigRequest, - UpdateEvaluationCriteriaRequest, - UpdateKnowledgeBaseBody, - UpdateMemoryBankBody, - UpdateOrganizationAlertPreferenceRequest, - UpdateSolutionRequest, - UpdateSourceBody, - UploadAgentInputApiResponse, -} from "./types"; - -/** Default API base URL (can be overridden with `baseUrl` or `SECLAI_API_URL`). */ -export const SECLAI_API_URL = "https://api.seclai.com"; - -/** A `fetch`-compatible function (e.g. `globalThis.fetch` or `undici.fetch`). */ -export type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise; - -/** - * Token provider: a synchronous or asynchronous function that returns an - * access token string. Called on every request to allow automatic refresh. - */ -export type AccessTokenProvider = () => string | Promise; - -/** Configuration for the {@link Seclai} client. */ -export interface SeclaiOptions { - /** API key used for authentication. Defaults to `process.env.SECLAI_API_KEY` when available. */ - apiKey?: string; - /** - * Static bearer access token **or** a provider function that returns one. - * Mutually exclusive with `apiKey`. - */ - accessToken?: string | AccessTokenProvider; - /** API base URL. Defaults to `process.env.SECLAI_API_URL` when available, else {@link SECLAI_API_URL}. */ - baseUrl?: string; - /** Header name to use for the API key. Defaults to `x-api-key`. */ - apiKeyHeader?: string; - /** Extra headers to include on every request. */ - defaultHeaders?: Record; - /** Optional `fetch` implementation for environments without a global `fetch`. */ - fetch?: FetchLike; - /** - * SSO profile name to load from `~/.seclai/config`. - * Defaults to `process.env.SECLAI_PROFILE`, then `"default"`. - */ - profile?: string; - /** - * Override the config directory path (default: `SECLAI_CONFIG_DIR` env var or `~/.seclai/`). - */ - configDir?: string; - /** - * Whether to auto-refresh expired SSO tokens. Defaults to `true`. - * Set to `false` in environments that should not write to disk. - */ - autoRefresh?: boolean; - /** - * Target organization account ID. Sent as `X-Account-Id` header. - * Overrides the profile's `sso_account_id` when using SSO auth. - */ - accountId?: string; - /** - * Dated API version (`YYYY-MM-DD`) sent as the `Seclai-Version` header, opting - * this client into backward-incompatible API changes released on or before - * that date. - * - * Left unset the header is omitted and the account's pinned baseline applies, - * so responses keep their current shapes and upgrading the SDK alone never - * changes the wire contract. Pin the account instead with - * {@link Seclai.updateApiVersion}, and read what a request resolves to with - * {@link Seclai.getApiVersion}. - * - * From `2026-07-27` the API rejects undeclared query parameters with a 422 - * rather than ignoring them, and list endpoints return the canonical - * `{data, pagination}` envelope. - */ - apiVersion?: ApiVersion; - /** - * Permit an {@link apiVersion} this release was not built against. - * - * Off by default. A newer API version can change response shapes, and this - * client would decode them incorrectly rather than reject them — a - * request-side mistake answers 422, but a reshaped response just mis-decodes, - * silently. Prefer upgrading the package. - */ - allowUnknownApiVersion?: boolean; -} - -// ─── Internal Helpers ──────────────────────────────────────────────────────── - -function getEnv(name: string): string | undefined { - const p = (globalThis as any)?.process; - return p?.env?.[name]; -} - -function buildURL(baseUrl: string, path: string, query?: Record): URL { - // Ensure baseUrl ends with "/" so new URL() preserves its path component. - const base = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`; - // Strip leading "/" from path so it's treated as relative to base. - const relative = path.startsWith("/") ? path.slice(1) : path; - const url = new URL(relative, base); - if (query) { - for (const [key, value] of Object.entries(query)) { - if (value === undefined || value === null) continue; - if (Array.isArray(value)) { - // A repeatable parameter: one `key=value` pair per element. - for (const item of value) url.searchParams.append(key, String(item)); - continue; - } - url.searchParams.set(key, String(value)); - } - } - return url; -} - -/** - * One page as a fetcher handed to {@link Seclai.paginate} may return it: a list - * method's `{data, pagination}` envelope or flat `{data, total, page, limit}`, - * a bare array, or `{items, pagination}` with a `total_pages` count. - */ -export type PaginatedPage = - | T[] - | { - data?: T[] | null; - pagination?: { pages?: number; has_next?: boolean } | null; - total?: number; - limit?: number; - } - | { items: T[]; pagination?: { page: number; total_pages: number } }; - -/** - * The items of a version-gated list whose method is declared as an array: a - * bare array by default, under `data` from 2026-07-27. - */ -function listItems(res: unknown): T[] { - if (Array.isArray(res)) return res as T[]; - if (res !== null && typeof res === "object" && "data" in res) { - const data = (res as { data: unknown }).data; - if (Array.isArray(data)) return data as T[]; - if (data === null) return []; - } - throw notAList(); -} - -/** An empty list would read as "no results" for a body that is not a list at all. */ -function notAList(): SeclaiError { - return new SeclaiError( - "Expected a list response: an array, or an object carrying the items under `data` or the endpoint's own key.", - ); -} - -/** - * A version-gated list as its declared object type. The items are under `key` - * by default (or the body is a bare array) and under `data` from 2026-07-27, - * where `flat` counters arrive inside `pagination`; both are restored to where - * the type declares them, and `data`/`pagination` stay when the API sent them. - */ -function keyedList( - res: unknown, - key: keyof T & string, - flat: readonly ("total" | "page" | "limit")[] = [], -): T { - if (Array.isArray(res)) return { [key]: res } as T; - if (res === null || typeof res !== "object") throw notAList(); - const body: Record = { ...(res as Record) }; - if (Array.isArray(body.data)) body[key] = body.data; - else if ("data" in body && body.data === null) body[key] = []; - else if (!Array.isArray(body[key])) throw notAList(); - const pagination = body.pagination as Record | null | undefined; - for (const field of flat) { - if (body[field] === undefined && pagination?.[field] !== undefined) body[field] = pagination[field]; - } - return body as T; -} - -/** The flat counters of a list type that declares `total`, `page` and `limit`. */ -const PAGE_COUNTERS = ["total", "page", "limit"] as const; - -/** - * Merge header layers into one value per header. A later layer wins, and names - * compare case-insensitively, so an override replaces instead of adding a - * second spelling for `fetch` to join. - */ -function mergeHeaders(...layers: (Record | undefined)[]): Record { - const byName = new Map(); - for (const layer of layers) { - for (const [name, value] of Object.entries(layer ?? {})) { - // A nullish value from untyped JavaScript means "not set", not a header. - if (value === undefined || value === null) continue; - const lower = name.toLowerCase(); - byName.delete(lower); - byName.set(lower, [name, value]); - } - } - return Object.fromEntries(byName.values()); -} - -/** The spelling under which `headers` carries `name` — the last one, which is the one a merge keeps. */ -function headerKey(headers: Record | undefined, name: string): string | undefined { - return Object.keys(headers ?? {}) - .filter((key) => key.toLowerCase() === name) - .pop(); -} - -async function safeText(response: Response): Promise { - try { - return await response.clone().text(); - } catch { - return undefined; - } -} - -async function safeJson(response: Response): Promise { - try { - return await response.clone().json(); - } catch { - return undefined; - } -} - -type SseMessage = { event?: string; data?: string }; - -function createSseParser(onMessage: (msg: SseMessage) => void) { - let buffer = ""; - let eventName: string | undefined; - let dataLines: string[] = []; - - function dispatch() { - if (!eventName && dataLines.length === 0) return; - const msg: SseMessage = { data: dataLines.join("\n") }; - if (eventName !== undefined) msg.event = eventName; - onMessage(msg); - eventName = undefined; - dataLines = []; - } - - function feed(textChunk: string) { - buffer += textChunk; - while (true) { - const newlineIdx = buffer.indexOf("\n"); - if (newlineIdx === -1) return; - - let line = buffer.slice(0, newlineIdx); - buffer = buffer.slice(newlineIdx + 1); - - if (line.endsWith("\r")) line = line.slice(0, -1); - - if (line === "") { - dispatch(); - continue; - } - - if (line.startsWith(":")) continue; - - const colon = line.indexOf(":"); - const field = colon === -1 ? line : line.slice(0, colon); - let value = colon === -1 ? "" : line.slice(colon + 1); - if (value.startsWith(" ")) value = value.slice(1); - - if (field === "event") { - eventName = value; - } else if (field === "data") { - dataLines.push(value); - } - } - } - - return { feed, end: dispatch }; -} - -function anySignal(signals: Array): AbortSignal | undefined { - const present = signals.filter(Boolean) as AbortSignal[]; - if (present.length === 0) return undefined; - if (present.length === 1) return present[0]; - const controller = new AbortController(); - const onAbort = () => controller.abort(); - for (const s of present) { - if (s.aborted) { - controller.abort(); - break; - } - s.addEventListener("abort", onAbort, { once: true }); - } - return controller.signal; -} - -function toBlob( - file: Blob | Uint8Array | ArrayBuffer | BufferSource, - mimeType?: string, -): Blob { - if (file instanceof Blob) return file; - const opts = mimeType ? { type: mimeType } : undefined; - if (file instanceof ArrayBuffer) return new Blob([new Uint8Array(file)], opts); - return new Blob([file as unknown as BlobPart], opts); -} - -const MIME_TYPES: Record = { - txt: "text/plain", html: "text/html", htm: "text/html", md: "text/markdown", - csv: "text/csv", xml: "text/xml", json: "application/json", - pdf: "application/pdf", doc: "application/msword", - docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - ppt: "application/vnd.ms-powerpoint", - pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation", - xls: "application/vnd.ms-excel", - xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - msg: "application/vnd.ms-outlook", zip: "application/zip", - epub: "application/epub+zip", - png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", gif: "image/gif", - bmp: "image/bmp", tiff: "image/tiff", webp: "image/webp", - mp3: "audio/mpeg", wav: "audio/wav", m4a: "audio/mp4", flac: "audio/flac", - ogg: "audio/ogg", mp4: "video/mp4", mov: "video/quicktime", avi: "video/x-msvideo", -}; - -function inferMimeType(fileName: string | undefined): string | undefined { - if (!fileName) return undefined; - const ext = fileName.split(".").pop()?.toLowerCase(); - return ext ? MIME_TYPES[ext] : undefined; -} - -// ─── Client ────────────────────────────────────────────────────────────────── - -/** - * Seclai JavaScript/TypeScript client. - * - * Provides typed methods for every Seclai API endpoint, plus higher-level - * abstractions for streaming, polling, and pagination. - * - * @example - * ```ts - * import { Seclai } from "@seclai/sdk"; - * - * const client = new Seclai({ apiKey: "sk-..." }); - * - * // List agents - * const { data: agents } = await client.listAgents(); - * - * // Run an agent - * const run = await client.runAgent("agent-id", { input: "Hello!" }); - * - * // Stream an agent run - * for await (const event of client.runStreamingAgent("agent-id", { input: "Hello!" })) { - * console.log(event.event, event.data); - * } - * ``` - */ -export class Seclai { - private readonly baseUrl: string; - private readonly defaultHeaders: Record; - private readonly allowUnknownApiVersion: boolean; - private readonly fetcher: FetchLike; - private _authState: AuthState | null = null; - private _authInitPromise: Promise | null = null; - private _authInitError: SeclaiConfigurationError | null = null; - - /** - * Create a new Seclai client. - * - * Credentials are resolved via a chain (first match wins): - * 1. Explicit `apiKey` option - * 2. Explicit `accessToken` option (static string or provider function) - * 3. `SECLAI_API_KEY` environment variable - * 4. SSO profile from `~/.seclai/config` + cached tokens in `~/.seclai/sso/cache/` - * - * @param opts - Client configuration. - * @throws {@link SeclaiConfigurationError} If no `fetch` implementation is available. - * @throws {@link SeclaiConfigurationError} If both `apiKey` and `accessToken` are provided. - */ - constructor(opts: SeclaiOptions = {}) { - // Validate mutual exclusion - if (opts.apiKey && opts.accessToken) { - throw new SeclaiConfigurationError( - "Provide either apiKey or accessToken, not both." - ); - } - - const fetcher = opts.fetch ?? (globalThis.fetch as FetchLike | undefined); - if (!fetcher) { - throw new SeclaiConfigurationError( - "No fetch implementation available. Provide opts.fetch or run in an environment with global fetch." - ); - } - - this.baseUrl = opts.baseUrl ?? getEnv("SECLAI_API_URL") ?? SECLAI_API_URL; - - // `defaultHeaders` is applied last so an explicit header wins, which means - // it can carry its own Seclai-Version; the guard reads the merged result, - // the value the client will send. - this.allowUnknownApiVersion = opts.allowUnknownApiVersion ?? false; - const merged = mergeHeaders( - opts.apiVersion ? { "Seclai-Version": opts.apiVersion } : undefined, - opts.defaultHeaders, - ); - const defaultKey = headerKey(opts.defaultHeaders, "seclai-version"); - this.assertKnownApiVersion(merged, defaultKey ? `defaultHeaders['${defaultKey}']` : "apiVersion"); - this.defaultHeaders = merged; - this.fetcher = fetcher; - - // Resolve credential chain (may be async for SSO profile loading) - const accessTokenProvider = - typeof opts.accessToken === "function" ? opts.accessToken : undefined; - const accessTokenStatic = - typeof opts.accessToken === "string" ? opts.accessToken : undefined; - - this._authInitPromise = resolveCredentialChain({ - apiKey: opts.apiKey, - accessToken: accessTokenStatic, - accessTokenProvider, - profile: opts.profile, - configDir: opts.configDir, - autoRefresh: opts.autoRefresh, - accountId: opts.accountId, - apiKeyHeader: opts.apiKeyHeader, - fetch: fetcher, - }).then((state) => { - this._authState = state; - }).catch((err) => { - this._authInitError = new SeclaiConfigurationError( - err instanceof Error ? err.message : String(err) - ); - }); - } - - /** Ensure the credential chain has been resolved. */ - private async ensureAuth(): Promise { - if (this._authInitPromise) { - await this._authInitPromise; - this._authInitPromise = null; - } - if (this._authInitError) { - throw this._authInitError; - } - if (!this._authState) { - throw new SeclaiConfigurationError( - "Missing credentials. Provide apiKey, accessToken, set SECLAI_API_KEY, or run `seclai auth login`." - ); - } - return this._authState; - } - - /** Throw unless the `Seclai-Version` in `headers` is one this release was built against. */ - private assertKnownApiVersion(headers: Record, via: string): void { - const key = headerKey(headers, "seclai-version"); - if (key === undefined || this.allowUnknownApiVersion) return; - const version = headers[key] ?? ""; - if (KNOWN_API_VERSIONS.includes(version)) return; - throw new SeclaiConfigurationError( - `Unknown API version '${version}' (via ${via}). This release was ` + - `built against ${KNOWN_API_VERSIONS.join(", ")}. A newer API version can ` + - `change response shapes, which this client would decode incorrectly rather ` + - `than reject. Upgrade the package, or set allowUnknownApiVersion to ` + - `proceed anyway.`, - ); - } - - /** - * The headers one request sends: `layers` merged in order, later winning, - * with the resulting `Seclai-Version` checked against the known versions. - */ - private requestHeaders( - layers: (Record | undefined)[], - perRequest?: Record, - ): Record { - const headers = mergeHeaders(...layers); - const requestKey = headerKey(perRequest, "seclai-version"); - this.assertKnownApiVersion(headers, requestKey ? `headers['${requestKey}']` : "defaultHeaders"); - return headers; - } - - /** Resolve auth headers for the current request. */ - private async authHeaders(): Promise> { - const state = await this.ensureAuth(); - return resolveAuthHeaders(state); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Low-level request - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Make a raw HTTP request to the Seclai API. - * - * This is a low-level escape hatch. For most operations, prefer the typed convenience methods. - * - * @param method - HTTP method (e.g. `"GET"`, `"POST"`). - * @param path - Request path relative to `baseUrl` (e.g. `"/sources/"`). - * @param opts - Query params, JSON body, per-request headers, and optional AbortSignal. - * @returns Parsed JSON for JSON responses, raw text for non-JSON responses, or `null` for empty bodies. - * @throws {@link SeclaiAPIValidationError} For validation errors (typically HTTP 422). - * @throws {@link SeclaiAPIStatusError} For other non-success HTTP status codes. - */ - async request( - method: string, - path: string, - opts?: { - query?: Record; - json?: unknown; - headers?: Record; - signal?: AbortSignal; - } - ): Promise { - const url = buildURL(this.baseUrl, path, opts?.query); - - const authHeaders = await this.authHeaders(); - let body: BodyInit | undefined; - if (opts?.json !== undefined) body = JSON.stringify(opts.json); - // A caller's content type, default or per-request, replaces the JSON one. - const headers = this.requestHeaders( - [ - body === undefined ? undefined : { "content-type": "application/json" }, - this.defaultHeaders, - opts?.headers, - authHeaders, - ], - opts?.headers, - ); - - const init: RequestInit = { method, headers }; - if (body !== undefined) { - init.body = body; - } - if (opts?.signal) { - init.signal = opts.signal; - } - const response = await this.fetcher(url, init); - - if (response.status === 204) return null; - - const contentType = response.headers.get("content-type") ?? ""; - const isJson = contentType.includes("application/json"); - - if (!response.ok) { - const responseText = await safeText(response); - if (response.status === 422) { - const validation = await safeJson(response); - throw new SeclaiAPIValidationError({ - message: "Validation error", - statusCode: response.status, - method, - url: url.toString(), - responseText, - validationError: validation, - }); - } - throw new SeclaiAPIStatusError({ - message: `Request failed with status ${response.status}`, - statusCode: response.status, - method, - url: url.toString(), - responseText, - }); - } - - if (!response.body) return null; - - if (isJson) { - return (await response.json()) as unknown; - } - return await response.text(); - } - - /** - * Make a raw HTTP request and return the raw `Response` object (for binary downloads, etc.). - * - * @param method - HTTP method. - * @param path - Request path relative to `baseUrl`. - * @param opts - Query params, JSON body, per-request headers, and optional AbortSignal. - * @returns The raw `Response` object. - * @throws {SeclaiAPIValidationError} On HTTP 422 responses. - * @throws {SeclaiAPIStatusError} On other non-2xx responses. - */ - async requestRaw( - method: string, - path: string, - opts?: { - query?: Record; - json?: unknown; - headers?: Record; - signal?: AbortSignal | undefined; - } - ): Promise { - const url = buildURL(this.baseUrl, path, opts?.query); - - const authHeaders = await this.authHeaders(); - let body: BodyInit | undefined; - if (opts?.json !== undefined) body = JSON.stringify(opts.json); - // A caller's content type, default or per-request, replaces the JSON one. - const headers = this.requestHeaders( - [ - body === undefined ? undefined : { "content-type": "application/json" }, - this.defaultHeaders, - opts?.headers, - authHeaders, - ], - opts?.headers, - ); - - const init: RequestInit = { method, headers }; - if (body !== undefined) init.body = body; - if (opts?.signal) init.signal = opts.signal; - - const response = await this.fetcher(url, init); - - if (!response.ok) { - const responseText = await safeText(response); - if (response.status === 422) { - const validation = await safeJson(response); - throw new SeclaiAPIValidationError({ - message: "Validation error", - statusCode: response.status, - method, - url: url.toString(), - responseText, - validationError: validation, - }); - } - throw new SeclaiAPIStatusError({ - message: `Request failed with status ${response.status}`, - statusCode: response.status, - method, - url: url.toString(), - responseText, - }); - } - - return response; - } - - /** Shared multipart upload helper. */ - private async uploadFile( - path: string, - opts: { - file: Blob | Uint8Array | ArrayBuffer | BufferSource; - title?: string; - metadata?: Record; - fileName?: string; - mimeType?: string; - signal?: AbortSignal; - }, - ): Promise { - const url = buildURL(this.baseUrl, path); - - const authHeaders = await this.authHeaders(); - const headers = this.requestHeaders([this.defaultHeaders, authHeaders]); - // Let fetch set the multipart Content-Type with its boundary. - const contentType = headerKey(headers, "content-type"); - if (contentType !== undefined) delete headers[contentType]; - - const form = new FormData(); - const mimeType = opts.mimeType ?? inferMimeType(opts.fileName); - const blob = toBlob(opts.file, mimeType); - form.set("file", blob, opts.fileName ?? "upload"); - - if (opts.title !== undefined) form.set("title", opts.title); - if (opts.metadata !== undefined) form.set("metadata", JSON.stringify(opts.metadata)); - - const init: RequestInit = { method: "POST", headers, body: form }; - if (opts.signal) init.signal = opts.signal; - - const response = await this.fetcher(url, init); - - if (!response.ok) { - const responseText = await safeText(response); - if (response.status === 422) { - const validation = await safeJson(response); - throw new SeclaiAPIValidationError({ - message: "Validation error", - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - validationError: validation, - }); - } - throw new SeclaiAPIStatusError({ - message: `Request failed with status ${response.status}`, - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - }); - } - - return await response.json(); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Identity - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Get the authenticated user's identity. - * - * Returns the personal `account_id` plus every organization the user belongs - * to — each with its own `id`, display `name`, and `account_id`. Use it to - * discover the account IDs that can be passed as the client's `accountId` - * option (sent as the `X-Account-Id` header) to target an org context. - * - * @returns The current user's account ID and organization memberships. - */ - async getMe(): Promise { - return (await this.request("GET", "/me")) as MeResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // API Version - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Read the API version this request resolved to, and the versions available. - * - * Resolution order is the `Seclai-Version` header, then the account pin, then - * the default — so `effective_version` reflects the client's `apiVersion` - * option when that is set. - * - * @returns The pinned, effective, default and latest versions. - */ - async getApiVersion(): Promise { - return (await this.request("GET", "/version")) as ApiVersionResponse; - } - - /** - * Pin the account to a dated API version, or clear the pin. - * - * Owner/admin only. The pin applies to later header-less requests; a - * `Seclai-Version` header still overrides it, so `effective_version` in the - * response describes this request rather than the pin just written. - * - * @param version - A `YYYY-MM-DD` date to pin to, or `null` to clear the pin. - * @returns The updated version state. - */ - async updateApiVersion(version: string | null): Promise { - return (await this.request("PUT", "/version", { json: { version } })) as ApiVersionResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agents — CRUD - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List agents. - * - * @param opts - Pagination options. - * @returns Paginated list of agents. - */ - async listAgents(opts: ListOptions = {}): Promise { - return (await this.request("GET", "/agents", { - query: { page: opts.page, limit: opts.limit }, - })) as AgentListResponse; - } - - /** - * Create a new agent. - * - * @param body - Agent creation payload (name, trigger type, template, etc.). - * @returns Summary of the created agent. - */ - async createAgent(body: CreateAgentRequest): Promise { - return (await this.request("POST", "/agents", { json: body })) as AgentSummaryResponse; - } - - /** - * Get agent details including its definition. - * - * @param agentId - Agent identifier. - * @returns Full agent metadata. - */ - async getAgent(agentId: string): Promise { - return (await this.request("GET", `/agents/${agentId}`)) as AgentSummaryResponse; - } - - /** - * Update an agent. - * - * @param agentId - Agent identifier. - * @param body - Fields to update. - * @returns Updated agent summary. - */ - async updateAgent(agentId: string, body: UpdateAgentRequest): Promise { - return (await this.request("PUT", `/agents/${agentId}`, { json: body })) as AgentSummaryResponse; - } - - /** - * Delete an agent. - * - * @param agentId - Agent identifier. - */ - async deleteAgent(agentId: string): Promise { - await this.request("DELETE", `/agents/${agentId}`); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agents — Enable / Disable - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Pause (disable) an agent so it stops firing from every trigger path. - * - * API runs return HTTP 409, inbound email is turned away, and scheduled / - * content triggers are skipped. - * - * Fails with HTTP 409 when other live agents still call this one via a - * `call_agent` step — use {@link getAgentCallers} to list them, and disable - * those first. - * - * @param agentId - Agent identifier. - * @returns The updated agent summary. - */ - async disableAgent(agentId: string): Promise { - return (await this.request("POST", `/agents/${agentId}/disable`)) as AgentSummaryResponse; - } - - /** - * Resume (enable) a paused agent. - * - * Clears the disable state whether the agent was paused manually or - * auto-paused by the inbound-email overload safeguard. - * - * @param agentId - Agent identifier. - * @returns The updated agent summary. - */ - async enableAgent(agentId: string): Promise { - return (await this.request("POST", `/agents/${agentId}/enable`)) as AgentSummaryResponse; - } - - /** - * List the live agents that call this agent via a `call_agent` step. - * - * These must be disabled before this agent can be paused. - * - * @param agentId - Agent identifier. - * @returns The calling agents. - */ - async getAgentCallers(agentId: string): Promise { - return listItems(await this.request("GET", `/agents/${agentId}/callers`)); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Export / Import - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Export an agent definition as a portable JSON snapshot. - * - * @param agentId - Agent identifier. - * @param download - When true (default), the server sets Content-Disposition: attachment. - * @returns The exported agent snapshot. - */ - async exportAgent(agentId: string, download = true): Promise { - return (await this.request("GET", `/agents/${agentId}/export`, { - query: { download }, - })) as AgentExportResponse; - } - - /** - * Validate an `agent_definition` payload (same shape as {@link exportAgent}) - * without creating or modifying any agent. - * - * Use this before {@link createAgent} or {@link updateAgent} with an - * `agent_definition` to surface `unresolved_refs` — workflow references to - * knowledge bases, memory banks, source connections, or sub-agents that - * don't exist in the target account. Pass the returned ids back in - * `entity_remap` on the commit call to substitute them. - * - * @param body - The preview payload (`{ agent_definition: ... }`). - * @returns Summary of the validated payload (step counts, schedules, - * alert configs, evaluation criteria, governance policies, and any - * `unresolved_refs`). - * @throws {SeclaiAPIValidationError} On HTTP 422 — the body is an - * {@link AgentDefinitionImportErrorResponse} with 1-indexed - * line/column-anchored errors against a canonical `source` echo. - */ - async previewImportAgent(body: AgentImportPreviewRequest): Promise { - return (await this.request("POST", "/agents/preview-import", { json: body })) as AgentImportPreviewResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Definitions - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Get an agent's full definition (steps, model config, etc.). - * - * @param agentId - Agent identifier. - * @returns The agent definition. - */ - async getAgentDefinition(agentId: string): Promise { - return (await this.request("GET", `/agents/${agentId}/definition`)) as AgentDefinitionResponse; - } - - /** - * Update an agent's definition. - * - * @param agentId - Agent identifier. - * @param body - Updated definition payload. - * @returns Updated agent definition. - */ - async updateAgentDefinition(agentId: string, body: UpdateAgentDefinitionRequest): Promise { - return (await this.request("PUT", `/agents/${agentId}/definition`, { json: body })) as AgentDefinitionResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Runs - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Start an agent run. - * - * @param agentId - Agent identifier. - * @param body - Run request payload (`input`, `metadata`, `priority`, etc.). - * @returns The created agent run. - */ - async runAgent(agentId: string, body: AgentRunRequest): Promise { - return (await this.request("POST", `/agents/${agentId}/runs`, { json: body })) as AgentRunResponse; - } - - /** - * List runs for a specific agent. - * - * @param agentId - Agent identifier. - * @param opts - Pagination and filter options. - * @returns Paginated list of runs. - */ - async listAgentRuns( - agentId: string, - opts: ListOptions & { status?: string } = {}, - ): Promise { - return (await this.request("GET", `/agents/${agentId}/runs`, { - query: { page: opts.page, limit: opts.limit, status: opts.status }, - })) as AgentRunListResponse; - } - - /** - * Search agent runs (traces) across all agents. - * - * @param body - Search query and filters. - * @returns Search results with matching runs. - */ - async searchAgentRuns(body: AgentTraceSearchRequest): Promise { - return (await this.request("POST", "/agents/runs/search", { json: body })) as AgentTraceSearchResponse; - } - - /** - * Get details of a specific agent run. - * - * @param runId - Run identifier. - * @param opts - Optional flags. - * @returns Agent run details. - */ - async getAgentRun( - runId: string, - opts?: { includeStepOutputs?: boolean }, - ): Promise { - return (await this.request("GET", `/agents/runs/${runId}`, opts?.includeStepOutputs ? { - query: { include_step_outputs: true }, - } : undefined)) as AgentRunResponse; - } - - /** - * Cancel an agent run. - * - * @deprecated This never deleted anything — the endpoint it calls is documented - * as "Cancel an agent run", and the API has no delete-a-run operation. It also - * discards the returned run state. Use {@link cancelAgentRun} instead. - * - * @param runId - Run identifier. - */ - async deleteAgentRun(runId: string): Promise { - await this.cancelAgentRun(runId); - } - - /** - * Cancel a running agent run. - * - * Cancellation is `DELETE` on the run resource — the API exposes no - * `POST .../cancel` route, and no operation that deletes a run. Rejected when - * the run has already reached a terminal state. - * - * @param runId - Run identifier. - * @returns Updated run (with cancelled status). - */ - async cancelAgentRun(runId: string): Promise { - return (await this.request("DELETE", `/agents/runs/${runId}`)) as AgentRunResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Runs — Streaming - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Run an agent in streaming mode (SSE) and wait for the final result. - * - * Consumes the entire SSE stream and returns only the terminal `done` payload. - * For real-time event access, use {@link runStreamingAgent} instead. The body - * takes no `include_reasoning`, and one passed anyway is not sent: this method - * returns no `stream_reasoning` events. - * - * @param agentId - Agent identifier. - * @param body - Streaming run request payload, without `include_reasoning`. - * @param opts - Timeout and abort signal options. - * @returns Final agent run payload from the `done` event. - * @throws {@link SeclaiStreamingError} If the stream ends before a `done` event. - */ - async runStreamingAgentAndWait( - agentId: string, - body: Omit, - opts?: { timeoutMs?: number; signal?: AbortSignal }, - ): Promise { - // Not sent even from untyped callers: the reasoning events are discarded here. - const { include_reasoning: _ignored, ...runBody } = body as AgentRunStreamRequest; - const url = buildURL(this.baseUrl, `/agents/${agentId}/runs/stream`); - - const authHdrs = await this.authHeaders(); - const headers = this.requestHeaders([ - this.defaultHeaders, - authHdrs, - { accept: "text/event-stream", "content-type": "application/json" }, - ]); - - const timeoutMs = opts?.timeoutMs ?? 60_000; - const timeoutController = new AbortController(); - let timedOut = false; - const timeoutId = setTimeout(() => { - timedOut = true; - timeoutController.abort(); - }, timeoutMs); - - const signal = anySignal([opts?.signal, timeoutController.signal]); - - let lastSeen: AgentRunResponse | undefined; - - try { - const init: RequestInit = { method: "POST", headers, body: JSON.stringify(runBody) }; - if (signal) init.signal = signal; - - const response = await this.fetcher(url, init); - - // Handle error responses - const contentType = response.headers.get("content-type") ?? ""; - const isJson = contentType.includes("application/json"); - - if (!response.ok) { - const responseText = await safeText(response); - if (response.status === 422) { - const validation = await safeJson(response); - throw new SeclaiAPIValidationError({ - message: "Validation error", - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - validationError: validation, - }); - } - throw new SeclaiAPIStatusError({ - message: `Request failed with status ${response.status}`, - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - }); - } - - // If server returned JSON instead of SSE - if (isJson) { - return (await response.json()) as AgentRunResponse; - } - - if (!response.body) { - throw new SeclaiConfigurationError( - "Streaming response body is not available in this environment. Provide a fetch implementation that supports ReadableStream bodies." - ); - } - - const reader = response.body.getReader(); - const decoder = new TextDecoder(); - - let final: AgentRunResponse | undefined; - - const parser = createSseParser((msg) => { - if (!msg.data) return; - if (msg.event === "init" || msg.event === "done") { - try { - const parsed = JSON.parse(msg.data) as AgentRunResponse; - lastSeen = parsed; - if (msg.event === "done") final = parsed; - } catch { /* ignore malformed JSON */ } - } - }); - - while (!final) { - const { value, done } = await reader.read(); - if (done) break; - if (value) parser.feed(decoder.decode(value, { stream: true })); - } - - parser.end(); - - if (final) return final; - if (lastSeen && (lastSeen as any).status && (lastSeen as any).status !== "pending") { - return lastSeen; - } - - throw new SeclaiStreamingError("Stream ended before receiving a 'done' event.", lastSeen?.run_id); - } catch (err) { - if (timedOut) { - throw new SeclaiStreamingError( - `Timed out after ${timeoutMs}ms waiting for streaming agent run to complete.`, - lastSeen?.run_id, - ); - } - throw err; - } finally { - clearTimeout(timeoutId); - } - } - - /** - * Run an agent in streaming mode and yield each SSE event as it arrives. - * - * This is an `AsyncGenerator` suitable for real-time UIs that want to render - * step progress as it happens. - * - * @param agentId - Agent identifier. - * @param body - Streaming run request payload. - * @param opts - Timeout and abort signal options. - * @yields {@link AgentRunEvent} for each SSE message. - * - * @example - * ```ts - * for await (const event of client.runStreamingAgent("agent-id", { input: "Hello!" })) { - * if (event.event === "done") { - * console.log("Final:", event.data); - * } - * } - * ``` - */ - async *runStreamingAgent( - agentId: string, - body: AgentRunStreamRequest, - opts?: { timeoutMs?: number; signal?: AbortSignal }, - ): AsyncGenerator { - const url = buildURL(this.baseUrl, `/agents/${agentId}/runs/stream`); - - const authHdrs = await this.authHeaders(); - const headers = this.requestHeaders([ - this.defaultHeaders, - authHdrs, - { accept: "text/event-stream", "content-type": "application/json" }, - ]); - - const timeoutMs = opts?.timeoutMs ?? 60_000; - const timeoutController = new AbortController(); - let timedOut = false; - const timeoutId = setTimeout(() => { - timedOut = true; - timeoutController.abort(); - }, timeoutMs); - - const signal = anySignal([opts?.signal, timeoutController.signal]); - - try { - const init: RequestInit = { method: "POST", headers, body: JSON.stringify(body) }; - if (signal) init.signal = signal; - - const response = await this.fetcher(url, init); - - const contentType = response.headers.get("content-type") ?? ""; - const isJson = contentType.includes("application/json"); - - if (!response.ok) { - const responseText = await safeText(response); - if (response.status === 422) { - const validation = await safeJson(response); - throw new SeclaiAPIValidationError({ - message: "Validation error", - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - validationError: validation, - }); - } - throw new SeclaiAPIStatusError({ - message: `Request failed with status ${response.status}`, - statusCode: response.status, - method: "POST", - url: url.toString(), - responseText, - }); - } - - // If server returned JSON instead of SSE, yield it as a single "done" event - if (isJson) { - const data = (await response.json()) as AgentRunResponse; - yield { event: "done", data }; - return; - } - - if (!response.body) { - throw new SeclaiConfigurationError( - "Streaming response body is not available in this environment." - ); - } - - const reader = response.body.getReader(); - const decoder = new TextDecoder(); - const events: AgentRunEvent[] = []; - - const parser = createSseParser((msg) => { - if (!msg.data) return; - let data: unknown; - try { - data = JSON.parse(msg.data); - } catch { - data = msg.data; - } - events.push({ event: msg.event ?? "message", data }); - }); - - while (true) { - const { value, done } = await reader.read(); - if (value) parser.feed(decoder.decode(value, { stream: true })); - - // Yield all events that were parsed from this chunk - while (events.length > 0) { - yield events.shift()!; - } - - if (done) break; - } - parser.end(); - - // Yield any remaining events from end() - while (events.length > 0) { - yield events.shift()!; - } - } catch (err) { - if (timedOut) { - throw new SeclaiStreamingError( - `Timed out after ${timeoutMs}ms waiting for streaming agent run to complete.` - ); - } - throw err; - } finally { - clearTimeout(timeoutId); - } - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Runs — Polling - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Run an agent and poll until it reaches a terminal status. - * - * This is useful in environments where SSE streaming is unavailable. - * - * @param agentId - Agent identifier. - * @param body - Run request payload. - * @param opts - Polling configuration and abort signal. - * @returns The terminal agent run. - * @throws {@link SeclaiStreamingError} On timeout. - */ - async runAgentAndPoll( - agentId: string, - body: AgentRunRequest, - opts?: { - /** Polling interval in ms (default: 2000). */ - pollIntervalMs?: number; - /** Maximum time to wait in ms (default: 300000 = 5 min). */ - timeoutMs?: number; - /** Include per-step outputs in the final result. */ - includeStepOutputs?: boolean; - signal?: AbortSignal; - }, - ): Promise { - const pollInterval = opts?.pollIntervalMs ?? 2_000; - const timeout = opts?.timeoutMs ?? 300_000; - const startTime = Date.now(); - - const run = await this.runAgent(agentId, body); - const runId = (run as any).id ?? (run as any).run_id; - if (!runId) throw new SeclaiError("Agent run response did not contain an id."); - - while (true) { - if (opts?.signal?.aborted) throw new SeclaiError("Polling aborted."); - if (Date.now() - startTime > timeout) { - throw new SeclaiStreamingError(`Polling timed out after ${timeout}ms.`, runId); - } - - await new Promise((r) => setTimeout(r, pollInterval)); - - const current = await this.getAgentRun(runId, - opts?.includeStepOutputs ? { includeStepOutputs: true } : undefined, - ); - const status = (current as any).status; - if (status === "completed" || status === "failed" || status === "cancelled") { - return current; - } - } - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Run Evaluation Results - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List evaluation results for a specific agent run. - * - * @param agentId - Agent identifier. - * @param runId - Run identifier. - * @param opts - Pagination options. - * @returns Paginated list of evaluation results. - */ - async listRunEvaluationResults( - agentId: string, - runId: string, - opts: ListOptions = {}, - ): Promise { - return keyedList( - await this.request("GET", `/agents/${agentId}/runs/${runId}/evaluation-results`, { - query: { page: opts.page, limit: opts.limit }, - }), - "data", - PAGE_COUNTERS, - ); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Input Uploads - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Upload a file to use as input for a `dynamic_input` agent run. Any other - * agent rejects the upload with HTTP 400. Files are limited to 200 MB. - * - * From API version `2026-10-16` a file of any type is accepted and is `ready` - * at once: pass its `id` as `input_upload_id` to {@link runAgent}. - * Earlier versions accept only a fixed list of extensions and write each - * file's extracted text into the run's `input`, so poll - * {@link getAgentInputUploadStatus} until `status` is `ready` before running. - * - * @param agentId - Agent identifier. - * @param opts - File payload and optional metadata. - * @returns Upload response with the upload ID and status. - */ - async uploadAgentInput( - agentId: string, - opts: { - file: Blob | Uint8Array | ArrayBuffer | BufferSource; - fileName?: string; - mimeType?: string; - }, - ): Promise { - return (await this.uploadFile(`/agents/${agentId}/upload-input`, opts)) as UploadAgentInputApiResponse; - } - - /** - * Get the status of an agent input upload. - * - * @param agentId - Agent identifier. - * @param uploadId - Upload identifier. - * @returns Upload status and metadata. - */ - async getAgentInputUploadStatus(agentId: string, uploadId: string): Promise { - return (await this.request("GET", `/agents/${agentId}/input-uploads/${uploadId}`)) as UploadAgentInputApiResponse; - } - - /** - * Get the static attachment-reference contract for an agent — what files (if - * any) its definition expects on a run. - * - * Call this before staging uploads to learn whether the agent accepts files - * at all (`requires_uploads`) and which specific filenames, indexes, or glob - * patterns its templates reference. A run-time upload batch that doesn't - * satisfy every declared selector is rejected with HTTP 400. - * - * @param agentId - Agent identifier. - * @returns The agent's attachment-reference contract. - */ - async getAgentAttachmentReferences(agentId: string): Promise { - return (await this.request("GET", `/agents/${agentId}/attachment-references`)) as AgentAttachmentRefsApiResponse; - } - - /** - * Download a file attachment emitted by a step in an agent run. - * - * Returns the raw `Response` so you can stream or save the binary data. - * - * @param runId - Run identifier. - * @param attachmentId - URL-safe-base64-encoded `storage_key` of the attachment - * (as surfaced in run output manifests and webhook/email payloads). - * @param opts - Optional `downloadName` filename hint for the download - * disposition, and `signal`, which cancels the request; with a standard `fetch` this - * includes reading the body, so `AbortSignal.timeout(ms)` bounds the whole - * transfer. - * @returns Raw response with the attachment bytes. - */ - async downloadAgentRunAttachment( - runId: string, - attachmentId: string, - opts: { downloadName?: string; signal?: AbortSignal } = {}, - ): Promise { - return await this.requestRaw("GET", `/v2/agent-runs/${runId}/attachments/${attachmentId}`, { - query: { download_name: opts.downloadName }, - signal: opts.signal, - }); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent AI Assistant (Steps Generation) - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Generate agent workflow steps from natural language using AI. - * - * @param agentId - Agent identifier. - * @param body - Generation request with user instructions. - * @returns AI-generated step configuration. - */ - async generateAgentSteps(agentId: string, body: GenerateAgentStepsRequest): Promise { - return (await this.request("POST", `/agents/${agentId}/ai-assistant/generate-steps`, { json: body })) as GenerateAgentStepsResponse; - } - - /** - * Generate a single step configuration using AI. - * - * @param agentId - Agent identifier. - * @param body - Step config generation request. - * @returns AI-generated step config. - */ - async generateStepConfig(agentId: string, body: GenerateStepConfigRequest): Promise { - return (await this.request("POST", `/agents/${agentId}/ai-assistant/step-config`, { json: body })) as GenerateStepConfigResponse; - } - - /** - * Get AI conversation history for an agent. - * - * @param agentId - Agent identifier. - * @returns Conversation history. - */ - async getAgentAiConversationHistory( - agentId: string, - opts: { stepType?: string; stepId?: string; limit?: number; offset?: number } = {}, - ): Promise { - // `step_type` is required by the API. It stays optional in the type so the - // released one-argument call still compiles, but leaving it undefined only - // means buildURL drops it and the server answers 422 naming the wire - // parameter — so fail here instead, naming the option. - if (!opts.stepType) { - throw new SeclaiConfigurationError( - "getAgentAiConversationHistory requires opts.stepType; the API rejects the " + - "request without it. Pass e.g. { stepType: \"llm\" }.", - ); - } - return (await this.request("GET", `/agents/${agentId}/ai-assistant/conversations`, { - query: { - step_type: opts.stepType, - step_id: opts.stepId, - limit: opts.limit, - offset: opts.offset, - }, - })) as AiConversationHistoryResponse; - } - - /** - * Mark an AI suggestion as accepted or rejected. - * - * @param agentId - Agent identifier. - * @param conversationId - Conversation turn identifier. - * @param body - Mark request payload. - */ - async markAgentAiSuggestion(agentId: string, conversationId: string, body: MarkAiSuggestionRequest): Promise { - await this.request("PATCH", `/agents/${agentId}/ai-assistant/${conversationId}`, { json: body }); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Evaluation Criteria - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List evaluation criteria for an agent. - * - * @param agentId - Agent identifier. - * @param opts - Pagination options. - */ - async listEvaluationCriteria(agentId: string, opts: ListOptions = {}): Promise { - return (await this.listEvaluationCriteriaPage(agentId, opts)).data ?? []; - } - - /** - * List evaluation criteria for an agent, with pagination metadata. - * - * The endpoint answers with a bare array by default and with `{data, - * pagination}` once `apiVersion` is 2026-07-27 or later; `pagination` is - * absent on the bare array. - * - * @param agentId - Agent identifier. - * @param opts - Pagination options. - * @returns The criteria under `data`, plus the page metadata when present. - */ - async listEvaluationCriteriaPage( - agentId: string, - opts: ListOptions = {}, - ): Promise { - return keyedList( - await this.request("GET", `/agents/${agentId}/evaluation-criteria`, { - query: { page: opts.page, limit: opts.limit }, - }), - "data", - ); - } - - /** - * Create evaluation criteria for an agent. - * - * @param agentId - Agent identifier. - * @param body - Criteria definition. - * @returns Created evaluation criteria. - */ - async createEvaluationCriteria(agentId: string, body: CreateEvaluationCriteriaRequest): Promise { - return (await this.request("POST", `/agents/${agentId}/evaluation-criteria`, { json: body })) as EvaluationCriteriaResponse; - } - - /** - * Get a single evaluation criteria by ID. - * - * @param criteriaId - Criteria identifier. - * @returns Evaluation criteria details. - */ - async getEvaluationCriteria(criteriaId: string): Promise { - return (await this.request("GET", `/agents/evaluation-criteria/${criteriaId}`)) as EvaluationCriteriaResponse; - } - - /** - * Update an evaluation criteria. - * - * @param criteriaId - Criteria identifier. - * @param body - Fields to update. - * @returns Updated evaluation criteria. - */ - async updateEvaluationCriteria(criteriaId: string, body: UpdateEvaluationCriteriaRequest): Promise { - return (await this.request("PATCH", `/agents/evaluation-criteria/${criteriaId}`, { json: body })) as EvaluationCriteriaResponse; - } - - /** - * Delete an evaluation criteria and all associated results. - * - * @param criteriaId - Criteria identifier. - */ - async deleteEvaluationCriteria(criteriaId: string): Promise { - await this.request("DELETE", `/agents/evaluation-criteria/${criteriaId}`); - } - - /** - * Get the evaluation summary for a specific criteria. - * - * @param criteriaId - Criteria identifier. - * @returns Evaluation result summary. - */ - async getEvaluationCriteriaSummary(criteriaId: string): Promise { - return (await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/summary`)) as EvaluationResultSummaryResponse; - } - - /** - * List evaluation results for a specific criteria. - * - * @param criteriaId - Criteria identifier. - * @param opts - Pagination options. - */ - async listEvaluationResults(criteriaId: string, opts: ListOptions = {}): Promise { - return keyedList( - await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/results`, { - query: { page: opts.page, limit: opts.limit }, - }), - "data", - PAGE_COUNTERS, - ); - } - - /** - * Create a manual evaluation result for a criteria. - * - * @param criteriaId - Criteria identifier. - * @param body - Evaluation result payload. - * @returns Created evaluation result. - */ - async createEvaluationResult(criteriaId: string, body: CreateEvaluationResultRequest): Promise { - return (await this.request("POST", `/agents/evaluation-criteria/${criteriaId}/results`, { json: body })) as EvaluationResultResponse; - } - - /** - * List runs compatible with a specific evaluation criteria. - * - * @param criteriaId - Criteria identifier. - * @param opts - Pagination options. - */ - async listCompatibleRuns(criteriaId: string, opts: ListOptions = {}): Promise { - return keyedList( - await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/compatible-runs`, { - query: { page: opts.page, limit: opts.limit }, - }), - "data", - PAGE_COUNTERS, - ); - } - - /** - * Test a draft evaluation criteria without persisting it. - * - * @param agentId - Agent identifier. - * @param body - Draft evaluation to test. - * @returns Test evaluation response. - */ - async testDraftEvaluation(agentId: string, body: TestDraftEvaluationRequest): Promise { - return (await this.request("POST", `/agents/${agentId}/evaluation-criteria/test-draft`, { json: body })) as TestDraftEvaluationResponse; - } - - /** - * List all evaluation results for an agent. - * - * @param agentId - Agent identifier. - * @param opts - Pagination options. - */ - async listAgentEvaluationResults(agentId: string, opts: ListOptions = {}): Promise { - return keyedList( - await this.request("GET", `/agents/${agentId}/evaluation-results`, { - query: { page: opts.page, limit: opts.limit }, - }), - "data", - PAGE_COUNTERS, - ); - } - - /** - * List evaluation run summaries for an agent. - * - * @param agentId - Agent identifier. - * @param opts - Pagination options. - */ - async listEvaluationRuns(agentId: string, opts: ListOptions = {}): Promise { - return keyedList( - await this.request("GET", `/agents/${agentId}/evaluation-runs`, { - query: { page: opts.page, limit: opts.limit }, - }), - "data", - PAGE_COUNTERS, - ); - } - - /** - * Get a summary of non-manual evaluations across an agent's runs. - * - * @param agentId - Agent identifier. - */ - async getNonManualEvaluationSummary(agentId: string): Promise { - return (await this.request("GET", "/agents/evaluation-results/non-manual-summary", { - query: { agent_id: agentId }, - })) as NonManualEvaluationSummaryResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Email Triggers - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Configure an agent's `EMAIL_RECEIVED` trigger and return its computed - * email address(es). - * - * Sets the custom alias, the sender allowlist, and the inbound-handling flags - * (`ignore_auto_generated`, `require_sender_auth`, `queue_on_quota`). Omitted - * fields are left unchanged; passing `null` (or `""` for `alias`) clears them. - * - * @param agentId - Agent identifier. - * @param triggerId - Trigger identifier. - * @param body - The fields to set. - * @returns The trigger's resolved addresses and config. - */ - async setEmailTriggerConfig( - agentId: string, - triggerId: string, - body: SetEmailTriggerConfigRequest, - ): Promise { - return (await this.request("PUT", `/agents/${agentId}/triggers/${triggerId}/email-config`, { - json: body, - })) as EmailTriggerConfigResponse; - } - - /** - * Replace the input attachments a trigger accepts. - * - * A run's files are each assigned to one declared attachment before any step - * runs, and steps reference one as `{{agent.attachments.}}`. The API - * answers 400 when the agent references an attachment the new declaration - * leaves out. - * - * @param agentId - Agent identifier. - * @param triggerId - Trigger identifier, as `getAgent()` returns it. - * @param body - The full list of accepted attachments; a slot's `min` defaults to 0. - * @returns The trigger's accepted attachments. - */ - async setAcceptedAttachments( - agentId: string, - triggerId: string, - body: SetAcceptedAttachmentsInput, - ): Promise { - return (await this.request("PUT", `/agents/${agentId}/triggers/${triggerId}/accepted-attachments`, { - json: body, - })) as AcceptedAttachmentsResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Agent Email Governance - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List recipients who have opted out of this account's agent emails. - * - * @param opts - Optional agent filter and `limit`/`offset` pagination. - * @param opts.agentId - Filter to one agent (account-wide opt-outs still apply). - * @param opts.limit - Page size (1-200, default 50). - * @param opts.offset - Rows to skip (default 0). - * @returns The page of opt-outs plus the total count. - */ - async listAgentEmailOptOuts( - opts: { agentId?: string; limit?: number; offset?: number } = {}, - ): Promise { - return keyedList( - await this.request("GET", "/agents/agent-email-optouts", { - query: { agent_id: opts.agentId, limit: opts.limit, offset: opts.offset }, - }), - "items", - ["total"], - ); - } - - /** - * Revoke an opt-out, opting the recipient back in to agent emails. - * - * @param optoutId - Opt-out identifier. - */ - async removeAgentEmailOptOut(optoutId: string): Promise { - await this.request("DELETE", `/agents/agent-email-optouts/${optoutId}`); - } - - /** - * List the account's blocked inbound email senders (newest first), plus the - * governance `auto_block_mode`. - * - * @param opts - Optional `limit`/`offset` pagination. - * @param opts.limit - Page size (1-200, default 50). - * @param opts.offset - Rows to skip (default 0). - */ - async listBlockedEmailSenders( - opts: { limit?: number; offset?: number } = {}, - ): Promise { - return keyedList( - await this.request("GET", "/agents/blocked-email-senders", { - query: { limit: opts.limit, offset: opts.offset }, - }), - "items", - ["total"], - ); - } - - /** - * Add a sender address or a whole domain to the account blocklist. - * - * Idempotent. `match_type` is `"address"` (default) or `"domain"`. - * Requires an account owner/admin. - * - * @param body - The sender or domain to block. - * @returns The blocked-sender entry. - */ - async blockEmailSender(body: BlockEmailSenderRequest): Promise { - return (await this.request("POST", "/agents/blocked-email-senders", { - json: body, - })) as BlockedEmailSenderResponse; - } - - /** - * Remove a blocked sender by id. Requires an account owner/admin. - * - * @param blockedId - Blocked-sender identifier. - */ - async unblockEmailSender(blockedId: string): Promise { - await this.request("DELETE", `/agents/blocked-email-senders/${blockedId}`); - } - - /** - * Set whether a governance BLOCK on an authenticated inbound sender - * auto-adds them to the blocklist. - * - * `mode` is `"disabled"`, `"input"`, or `"input_and_output"`. - * Requires an account owner/admin. - * - * @param body - The mode to set. - * @returns The updated blocked-sender list. - */ - async setAutoBlockMode(body: SetAutoBlockModeRequest): Promise { - return keyedList( - await this.request("PUT", "/agents/blocked-email-senders/mode", { json: body }), - "items", - ["total"], - ); - } - - /** - * List recent inbound emails that were quietly discarded before running an - * agent (unauthorized sender, unknown alias, spam/virus, flood-shed). - * - * @param opts - Optional agent filter and result limit. - * @param opts.agentId - Filter to a single agent's rejections. - * @param opts.limit - Maximum results (1-200, default 50). - */ - async listInboundEmailRejections( - opts: { agentId?: string; limit?: number } = {}, - ): Promise { - return listItems( - await this.request("GET", "/agents/inbound-email-rejections", { - query: { agent_id: opts.agentId, limit: opts.limit }, - }), - ); - } - - /** - * Get the account's inbound-email overload status — whether the circuit - * breaker has paused new inbound email, and the size of the QUEUED - * (over-quota parked) run backlog. - */ - async getInboundEmailStatus(): Promise { - return (await this.request("GET", "/agents/inbound-email-status")) as InboundEmailStatusResponse; - } - - /** - * Fail all of the account's QUEUED (over-quota parked) inbound-email runs at - * once. - * - * A queued run consumed no quota or credits at queue time, so this merely - * fails them. Requires an account owner/admin. - * - * @returns The count cancelled. - */ - async cancelQueuedEmailRuns(): Promise { - return (await this.request("POST", "/agents/inbound-email-status/cancel-queued")) as CancelQueuedRunsResponse; - } - - /** - * Manually lift the account-wide inbound-email pause. - * - * If the queued backlog is still above the ceiling the breaker re-arms on the - * next evaluation — this is a one-shot override, not a permanent disable. - * Requires an account owner/admin. - */ - async resumeInboundEmail(): Promise { - return (await this.request("POST", "/agents/inbound-email-status/resume")) as ResumeInboundResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Knowledge Bases - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List knowledge bases. - * - * @param opts - Pagination and sorting options. - * @returns Paginated list of knowledge bases. - */ - async listKnowledgeBases(opts: SortableListOptions = {}): Promise { - return keyedList( - await this.request("GET", "/knowledge_bases", { - query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }, - }), - "knowledge_bases", - PAGE_COUNTERS, - ); - } - - /** - * Create a new knowledge base. - * - * @param body - Knowledge base configuration. - * @returns The created knowledge base. - */ - async createKnowledgeBase(body: CreateKnowledgeBaseBody): Promise { - return (await this.request("POST", "/knowledge_bases", { json: body })) as KnowledgeBaseResponse; - } - - /** - * Get a knowledge base by ID. - * - * @param knowledgeBaseId - Knowledge base identifier. - * @returns Knowledge base details. - */ - async getKnowledgeBase(knowledgeBaseId: string): Promise { - return (await this.request("GET", `/knowledge_bases/${knowledgeBaseId}`)) as KnowledgeBaseResponse; - } - - /** - * Update a knowledge base. - * - * @param knowledgeBaseId - Knowledge base identifier. - * @param body - Fields to update. - * @returns Updated knowledge base. - */ - async updateKnowledgeBase(knowledgeBaseId: string, body: UpdateKnowledgeBaseBody): Promise { - return (await this.request("PUT", `/knowledge_bases/${knowledgeBaseId}`, { json: body })) as KnowledgeBaseResponse; - } - - /** - * Delete a knowledge base. - * - * @param knowledgeBaseId - Knowledge base identifier. - */ - async deleteKnowledgeBase(knowledgeBaseId: string): Promise { - await this.request("DELETE", `/knowledge_bases/${knowledgeBaseId}`); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Memory Banks - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List memory banks. - * - * @param opts - Pagination and sorting options. - * @returns Paginated list of memory banks. - */ - async listMemoryBanks(opts: SortableListOptions = {}): Promise { - return keyedList( - await this.request("GET", "/memory_banks", { - query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }, - }), - "memory_banks", - PAGE_COUNTERS, - ); - } - - /** - * Create a new memory bank. - * - * Memory banks give agents persistent memory across conversations. - * Types: `conversation` (chat-style history) or `general` (flat factual entries). - * - * @param body - Memory bank configuration. - * @returns The created memory bank. - */ - async createMemoryBank(body: CreateMemoryBankBody): Promise { - return (await this.request("POST", "/memory_banks", { json: body })) as MemoryBankResponse; - } - - /** - * Get a memory bank by ID. - * - * @param memoryBankId - Memory bank identifier. - * @returns Memory bank details. - */ - async getMemoryBank(memoryBankId: string): Promise { - return (await this.request("GET", `/memory_banks/${memoryBankId}`)) as MemoryBankResponse; - } - - /** - * Update a memory bank. - * - * @param memoryBankId - Memory bank identifier. - * @param body - Fields to update. - * @returns Updated memory bank. - */ - async updateMemoryBank(memoryBankId: string, body: UpdateMemoryBankBody): Promise { - return (await this.request("PUT", `/memory_banks/${memoryBankId}`, { json: body })) as MemoryBankResponse; - } - - /** - * Delete a memory bank. - * - * @param memoryBankId - Memory bank identifier. - */ - async deleteMemoryBank(memoryBankId: string): Promise { - await this.request("DELETE", `/memory_banks/${memoryBankId}`); - } - - /** - * Get agents that are using a specific memory bank. - * - * @param memoryBankId - Memory bank identifier. - */ - async getAgentsUsingMemoryBank(memoryBankId: string): Promise { - return listItems(await this.request("GET", `/memory_banks/${memoryBankId}/agents`)); - } - - /** - * Get stats for a memory bank. - * - * @param memoryBankId - Memory bank identifier. - */ - async getMemoryBankStats(memoryBankId: string): Promise { - return await this.request("GET", `/memory_banks/${memoryBankId}/stats`); - } - - /** - * Compact a memory bank (trigger compaction). - * - * @param memoryBankId - Memory bank identifier. - */ - async compactMemoryBank(memoryBankId: string): Promise { - await this.request("POST", `/memory_banks/${memoryBankId}/compact`); - } - - /** - * Delete a memory bank source. - * - * @param memoryBankId - Memory bank identifier. - */ - async deleteMemoryBankSource(memoryBankId: string): Promise { - await this.request("DELETE", `/memory_banks/${memoryBankId}/source`); - } - - /** - * Test compaction for a specific memory bank. - * - * @param memoryBankId - Memory bank identifier. - * @param body - Test compaction request. - */ - async testMemoryBankCompaction(memoryBankId: string, body: TestCompactionRequest): Promise { - return (await this.request("POST", `/memory_banks/${memoryBankId}/test-compaction`, { json: body })) as CompactionTestResponse; - } - - /** - * Test compaction prompt standalone (not tied to a specific memory bank). - * - * @param body - Standalone compaction test request. - */ - async testCompactionPromptStandalone(body: StandaloneTestCompactionRequest): Promise { - return (await this.request("POST", "/memory_banks/test-compaction", { json: body })) as CompactionTestResponse; - } - - /** - * List available memory bank templates. - */ - async listMemoryBankTemplates(): Promise { - return listItems(await this.request("GET", "/memory_banks/templates")); - } - - // ─── Memory Bank AI Assistant ────────────────────────────────────────────── - - /** - * Generate memory bank configuration using AI. - * - * @param body - AI assistant request with user instructions. - * @returns AI-generated memory bank config. - */ - async generateMemoryBankConfig(body: MemoryBankAiAssistantRequest): Promise { - return (await this.request("POST", "/memory_banks/ai-assistant", { json: body })) as MemoryBankAiAssistantResponse; - } - - /** - * Get the last AI conversation for memory banks. - */ - async getMemoryBankAiLastConversation(): Promise { - return (await this.request("GET", "/memory_banks/ai-assistant/last-conversation")) as MemoryBankLastConversationResponse; - } - - /** - * Accept a memory bank AI suggestion. - * - * @param conversationId - Conversation identifier. - * @param body - Accept request payload. - */ - async acceptMemoryBankAiSuggestion(conversationId: string, body: MemoryBankAcceptRequest): Promise { - return (await this.request("PATCH", `/memory_banks/ai-assistant/${conversationId}`, { json: body })) as OkResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Sources - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List sources. - * - * @param opts - Pagination, sorting, and filter options. - * @returns Paginated list of sources. - */ - async listSources( - opts: SortableListOptions & { accountId?: string } = {}, - ): Promise { - return (await this.request("GET", "/sources", { - query: { - page: opts.page, - limit: opts.limit, - sort: opts.sort, - order: opts.order, - account_id: opts.accountId, - }, - })) as SourceListResponse; - } - - /** - * Create a new content source. - * - * @param body - Source configuration (type, name, knowledge base link, etc.). - * @returns The created source. - */ - async createSource(body: CreateSourceBody): Promise { - return (await this.request("POST", "/sources", { json: body })) as SourceResponse; - } - - /** - * Get a source by ID. - * - * @param sourceId - Source connection identifier. - * @returns Source details. - */ - async getSource(sourceId: string): Promise { - return (await this.request("GET", `/sources/${sourceId}`)) as SourceResponse; - } - - /** - * Update a source. - * - * @param sourceId - Source connection identifier. - * @param body - Fields to update. - * @returns Updated source. - */ - async updateSource(sourceId: string, body: UpdateSourceBody): Promise { - return (await this.request("PUT", `/sources/${sourceId}`, { json: body })) as SourceResponse; - } - - /** - * Delete a source. - * - * @param sourceId - Source connection identifier. - */ - async deleteSource(sourceId: string): Promise { - await this.request("DELETE", `/sources/${sourceId}`); - } - - /** - * Upload a file to a source. - * - * Maximum file size: 200 MiB. Supports text, PDF, DOCX, audio, video, images, and more. - * If `mimeType` is omitted, it will be inferred from the `fileName` extension when possible. - * - * @param sourceId - Source connection identifier. - * @param opts - File payload and optional metadata. - * @returns Upload response details. - */ - async uploadFileToSource( - sourceId: string, - opts: { - file: Blob | Uint8Array | ArrayBuffer | BufferSource; - title?: string; - metadata?: Record; - fileName?: string; - mimeType?: string; - }, - ): Promise { - return (await this.uploadFile(`/sources/${sourceId}/upload`, opts)) as FileUploadResponse; - } - - /** - * Upload inline text to a source. - * - * @param sourceId - Source connection identifier. - * @param body - Inline text upload payload. - * @returns Upload response. - */ - async uploadInlineTextToSource(sourceId: string, body: InlineTextUploadRequest): Promise { - return (await this.request("POST", `/sources/${sourceId}`, { json: body })) as FileUploadResponse; - } - - /** - * List a source's content items and their indexing status. - * - * @param sourceId - Source connection identifier. - * @param opts - Pagination, sorting, and filters. Pass the `content_version_id` - * values the upload methods return as `contentVersionIds` to poll a batch of - * uploads in one request — about 100 at a time, since the ids travel in the - * query string and a URL over 8,192 bytes is rejected with a 414. An empty - * `contentVersionIds` matches nothing, so it returns an empty page without - * sending a request. - * @returns The items under `data` with `pagination`, on every API version. - */ - async listSourceContents( - sourceId: string, - opts: ListSourceContentsOptions = {}, - ): Promise { - if (opts.contentVersionIds?.length === 0) { - return { - data: [], - pagination: { - page: opts.page ?? 1, - limit: opts.limit ?? 20, - total: 0, - pages: 0, - has_next: false, - has_prev: false, - }, - }; - } - return (await this.request("GET", `/sources/${sourceId}/contents`, { - query: { - page: opts.page, - limit: opts.limit, - sort: opts.sort, - order: opts.order, - status: opts.status, - content_version_id: opts.contentVersionIds, - }, - })) as SourceContentStatusListResponse; - } - - /** - * Get one content item's indexing status. - * - * @param sourceId - Source connection identifier. - * @param contentVersionId - The `content_version_id` an upload returned. - */ - async getSourceContentStatus(sourceId: string, contentVersionId: string): Promise { - return (await this.request( - "GET", - `/sources/${sourceId}/contents/${contentVersionId}`, - )) as SourceContentStatusResponse; - } - - /** - * List mail an email content source refused, newest first. - * - * Each entry says who sent the message and why it was refused, never its - * subject or body. To accept a refused sender, add its `from_address` or that - * address's domain to the source's `email_allowed_senders` — which only helps - * when `authenticated` is true. Requires an account owner or administrator; - * the API answers 404 for a source that is not an email source. - * - * @param sourceId - Source connection identifier. - * @param opts - Pagination options (`limit` 1-100). - * @returns The rejections under `data` with `pagination`. - */ - async listEmailSourceRejections( - sourceId: string, - opts: ListOptions = {}, - ): Promise { - return (await this.request("GET", `/sources/${sourceId}/email-rejections`, { - query: { page: opts.page, limit: opts.limit }, - })) as EmailSourceRejectionListResponse; - } - - // ─── Source Exports ──────────────────────────────────────────────────────── - - /** - * List exports for a source. - * - * @param sourceId - Source connection identifier. - * @param opts - Pagination options. - * @returns Paginated list of exports. - */ - async listSourceExports(sourceId: string, opts: ListOptions = {}): Promise { - return (await this.request("GET", `/sources/${sourceId}/exports`, { - query: { page: opts.page, limit: opts.limit }, - })) as ExportListResponse; - } - - /** - * Create a source data export. - * - * @param sourceId - Source connection identifier. - * @param body - Export configuration (format, etc.). - * @returns Export response with job status. - */ - async createSourceExport(sourceId: string, body: CreateExportRequest): Promise { - return (await this.request("POST", `/sources/${sourceId}/exports`, { json: body })) as ExportResponse; - } - - /** - * Get a specific source export. - * - * @param sourceId - Source connection identifier. - * @param exportId - Export identifier. - * @returns Export details. - */ - async getSourceExport(sourceId: string, exportId: string): Promise { - return (await this.request("GET", `/sources/${sourceId}/exports/${exportId}`)) as ExportResponse; - } - - /** - * Cancel a source export. - * - * @param sourceId - Source connection identifier. - * @param exportId - Export identifier. - */ - async cancelSourceExport(sourceId: string, exportId: string): Promise { - return (await this.request("POST", `/sources/${sourceId}/exports/${exportId}/cancel`)) as ExportResponse; - } - - /** - * Download a source export file. - * - * Returns the raw `Response` so you can stream or save the binary data. - * - * @param sourceId - Source connection identifier. - * @param exportId - Export identifier. - * @param opts - Optional `signal`, which cancels the request; with a standard `fetch` this - * includes reading the body, so `AbortSignal.timeout(ms)` bounds the whole - * transfer. - * @returns Raw response with the export file. - */ - async downloadSourceExport( - sourceId: string, - exportId: string, - opts: { signal?: AbortSignal } = {}, - ): Promise { - return await this.requestRaw("GET", `/sources/${sourceId}/exports/${exportId}/download`, { - signal: opts.signal, - }); - } - - /** - * Estimate a source export. - * - * @param sourceId - Source connection identifier. - * @param body - Estimate request. - * @returns Export estimate. - */ - async estimateSourceExport(sourceId: string, body: EstimateExportRequest): Promise { - return (await this.request("POST", `/sources/${sourceId}/exports/estimate`, { json: body })) as EstimateExportResponse; - } - - /** - * Delete a source export. - * - * @param sourceId - Source connection identifier. - * @param exportId - Export identifier. - */ - async deleteSourceExport(sourceId: string, exportId: string): Promise { - await this.request("DELETE", `/sources/${sourceId}/exports/${exportId}`); - } - - // ─── Source Embedding Migrations ─────────────────────────────────────────── - - /** - * Get the status of a source embedding migration. - * - * @param sourceId - Source connection identifier. - * @returns Migration status. - */ - async getSourceEmbeddingMigration(sourceId: string): Promise { - return (await this.request("GET", `/sources/${sourceId}/embedding-migration`)) as SourceEmbeddingMigrationResponse; - } - - /** - * Start a source embedding migration. - * - * @param sourceId - Source connection identifier. - * @param body - Migration configuration (target embedding model, etc.). - * @returns Migration status. - */ - async startSourceEmbeddingMigration(sourceId: string, body: StartSourceEmbeddingMigrationRequest): Promise { - return (await this.request("POST", `/sources/${sourceId}/embedding-migration`, { json: body })) as SourceEmbeddingMigrationResponse; - } - - /** - * Cancel a source embedding migration. - * - * @param sourceId - Source connection identifier. - * @returns Updated migration status. - */ - async cancelSourceEmbeddingMigration(sourceId: string): Promise { - return (await this.request("POST", `/sources/${sourceId}/embedding-migration/cancel`)) as SourceEmbeddingMigrationResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Content - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Get content detail for a specific content version. - * - * @param contentVersionId - Content version identifier. - * @param opts - Range options for slicing large content. - * @returns Content details for the requested range. - */ - async getContentDetail( - contentVersionId: string, - opts: { start?: number; end?: number } = {}, - ): Promise { - return (await this.request("GET", `/contents/${contentVersionId}`, { - query: { start: opts.start ?? 0, end: opts.end ?? 5000 }, - })) as ContentDetailResponse; - } - - /** - * Replace content with inline text. - * - * @param contentVersionId - Content version identifier. - * @param body - Inline text replacement payload. - */ - async replaceContentWithInlineText(contentVersionId: string, body: InlineTextReplaceRequest): Promise { - return (await this.request("PUT", `/contents/${contentVersionId}`, { json: body })) as ContentFileUploadResponse; - } - - /** - * Delete a specific content version. - * - * @param contentVersionId - Content version identifier. - */ - async deleteContent(contentVersionId: string): Promise { - await this.request("DELETE", `/contents/${contentVersionId}`); - } - - /** - * List embeddings for a content version. - * - * @param contentVersionId - Content version identifier. - * @param opts - Pagination options. - * @returns Paginated list of embeddings. - */ - async listContentEmbeddings( - contentVersionId: string, - opts: ListOptions = {}, - ): Promise { - return (await this.request("GET", `/contents/${contentVersionId}/embeddings`, { - query: { page: opts.page ?? 1, limit: opts.limit ?? 20 }, - })) as ContentEmbeddingsListResponse; - } - - /** - * List the files attached to a content item. - * - * Files arrive from an agent's `write_content_attachment` step, with an email - * message, from an RSS feed's `feed_attachments`, from a web page's media, or - * as the images inside a document. Each entry says whether it is indexed for - * search and, when indexing failed, why. - * - * @param contentVersionId - Content version identifier. - * @param opts - Pagination options. - * @returns The attachments under `data` with `pagination`. - */ - async listContentAttachments( - contentVersionId: string, - opts: ListOptions = {}, - ): Promise { - return (await this.request("GET", `/contents/${contentVersionId}/attachments`, { - query: { page: opts.page, limit: opts.limit }, - })) as ContentAttachmentsListResponse; - } - - /** - * Get one file attached to a content item: its indexing status and reason, - * its metadata, and the text it is indexed by. - * - * @param contentVersionId - Content version identifier. - * @param attachmentId - The `id` of an entry from {@link listContentAttachments}. - * @param opts - `start` and `end` character offsets for paging through long text - * (server defaults 0 and 5000). Both are sent as given, so `end: 0` asks for - * the metadata without any text. A file that was not indexed has no text. - * @returns The attachment with the requested range of its text. - * @throws {SeclaiAPIStatusError} 402 when the account has no credits left - * (`error.code` `insufficient_credits`). - */ - async getContentAttachment( - contentVersionId: string, - attachmentId: string, - opts: { start?: number; end?: number } = {}, - ): Promise { - return (await this.request("GET", `/contents/${contentVersionId}/attachments/${attachmentId}`, { - query: { start: opts.start, end: opts.end }, - })) as ContentAttachmentDetailResponse; - } - - /** - * List the embeddings (chunk vectors) a content attachment is indexed by. - * The list is empty for a file that has no completed index. - * - * @param contentVersionId - Content version identifier. - * @param attachmentId - Attachment identifier. - * @param opts - Pagination options (`limit` 1-100). - * @returns Paginated list of embeddings. - * @throws {SeclaiAPIStatusError} 402 when the account has no credits left - * (`error.code` `insufficient_credits`). - */ - async listContentAttachmentEmbeddings( - contentVersionId: string, - attachmentId: string, - opts: ListOptions = {}, - ): Promise { - return (await this.request("GET", `/contents/${contentVersionId}/attachments/${attachmentId}/embeddings`, { - query: { page: opts.page, limit: opts.limit }, - })) as ContentEmbeddingsListResponse; - } - - /** - * Download a content attachment's bytes. - * - * Returns the raw `Response` so you can stream or save the binary data. The - * API answers 403 when the file is withheld — blocked or redacted by a - * governance policy, or still being indexed after arriving from outside; the - * attachment's `file_withheld` field says which before you ask. - * - * @param contentVersionId - Content version identifier. - * @param attachmentId - Attachment identifier. - * @param opts - Optional `signal`, which cancels the request; with a standard `fetch` this - * includes reading the body, so `AbortSignal.timeout(ms)` bounds the whole - * transfer. - * @returns Raw response with the attachment bytes. - * @throws {SeclaiAPIStatusError} 403 when the file is withheld, and 402 when - * the account has no credits left (`error.code` `insufficient_credits`). - */ - async downloadContentAttachment( - contentVersionId: string, - attachmentId: string, - opts: { signal?: AbortSignal } = {}, - ): Promise { - return await this.requestRaw("GET", `/contents/${contentVersionId}/attachments/${attachmentId}/file`, { - signal: opts.signal, - }); - } - - /** - * Upload a file to replace content for an existing content version. - * - * @param contentVersionId - Content version identifier. - * @param opts - File payload and optional metadata. - * @returns Upload response. - */ - async uploadFileToContent( - contentVersionId: string, - opts: { - file: Blob | Uint8Array | ArrayBuffer | BufferSource; - title?: string; - metadata?: Record; - fileName?: string; - mimeType?: string; - }, - ): Promise { - return (await this.uploadFile(`/contents/${contentVersionId}/upload`, opts)) as ContentFileUploadResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Solutions - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List solutions. - * - * @param opts - Pagination and sorting options. - * @returns Paginated list of solutions. - */ - async listSolutions(opts: SortableListOptions = {}): Promise { - return (await this.request("GET", "/solutions", { - query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }, - })) as SolutionListResponse; - } - - /** - * Create a new solution. - * - * @param body - Solution configuration. - * @returns The created solution. - */ - async createSolution(body: CreateSolutionRequest): Promise { - return (await this.request("POST", "/solutions", { json: body })) as SolutionResponse; - } - - /** - * Get a solution by ID. - * - * @param solutionId - Solution identifier. - * @returns Solution details. - */ - async getSolution(solutionId: string): Promise { - return (await this.request("GET", `/solutions/${solutionId}`)) as SolutionResponse; - } - - /** - * Update a solution. - * - * @param solutionId - Solution identifier. - * @param body - Fields to update. - * @returns Updated solution. - */ - async updateSolution(solutionId: string, body: UpdateSolutionRequest): Promise { - return (await this.request("PATCH", `/solutions/${solutionId}`, { json: body })) as SolutionResponse; - } - - /** - * Delete a solution. - * - * @param solutionId - Solution identifier. - */ - async deleteSolution(solutionId: string): Promise { - await this.request("DELETE", `/solutions/${solutionId}`); - } - - // ─── Solution Resource Linking ───────────────────────────────────────────── - - /** - * Link agents to a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to link. - * @returns Updated solution. - */ - async linkAgentsToSolution(solutionId: string, body: LinkResourcesRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/agents`, { json: body })) as SolutionResponse; - } - - /** - * Unlink agents from a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to unlink. - * @returns Updated solution. - */ - async unlinkAgentsFromSolution(solutionId: string, body: UnlinkResourcesRequest): Promise { - return (await this.request("DELETE", `/solutions/${solutionId}/agents`, { json: body })) as SolutionResponse; - } - - /** - * Link knowledge bases to a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to link. - * @returns Updated solution. - */ - async linkKnowledgeBasesToSolution(solutionId: string, body: LinkResourcesRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/knowledge-bases`, { json: body })) as SolutionResponse; - } - - /** - * Unlink knowledge bases from a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to unlink. - * @returns Updated solution. - */ - async unlinkKnowledgeBasesFromSolution(solutionId: string, body: UnlinkResourcesRequest): Promise { - return (await this.request("DELETE", `/solutions/${solutionId}/knowledge-bases`, { json: body })) as SolutionResponse; - } - - /** - * Link source connections to a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to link. - * @returns Updated solution. - */ - async linkSourceConnectionsToSolution(solutionId: string, body: LinkResourcesRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/source-connections`, { json: body })) as SolutionResponse; - } - - /** - * Unlink source connections from a solution. - * - * @param solutionId - Solution identifier. - * @param body - Resource IDs to unlink. - * @returns Updated solution. - */ - async unlinkSourceConnectionsFromSolution(solutionId: string, body: UnlinkResourcesRequest): Promise { - return (await this.request("DELETE", `/solutions/${solutionId}/source-connections`, { json: body })) as SolutionResponse; - } - - // ─── Solution Conversations ──────────────────────────────────────────────── - - /** - * List conversations for a solution. - * - * @param solutionId - Solution identifier. - * @returns List of conversations. - */ - async listSolutionConversations(solutionId: string): Promise { - return listItems( - await this.request("GET", `/solutions/${solutionId}/conversations`), - ); - } - - /** - * Add a conversation turn to a solution. - * - * @param solutionId - Solution identifier. - * @param body - Conversation turn payload. - * @returns Updated conversation. - */ - async addSolutionConversationTurn(solutionId: string, body: AddConversationTurnRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/conversations`, { json: body })) as SolutionConversationResponse; - } - - /** - * Mark a conversation turn (e.g. accepted/rejected). - * - * @param solutionId - Solution identifier. - * @param conversationId - Conversation identifier. - * @param body - Mark payload. - */ - async markSolutionConversationTurn(solutionId: string, conversationId: string, body: MarkConversationTurnRequest): Promise { - await this.request("PATCH", `/solutions/${solutionId}/conversations/${conversationId}`, { json: body }); - } - - // ─── Solution AI Assistant ───────────────────────────────────────────────── - - /** - * Generate a solution AI plan. - * - * @param solutionId - Solution identifier. - * @param body - Generation request. - * @returns AI-generated plan. - */ - async generateSolutionAiPlan(solutionId: string, body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/ai-assistant/generate`, { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Generate a knowledge base configuration via solution AI. - * - * @param solutionId - Solution identifier. - * @param body - Generation request. - * @returns AI-generated knowledge base config. - */ - async generateSolutionAiKnowledgeBase(solutionId: string, body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/ai-assistant/knowledge-base`, { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Generate a source configuration via solution AI. - * - * @param solutionId - Solution identifier. - * @param body - Generation request. - * @returns AI-generated source config. - */ - async generateSolutionAiSource(solutionId: string, body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/ai-assistant/source`, { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Accept a solution AI plan. - * - * @param solutionId - Solution identifier. - * @param conversationId - Conversation identifier. - * @param body - Accept request. - * @returns Acceptance result with executed actions. - */ - async acceptSolutionAiPlan(solutionId: string, conversationId: string, body: AiAssistantAcceptRequest): Promise { - return (await this.request("POST", `/solutions/${solutionId}/ai-assistant/${conversationId}/accept`, { json: body })) as AiAssistantAcceptResponse; - } - - /** - * Decline a solution AI plan. - * - * @param solutionId - Solution identifier. - * @param conversationId - Conversation identifier. - */ - async declineSolutionAiPlan(solutionId: string, conversationId: string): Promise { - await this.request("POST", `/solutions/${solutionId}/ai-assistant/${conversationId}/decline`); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Governance — AI Assistant - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Generate governance policy suggestions using AI. - * - * @param body - AI governance request. - * @returns AI-generated governance suggestions. - */ - async generateGovernanceAiPlan(body: GovernanceAiAssistantRequest): Promise { - return (await this.request("POST", "/governance/ai-assistant", { json: body })) as GovernanceAiAssistantResponse; - } - - /** - * List governance AI conversations. - */ - async listGovernanceAiConversations(): Promise { - return listItems( - await this.request("GET", "/governance/ai-assistant/conversations"), - ); - } - - /** - * Accept a governance AI plan. - * - * @param conversationId - Conversation identifier. - * @returns Acceptance result. - */ - async acceptGovernanceAiPlan(conversationId: string): Promise { - return (await this.request("POST", `/governance/ai-assistant/${conversationId}/accept`)) as GovernanceAiAcceptResponse; - } - - /** - * Decline a governance AI plan. - * - * @param conversationId - Conversation identifier. - */ - async declineGovernanceAiPlan(conversationId: string): Promise { - await this.request("POST", `/governance/ai-assistant/${conversationId}/decline`); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Alerts - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List alerts. - * - * @param opts - Pagination and filter options. - * @returns Paginated list of alerts. - */ - async listAlerts(opts: ListOptions & { status?: string; severity?: string } = {}): Promise { - // `severity` is deliberately not forwarded: GET /alerts declares no such - // filter, so it never filtered anything, and sending it is a 422 once - // `apiVersion` is 2026-07-27 or later. Accepted and dropped so existing - // call sites keep working. - return (await this.request("GET", "/alerts", { - query: { page: opts.page, limit: opts.limit, status: opts.status }, - })) as AlertListResponse; - } - - /** - * Get alert details by ID. - * - * @param alertId - Alert identifier. - * @returns Alert details. - */ - async getAlert(alertId: string): Promise { - return (await this.request("GET", `/alerts/${alertId}`)) as AlertDetailResponse; - } - - /** - * Change the status of an alert. - * - * @param alertId - Alert identifier. - * @param body - Status change request. - */ - async changeAlertStatus(alertId: string, body: ChangeStatusRequest): Promise { - return (await this.request("POST", `/alerts/${alertId}/status`, { json: body })) as AlertDetailResponse; - } - - /** - * Add a comment to an alert. - * - * @param alertId - Alert identifier. - * @param body - Comment payload. - */ - async addAlertComment(alertId: string, body: AddCommentRequest): Promise { - return (await this.request("POST", `/alerts/${alertId}/comments`, { json: body })) as AlertDetailResponse; - } - - /** - * Subscribe to an alert. - * - * @param alertId - Alert identifier. - */ - async subscribeToAlert(alertId: string): Promise { - return (await this.request("POST", `/alerts/${alertId}/subscribe`)) as AlertDetailResponse; - } - - /** - * Unsubscribe from an alert. - * - * @param alertId - Alert identifier. - */ - async unsubscribeFromAlert(alertId: string): Promise { - return (await this.request("POST", `/alerts/${alertId}/unsubscribe`)) as AlertDetailResponse; - } - - // ─── Alert Configs ───────────────────────────────────────────────────────── - - /** - * List alert configurations. - * - * @param opts - Pagination options. - * @returns Paginated list of alert configs. - */ - /** - * `configs` and `total` are populated on every API version; `data` and - * `pagination` are also present once `apiVersion` is 2026-07-27 or later. - */ - async listAlertConfigs(opts: ListOptions = {}): Promise { - return keyedList( - await this.request("GET", "/alerts/configs", { query: { page: opts.page, limit: opts.limit } }), - "configs", - ["total"], - ); - } - - /** - * Create an alert configuration. - * - * @param body - Alert config definition. - * @returns Created alert config. - */ - async createAlertConfig(body: CreateAlertConfigRequest): Promise { - return (await this.request("POST", "/alerts/configs", { json: body })) as AlertConfigResponse; - } - - /** - * Get an alert configuration by ID. - * - * @param configId - Alert config identifier. - * @returns Alert config details. - */ - async getAlertConfig(configId: string): Promise { - return (await this.request("GET", `/alerts/configs/${configId}`)) as AlertConfigResponse; - } - - /** - * Update an alert configuration. - * - * @param configId - Alert config identifier. - * @param body - Fields to update. - * @returns Updated alert config. - */ - async updateAlertConfig(configId: string, body: UpdateAlertConfigRequest): Promise { - return (await this.request("PATCH", `/alerts/configs/${configId}`, { json: body })) as AlertConfigResponse; - } - - /** - * Delete an alert configuration. - * - * @param configId - Alert config identifier. - */ - async deleteAlertConfig(configId: string): Promise { - await this.request("DELETE", `/alerts/configs/${configId}`); - } - - // ─── Organization Alert Preferences ──────────────────────────────────────── - - /** - * List organization alert preferences. - */ - async listOrganizationAlertPreferences(): Promise { - return keyedList( - await this.request("GET", "/alerts/organization-preferences/list"), - "preferences", - ["total"], - ); - } - - /** - * Update an organization alert preference. - * - * @param organizationId - Organization identifier. - * @param alertType - Alert type. - * @param body - Preference update. - */ - async updateOrganizationAlertPreference( - organizationId: string, - alertType: string, - body: UpdateOrganizationAlertPreferenceRequest, - ): Promise { - return (await this.request( - "PATCH", - `/alerts/organization-preferences/${organizationId}/${alertType}`, - { json: body }, - )) as OrganizationAlertPreferenceResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Models & Model Alerts - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List model alerts. - * - * @param opts - Pagination options. - */ - async listModelAlerts(opts: ListOptions = {}): Promise { - // The endpoint declares limit/offset, not page, so `page` was ignored and - // every page after the first returned page 1. - const limit = opts.limit ?? 50; - const offset = opts.page && opts.page > 1 ? (opts.page - 1) * limit : undefined; - return keyedList( - await this.request("GET", "/models/alerts", { query: { offset, limit: opts.limit } }), - "alerts", - ["total"], - ); - } - - /** - * Mark all model alerts as read. - */ - async markAllModelAlertsRead(): Promise { - await this.request("POST", "/models/alerts/mark-all-read"); - } - - /** - * Get unread model alert count. - */ - async getUnreadModelAlertCount(): Promise { - return (await this.request("GET", "/models/alerts/unread-count")) as UnreadCountResponse; - } - - /** - * Mark a specific model alert as read. - * - * @param alertId - Model alert identifier. - */ - async markModelAlertRead(alertId: string): Promise { - await this.request("PATCH", `/models/alerts/${alertId}/read`); - } - - /** - * Get model recommendations. - * - * @param modelId - Model identifier. - */ - async getModelRecommendations(modelId: string): Promise { - return (await this.request("GET", `/models/${modelId}/recommendations`)) as ModelRecommendationsResponse; - } - - /** - * List all enabled LLM models grouped by provider. - * - * @param opts - Optional filters. - */ - async listModels( - opts: { - provider?: string; - supportsToolUse?: boolean; - supportsThinking?: boolean; - supportsInputMedia?: string; - supportsOutputMedia?: string; - } = {}, - ): Promise { - return listItems(await this.request("GET", "/models", { - query: { - provider: opts.provider, - supports_tool_use: opts.supportsToolUse, - supports_thinking: opts.supportsThinking, - supports_input_media: opts.supportsInputMedia, - supports_output_media: opts.supportsOutputMedia, - }, - })); - } - - /** - * Get full details for a specific model. - * - * @param modelId - Model identifier. - */ - async getModel(modelId: string): Promise { - return (await this.request("GET", `/models/${modelId}/details`)) as PromptModelResponse; - } - - /** - * List the media-generation quality tiers and the model + cost each resolves to. - * - * On a `prompt_call`'s `media_generation` tool — and the dedicated - * `generate_*` steps via tier routing — the author/LLM picks a *tier* - * (fast/balanced/thorough), never a model. This maps each - * `(modality, tier)` to its concrete generator, raw `credits_per_unit`, - * `unit_label`, and a human-readable scaled `price_label`. - * - * Global routing/pricing (the same for every account); read-only. - */ - async getGenerationTiers(): Promise> { - return keyedList>(await this.request("GET", "/models/generation-tiers"), "tiers"); - } - - /** - * List the embedding models a source can index with, and their pricing. - * - * The endpoint lists the embedders under `models` by default and under `data` - * once the caller opts in with `apiVersion` 2026-07-27 or later; `models` is - * populated on either, with the defaults and pricing beside it. - * - * @param opts.supportsInputMedia - Keep only embedders that can index this - * input modality — a coarse kind (text, image, video, audio) or a full MIME. - */ - async listEmbeddingModels(opts: { supportsInputMedia?: string } = {}): Promise { - return keyedList( - await this.request("GET", "/models/embedders", { - query: { supports_input_media: opts.supportsInputMedia }, - }), - "models", - ); - } - - /** - * List the reranker models a knowledge base can use, and their pricing. - * - * `models` is populated on either wire shape, as for {@link Seclai.listEmbeddingModels}. - */ - async listRerankerModels(): Promise { - return keyedList(await this.request("GET", "/models/rerankers"), "models"); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Model Playground Experiments - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List model playground experiments. - * - * @param opts - Optional filters and pagination. - */ - async listExperiments(opts: { days?: number; startDate?: string; endDate?: string; limit?: number; offset?: number } = {}): Promise { - return keyedList( - await this.request("GET", "/models/playground/experiments", { - query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate, limit: opts.limit, offset: opts.offset }, - }), - "experiments", - ["total"], - ); - } - - /** - * Create a model playground experiment. - * - * @param body - Experiment configuration. - */ - async createExperiment(body: CreateExperimentInput): Promise { - return (await this.request("POST", "/models/playground/experiments", { json: body })) as CreateExperimentResponse; - } - - /** - * Get a model playground experiment by ID. - * - * @param experimentId - Experiment identifier. - */ - async getExperiment(experimentId: string): Promise { - return (await this.request("GET", `/models/playground/experiments/${experimentId}`)) as ExperimentDetailResponse; - } - - /** - * Cancel a running model playground experiment. - * - * @param experimentId - Experiment identifier. - */ - async cancelExperiment(experimentId: string): Promise { - return (await this.request("POST", `/models/playground/experiments/${experimentId}/cancel`)) as CancelExperimentResponse; - } - - /** - * Soft-delete a model playground experiment. - * - * Removes the experiment from list/detail views while preserving audit - * history. Returns HTTP 204 with no body. - * - * @param experimentId - Experiment identifier. - */ - async deleteExperiment(experimentId: string): Promise { - await this.request("DELETE", `/models/playground/experiments/${experimentId}`); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Cloud Drives - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List the cloud-drive providers this deployment has configured. - * - * @returns The providers, read from either wire shape. - */ - async listCloudDriveProviders(): Promise { - return listItems(await this.request("GET", "/cloud-drives/providers")); - } - - /** - * List the account's cloud-drive connections. - * - * @returns The connections, read from either wire shape. - */ - async listCloudDrives(): Promise { - return listItems(await this.request("GET", "/cloud-drives")); - } - - /** - * Get a cloud-drive connection. - * - * @param connectionId - Cloud-drive connection identifier. - */ - async getCloudDrive(connectionId: string): Promise { - return (await this.request("GET", `/cloud-drives/${connectionId}`)) as CloudDriveResponse; - } - - /** - * Update a cloud-drive connection. - * - * @param connectionId - Cloud-drive connection identifier. - * @param body - Fields to change — `name` and/or `folder_path`. - * @returns The updated connection. - */ - async updateCloudDrive(connectionId: string, body: CloudDriveUpdateRequest): Promise { - return (await this.request("PATCH", `/cloud-drives/${connectionId}`, { json: body })) as CloudDriveResponse; - } - - /** - * Disconnect a cloud-drive connection, keeping the connection itself. - * - * @param connectionId - Cloud-drive connection identifier. - * @returns The connection in its disconnected state. - */ - async disconnectCloudDrive(connectionId: string): Promise { - return (await this.request("POST", `/cloud-drives/${connectionId}/disconnect`)) as CloudDriveResponse; - } - - /** - * Delete a cloud-drive connection. - * - * @param connectionId - Cloud-drive connection identifier. - */ - async deleteCloudDrive(connectionId: string): Promise { - await this.request("DELETE", `/cloud-drives/${connectionId}`); - } - - /** - * List the agents that use a cloud-drive connection. - * - * @param connectionId - Cloud-drive connection identifier. - * @returns The agents, read from either wire shape. - */ - async getAgentsUsingCloudDrive(connectionId: string): Promise { - return listItems( - await this.request("GET", `/cloud-drives/${connectionId}/agents`), - ); - } - - /** - * List the files a cloud-drive connection skipped, newest first. - * - * A skipped file fires no trigger, so this is where to look when an agent - * did not run for a file. - * - * @param connectionId - Cloud-drive connection identifier. - * @param opts.limit - Maximum number of rejections (1-200, default 50). - * @returns The rejections with their reasons, read from either wire shape. - */ - async listCloudDriveRejections( - connectionId: string, - opts: { limit?: number } = {}, - ): Promise { - return listItems( - await this.request("GET", `/cloud-drives/${connectionId}/rejections`, { - query: { limit: opts.limit }, - }), - ); - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Search - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Search across all resource types in your account. - * - * Accepts a free-text keyword query or a UUID. Results are ranked: - * name-prefix > name-substring > description-substring. - * - * @param opts - Search options. - * @param opts.query - Search query string (required, 1-200 chars). - * @param opts.limit - Maximum results (1-50, default 10). - * @param opts.entityType - Optional entity type filter (e.g. "agent", "knowledge_base"). - * @returns Search results. - */ - async search(opts: { query: string; limit?: number; entityType?: string }): Promise { - return (await this.request("GET", "/search", { - query: { q: opts.query, limit: opts.limit, entity_type: opts.entityType }, - })) as SearchResponse; - } - - /** - * Search the Seclai documentation by content. - * - * `mode: "keyword"` matches page titles and summaries (fast, no AI cost); - * `mode: "semantic"` matches page body content by meaning (uses an embedding). - * - * Each result carries a `doc_slug` and an optional section `anchor` for - * building a `https://seclai.com/docs/[#]` link, a `score` - * (not comparable across modes), and — in semantic mode — a `highlight` - * (best matching verbatim sentence; `null` for keyword). - * - * Documentation is global, so results are not account-scoped. - * - * @param opts - Search options. - * @param opts.query - Search query string (required, 1-200 chars). - * @param opts.mode - Search strategy (default `"keyword"`). - * @param opts.limit - Maximum results (1-20, default 8). - */ - async searchDocs(opts: { query: string; mode?: "keyword" | "semantic"; limit?: number }): Promise> { - return (await this.request("GET", "/docs-search", { - query: { q: opts.query, mode: opts.mode, limit: opts.limit }, - })) as Record; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Email Domains - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * List the account's vanity (`.seclai.com`) and custom - * (`agent.mycompany.com`) agent-email domains. - * - * Includes each domain's verification status and the DNS records the customer - * must publish, plus the plan capabilities (`can_add_vanity` / - * `can_add_custom`) and whether one of each kind already exists - * (`has_vanity` / `has_custom` — the per-kind limit is 1). - * - * Requires a user-bound credential; an account-only API key is refused with 403. - */ - async listEmailDomains(): Promise { - return keyedList(await this.request("GET", "/email-domains"), "domains"); - } - - /** - * Add and provision a new agent-email domain. - * - * Pass `kind: "vanity"` with `value: ""`, or `kind: "custom"` with - * `value: "agent.mycompany.com"` (optionally `delegated: true` to let Seclai - * manage a dedicated Route53 zone). Stands up the SES identity + DNS and - * returns the records the customer must publish. Requires an account - * owner/admin. - * - * @param body - The domain to add. `delegated` defaults to `false` server-side. - */ - async addEmailDomain(body: AddEmailDomainInput): Promise { - return (await this.request("POST", "/email-domains", { json: body })) as EmailDomainResponse; - } - - /** - * Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. - * - * Returns a `cleanup_note` when the removed domain was Seclai-managed - * (delegated), reminding you to delete the registrar NS delegation record - * (dangling-delegation / subdomain-takeover guard). Requires an account - * owner/admin. - * - * @param domainId - Domain identifier. - */ - async removeEmailDomain(domainId: string): Promise { - return (await this.request("DELETE", `/email-domains/${domainId}`)) as RemoveEmailDomainResponse; - } - - /** - * Run a verification check immediately ("Check now"). - * - * Re-polls SES + DNS for this domain instead of waiting for the background - * verification sweep, and returns its updated status + DNS-record check - * results. Useful right after publishing the required records. Requires an - * account owner/admin. - * - * @param domainId - Domain identifier. - */ - async verifyEmailDomain(domainId: string): Promise { - return (await this.request("POST", `/email-domains/${domainId}/verify`)) as EmailDomainResponse; - } - - /** - * Promote a verified domain to the account's primary domain. - * - * Agent email then sends FROM and receives ON this domain - * (`@`, `@`) instead of the shared - * `agent.seclai.com`. The domain must be verified. Requires an account - * owner/admin. - * - * @param domainId - Domain identifier. - */ - async setPrimaryEmailDomain(domainId: string): Promise { - return (await this.request("POST", `/email-domains/${domainId}/primary`)) as EmailDomainResponse; - } - - /** - * Revert to the shared `agent.seclai.com` sending/inbound domain. - * - * Clears the account's primary domain WITHOUT removing the configured - * domain(s) — they stay verified and can be promoted again later. Requires an - * account owner/admin. - */ - async useSharedEmailDomain(): Promise { - await this.request("POST", "/email-domains/use-shared-domain"); - } - - /** - * Send a test message FROM a verified domain (`noreply@`) TO the - * account owner's email. - * - * Confirms end-to-end that the domain actually sends (SES verified, DKIM/SPF - * aligned). Never sends to any other address, so it can't be used as an open - * relay. Requires an account owner/admin. - * - * @param domainId - Domain identifier. - */ - async sendEmailDomainTestEmail(domainId: string): Promise { - return (await this.request("POST", `/email-domains/${domainId}/test-email`)) as SendTestEmailResponse; - } - - /** - * Get the DMARC aggregate-report summary for a domain. - * - * Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top - * failing source IPs from the DMARC `rua` reports over the last `days` - * (clamped by the service). - * - * Populated for domains whose DNS zone Seclai controls (vanity + delegated - * custom); a self-managed custom domain keeps its own DMARC reporting and - * returns an all-zero summary. - * - * @param domainId - Domain identifier. - * @param opts - Reporting window options. - * @param opts.days - Window length in days (default 30). - * @param opts.topSources - Number of top failing sources to return (default 10). - */ - async getDmarcSummary( - domainId: string, - opts: { days?: number; topSources?: number } = {}, - ): Promise { - return (await this.request("GET", `/email-domains/${domainId}/dmarc`, { - query: { days: opts.days, top_sources: opts.topSources }, - })) as DmarcSummaryResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Top-Level AI Assistant - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Submit feedback on an AI assistant interaction. - * - * @param body - Feedback payload (thumbs up/down, optional comment). - * @returns Feedback response. - */ - async submitAiFeedback(body: AiAssistantFeedbackRequest): Promise { - return (await this.request("POST", "/ai-assistant/feedback", { json: body })) as AiAssistantFeedbackResponse; - } - - /** - * Generate a knowledge base configuration via AI assistant. - * - * @param body - Generation request. - */ - async aiAssistantKnowledgeBase(body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", "/ai-assistant/knowledge-base", { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Generate a source configuration via AI assistant. - * - * @param body - Generation request. - */ - async aiAssistantSource(body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", "/ai-assistant/source", { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Generate a solution via AI assistant. - * - * @param body - Generation request. - */ - async aiAssistantSolution(body: AiAssistantGenerateRequest): Promise { - return (await this.request("POST", "/ai-assistant/solution", { json: body })) as AiAssistantGenerateResponse; - } - - /** - * Generate a memory bank configuration via AI assistant. - * - * @param body - Generation request. - */ - async aiAssistantMemoryBank(body: MemoryBankAiAssistantRequest): Promise { - return (await this.request("POST", "/ai-assistant/memory-bank", { json: body })) as MemoryBankAiAssistantResponse; - } - - /** - * Get AI assistant memory bank conversation history. - */ - async getAiAssistantMemoryBankHistory(): Promise { - return (await this.request("GET", "/ai-assistant/memory-bank/last-conversation")) as MemoryBankLastConversationResponse; - } - - /** - * Accept an AI assistant suggestion. - * - * @param conversationId - Conversation identifier. - * @param body - Acceptance request payload. - */ - async acceptAiAssistantPlan(conversationId: string, body: AiAssistantAcceptRequest): Promise { - return (await this.request("POST", `/ai-assistant/${conversationId}/accept`, { json: body })) as AiAssistantAcceptResponse; - } - - /** - * Decline an AI assistant suggestion. - * - * @param conversationId - Conversation identifier. - */ - async declineAiAssistantPlan(conversationId: string): Promise { - await this.request("POST", `/ai-assistant/${conversationId}/decline`); - } - - /** - * Accept/mark an AI memory bank suggestion. - * - * @param conversationId - Conversation identifier. - * @param body - Acceptance payload for the memory bank suggestion. - */ - async acceptAiMemoryBankSuggestion(conversationId: string, body: MemoryBankAcceptRequest): Promise { - return (await this.request("PATCH", `/ai-assistant/memory-bank/${conversationId}`, { json: body })) as OkResponse; - } - - // ═══════════════════════════════════════════════════════════════════════════ - // Pagination Helpers - // ═══════════════════════════════════════════════════════════════════════════ - - /** - * Auto-paginate through a list endpoint. - * - * Yields individual items from each page, fetching the next page until the - * response reports there is none. A fetcher that answers with a bare array has - * no further pages, so its items are yielded once. - * - * @param fetchPage - A function that fetches a single page given `{ page, limit }`. - * @param opts - Page size (default: 50). - * @throws {@link SeclaiError} When a page carries its items under neither `data` nor `items`. - * - * @example - * ```ts - * for await (const agent of client.paginate( - * (opts) => client.listAgents(opts), - * )) { - * console.log(agent.name); - * } - * ``` - */ - async *paginate( - fetchPage: (opts: { page: number; limit: number }) => Promise>, - opts?: { limit?: number }, - ): AsyncGenerator { - const limit = opts?.limit ?? 50; - let page = 1; - - while (true) { - const result = (await fetchPage({ page, limit })) as unknown; - if (Array.isArray(result)) { - yield* result as T[]; - return; - } - const body = (result ?? {}) as { - data?: T[] | null; - items?: T[] | null; - pagination?: { pages?: number; total_pages?: number; has_next?: boolean } | null; - total?: number; - limit?: number; - }; - const items = "data" in body ? body.data ?? [] : body.items; - if (!Array.isArray(items)) { - throw new SeclaiError( - "paginate() could not find the page's items: expected an array, or an object with a `data` or `items` array.", - ); - } - yield* items; - - const pagination = body.pagination; - if (items.length === 0) return; - if (!pagination) { - // The flat `{data, total, page, limit}` shape. Counted from the page - // requested, so a server that ignores `page` cannot loop this forever. - if (typeof body.total !== "number") return; - const pageSize = typeof body.limit === "number" && body.limit > 0 ? body.limit : limit; - if (page * pageSize >= body.total) return; - } else if (typeof pagination.has_next === "boolean") { - if (!pagination.has_next) return; - } else { - const pages = pagination.pages ?? pagination.total_pages; - if (items.length < limit || pages === undefined || page >= pages) return; - } - page++; - } - } -} diff --git a/src/errors.ts b/src/errors.ts deleted file mode 100644 index 36c1fb2..0000000 --- a/src/errors.ts +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @module - * - * Error classes thrown by the Seclai SDK. - * - * All errors extend {@link SeclaiError}, so a single `catch (err instanceof SeclaiError)` - * handles every SDK error. Narrow to more specific subclasses for finer handling. - */ - -/** Base error class for the Seclai SDK. */ -export class SeclaiError extends Error { - constructor(message: string) { - super(message); - this.name = "SeclaiError"; - } -} - -/** Thrown when the SDK is misconfigured (for example, missing API key). */ -export class SeclaiConfigurationError extends SeclaiError { - constructor(message: string) { - super(message); - this.name = "SeclaiConfigurationError"; - } -} - -/** - * Thrown when the API returns a non-success status code. - * - * @remarks - * Use {@link SeclaiAPIValidationError} for HTTP 422 validation errors. - */ -export class SeclaiAPIStatusError extends SeclaiError { - /** HTTP status code returned by the API. */ - public readonly statusCode: number; - /** HTTP method used for the request. */ - public readonly method: string; - /** Full request URL. */ - public readonly url: string; - /** Best-effort response body text (if available). */ - public readonly responseText: string | undefined; - - constructor(opts: { - /** Human-readable error message. */ - message: string; - statusCode: number; - method: string; - url: string; - responseText: string | undefined; - }) { - super(opts.message); - this.name = "SeclaiAPIStatusError"; - this.statusCode = opts.statusCode; - this.method = opts.method; - this.url = opts.url; - this.responseText = opts.responseText; - } -} - -/** - * Thrown when the API returns a validation error response (typically HTTP 422). - * - * The `validationError` field contains the decoded validation payload when available. - */ -export class SeclaiAPIValidationError extends SeclaiAPIStatusError { - /** Parsed validation error payload (best-effort). */ - public readonly validationError: unknown; - - constructor(opts: { - message: string; - statusCode: number; - method: string; - url: string; - responseText: string | undefined; - validationError: unknown; - }) { - super(opts); - this.name = "SeclaiAPIValidationError"; - this.validationError = opts.validationError; - } -} - -/** Thrown when a streaming operation fails (e.g. stream ends unexpectedly). */ -export class SeclaiStreamingError extends SeclaiError { - /** The run ID associated with the failed stream, when available. */ - public readonly runId: string | undefined; - - constructor(message: string, runId?: string) { - super(message); - this.name = "SeclaiStreamingError"; - this.runId = runId; - } -} diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index e8ae7ea..0000000 --- a/src/index.ts +++ /dev/null @@ -1,341 +0,0 @@ -/** - * @module - * - * Seclai JavaScript/TypeScript SDK. - * - * ```ts - * import { Seclai } from "@seclai/sdk"; - * - * const client = new Seclai({ apiKey: process.env.SECLAI_API_KEY }); - * const agents = await client.listAgents(); - * ``` - * - * @see {@link Seclai} for the main client class. - * @packageDocumentation - */ -export type { PaginatedPage } from "./client"; -export { SeclaiApiVersion } from "./versions"; -export type { ApiVersion } from "./versions"; - -export { - Seclai, - SECLAI_API_URL, - type SeclaiOptions, - type FetchLike, - type AccessTokenProvider, -} from "./client"; - -export { - type SsoProfile, - type SsoCacheEntry, - type AuthState, - type CredentialChainOptions, - DEFAULT_SSO_DOMAIN, - DEFAULT_SSO_CLIENT_ID, - DEFAULT_SSO_REGION, - /** - * Load an SSO profile from the config file. - * **Node.js only** — uses `node:fs` and `node:path`. - */ - loadSsoProfile, - /** - * Read a cached SSO token from disk. - * **Node.js only** — uses `node:fs` and `node:path`. - */ - readSsoCache, - /** - * Write a cached SSO token to disk atomically. - * **Node.js only** — uses `node:fs` and `node:path`. - */ - writeSsoCache, - /** - * Delete a cached SSO token file. - * **Node.js only** — uses `node:fs` and `node:path`. - */ - deleteSsoCache, - isTokenValid, -} from "./auth"; - -export { - SeclaiError, - SeclaiConfigurationError, - SeclaiAPIStatusError, - SeclaiAPIValidationError, - SeclaiStreamingError, -} from "./errors"; - -export type { - // General - JSONValue, - HTTPValidationError, - ValidationError, - PaginationResponse, - ListOptions, - SortableListOptions, - - // Identity - MeResponse, - OrganizationInfoResponse, - - // Agents - AgentListResponse, - AgentDefinitionResponse, - AgentExportResponse, - AgentSummaryResponse, - CreateAgentRequest, - UpdateAgentRequest, - UpdateAgentDefinitionRequest, - AgentImportPreviewRequest, - AgentImportPreviewResponse, - AgentDefinitionImportErrorResponse, - ImportFieldErrorModel, - ImportSkipResponse, - GovernancePolicyRefResponse, - AgentCallerApiResponse, - - // Agent Email Triggers - SetEmailTriggerConfigRequest, - EmailTriggerConfigResponse, - - // Agent Email Governance - AgentEmailOptOutResponse, - AgentEmailOptOutListResponse, - BlockEmailSenderRequest, - BlockedEmailSenderResponse, - BlockedEmailSenderListResponse, - SetAutoBlockModeRequest, - InboundEmailRejectionResponse, - EmailSourceRejectionResponse, - EmailSourceRejectionListResponse, - InboundEmailStatusResponse, - CancelQueuedRunsResponse, - ResumeInboundResponse, - - // Agent Runs - AgentRunRequest, - AgentRunStreamRequest, - AgentRunResponse, - AgentRunListResponse, - AgentRunStepResponse, - AgentRunAttemptResponse, - AgentRunFileResponse, - AgentRunToolCallResponse, - AgentTraceSearchRequest, - AgentTraceSearchResponse, - AgentTraceMatchResponse, - AgentRunEvent, - - // Agent Input Uploads - UploadAgentInputApiResponse, - AgentAttachmentRefsApiResponse, - AcceptedAttachmentSlot, - AcceptedAttachmentSlotInput, - AcceptedAttachmentsResponse, - SetAcceptedAttachmentsRequest, - SetAcceptedAttachmentsInput, - AttachmentRefsSourceApiSummary, - - // Agent AI Assistant - GenerateAgentStepsRequest, - GenerateAgentStepsResponse, - GenerateStepConfigRequest, - GenerateStepConfigResponse, - ExamplePrompt, - MarkAiSuggestionRequest, - AiConversationHistoryResponse, - AiConversationTurnResponse, - - // Agent Evaluations - AgentEvaluationTier, - EvaluationCriteriaResponse, - EvaluationCriteriaListResponse, - ApiVersionResponse, - AlertDetailResponse, - AlertCommentResponse, - AlertSubscriberResponse, - UnreadCountResponse, - ModelRecommendationsResponse, - ModelRecommendationResponse, - ExperimentListResponse, - ExperimentSummaryResponse, - ExperimentDetailResponse, - CreateExperimentResponse, - CancelExperimentResponse, - SearchResponse, - SearchResultResponse, - OkResponse, - AlertListResponse, - AlertResponse, - AlertConfigListResponse, - AlertConfigResponse, - ModelAlertListResponse, - ModelAlertResponse, - CreateEvaluationCriteriaRequest, - UpdateEvaluationCriteriaRequest, - EvaluationResultResponse, - EvaluationResultListResponse, - CreateEvaluationResultRequest, - EvaluationResultSummaryResponse, - EvaluationResultWithCriteriaResponse, - EvaluationResultWithCriteriaListResponse, - EvaluationRunSummaryResponse, - EvaluationRunSummaryListResponse, - EvaluationStatus, - NonManualEvaluationSummaryResponse, - NonManualEvaluationModeStatResponse, - TestDraftEvaluationRequest, - TestDraftEvaluationResponse, - CompatibleRunListResponse, - CompatibleRunResponse, - - // Knowledge Bases - KnowledgeBaseListResponse, - KnowledgeBaseResponse, - CreateKnowledgeBaseBody, - UpdateKnowledgeBaseBody, - - // Memory Banks - MemoryBankListResponse, - MemoryBankResponse, - CreateMemoryBankBody, - UpdateMemoryBankBody, - MemoryBankAiAssistantRequest, - MemoryBankAiAssistantResponse, - MemoryBankAcceptRequest, - MemoryBankConfigResponse, - MemoryBankLastConversationResponse, - MemoryBankConversationTurnResponse, - TestCompactionRequest, - CompactionTestResponse, - CompactionEvaluationModel, - StandaloneTestCompactionRequest, - - // Sources - SourceListResponse, - SourceResponse, - SourceConnectionResponse, - CreateSourceBody, - UpdateSourceBody, - FileUploadResponse, - InlineTextUploadRequest, - InlineTextReplaceRequest, - SourceContentStatusResponse, - SourceContentStatusListResponse, - ListSourceContentsOptions, - - // Cloud Drives - CloudDriveProviderResponse, - CloudDriveScopeResponse, - CloudDriveAccessLevelResponse, - CloudDriveResponse, - CloudDriveUpdateRequest, - AgentUsingCloudDriveResponse, - CloudDriveRejectionResponse, - - // Source Exports - ExportListResponse, - ExportResponse, - CreateExportRequest, - EstimateExportRequest, - EstimateExportResponse, - ExportFormat, - - // Source Embedding Migrations - SourceEmbeddingMigrationResponse, - StartSourceEmbeddingMigrationRequest, - - // Content - ContentDetailResponse, - ContentEmbeddingsListResponse, - ContentEmbeddingResponse, - ContentAttachmentResponse, - ContentAttachmentsListResponse, - ContentAttachmentDetailResponse, - SkippedAttachmentResponse, - SkippedAttachmentReason, - ContentFileUploadResponse, - - // Solutions - SolutionListResponse, - SolutionResponse, - SolutionSummaryResponse, - CreateSolutionRequest, - UpdateSolutionRequest, - SolutionAgentResponse, - SolutionKnowledgeBaseResponse, - SolutionSourceConnectionResponse, - SolutionConversationResponse, - AddConversationTurnRequest, - MarkConversationTurnRequest, - AiAssistantGenerateRequest, - AiAssistantGenerateResponse, - AiAssistantAcceptRequest, - AiAssistantAcceptResponse, - ProposedActionResponse, - ExecutedActionResponse, - - // Resource Linking - LinkResourcesRequest, - UnlinkResourcesRequest, - - // Governance - GovernanceAiAssistantRequest, - GovernanceAiAssistantResponse, - GovernanceAiAcceptResponse, - GovernanceConversationResponse, - GovernanceProposedPolicyActionResponse, - GovernanceAppliedActionResponse, - - // Alerts - CreateAlertConfigRequest, - UpdateAlertConfigRequest, - ChangeStatusRequest, - AddCommentRequest, - OrganizationAlertPreferenceResponse, - OrganizationAlertPreferenceListResponse, - UpdateOrganizationAlertPreferenceRequest, - - // AI Assistant (top-level) - AiAssistantFeedbackRequest, - AiAssistantFeedbackResponse, - - // Models - PromptModelAutoUpgradeStrategy, - ProviderGroupResponse, - PromptModelResponse, - PromptToolResponse, - ModalityRateResponse, - EffortOptionsResponse, - EmbeddingModelResponse, - EmbeddingModelListResponse, - EmbeddingModalityRateResponse, - EmbeddingStorageCreditsResponse, - RerankerModelResponse, - RerankerModelListResponse, - VariantCategoryResponse, - VariantOptionResponse, - PlaygroundCreateRequest, - CreateExperimentInput, - - // Email Domains - AddEmailDomainRequest, - AddEmailDomainInput, - EmailDomainResponse, - EmailDomainsListResponse, - RemoveEmailDomainResponse, - SendTestEmailResponse, - DnsRecordResponse, - DnsProviderResponse, - DmarcSummaryResponse, - DmarcFailingSourceResponse, - - // Sources (enums) - SourceIndexMode, - - // Errors - InsufficientCreditsResponse, - InsufficientCreditsDetail, - - // Enums - PendingProcessingCompletedFailedStatus, -} from "./types"; diff --git a/src/openapi.ts b/src/openapi.ts deleted file mode 100644 index b08e65c..0000000 --- a/src/openapi.ts +++ /dev/null @@ -1,19626 +0,0 @@ -/** - * This file was auto-generated by openapi-typescript. - * Do not make direct changes to the file. - */ - -export interface paths { - "/agents": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List agents - * @description List agents for the account with pagination. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - get: operations["list_agents_api_agents_get"]; - put?: never; - /** - * Create an agent - * @description Create a new agent. - * - * Trigger types: - * - `dynamic_input`: triggered via API with user-provided input - * - `template_input`: triggered via API with a predefined template - * - `schedule`: triggered on a schedule - * - `new_content`: triggered when new content arrives - * - `email_received`: a virtual email inbox; runs when mail arrives at the agent's address. Configure the alias/allowlist with `PUT /agents/{agent_id}/triggers/{trigger_id}/email-config`, using the `trigger_id` this response returns. - * - * Templates: `blank`, `retrieval_example`, `simple_qa`, `summarizer`, `json_extractor`, `content_change_notifier`, `scheduled_report`, `webhook_pipeline` - * - * Importing an existing agent: - * - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. The full extras suite (alert_configs, evaluation_criteria, governance_policies, schedules, solutions) is applied; items that don't resolve in this account are reported in the response's `import_warnings` array. - * - Use `POST /agents/preview-import` first to surface `unresolved_refs` (workflow refs to KBs, memory banks, source connections, sub-agents that don't exist here). Then pass `entity_remap: {source_uuid: target_uuid}` on this call to substitute them before save. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Agent is created in the caller's account. - */ - post: operations["create_agent_api_agents_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/agent-email-optouts": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List agent-email opt-outs - * @description List recipients who have opted out of this account's agent emails (filter to one agent via `agent_id`; account-wide opt-outs always apply). Paginated via `limit`/`offset`; returns the page plus the `total` count. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account. - */ - get: operations["list_agent_email_optouts_api_api_agents_agent_email_optouts_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/agent-email-optouts/{optout_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** - * Revoke an agent-email opt-out - * @description Revoke an opt-out (opt the recipient back in to agent emails). - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the opt-out must belong to the key's account. - */ - delete: operations["remove_agent_email_optout_api_api_agents_agent_email_optouts__optout_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/blocked-email-senders": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List blocked inbound email senders + the auto-block mode - * @description List the account's blocked inbound email senders (newest first, paginated via `limit`/`offset`) plus the governance `auto_block_mode`. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account. - */ - get: operations["list_blocked_email_senders_api_api_agents_blocked_email_senders_get"]; - put?: never; - /** - * Block an inbound email sender or domain - * @description Add a sender address or a whole domain to the account blocklist (idempotent; `match_type` is `address` (default) or `domain`). - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account. - */ - post: operations["block_email_sender_api_api_agents_blocked_email_senders_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/blocked-email-senders/mode": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - /** - * Set the governance auto-block mode - * @description Set whether a governance BLOCK on an authenticated inbound email sender auto-adds them to the blocklist (`disabled`, `input`, or `input_and_output`); returns the updated list. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account. - */ - put: operations["set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put"]; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/blocked-email-senders/{blocked_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** - * Unblock an inbound email sender - * @description Remove a blocked sender by id. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; the blocked sender must belong to the key's account. - */ - delete: operations["unblock_email_sender_api_api_agents_blocked_email_senders__blocked_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/evaluation-criteria/{criteria_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Evaluation Criteria - * @description Get a single evaluation criteria by ID. - * - * Returns the full criteria configuration including type-specific fields, - * current enabled state, and a summary of recent evaluation results. - */ - get: operations["get_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__get"]; - put?: never; - post?: never; - /** - * Delete Evaluation Criteria - * @description Delete an evaluation criteria and all associated evaluation results. - * - * This action is permanent and cannot be undone. All historical result - * records tied to the criteria are removed as well. - */ - delete: operations["delete_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__delete"]; - options?: never; - head?: never; - /** - * Update Evaluation Criteria - * @description Update an evaluation criteria. - * - * Accepts a partial update – only the fields included in the request body - * are modified. Use this to toggle enabled/disabled, change the - * evaluation prompt, adjust retries, or rename the criteria. - */ - patch: operations["update_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__patch"]; - trace?: never; - }; - "/agents/evaluation-criteria/{criteria_id}/compatible-runs": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Compatible Runs - * @description List agent runs that have a completed step matching the criteria's target step. - * - * Returns runs whose step output can be used for testing or replaying the - * evaluation criteria. Results are ordered newest-first and paginated. - */ - get: operations["list_compatible_runs_api_agents_evaluation_criteria__criteria_id__compatible_runs_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/evaluation-criteria/{criteria_id}/results": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Evaluation Results - * @description List evaluation results for a criteria with optional filtering. - * - * Supports filtering by status (pending, passed, failed, skipped, error), - * flagged-only mode, and an optional time range. Results are paginated - * with configurable page size. - */ - get: operations["list_evaluation_results_api_agents_evaluation_criteria__criteria_id__results_get"]; - put?: never; - /** - * Create Evaluation Result - * @description Record an evaluation result for a criteria. - * - * Use this endpoint to push results from external test harnesses, CI/CD - * pipelines, or custom evaluation logic. Each result is linked to an - * agent run and optionally a specific step run. - */ - post: operations["create_evaluation_result_api_agents_evaluation_criteria__criteria_id__results_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/evaluation-criteria/{criteria_id}/summary": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Evaluation Summary - * @description Get an aggregated summary of evaluation results for a criteria. - * - * Returns total, passed, failed, error, and flagged counts alongside the - * average score, giving a quick overview of how the criteria is performing. - * With ``2026-10-21`` or later, ``average_score`` averages only passed and failed - * results; earlier versions average every stored score, ``error`` included. - */ - get: operations["get_evaluation_summary_api_agents_evaluation_criteria__criteria_id__summary_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/evaluation-results/non-manual-summary": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Non Manual Evaluation Summary - * @description Get an evaluation summary for API key clients. - * - * Returns aggregated pass/fail/flagged counts and pass rates for each evaluation mode (eval_and_retry, sample_and_flag). - * - * With ``2026-10-21`` or later, ``error`` results (the evaluator returned no - * verdict) are left out of ``failed``, and the rates are over passed and - * failed results. Earlier versions count them in ``failed`` and rate over - * every result. ``error`` is returned on every version. - * - * The ``agent_id`` scoping parameter is part of the ``2026-07-27`` changeset - * (opt in via the ``Seclai-Version`` header). Clients on the legacy baseline - * always receive the account-wide rollup; ``agent_id`` is ignored for them so - * the endpoint's behavior is frozen. With ``2026-07-27`` or later, the summary - * is scoped to ``agent_id`` when supplied (and returns 404 if it doesn't exist). - */ - get: operations["get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/inbound-email-rejections": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List discarded inbound emails - * @description List recent inbound emails that were quietly discarded before running an agent (unauthorized sender, unknown alias, spam/virus, flood-shed) for this account's agents. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account. - */ - get: operations["list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/inbound-email-status": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Account inbound-email overload status - * @description Whether the account-wide overload circuit breaker has currently paused new inbound email (all inbound turned away until the queued backlog drains), plus the size of the QUEUED (over-quota parked) run backlog. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; always scoped to the key's account. - */ - get: operations["get_inbound_email_status_api_api_agents_inbound_email_status_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/inbound-email-status/cancel-queued": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Cancel all queued inbound-email runs - * @description Fail all of the account's QUEUED (over-quota parked) inbound-email runs at once. A queued run has consumed no quota, so this merely fails them. Returns the count cancelled. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account. - */ - post: operations["cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/inbound-email-status/resume": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Manually resume paused inbound email - * @description Manually lift the account-wide inbound pause. If the queued backlog is still above the ceiling the breaker re-arms on the next evaluation — this is a one-shot override, not a permanent disable. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token for an account owner/admin; scoped to the key's account. - */ - post: operations["resume_inbound_email_api_api_agents_inbound_email_status_resume_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/preview-import": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Preview an agent_definition import - * @description Validate an `agent_definition` payload (the same shape produced by `GET /agents/{agent_id}/export`) without creating or modifying any agent. On success returns a summary the client can show before commit (counts of steps, schedules, alert configs, evaluation criteria, governance policies). On failure returns the same 422 body shape used by `POST /agents` and `PUT /agents/{id}` so callers can render line/column-anchored errors. - * - * Coverage: everything decidable from the payload itself — schema, step ids, nesting depth, text lengths, attachment references, prompt-tool declarations, step-graph cycles, racing step references, and `for_each` aggregation. Rules that depend on account state (email recipients, memory-bank types, cloud-drive connections, the agent's own trigger) can only run at save time, so `POST /agents` may still reject a payload this endpoint accepts. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. No DB writes. - */ - post: operations["preview_import_agent_api_agents_preview_import_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/runs/search": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Search agent traces - * @description Search agent traces using semantic similarity. - * - * Finds step-run outputs that are most semantically similar to the query. - * Results include the matching text, agent/step metadata, and a similarity score. - * - * Agent traces are automatically indexed when runs complete. The first 7 days of storage are free; extended retention is billed. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Searches only within your account's traces. - */ - post: operations["search_agent_runs_api_agents_runs_search_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/runs/{run_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get an agent run - * @description Fetch the latest snapshot for an agent run created by `POST /agents/{agent_id}/runs` or `POST /agents/{agent_id}/runs/stream`. - * - * The response includes `status`, `error_count`, and `output` once the run completes. Use `include_step_outputs=true` to include per-step outputs, timing, durations, and credits. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access runs belonging to your account. - */ - get: operations["get_agent_run_api_agents_runs__run_id__get"]; - put?: never; - post?: never; - /** - * Cancel an agent run - * @description Cancel an in-flight (`processing`) or queued (`queued`) agent run. - * - * A `queued` run is an inbound-email run parked by the per-plan rate quota that has not yet been dispatched; it has consumed no quota. - * - * If the run is already in a terminal state (`completed` or `failed`), cancellation will be rejected. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only cancel runs belonging to your account. - */ - delete: operations["delete_agent_run_api_agents_runs__run_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get an agent - * @description Fetch an agent's metadata (name, description, trigger type, timestamps). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account. - */ - get: operations["get_agent_metadata_api_agents__agent_id__get"]; - /** - * Update agent metadata - * @description Update an agent's name, description, evaluation settings, and model lifecycle settings. - * - * Evaluation settings: `evaluation_mode` ('output_expectation', 'eval_and_retry', 'sample_and_flag'), `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `max_retries`, `retry_on_failure`, `sampling_config`. - * - * Model lifecycle settings: `prompt_model_auto_upgrade_strategy` ('none', 'early_adopter', 'middle_of_road', 'cautious_adopter'), `prompt_model_auto_rollback_enabled`, `prompt_model_auto_rollback_triggers` (list of 'agent_eval_fail', 'governance_flag', 'governance_block', 'agent_run_failed'). - * - * Replacing the workflow from an export: - * - Pass `agent_definition` with the JSON shape produced by `GET /agents/{id}/export`. Update only touches the workflow + agent metadata — alert_configs, evaluation_criteria, governance_policies, schedules, and solution links from the imported file are NOT applied (use the dedicated endpoints for those, or `POST /agents` to import as a new agent). - * - `entity_remap: {source_uuid: target_uuid}` substitutes workflow entity refs before save (same shape as `POST /agents`). - * - * At least one field must be provided. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account. - */ - put: operations["update_agent_api_agents__agent_id__put"]; - post?: never; - /** - * Delete an agent - * @description Soft-delete an agent. The agent will no longer appear in listings or be accessible via the API. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only delete agents belonging to your account. - */ - delete: operations["delete_agent_api_agents__agent_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/ai-assistant/conversations": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get AI conversation history - * @description Fetch the AI assistant conversation history for a specific step of an agent. - * - * Returns past conversation turns (user inputs, AI responses, accept/decline status) ordered oldest first. Use `step_type` to filter by step type, and optionally `step_id` to narrow to a specific step instance. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be queried. - */ - get: operations["get_ai_conversation_history_api_agents__agent_id__ai_assistant_conversations_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/ai-assistant/generate-steps": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate agent workflow - * @description Use the AI assistant to generate a full agent step workflow from a natural language description. - * - * Provide a description of what the agent should do, along with optional context (current steps, trigger type). The AI produces a complete set of agent steps. - * Use mode 'generate_full' for new workflows or 'modify_workflow' to refine existing ones. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used. - */ - post: operations["generate_agent_steps_api_agents__agent_id__ai_assistant_generate_steps_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/ai-assistant/step-config": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate step configuration - * @description Use the AI assistant to generate or refine a single step's configuration. - * - * Provide the step type, a natural language instruction, and optionally the current configuration. The AI will produce a proposed configuration along with an explanation. The suggestion is stored as a conversation turn that can be accepted or declined separately via the mark endpoint. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Only agents belonging to your account can be used. - */ - post: operations["generate_step_config_api_agents__agent_id__ai_assistant_step_config_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/ai-assistant/{conversation_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Accept or decline suggestion - * @description Accept or decline a proposed AI assistant configuration for a conversation turn. - * - * This only updates the tracking status on the conversation record. To actually apply the proposed configuration, use the agent definition update endpoint separately. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The conversation must belong to one of your agents. - */ - patch: operations["mark_ai_suggestion_api_agents__agent_id__ai_assistant__conversation_id__patch"]; - trace?: never; - }; - "/agents/{agent_id}/attachment-references": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get agent attachment-reference contract - * @description Return the input attachments the agent's dynamic_input trigger declares — the files a run may carry. - * - * Call this BEFORE staging uploads so you know whether the agent accepts files at all (``requires_uploads``), and which attachments its trigger declares (``accepted_attachments``). Batches that do not fit them are rejected at run time with HTTP 400. - */ - get: operations["api_get_agent_attachment_references_api_agents__agent_id__attachment_references_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/callers": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List agents that call this agent - * @description List the live agents that call this agent via a `call_agent` step. They must be disabled before this agent can be paused. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the agent must belong to the key's account. - */ - get: operations["get_agent_callers_api_api_agents__agent_id__callers_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/definition": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get agent definition - * @description Fetch the current agent definition from the main branch. - * - * The response includes `change_id` which must be provided when updating the definition (optimistic locking). - * - * The definition contains the agent's step workflow. Available step types: - * - `prompt_call`: Call an LLM with a prompt template - * - `retrieval`: Search a knowledge base - * - `regex_replace`: Reshape text via ordered regex find/replace rules - * - `gate`: Evaluate conditions, stop or continue child execution - * - `retry`: Re-execute from a target ancestor step (for quality-control loops; pair with a `gate` step for conditional retrying. Fields: `target_step_id` (ancestor step ID), `max_retries` (1–10)) - * - `evaluate_step`: Score a selected previous step output and emit JSON with `score`, `passed`, and `pass_threshold` (fields: `target_step_id`, `evaluation_prompt`, `pass_threshold`, optional `evaluation_tier`, optional `expectation_config`) - * - `extract_data`: Progressively read and analyze large input - * - `extract_content`: Extract structured data (JSON, HTML, XML) - * - `add_chat_turn` / `load_chat_history`: Record a turn or load running history from a conversation memory bank - * - `add_memory` / `search_memory` / `load_memory`: Write, semantic-search, or load entries on a general memory bank - * - `send_email`: Send email with step output - * - `webhook_call`: POST data to an external URL - * - `write_aws_s3_object`: Write output to S3 - * - `call_agent`: Invoke another agent - * - `write_metadata`: Write a value to content metadata (for filtering/gates; content-triggered agents only. Fields: `metadata_key`, `content`) - * - `write_content_attachment`: Write a file-backed attachment to content (optionally indexed for retrieval; content-triggered agents only. Fields: `attachment_key`, `content`, `content_type`, `indexed`) - * - `load_content_attachment`: Load a previously written attachment (content-triggered agents only. Fields: `attachment_key`) - * - `load_content`: Load the full text body of a source document (typically used with content-triggered agents; can also load by explicit `content_version_id`. Fields: `content_version_id` optional) - * - `streaming_result`: Stream LLM tokens in real-time via SSE (must be a direct child of `prompt_call`; requires `dynamic_input` or `template_input` trigger; `priority: true` enables real-time streaming). To stream **and** return a schema-validated payload, add a sibling branch `extract_content` (`expected_format: "json"` + `json_schema`) → `display_result` under the same `prompt_call` — a `display_result` takes precedence over the stream regardless of which finishes first, so its validated output becomes the run's result while the tokens act as a progress channel - * - `display_result`: Show output to the user - * - `join`: Merge parallel branches - * - `merge`: Combine multiple inputs into a single templated output - * - `text`: Static text literal - * - `for_each`: Iterate a body over a list of items (body lives in `body[]`) - * - `if_else`: Conditional dispatch. Evaluates `conditions` (same shape as `gate`) and runs `then_steps` on match, otherwise the optional `else_steps`. The chosen branch's output flows to the if_else step's own `child_steps` (post-branch continuation chain). **`display_result` and `streaming_result` are not allowed inside `then_steps` / `else_steps`** — end each branch with a content-producing step (e.g. `text`, `prompt_call`) and place the single `display_result` in `child_steps`. - * - `switch`: Single-discriminator dispatch. Renders `discriminator` (default `{{input}}`) and routes to the first matching `cases[]` entry (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when nothing matches. The chosen case's output flows to the switch step's own `child_steps`. **`display_result` and `streaming_result` are not allowed inside `cases[].steps` or `else_steps`** — end each case with a content-producing step and place the single `display_result` in `child_steps`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access agents belonging to your account. - */ - get: operations["get_agent_definition_api_agents__agent_id__definition_get"]; - /** - * Update agent definition - * @description Update the agent's definition on the main branch. - * - * Uses **optimistic locking**: provide `expected_change_id` from the last `GET /agents/{agent_id}/definition`. Returns `409 Conflict` if the definition was modified since your last read. - * - * The definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, `regex_replace`, `gate`, `retry`, `evaluate_step`, `extract_data`, `extract_content`, `add_chat_turn`, `load_chat_history`, `add_memory`, `search_memory`, `load_memory`, `streaming_result`, `send_email`, `webhook_call`, `write_aws_s3_object`, `call_agent`, `write_metadata`, `write_content_attachment`, `load_content_attachment`, `load_content`, `display_result`, `join`, `merge`, `text`, `for_each`, `if_else`, and `switch`. Non-composite step types (`display_result`, `join`, `retry`, `streaming_result`) cannot contain child steps. - * - * **Retry steps** re-execute from a target ancestor step for quality-control loops. Configure with `target_step_id` (ancestor step ID) and `max_retries` (1–10). Best practice: place a `gate` step before the retry to make retries conditional. - * - * **if_else** runs `then_steps` when its `conditions` (same shape as `gate`) match, otherwise its optional `else_steps`. Either branch's output flows to the if_else step's own `child_steps` (the post-branch continuation chain). - * - * **switch** dispatches on a `discriminator` template (default `{{input}}`) to the first matching case (equality by default; pass a list in `match` for `$in` semantics) or to `else_steps` when no case matches. Cases own their own `steps` subtrees; the chosen branch's output flows to the switch step's own `child_steps`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only update agents belonging to your account. - */ - put: operations["update_agent_definition_api_agents__agent_id__definition_put"]; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/disable": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Pause (disable) an agent - * @description Disable an agent so it stops firing from every trigger path (API runs return 409, inbound email is turned away, scheduled/content triggers are skipped). - * - * Returns **409** with the blocking callers when other live agents still call this one via a `call_agent` step — disable those first. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user is recorded); the agent must belong to the key's account. - */ - post: operations["disable_agent_api_api_agents__agent_id__disable_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/enable": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Resume (enable) a paused agent - * @description Re-enable a paused agent (clears the disable state, whether it was paused manually or auto-paused by the inbound-email overload safeguard). - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token bound to a user (the acting user is recorded); the agent must belong to the key's account. - */ - post: operations["enable_agent_api_api_agents__agent_id__enable_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/evaluation-criteria": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Evaluation Criteria - * @description List evaluation criteria configured for an agent. - * - * Response shape is version-gated by the ``Seclai-Version`` header: - * - * - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - * JSON array of criteria (unpaginated — every criterion for the agent). - * - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - * envelope ``{data, pagination: {page, limit, total, pages, has_next, - * has_prev}}``. - * - * Each criterion carries its type, configuration, and a summary of results - * (pass / fail counts). Criteria can be filtered client-side by type or - * enabled status. - */ - get: operations["list_evaluation_criteria_api_agents__agent_id__evaluation_criteria_get"]; - put?: never; - /** - * Create Evaluation Criteria - * @description Create new step evaluation settings for an agent. - * - * The evaluation mode, retry settings, and sample frequency are inherited - * from the agent and stored on the criteria row for historical reference. - */ - post: operations["create_evaluation_criteria_api_agents__agent_id__evaluation_criteria_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/evaluation-criteria/test-draft": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Test Draft Evaluation - * @description Run an ephemeral evaluation against provided step output without persisting results. - * - * Use this to interactively test evaluation prompts and expectation - * configurations while editing criteria. The evaluation is a billed LLM - * call; only its result goes unrecorded. - * - * ``status`` is ``error`` when the evaluator returned no verdict. With - * ``Seclai-Version: 2026-10-21`` or later, ``score`` and ``passed`` are then - * ``null``; earlier versions return ``score`` 0.5 and ``passed`` false. - */ - post: operations["test_draft_evaluation_api_agents__agent_id__evaluation_criteria_test_draft_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/evaluation-results": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Agent Evaluation Results - * @description List evaluation results across all criteria configured on an agent. - * - * Returns a paginated list of evaluation results with optional filtering by status, criteria, and date range. Results include score, pass/fail status, and details. - */ - get: operations["list_agent_evaluation_results_api_agents__agent_id__evaluation_results_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/evaluation-runs": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Evaluation Runs - * @description List evaluation results grouped by agent run. - * - * Returns paginated per-run summaries with pass/fail counts and optional - * filtering by evaluation outcome, step, or date range. - */ - get: operations["list_evaluation_runs_api_agents__agent_id__evaluation_runs_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/export": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Export agent definition - * @description Export an agent definition as a portable JSON snapshot. - * - * The response contains the full definition, trigger configuration with schedules, alert configs, evaluation criteria, agent-scoped governance policies, and a resolved dependency manifest that maps every referenced external entity UUID to its human-readable name. - * - * Response shape: - * - `export_version`: schema version (currently `"5"`) - * - `exported_at`: ISO-8601 timestamp - * - `agent`: name, description, schema_version, definition, timestamps - * - `trigger`: trigger type, input template, schedules - * - `alert_configs`: alert type, thresholds, recipients - * - `evaluation_criteria`: evaluation settings per step - * - `governance_policies`: agent-scoped governance policies - * - `dependencies`: knowledge_bases, memory_banks, source_connections, agents, users - * - * Query params: - * - `download` (default true): when true, sets `Content-Disposition: attachment` so clients treat the response as a file download. - * - * Auth & scoping: - * - Requires `X-API-Key`. You can only export agents belonging to your account. - */ - get: operations["export_agent_api_agents__agent_id__export_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/input-uploads/{upload_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get upload status - * @description Poll the processing status of a file upload created via `POST /agents/{agent_id}/upload-input`. - * - * Possible `status` values: `processing`, `ready`, `failed`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - get: operations["api_get_agent_input_upload_status_api_agents__agent_id__input_uploads__upload_id__get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/runs": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List agent runs - * @description List runs for a specific agent (most recent first), with pagination. - * - * Typical use cases: - * - Build a traces UI for an agent. - * - Debug recent executions and inspect terminal statuses. - * - * Notes: - * - This endpoint returns a summary list. Fetch full details with `GET /agents/runs/{run_id}`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only list runs for agents in your account. - */ - get: operations["list_agent_runs_api_agents__agent_id__runs_get"]; - put?: never; - /** - * Run an agent - * @description Start an agent run. - * - * An *agent* is an automated workflow that can monitor content from your sources, process it with AI, and trigger actions. This endpoint creates a new run and returns a `run_id` you can poll to retrieve status and output. - * - * When to use: - * - Use this endpoint for request/response style integrations where polling is acceptable. - * - Use `POST /agents/{agent_id}/runs/stream` if you need real-time progress via SSE. - * - * Key fields: - * - `input`: text input for agents with a `dynamic_input` trigger. - * - `input_upload_id` / `input_upload_ids`: reference one or more files previously uploaded via `POST /agents/{agent_id}/upload-input`. Send them **with** `input` to pair prompt text with the files (the text leads, each file follows under its heading); only the two upload fields are mutually exclusive with each other. - * - `priority`: set true for latency-sensitive, user-facing work. For agents with a `streaming_result` step, set `priority=true` to enable real-time token streaming; otherwise the run still proceeds, but without live token streaming. - * - `metadata`: a JSON object that becomes available to agent steps for string substitution. - * - * After starting: - * - Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`. - * - Use `include_step_outputs=true` to include per-step outputs, timing, and credits. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - post: operations["run_agent_api_agents__agent_id__runs_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/runs/stream": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Run an agent (stream events) - * @description Start a **priority** agent run and stream run events using Server-Sent Events (SSE). - * - * This is the best option for interactive UIs where you want progress updates as the run executes. - * - * How it works: - * - The first `init` event contains an `AgentRunResponse` snapshot, including the `run_id`. - * - Subsequent events are forwarded from the run event stream (status changes, step events, etc). - * - If the agent contains a `streaming_result` step, `stream_token` events deliver individual LLM tokens (with a `token` field) and a `stream_end` event signals completion. - * - With `include_reasoning=true`, `stream_reasoning` events (with a `text` field) carry the model's reasoning while it thinks, when the `streaming_result` step's author enabled `show_reasoning`. Reasoning is never part of `output`. - * - The final `done` event contains the terminal snapshot (including `output` and `credits` when available). - * - * Input options (for `dynamic_input` triggers): - * - `input`: text input passed directly. - * - `input_upload_id` / `input_upload_ids`: reference one or more files uploaded via `POST /agents/{agent_id}/upload-input`. Combine either with `input` to send prompt text alongside the files; only the two upload fields are mutually exclusive with each other. - * - * Client guidance: - * - Keep the connection open and handle keepalive comments. - * - On `timeout` or `error`, the payload includes `run_id` so clients can resume by polling `GET /agents/runs/{run_id}`. - * - `stream_token` events carry the model's raw output. When the agent pairs `streaming_result` with a sibling `extract_content`/`display_result` branch, that branch's `display_result` takes precedence over the stream, so the `done` snapshot's `output` is the validated payload and the tokens are a progress channel — render tokens live, but read the result from `done`. Check `done.status` first: the streamed text is already the run's output when the stream ends, so a run that FAILED its validation step still carries that raw text in `output`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - post: operations["run_streaming_agent_api_agents__agent_id__runs_stream_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/runs/{run_id}/evaluation-results": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Run Evaluation Results - * @description List evaluation results recorded for a specific agent run. - * - * Response shape is version-gated by the ``Seclai-Version`` header: - * - * - **Default / legacy** (no header, or a date before ``2026-07-27``): a bare - * JSON array of results (unpaginated — every result for the run). - * - **``Seclai-Version: 2026-07-27`` or later**: the canonical paginated - * envelope ``{data, pagination: {page, limit, total, pages, has_next, - * has_prev}}``. - * - * Results span all evaluation criteria for the given run, useful for getting a - * complete quality snapshot of a single execution. - */ - get: operations["list_run_evaluation_results_api_agents__agent_id__runs__run_id__evaluation_results_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/triggers/{trigger_id}/accepted-attachments": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - /** - * Declare the input attachments a trigger accepts - * @description Replace the input attachments a trigger accepts. A run's files are each assigned to one declared attachment before any step runs; steps reference one as ``{{agent.attachments.}}``. Rejected with HTTP 400 when the agent references an attachment the new declaration leaves out. `trigger_id` is the one `GET /agents/{agent_id}` returns. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account. - */ - put: operations["set_accepted_attachments_api_api_agents__agent_id__triggers__trigger_id__accepted_attachments_put"]; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/triggers/{trigger_id}/email-config": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - /** - * Configure an EMAIL_RECEIVED trigger - * @description Set the custom alias, sender allowlist, and inbound-handling flags (`ignore_auto_generated`, `require_sender_auth`, `queue_on_quota`, `run_on_attachment_mismatch`) on an agent's EMAIL_RECEIVED trigger, and return its computed email address(es). `trigger_id` is the one `GET /agents/{agent_id}` returns. Omitted fields are left unchanged. - * - * Auth & scoping: requires `X-API-Key` header or OAuth Bearer token; the trigger must belong to an agent in the key's account. - */ - put: operations["set_email_trigger_config_api_api_agents__agent_id__triggers__trigger_id__email_config_put"]; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/agents/{agent_id}/upload-input": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Upload file input - * @description Upload a file to use as input for a `dynamic_input` agent run. Any other agent rejects the upload with HTTP 400. - * - * **Size limit:** 200 MB per file. - * - * From `Seclai-Version: 2026-10-16` a file of any type is accepted and is `ready` at once: pass `input_upload_id` to `POST /agents/{agent_id}/runs`. Each step receives the file itself when its model reads that type, and otherwise its text (OCR, extraction or transcript), made once for the steps that need it; a type nothing reads or converts is passed on as a file only. `input` carries a `# filename` heading per file. - * - * Earlier versions accept only these extensions: avi, bmp, csv, docx, epub, flac, gif, html, jpg, json, m4a, markdown, md, mov, mp3, mp4, msg, ogg, pdf, png, ppt, pptx, svg, tiff, txt, wav, webp, xls, xlsx, xml, zip. They write each file's text into `input`, so poll `GET /agents/{agent_id}/input-uploads/{upload_id}` until `status` is `ready` before running. - * - * The agent-input-binary janitor sweeps originals once they pass your account's agent-trace retention (the agent-traces source's retention period; free default 7 days). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - post: operations["api_upload_agent_input_api_agents__agent_id__upload_input_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/feedback": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Submit AI assistant feedback - * @description Submit thumbs-up/down feedback on any AI assistant interaction. Negative feedback with a comment is analyzed for concerning issues. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_feedback_api_ai_assistant_feedback_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/knowledge-base": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a knowledge base plan (standalone) - * @description Generate a knowledge base creation/modification plan without requiring an existing solution. May also propose prerequisite source creation actions. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_knowledge_base_api_ai_assistant_knowledge_base_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/memory-bank": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a memory bank configuration (standalone) - * @description Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_memory_bank_api_ai_assistant_memory_bank_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/memory-bank/last-conversation": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Fetch memory bank AI conversation history - * @description Fetch the most recent memory bank AI assistant conversation turns for the authenticated user. Returns turns in oldest-first order with a total count for pagination via limit/offset query parameters. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - get: operations["api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/memory-bank/{conversation_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Accept or decline a memory bank AI suggestion - * @description Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - patch: operations["api_ai_memory_bank_accept_api_ai_assistant_memory_bank__conversation_id__patch"]; - trace?: never; - }; - "/ai-assistant/solution": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a solution plan (standalone) - * @description Generate a complete solution plan covering sources, knowledge bases, and agents without requiring an existing solution. Supports SSE streaming when ``Accept: text/event-stream`` is set. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_solution_api_ai_assistant_solution_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/source": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a source plan (standalone) - * @description Generate a content source creation/modification plan without requiring an existing solution. The AI proposes actions for the user to review before any changes are made. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_source_api_ai_assistant_source_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/{conversation_id}/accept": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Accept and execute a standalone plan - * @description Accept and execute a previously proposed standalone plan. If the plan contains destructive actions (deletions), ``confirm_deletions`` must be set to true. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_accept_api_ai_assistant__conversation_id__accept_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/ai-assistant/{conversation_id}/decline": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Decline a standalone plan - * @description Decline a previously proposed standalone plan. No resources are modified. The conversation is marked as declined. - * - * Auth: requires ``X-API-Key`` header or OAuth Bearer token. - */ - post: operations["api_ai_decline_api_ai_assistant__conversation_id__decline_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List alerts - * @description List alerts for the account with optional filters. - * - * Filters: - * - `status`: triggered, acknowledged, resolved, dismissed - * - `agent_id`: filter by agent - * - `source_connection_id`: filter by source - * - `time_from` / `time_to`: ISO 8601 date range - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - */ - get: operations["list_alerts_api_alerts_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/configs": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List alert configs - * @description List alert configurations. - * - * Filters: - * - `agent_id`: list configs for a specific agent - * - `source_connection_id`: list configs for a specific source - * - Neither: list account-level agent alert configs - * - `scope=source`: list account-level source alert configs - * - * Credits alerts (`credits_low_threshold`, `credits_runout_prediction`, `credits_usage_spike`) are account-level alert configs. They are evaluated by the credits alert sweep and default-enabled configs may be auto-created for active accounts at runtime. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["list_alert_configs_api_alerts_configs_get"]; - put?: never; - /** - * Create alert config - * @description Create a new alert configuration. - * - * Agent alert types: run_failed, consecutive_failures, error_rate_spike, run_burst, slow_run, credits_low_threshold, credits_runout_prediction, credits_usage_spike, non_manual_eval_failed, non_manual_eval_flagged, governance_flagged, governance_blocked, model_newer_available, model_deprecated, model_sunset. - * Source alert types: pull_failed, consecutive_pull_failures, pull_error_rate_spike. - * - * Distribution types: owner, owner_admins, selected_members. Organization accounts are normalized to owner_admins. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["create_alert_config_api_alerts_configs_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/configs/{config_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get alert config - * @description Get a specific alert configuration by ID. - * - * Returns all fields including type, enabled state, threshold, cooldown, distribution type, and recipient list. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["get_alert_config_api_alerts_configs__config_id__get"]; - put?: never; - post?: never; - /** - * Delete alert config - * @description Delete an alert configuration. This permanently removes the config and stops any future alerts of this type from being triggered. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - delete: operations["delete_alert_config_api_alerts_configs__config_id__delete"]; - options?: never; - head?: never; - /** - * Update alert config - * @description Update an alert configuration. Only provided fields are updated. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - patch: operations["update_alert_config_api_alerts_configs__config_id__patch"]; - trace?: never; - }; - "/alerts/organization-preferences/list": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List organization alert delivery preferences - * @description List per-organization alert delivery preferences for the authenticated user. - * - * By default, only explicit override rows are returned. Set `include_defaults=true` to return the effective subscribed state for every alert type in every organization the user can manage. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - * - Only organizations where the user is an owner or administrator are included. - */ - get: operations["list_organization_preferences_api_alerts_organization_preferences_list_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/organization-preferences/{organization_id}/{alert_type}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Update organization alert delivery preference - * @description Update the authenticated user's personal delivery preference for one alert type in one organization. - * - * Setting `subscribed=false` stores an explicit opt-out override. Setting `subscribed=true` removes the override and restores the default subscribed behavior. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - * - Only owners and administrators can update preferences for an organization. - */ - patch: operations["update_organization_preference_api_alerts_organization_preferences__organization_id___alert_type__patch"]; - trace?: never; - }; - "/alerts/{alert_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get alert detail - * @description Get full alert detail including history, comments, and subscribers. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["get_alert_detail_api_alerts__alert_id__get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/{alert_id}/comments": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Add alert comment - * @description Add a comment to an alert. Comments are visible to all subscribers and are included in the alert detail response. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["add_alert_comment_api_alerts__alert_id__comments_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/{alert_id}/status": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Change alert status - * @description Change the status of an alert. Valid statuses: triggered, acknowledged, resolved, dismissed. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["change_alert_status_api_alerts__alert_id__status_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/{alert_id}/subscribe": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Subscribe to alert - * @description Subscribe the current user to an alert. Subscribed users receive email notifications when the alert status changes or new comments are added, for as long as they remain an owner or administrator of the account. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["subscribe_to_alert_api_alerts__alert_id__subscribe_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/alerts/{alert_id}/unsubscribe": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Unsubscribe from alert - * @description Unsubscribe the current user from an alert. The user will no longer receive email notifications for status changes or new comments on this alert. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["unsubscribe_from_alert_api_alerts__alert_id__unsubscribe_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/cloud-drives": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List the account's cloud-drive connections - * @description List the account's cloud-drive connections. Use a connection's `id` as `cloud_drive_connection_id` when creating a `cloud_drive` content source or binding a file-change agent trigger. `realtime_updates` reports whether changes arrive within seconds or on the scheduled backstop sweep. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - get: operations["list_cloud_drives_api_api_cloud_drives_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/cloud-drives/providers": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List configured cloud-drive providers - * @description List the cloud-drive providers whose OAuth app is configured on this deployment (e.g. Dropbox, Google Drive), with the permissions each requests. A provider missing from this list cannot be connected here. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - get: operations["list_cloud_drive_providers_api_api_cloud_drives_providers_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/cloud-drives/{connection_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a cloud-drive connection - * @description Fetch a single cloud-drive connection by id. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - get: operations["get_cloud_drive_api_api_cloud_drives__connection_id__get"]; - put?: never; - post?: never; - /** - * Delete a cloud-drive connection - * @description Soft-delete a connection and clear its tokens. Refused with **409** while anything still depends on it — a live agent trigger, or a `cloud_drive` content source ingesting into a knowledge base. `GET /{connection_id}/agents` shows which agents reference it, but does NOT list content sources, so treat the 409 as the authoritative check rather than a clean /agents response. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - delete: operations["delete_cloud_drive_api_api_cloud_drives__connection_id__delete"]; - options?: never; - head?: never; - /** - * Update a cloud-drive connection - * @description Rename a connection and/or change the folder it watches. Changing the folder resets the sync cursor, so existing files in the new folder are not replayed as triggers. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - patch: operations["update_cloud_drive_api_api_cloud_drives__connection_id__patch"]; - trace?: never; - }; - "/cloud-drives/{connection_id}/agents": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List agents using a cloud-drive connection - * @description Agents that reference this connection — via a cloud-drive step, a `prompt_call` cloud-drive tool, or a file-change trigger. Check this before disconnecting or deleting a connection. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - get: operations["get_agents_using_cloud_drive_api_api_cloud_drives__connection_id__agents_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/cloud-drives/{connection_id}/disconnect": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Disconnect a cloud-drive connection - * @description Revoke and clear the stored tokens and stop change notifications, keeping the connection row so it can be reconnected from the app. Agents bound to it stop firing until it is reconnected. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - post: operations["disconnect_cloud_drive_api_api_cloud_drives__connection_id__disconnect_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/cloud-drives/{connection_id}/rejections": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List files this connection did not process - * @description Recent files the connection deliberately skipped, newest first, with the reason: `too_large` (above the size cap), `download_failed` (the provider would not serve the bytes), or `flood` (the per-sync or per-account run cap was hit, so remaining changes were dropped). - * - * This is the answer to "why didn't my agent run for that file?" — a skipped file fires no trigger and appears nowhere else. - * - * Requires an API key or OAuth token scoped to the account. Cloud-drive secrets are never returned. - */ - get: operations["list_cloud_drive_rejections_api_api_cloud_drives__connection_id__rejections_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/contents/{source_connection_content_version}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get content details - * @description Get detailed information about a specific content item (a `SourceConnectionContentVersion`). - * - * This is useful when you want to: - * - Inspect the extracted text for debugging or review. - * - Display content details in a UI. - * - * Text range: - * - `start` and `end` control the character range returned in `text_content` so clients can page through large documents. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account. - */ - get: operations["get_content_detail_api_contents__source_connection_content_version__get"]; - /** - * Replace a content version with inline text - * @description Replace a content version using a small inline text payload. - * - * **Maximum payload size:** 8192 bytes (UTF-8). - * - * **Supported content types:** - * - `application/json` - * - `application/xml` - * - `text/csv` - * - `text/html` - * - `text/markdown` - * - `text/plain` - * - `text/x-markdown` - * - `text/xml` - * - * Notes: - * - A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected. - * - Use this endpoint for small text payloads; larger files should use `/upload`. - * - `title` is merged into `metadata.title` when not already present. - * - The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version. - */ - put: operations["replace_content_with_inline_text_api_contents__source_connection_content_version__put"]; - post?: never; - /** - * Delete content - * @description Delete a content item (a `SourceConnectionContentVersion`). - * - * Use this to remove an uploaded or indexed item from your account. Deleting content can affect agents and knowledge base workflows that reference this item. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only delete content belonging to your account. - * - A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected. - */ - delete: operations["delete_content_api_contents__source_connection_content_version__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/contents/{source_connection_content_version}/attachments": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List content attachments - * @description List the files attached to a content item, with pagination. - * - * An agent's `write_content_attachment` step attaches a file, and an email content source attaches the files sent with a message. An RSS source attaches the kinds of feed file chosen in its `feed_attachments`. The images and video in a web page's main content are attached on a source with media indexing on. The images inside a PDF, DOCX, PPTX or XLSX item or attachment are attached too, on a source that indexes document images. Each entry says whether the file is indexed for search and, when indexing failed, why. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account. - */ - get: operations["list_content_attachments_api_contents__source_connection_content_version__attachments_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/contents/{source_connection_content_version}/attachments/{attachment_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a content attachment - * @description Get one file attached to a content item: its indexing status and reason, its metadata, and the text it is indexed by. - * - * `attachment_id` is the `id` of an entry in the item's attachment list. Use `start` and `end` to page through long text. A file that was not indexed has no text. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account. - */ - get: operations["get_content_attachment_api_contents__source_connection_content_version__attachments__attachment_id__get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/contents/{source_connection_content_version}/attachments/{attachment_id}/embeddings": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List a content attachment's embeddings - * @description List the embeddings (chunk vectors) an attached file is indexed by, with pagination. The list is empty for a file that has no completed index. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account. - */ - get: operations["list_content_attachment_embeddings_api_contents__source_connection_content_version__attachments__attachment_id__embeddings_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/contents/{source_connection_content_version}/attachments/{attachment_id}/file": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Download a content attachment - * @description Download an attached file's bytes. - * - * Images, audio, video, PDF and plain text are served with their own type; an SVG that cannot be sanitized, and anything else, is served as `application/octet-stream`. - * - * Answers 403 when the file is withheld: a governance policy blocked or redacted it, or it arrived from outside and is still being indexed. The attachment's `file_withheld` field says which before you ask. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access attachments of content belonging to your account. - */ - get: operations["get_content_attachment_file_api_contents__source_connection_content_version__attachments__attachment_id__file_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/contents/{source_connection_content_version}/embeddings": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List content embeddings - * @description List the embeddings (chunk vectors) for a content item, with pagination. - * - * Embeddings are used for semantic search and retrieval in knowledge base workflows. This endpoint is primarily useful for debugging chunking, indexing, and vector contents. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access embeddings for content belonging to your account. - */ - get: operations["list_content_embeddings_api_contents__source_connection_content_version__embeddings_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/contents/{source_connection_content_version}/upload": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Replace a content version with a new upload - * @description Upload a new file and replace the content backing an existing `SourceConnectionContentVersion`. - * - * This behaves like a source file upload, but it targets an existing content version ID. This is useful when you want to correct or update an uploaded document while keeping references stable. - * - * **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored). - * - * **Supported MIME types:** - * - `application/atom+xml` - * - `application/epub+zip` - * - `application/json` - * - `application/pdf` - * - `application/rss+xml` - * - `application/rtf` - * - `application/vnd.ms-excel` - * - `application/vnd.ms-outlook` - * - `application/vnd.ms-powerpoint` - * - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - * - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - * - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - * - `application/x-ipynb+json` - * - `application/xhtml+xml` - * - `application/xml` - * - `application/zip` - * - `audio/aac` - * - `audio/amr` - * - `audio/flac` - * - `audio/mp4` - * - `audio/mpeg` - * - `audio/ogg` - * - `audio/opus` - * - `audio/wav` - * - `audio/webm` - * - `image/bmp` - * - `image/gif` - * - `image/jpeg` - * - `image/png` - * - `image/svg+xml` - * - `image/tiff` - * - `image/webp` - * - `message/rfc822` - * - `text/calendar` - * - `text/csv` - * - `text/html` - * - `text/javascript` - * - `text/markdown` - * - `text/plain` - * - `text/tab-separated-values` - * - `text/vcard` - * - `text/vtt` - * - `text/x-c` - * - `text/x-c++` - * - `text/x-csharp` - * - `text/x-go` - * - `text/x-ini` - * - `text/x-java` - * - `text/x-log` - * - `text/x-markdown` - * - `text/x-php` - * - `text/x-python` - * - `text/x-ruby` - * - `text/x-rust` - * - `text/x-shellscript` - * - `text/x-sql` - * - `text/x-subrip` - * - `text/x-tex` - * - `text/x-toml` - * - `text/x-typescript` - * - `text/xml` - * - `text/yaml` - * - `video/3gpp` - * - `video/mp2t` - * - `video/mp4` - * - `video/mpeg` - * - `video/quicktime` - * - `video/webm` - * - `video/x-matroska` - * - `video/x-msvideo` - * - * Notes: - * - A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected. - * - The replacement is indexed in the background. This `SourceConnectionContentVersion` ID keeps working, and reads return the previous content until indexing finishes; poll `list_source_content_status` to follow it. The returned `content_version_id` is the new version. - * - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension. - * - Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={"category":"docs"}`). - * - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`). - * - For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only replace content belonging to your account. - */ - post: operations["upload_file_to_content_api_contents__source_connection_content_version__upload_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/docs-search": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Search documentation - * @description Search the Seclai documentation by content and return matching pages. `mode=keyword` matches page titles and summaries (fast, no AI cost); `mode=semantic` matches page body content by meaning (uses an embedding). Each result carries a `doc_slug` and an optional section `anchor` for building a `https://seclai.com/docs/[#]` link, a `score` (relevance; not comparable across modes), and — in semantic mode — a `highlight` (best matching verbatim sentence; `null` for keyword). Documentation is global, so results are not account-scoped. - */ - get: operations["docs_search_api_docs_search_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List the account's email domains + plan capabilities - * @description List the account's vanity (`.seclai.com`) and custom (`agent.mycompany.com`) agent-email domains with their verification status, the DNS records the customer must publish, and the plan capabilities (`can_add_vanity`/`can_add_custom`) plus whether one of each kind already exists (`has_vanity`/`has_custom` — the per-kind limit is 1). - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - get: operations["list_email_domains_api_api_email_domains_get"]; - put?: never; - /** - * Add + provision an email domain - * @description Add a new vanity subdomain (`kind=vanity`, `value=`) or custom domain (`kind=custom`, `value=agent.mycompany.com`; optional `delegated=true` to let Seclai manage a dedicated Route53 zone). Stands up the SES identity + DNS and returns the records the customer must publish. Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - post: operations["add_email_domain_api_api_email_domains_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/use-shared-domain": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Revert to the shared agent.seclai.com sending domain - * @description Clear the account's primary domain so agent email reverts to the shared `agent.seclai.com` sending domain, WITHOUT removing the configured domain(s) — they stay verified and can be promoted again later. Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - post: operations["use_shared_domain_api_api_email_domains_use_shared_domain_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/{domain_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** - * Remove an email domain - * @description Remove a domain and tear down its SES identity + DNS / receipt-rule recipient. Returns a `cleanup_note` when the removed domain was Seclai-managed (delegated), reminding the caller to delete the registrar NS delegation record (dangling-delegation / subdomain-takeover guard). Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - delete: operations["remove_email_domain_api_api_email_domains__domain_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/{domain_id}/dmarc": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * DMARC aggregate-report summary for a domain - * @description Pass rate, disposition breakdown (`none`/`quarantine`/`reject`), and top failing source IPs from the DMARC `rua` aggregate reports over the last `days` (clamped by the service). Populated for domains whose DNS zone Seclai controls (vanity + delegated custom); a self-managed custom domain keeps its own DMARC reporting and returns an all-zero summary. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - get: operations["get_dmarc_summary_api_api_email_domains__domain_id__dmarc_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/{domain_id}/primary": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Make a verified domain the account's primary sending domain - * @description Promote a verified domain to the account's primary domain — agent email then sends FROM this domain and shows its addresses on it (`@`, `@`) instead of the shared `agent.seclai.com`; addresses keep resolving on the account's other verified domains and the shared form. The domain must be verified. Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - post: operations["set_primary_email_domain_api_api_email_domains__domain_id__primary_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/{domain_id}/test-email": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Send a test email from a verified domain to the account owner - * @description Send a test message FROM the verified domain (`noreply@`) TO the account owner's email, to confirm end-to-end that the domain actually sends (SES verified, DKIM/SPF aligned). Never sends to any other address, so it can't be used as an open relay. Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - post: operations["send_test_email_api_api_email_domains__domain_id__test_email_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/email-domains/{domain_id}/verify": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Run a verification check immediately ('Check now') - * @description Re-poll SES + DNS for this domain right now instead of waiting for the background verification sweep, and return its updated status + DNS-record check results. Useful right after publishing the required records. Owner/admin only. - * - * Auth & scoping: requires an `X-API-Key` header or OAuth Bearer token bound to a **user** (an account-only key is refused with 403); the domain is scoped to the key's account. - */ - post: operations["verify_email_domain_api_api_email_domains__domain_id__verify_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/governance/ai-assistant": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a governance plan - * @description Send a natural-language request to the governance AI assistant to generate a plan of policy changes. Returns a conversation with proposed actions that can be accepted or declined. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - */ - post: operations["governance_ai_generate_api_governance_ai_assistant_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/governance/ai-assistant/conversations": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List AI assistant conversations - * @description Return recent governance AI assistant conversations for the account, ordered by most recent first. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - */ - get: operations["list_governance_ai_conversations_api_governance_ai_assistant_conversations_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/governance/ai-assistant/{conversation_id}/accept": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Accept a governance plan - * @description Execute the proposed policy changes from a governance AI assistant conversation. Each action is applied in order and results are returned. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - */ - post: operations["governance_ai_accept_api_governance_ai_assistant__conversation_id__accept_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/governance/ai-assistant/{conversation_id}/decline": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Decline a governance plan - * @description Reject a previously proposed governance AI assistant plan without applying any changes. The conversation is marked as declined and no policy modifications are made. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token with governance access. - */ - post: operations["governance_ai_decline_api_governance_ai_assistant__conversation_id__decline_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/knowledge_bases": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Knowledge Bases - * @description List knowledge bases for the account. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - get: operations["list_knowledge_bases_api_knowledge_bases_get"]; - put?: never; - /** - * Create Knowledge Base - * @description Create a new knowledge base. - * - * At least one `source_id` is required. The source connections must belong to the same account. - */ - post: operations["create_knowledge_base_api_knowledge_bases_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/knowledge_bases/{knowledge_base_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Knowledge Base - * @description Fetch a knowledge base by ID. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access knowledge bases belonging to your account. - */ - get: operations["get_knowledge_base_api_knowledge_bases__knowledge_base_id__get"]; - /** - * Update Knowledge Base - * @description Update a knowledge base's configuration. Only provided fields are changed; omitted fields are left unchanged. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only update knowledge bases belonging to your account. - */ - put: operations["update_knowledge_base_api_knowledge_bases__knowledge_base_id__put"]; - post?: never; - /** - * Delete Knowledge Base - * @description Soft-delete a knowledge base. This action cannot be undone. - * - * Fails if the knowledge base is referenced by any agent definitions. Remove the knowledge base from agents first. - */ - delete: operations["delete_knowledge_base_api_knowledge_bases__knowledge_base_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/me": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get current user identity - * @description Returns the authenticated user's personal account ID and a list of organisations they belong to. Each organisation entry includes the organisation's own id, display name, and account_id. Useful for CLI tooling that needs to let the user pick an org context. - */ - get: operations["get_me_api_me_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Memory Banks - * @description List memory banks for the account. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. - */ - get: operations["list_memory_banks_api_memory_banks_get"]; - put?: never; - /** - * Create Memory Bank - * @description Create a new memory bank. - * - * Modes: `fast_and_cheap` (256-dim), `balanced` (512-dim), `slow_and_thorough` (1024-dim), or `custom` (supply your own embedding params). - */ - post: operations["create_memory_bank_api_memory_banks_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/ai-assistant": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate a memory bank configuration - * @description Generate a memory bank configuration suggestion via the AI assistant. The AI proposes name, type, mode, compaction prompt, and retention settings based on the user's description. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token. - */ - post: operations["memory_bank_ai_generate_api_memory_banks_ai_assistant_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/ai-assistant/last-conversation": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Fetch memory bank AI conversation history - * @description Fetch the most recent memory bank AI assistant conversation turns for the current user. Supports pagination via limit/offset. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/ai-assistant/{conversation_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Accept or decline a memory bank AI suggestion - * @description Update the acceptance status of a memory bank AI assistant conversation turn. Set ``accepted`` to true to accept the proposed configuration, or false to decline it. The accepted status is recorded for audit purposes. - * - * Auth: requires `X-API-Key` header or OAuth Bearer token. - */ - patch: operations["memory_bank_ai_accept_api_memory_banks_ai_assistant__conversation_id__patch"]; - trace?: never; - }; - "/memory_banks/templates": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Templates - * @description Return pre-built template configurations for common memory bank use cases. - * - * Each template includes a name, description, suggested use case, and full default settings that can be used directly with the create endpoint. - */ - get: operations["list_templates_api_memory_banks_templates_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/test-compaction": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Test Compaction Prompt Standalone - * @description Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning. - */ - post: operations["test_compaction_prompt_standalone_api_memory_banks_test_compaction_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Memory Bank - * @description Fetch a memory bank by ID. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access memory banks belonging to your account. - */ - get: operations["get_memory_bank_api_memory_banks__memory_bank_id__get"]; - /** - * Update Memory Bank - * @description Update a memory bank's configuration. Only provided fields are changed; omitted fields are left unchanged. - * - * Note: the embedding `mode` cannot be changed after creation because it determines the vector dimensions used to store entries. - */ - put: operations["update_memory_bank_api_memory_banks__memory_bank_id__put"]; - post?: never; - /** - * Delete Memory Bank - * @description Soft-delete a memory bank. This action is permanent and cannot be undone. - * - * The linked content source and all stored conversation memory entries will also be removed. - */ - delete: operations["delete_memory_bank_api_memory_banks__memory_bank_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}/agents": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Agents Using Bank - * @description List agents whose current definition references this memory bank. - * - * Returns an array of `{agent_id, agent_name}` objects. - */ - get: operations["get_agents_using_bank_api_memory_banks__memory_bank_id__agents_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}/compact": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Compact Memory Bank - * @description Trigger an on-demand compaction run for a memory bank. - * - * The bank must have at least one compaction threshold configured (max_turns or max_size_tokens). Age no longer triggers compaction — use retention_days to remove entries by age. Compaction runs asynchronously — the response confirms scheduling, not completion. - */ - post: operations["compact_memory_bank_api_memory_banks__memory_bank_id__compact_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}/source": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** - * Delete Memory Bank Source - * @description Delete the content source linked to a memory bank, removing all stored memory entries. - * - * A new content source is automatically created on the next write. Use this to reset a bank's data without deleting the bank itself. - */ - delete: operations["delete_memory_bank_source_api_memory_banks__memory_bank_id__source_delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}/stats": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Memory Bank Entry Stats - * @description Return aggregated entry statistics for a memory bank, including total counts, token/age/entries-per-key distributions (avg, p95, min, max), and top conversation keys, group keys, speakers, and tags. Supports time-range filtering via `days`, `start_date`, and `end_date` query parameters. - */ - get: operations["get_memory_bank_entry_stats_api_memory_banks__memory_bank_id__stats_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/memory_banks/{memory_bank_id}/test-compaction": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Test Compaction Prompt - * @description Test a compaction prompt by running the summarizer and evaluating the result with an LLM-as-judge. Returns original entries, compaction summary, surviving entries, and a structured quality evaluation with verdict, score, and reasoning. - */ - post: operations["test_compaction_prompt_api_memory_banks__memory_bank_id__test_compaction_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Models - * @description List the enabled LLM models with full details. - * - * Returns models grouped by provider, including capabilities, credit pricing, tool support, variant tiers, and lifecycle status. - * - * A model whose credit rate has not been published yet is omitted, so you are never offered a model that cannot be billed and therefore cannot be run. Such a model may appear later without any other change. - * - * Optional query parameters: - * - `provider`: filter by provider (e.g. 'anthropic', 'openai') - * - `supports_tool_use`: filter to models with tool calling support - * - `supports_thinking`: filter to models with extended thinking support - * - `supports_input_media`: filter to models accepting an input modality (`image`/`audio`/`video`/`pdf` or a full MIME) - * - `supports_output_media`: filter to models producing an output modality (`image`/`audio`/`video`) — e.g. to find generation models - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["list_models_api_models_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/alerts": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Alerts - * @description List model lifecycle alerts for the account. - * - * Returns in-app notifications about model deprecations, sunsets, and newer model availability. Supports filtering by agent, unread-only, and pagination. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Alerts are scoped to the caller's account. - */ - get: operations["list_alerts_api_models_alerts_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/alerts/mark-all-read": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Mark All Read - * @description Mark all model lifecycle alerts as read for the account. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Scoped to the caller's account. - */ - post: operations["mark_all_read_api_models_alerts_mark_all_read_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/alerts/unread-count": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Alert Unread Count - * @description Get the count of unread model lifecycle alerts. - * - * Useful for badge indicators in UIs and dashboards. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Count is scoped to the caller's account. - */ - get: operations["get_alert_unread_count_api_models_alerts_unread_count_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/alerts/{alert_id}/read": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Mark Read - * @description Mark a single model lifecycle alert as read (dismissed). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The alert must belong to the caller's account. - */ - patch: operations["mark_read_api_models_alerts__alert_id__read_patch"]; - trace?: never; - }; - "/models/embedders": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Embedding Models - * @description List the embedding models a source can be created with. - * - * Each entry carries the `model_type` to pass as `embedding_model` when creating a source, the `dimensions` it supports, and — most importantly for multi-modal indexing — `supported_input_media`: the modalities that embedder can actually index. A source only honours a `media_types` entry its embedder lists here; a kind it does not list is stored and not indexed, so check this before choosing an embedder for a knowledge base of images or video. - * - * Text-only embedders report `supported_input_media` as null. Pricing is reported as `credits` (per ~1,000 English words of text) plus `per_modality_rates` for the non-text modalities a multi-modal embedder bills differently. - * - * An embedder whose credit rate has not been published yet is omitted, so you are never offered one that cannot be billed. - * - * Optional query parameters: - * - `supports_input_media`: keep only embedders that can index this modality (`text`/`image`/`video`/`audio` or a full MIME) - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical for every account. - */ - get: operations["list_embedding_models_api_models_embedders_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/generation-tiers": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Generation Tiers - * @description List the media-generation quality tiers and the model + cost each resolves to. - * - * On a prompt_call's `media_generation` tool — and the dedicated generate_* steps via tier routing — the author/LLM chooses a *tier* (fast/balanced/thorough), never a model. This is the surface that maps each `(modality, tier)` to its concrete generator, raw `credits_per_unit`, `unit_label`, and a human-readable scaled `price_label`. Global routing/pricing (the same for every account); read-only. REST parity with the `list_generation_tiers` MCP tool. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["get_generation_tiers_api_models_generation_tiers_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/playground/experiments": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Experiments - * @description List model playground experiments for the account. - * - * Returns a paginated, time-filtered list of experiments ordered by creation date descending. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Experiments are scoped to the caller's account and, when the credential is bound to a user, to that user. - */ - get: operations["list_experiments_api_models_playground_experiments_get"]; - put?: never; - /** - * Create Experiment - * @description Create and schedule a model playground experiment. - * - * Runs the given prompt against 1-10 models in parallel and optionally evaluates the outputs with an LLM judge. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - * - When the credential is bound to a user, the experiment belongs to that user; only that user or an account-scoped key can cancel or delete it. - */ - post: operations["create_experiment_api_models_playground_experiments_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/playground/experiments/{experiment_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Experiment - * @description Get details and results for a specific model playground experiment. - * - * Returns the full experiment payload including prompt, model outputs, and evaluation results (if available). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404. - */ - get: operations["get_experiment_api_models_playground_experiments__experiment_id__get"]; - put?: never; - post?: never; - /** - * Delete Experiment Endpoint - * @description Soft-delete a model playground experiment. - * - * Removes the experiment from list/detail views while preserving audit history. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth access token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404. - */ - delete: operations["delete_experiment_endpoint_api_models_playground_experiments__experiment_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/playground/experiments/{experiment_id}/cancel": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Cancel Experiment Endpoint - * @description Cancel a running or pending model playground experiment. - * - * Marks the experiment as canceled. An experiment that has not started never runs. One that is running starts no further model calls, and records each model it did not call with the error `Canceled`. A model call or evaluation already in progress is not interrupted by the cancel: it continues and is billed, and its result is recorded on the canceled experiment. Canceling may therefore not shorten the run or reduce its cost. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The experiment must belong to the caller's account and, when the credential is bound to a user, to that user; otherwise 404. - */ - post: operations["cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/rerankers": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List Reranker Models - * @description List the reranker models a knowledge base can be created with. - * - * A reranker re-scores the top results of a vector search for relevance. Each entry carries the `model_type` to pass as `reranker_model` on a knowledge base, its `credits_per_action`, and whether it is the platform default (`is_default`, used when you omit `reranker_model`). - * - * To disable reranking, send `"none"` or an empty string as `reranker_model` rather than a value from this list. Reranking scores text, so a knowledge base whose sources all embed media natively — whose chunks carry no text — defaults to no reranker. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. The catalog is global reference data, identical for every account. - */ - get: operations["list_reranker_models_api_models_rerankers_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/{model_id}/details": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Model - * @description Get detailed information about a specific model. - * - * Returns full model details including capabilities, credit pricing, tool support, variant tiers, and lifecycle status. - * - * The `model_id` is the model enum identifier (e.g. 'anthropic_claude_opus_4_6'). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["get_model_api_models__model_id__details_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/models/{model_id}/recommendations": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Recommendations - * @description Get replacement/upgrade recommendations for a model. - * - * Returns a designated successor (if any), same-family upgrades, and cross-provider/cross-family alternatives. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - */ - get: operations["get_recommendations_api_models__model_id__recommendations_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/search": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Search resources - * @description Search across all resource types in your account. Accepts a free-text keyword query or a UUID. UUIDs are matched exactly; keywords are matched by name and description (case-insensitive substring). Results are ranked: name-prefix > name-substring > description-substring. Searchable types: agent, knowledge_base, source_connection, solution, memory_bank, alert, api_key, governance_policy, mcp_client. - */ - get: operations["search_api_search_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List solutions - * @description List solutions for your account. - * - * A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Use solutions to organise related resources and leverage AI assistants for automated setup. - * - * Parameters: - * - Pagination: `page` and `limit`. - * - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - * - Filtering: `search` to filter by solution name (case-insensitive partial match). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - */ - get: operations["list_solutions_api_solutions_get"]; - put?: never; - /** - * Create a solution - * @description Create a new solution for the caller's account. - * - * A *solution* groups agents, knowledge bases, and content sources into a cohesive unit. Provide a `name` and optional `description` in the request body. - */ - post: operations["create_solution_api_solutions_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get a solution - * @description Retrieve a solution by its ID, including all linked agents, knowledge bases, and source connections. - * - * Returns the full solution detail with nested resource information. - */ - get: operations["get_solution_api_solutions__solution_id__get"]; - put?: never; - post?: never; - /** - * Delete a solution - * @description Delete a solution by its ID. - * - * This permanently removes the solution and all its resource associations (agent links, knowledge base links, source connection links). The underlying resources themselves are not deleted. - */ - delete: operations["delete_solution_api_solutions__solution_id__delete"]; - options?: never; - head?: never; - /** - * Update a solution - * @description Update an existing solution's name or description. - * - * Pass the fields you wish to change in the request body. Fields not included remain unchanged. - */ - patch: operations["update_solution_api_solutions__solution_id__patch"]; - trace?: never; - }; - "/solutions/{solution_id}/agents": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Link agents - * @description Link one or more agents to a solution by their IDs. - * - * Pass a JSON body with an `ids` array of agent UUIDs. Already-linked agents are silently ignored. Returns the updated solution with all linked resources. - */ - post: operations["link_agents_api_solutions__solution_id__agents_post"]; - /** - * Unlink agents - * @description Unlink one or more agents from a solution by their IDs. - * - * Pass a JSON body with an `ids` array of agent UUIDs to remove. Agents not currently linked are silently ignored. Returns the updated solution with remaining linked resources. - */ - delete: operations["unlink_agents_api_solutions__solution_id__agents_delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/ai-assistant/generate": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate solution plan - * @description Generate a comprehensive solution management plan via the solution AI assistant. - * - * This is the most powerful assistant — it can propose changes across sources, knowledge bases, and agents. Describe your goal in natural language and the assistant will create a multi-step plan. Review the proposed actions and use the accept or decline endpoint. - * - * Supports SSE streaming when `Accept: text/event-stream` is set. - */ - post: operations["ai_assistant_generate_api_solutions__solution_id__ai_assistant_generate_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/ai-assistant/knowledge-base": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate knowledge base plan - * @description Generate a knowledge base plan via the KB AI assistant. - * - * Describe what knowledge bases you need in natural language and the assistant will propose a plan with create, update, or delete actions. The assistant may also propose creating new sources if needed. Review the proposed actions and use the accept or decline endpoint. - */ - post: operations["ai_assistant_knowledge_base_api_solutions__solution_id__ai_assistant_knowledge_base_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/ai-assistant/source": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Generate source plan - * @description Generate a content source plan via the source AI assistant. - * - * Describe what sources you need in natural language and the assistant will propose a plan with create, update, or delete actions. Review the proposed actions and use the accept or decline endpoint to execute or discard the plan. - */ - post: operations["ai_assistant_source_api_solutions__solution_id__ai_assistant_source_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/ai-assistant/{conversation_id}/accept": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Accept plan - * @description Accept and execute a proposed plan generated by one of the AI assistant endpoints. - * - * Executes all proposed actions in the plan and returns the results of each action. If the plan contains destructive actions (e.g. deletions), you must set `confirm_deletions` to `true` in the request body. Returns a summary of executed actions with success/failure status. - */ - post: operations["ai_assistant_accept_api_solutions__solution_id__ai_assistant__conversation_id__accept_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/ai-assistant/{conversation_id}/decline": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Decline plan - * @description Decline a proposed plan generated by one of the AI assistant endpoints. - * - * Marks the conversation as declined without executing any actions. The conversation history is preserved for reference. You can generate a new plan afterwards if needed. - */ - post: operations["ai_assistant_decline_api_solutions__solution_id__ai_assistant__conversation_id__decline_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/conversations": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List conversations - * @description List AI assistant conversation history for a solution. - * - * Returns all conversation turns for the given solution, including user inputs, AI responses, proposed actions, and acceptance status. - */ - get: operations["list_conversations_api_solutions__solution_id__conversations_get"]; - put?: never; - /** - * Add conversation turn - * @description Add a conversation turn to a solution's AI assistant history. - * - * Records a user input and optional AI response and actions taken. This is typically called internally by AI assistant endpoints, but can also be used to manually log interactions. - */ - post: operations["add_conversation_turn_api_solutions__solution_id__conversations_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/conversations/{conversation_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - /** - * Mark conversation turn - * @description Mark a conversation turn as accepted or declined. - * - * Updates the `accepted` field on an existing conversation turn. Use this after reviewing a proposed plan to record whether it was accepted or declined by the user. - */ - patch: operations["mark_conversation_turn_api_solutions__solution_id__conversations__conversation_id__patch"]; - trace?: never; - }; - "/solutions/{solution_id}/knowledge-bases": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Link knowledge bases - * @description Link one or more knowledge bases to a solution by their IDs. - * - * Pass a JSON body with an `ids` array of knowledge base UUIDs. Already-linked knowledge bases are silently ignored. Returns the updated solution with all linked resources. - */ - post: operations["link_knowledge_bases_api_solutions__solution_id__knowledge_bases_post"]; - /** - * Unlink knowledge bases - * @description Unlink one or more knowledge bases from a solution by their IDs. - * - * Pass a JSON body with an `ids` array of knowledge base UUIDs to remove. Knowledge bases not currently linked are silently ignored. Returns the updated solution. - */ - delete: operations["unlink_knowledge_bases_api_solutions__solution_id__knowledge_bases_delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/solutions/{solution_id}/source-connections": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Link source connections - * @description Link one or more source connections to a solution by their IDs. - * - * Pass a JSON body with an `ids` array of source connection UUIDs. Already-linked sources are silently ignored. Returns the updated solution with all linked resources. - */ - post: operations["link_source_connections_api_solutions__solution_id__source_connections_post"]; - /** - * Unlink source connections - * @description Unlink one or more source connections from a solution by their IDs. - * - * Pass a JSON body with an `ids` array of source connection UUIDs to remove. Sources not currently linked are silently ignored. Returns the updated solution. - */ - delete: operations["unlink_source_connections_api_solutions__solution_id__source_connections_delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List sources - * @description List content sources for your account. - * - * A *source* is where Seclai pulls or receives content from — RSS feeds, websites, or content stores (``custom_index``). Content stores support file uploads and API-driven content ingestion with configurable index modes (``fast_and_cheap``, ``balanced``, ``slow_and_thorough``, or ``custom``). - * - * Parameters: - * - Pagination: `page` and `limit`. - * - Sorting: `sort` (created_at/updated_at/name) and `order` (asc/desc). - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. Results are scoped to the caller's account. - * - The optional `account_id` query param is only allowed when it matches the caller's account. - */ - get: operations["list_sources_api_sources_get"]; - put?: never; - /** - * Create Source - * @description Create a new content source. - * - * Source types: `rss_feed`, `website`, `custom_index`, `cloud_drive`, `email`. - * - * For RSS and website sources, provide the URL. For custom index sources, the URL is created automatically. - * - * An `email` source takes no URL and requires `email_allowed_senders`; the response's `email_address` is where to send mail. - * - * A `cloud_drive` source takes no URL and requires `cloud_drive_connection_id`, the id of a drive connected in the app (`GET /cloud-drives` lists them). - * - * For custom_index sources, you can optionally specify an `index_mode`: `fast_and_cheap` (default), `balanced`, `slow_and_thorough`, or `custom`. The legacy `file_uploads` source type is accepted as an alias for `custom_index` with `index_mode=fast_and_cheap`. - */ - post: operations["create_source_api_sources_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Source - * @description Fetch a content source by ID. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access sources belonging to your account. - */ - get: operations["get_source_api_sources__source_connection_id__get"]; - /** - * Update Source - * @description Update a content source's configuration. Only provided fields are changed; omitted fields are left unchanged. - * - * System-managed sources only allow `retention_days` updates. - */ - put: operations["update_source_api_sources__source_connection_id__put"]; - /** - * Upload inline text to a content source - * @description Upload a small text payload to a content source (no multipart/form-data required). - * - * **Maximum payload size:** 8192 bytes (UTF-8). - * - * **Supported content types:** - * - `application/json` - * - `application/xml` - * - `text/csv` - * - `text/html` - * - `text/markdown` - * - `text/plain` - * - `text/x-markdown` - * - `text/xml` - * - * Notes: - * - A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected. - * - Use this endpoint for small text payloads; larger files should use `/upload`. - * - `title` is merged into `metadata.title` when not already present. - * - * Tracking indexing progress: - * - **Which id you get back depends on `status`, and they are not interchangeable:** - * - `uploaded` — a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns. - * - `duplicate` — this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll. - * - For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=…&content_version_id=…` for a whole batch, to follow each item through to `completed` or `failed`. - * - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. - * - An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is not in the source and its id stays `null` unless a reviewer releases it, so stop polling. - */ - post: operations["upload_inline_text_to_source_api_sources__source_connection_id__post"]; - /** - * Delete Source - * @description Soft-delete a content source. This action cannot be undone. - * - * System-managed sources (such as agent history or conversation memory) cannot be deleted through this endpoint. - */ - delete: operations["delete_source_api_sources__source_connection_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/contents": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List content items and their indexing status - * @description List every content item this source has attempted to index, with the status of each. - * - * Unlike the source's `content_count`, which only counts finished items, this listing includes items that are still processing and items that failed — so a bulk upload can report per-item progress and point at the specific items that did not make it. - * - * Correlating with an upload: - * - Each item is keyed by `content_version_id`, which is what the upload endpoints return. Pass those ids as repeated `content_version_id` query parameters to poll exactly the items you uploaded. - * - `source_connection_content_version_id` is `null` until an item finishes indexing; once set, it is the id `GET /contents/{id}` takes. - * - `content_status` reaches `completed` on success and `failed` on error, with the reason in `error`. The intermediate values are `pending`, `fetching`, `transcribing`, `scanning`, and `indexing`. - * - An item an Enforce governance policy blocked at import is held for review: `held_for_review` is `true` and `source_connection_content_version_id` stays `null` until a reviewer releases it. With `Seclai-Version: 2026-10-05` or later it reports `completed`; earlier versions report it as `failed` with the hold as the `error`. The `status` filter matches the item under `completed` on every version. - * - * Parameters: - * - Pagination: `page` and `limit`. - * - Sorting: `sort` (created_at/title/status) and `order` (asc/desc). `created_at` sorts on when the item was uploaded or pulled. - * - Filtering: `status` and repeatable `content_version_id`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only list content for sources belonging to your account. - */ - get: operations["list_source_contents_api_sources__source_connection_id__contents_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/contents/{content_version_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get one content item's indexing status - * @description Get the indexing status of a single content item, addressed by the `content_version_id` the upload endpoints return. - * - * Use this to follow one uploaded file through indexing. To follow many at once, use `GET /sources/{id}/contents` with repeated `content_version_id` parameters instead of polling this endpoint per item. - * - * An item held for review by an Enforce governance policy reports `held_for_review: true`. With `Seclai-Version: 2026-10-05` or later its `content_status` is `completed`; earlier versions report `failed` with the hold as the `error`. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. You can only access content belonging to your account. - */ - get: operations["get_source_content_status_endpoint_api_sources__source_connection_id__contents__content_version_id__get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/email-rejections": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List mail an email source refused - * @description List mail that an email content source refused, newest first. Each entry says who sent the message and why it was refused, never its subject or body. A message refused as `unsafe_content` also has a prompt-scan record, which keeps the scanned text. - * - * To accept a refused sender, add its `from_address` or that address's domain to the source's `email_allowed_senders`. That only helps when `authenticated` is true. A `repeat_*` reason marks a message the source received before; allowing its sender does not store it. - * - * Requires an account owner or administrator: a key or token bound to another member gets 403. Returns 404 for a source that is not an email source. - */ - get: operations["list_email_source_rejections_api_api_sources__source_connection_id__email_rejections_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/embedding-migration": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get Source Embedding Migration - * @description Get the latest embedding migration status for a custom-index source. - * - * Returns `null` when no migration has ever been started for this source. - */ - get: operations["get_source_embedding_migration_api_sources__source_connection_id__embedding_migration_get"]; - put?: never; - /** - * Start Source Embedding Migration - * @description Start an embedding model migration for a custom-index source. - * - * The migration runs asynchronously in the background. Poll `GET /sources/{id}/embedding-migration` to track progress. - * - * Optionally override chunking configuration (`chunk_size`, `chunk_overlap`, `chunk_language`, `chunk_separators`, `chunk_regex_separators`). When a chunking field is omitted (null), the current source's value is preserved. - * - * Constraints: - * - Only `custom_index` source types support migration. - * - A migration cannot be started while another is already active. - * - The target model + dimensions must differ from the source's current settings. - */ - post: operations["start_source_embedding_migration_api_sources__source_connection_id__embedding_migration_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/embedding-migration/cancel": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Cancel Source Embedding Migration - * @description Cancel an active embedding migration for a custom-index source. - * - * Only pending and running migrations can be cancelled. A migration that has reached the switching phase is committing its switch-over in a single transaction, so there is no half-applied state to back out of and cancel is refused. - */ - post: operations["cancel_source_embedding_migration_api_sources__source_connection_id__embedding_migration_cancel_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/exports": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * List exports - * @description List all export jobs for a source connection, ordered newest first. Supports pagination via ``page`` and ``limit`` query parameters. Returns status, progress, and file metadata for each export. - */ - get: operations["list_source_exports_api_sources__source_connection_id__exports_get"]; - put?: never; - /** - * Create export - * @description Start an asynchronous export job. Poll GET .../exports/{export_id} until status becomes completed, then use /download to retrieve the file. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. - */ - post: operations["create_source_export_api_sources__source_connection_id__exports_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/exports/estimate": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Estimate export size - * @description Return an order-of-magnitude size estimate (in bytes) for an export without creating a job. Use this to show users how large the download will be before they commit to running the export. - */ - post: operations["estimate_source_export_api_sources__source_connection_id__exports_estimate_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/exports/{export_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get export status - * @description Retrieve the current status and progress of an export job. Returns all metadata including progress counters, file size, item count, and expiration time once completed. - */ - get: operations["get_source_export_api_sources__source_connection_id__exports__export_id__get"]; - put?: never; - post?: never; - /** - * Delete export - * @description Delete an export job and remove the associated file from S3. This is a soft-delete: the database record is retained for audit purposes but the backing file is permanently removed. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. - */ - delete: operations["delete_source_export_api_sources__source_connection_id__exports__export_id__delete"]; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/exports/{export_id}/cancel": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Cancel export - * @description Cancel a pending or running export. The background task will stop at the next chunk boundary. Completed, failed, expired, or already-cancelled exports cannot be cancelled. On an organization account, a key bound to a user must belong to an owner or administrator; a viewer's key is refused with 403 `permission_denied`. Personal accounts and account-scoped keys are unaffected. - */ - post: operations["cancel_source_export_api_sources__source_connection_id__exports__export_id__cancel_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/exports/{export_id}/download": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Download export - * @description Stream the completed export file. Returns the file content with appropriate Content-Type and Content-Disposition headers. Returns 409 if the export is not yet completed and 410 if it has expired. - */ - get: operations["download_source_export_api_sources__source_connection_id__exports__export_id__download_get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/sources/{source_connection_id}/upload": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Upload a file to a content source - * @description Upload a file to a content source. - * - * **Maximum file size:** 209715200 bytes, except `image/svg+xml` at 5242880 bytes (SVG is sanitized before it is stored). - * - * **Supported MIME types:** - * - `application/atom+xml` - * - `application/epub+zip` - * - `application/json` - * - `application/pdf` - * - `application/rss+xml` - * - `application/rtf` - * - `application/vnd.ms-excel` - * - `application/vnd.ms-outlook` - * - `application/vnd.ms-powerpoint` - * - `application/vnd.openxmlformats-officedocument.presentationml.presentation` - * - `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - * - `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - * - `application/x-ipynb+json` - * - `application/xhtml+xml` - * - `application/xml` - * - `application/zip` - * - `audio/aac` - * - `audio/amr` - * - `audio/flac` - * - `audio/mp4` - * - `audio/mpeg` - * - `audio/ogg` - * - `audio/opus` - * - `audio/wav` - * - `audio/webm` - * - `image/bmp` - * - `image/gif` - * - `image/jpeg` - * - `image/png` - * - `image/svg+xml` - * - `image/tiff` - * - `image/webp` - * - `message/rfc822` - * - `text/calendar` - * - `text/csv` - * - `text/html` - * - `text/javascript` - * - `text/markdown` - * - `text/plain` - * - `text/tab-separated-values` - * - `text/vcard` - * - `text/vtt` - * - `text/x-c` - * - `text/x-c++` - * - `text/x-csharp` - * - `text/x-go` - * - `text/x-ini` - * - `text/x-java` - * - `text/x-log` - * - `text/x-markdown` - * - `text/x-php` - * - `text/x-python` - * - `text/x-ruby` - * - `text/x-rust` - * - `text/x-shellscript` - * - `text/x-sql` - * - `text/x-subrip` - * - `text/x-tex` - * - `text/x-toml` - * - `text/x-typescript` - * - `text/xml` - * - `text/yaml` - * - `video/3gpp` - * - `video/mp2t` - * - `video/mp4` - * - `video/mpeg` - * - `video/quicktime` - * - `video/webm` - * - `video/x-matroska` - * - `video/x-msvideo` - * - * Notes: - * - A key bound to a user must belong to an owner or administrator of the account; a viewer's key is refused with 403 `permission_denied`. Account-scoped keys carry no user and are unaffected. - * - If the uploaded file's content type is `application/octet-stream`, the server attempts to infer the type from the file extension. - * - Use `metadata` to attach an arbitrary JSON object of metadata (for example `metadata={"author":"Ada","category":"docs"}`). - * - `title` is a convenience field and is merged into the metadata as `metadata.title` (it does not override an existing `metadata.title`). - * - For backwards compatibility, you can also pass form fields named `metadata_` (for example `metadata_author=...`). These override keys from `metadata`. - * - * Response: - * - `status` is `uploaded` for a new upload, or `duplicate` when the same file already exists for this source. - * - * Tracking indexing progress: - * - **Which id you get back depends on `status`, and they are not interchangeable:** - * - `uploaded` — a new item. `content_version_id` is set and `source_connection_content_version_id` is `null`. Indexing continues in the background after this call returns. - * - `duplicate` — this exact file is already on the source, so nothing was created and nothing is being indexed. `content_version_id` is `null` and `source_connection_content_version_id` is the existing, already-indexed item: pass it straight to `GET /contents/{id}`. There is nothing to poll. - * - For an `uploaded` item, poll `GET /sources/{id}/contents/{content_version_id}` with the returned `content_version_id`, or `GET /sources/{id}/contents?content_version_id=…&content_version_id=…` for a whole batch, to follow each item through to `completed` or `failed`. - * - On those status endpoints `source_connection_content_version_id` stays `null` until the item finishes indexing; that is the id `GET /contents/{id}` takes. - * - An item that reports `held_for_review: true` was blocked by an Enforce governance policy. It is not in the source and its id stays `null` unless a reviewer releases it, so stop polling. - */ - post: operations["upload_file_to_source_api_sources__source_connection_id__upload_post"]; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/v2/agent-runs/{run_id}/attachments/{attachment_id}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Download an agent-run attachment - * @description Streams the bytes of a file of the given agent run: one a step emitted, or one the run started with. ``attachment_id`` is the ``id`` of an entry in the run's or a step's ``attachments``, or the URL-safe-base64-encoded storage key, which webhook and email links carry. - * - * Auth & scoping: - * - Requires `X-API-Key` header or OAuth Bearer token. - * - The calling account must own ``run_id``; lookup failures (missing run, cross-account run, soft-deleted agent, a run whose trace was purged, a file not in the run) all collapse to a single 404 to prevent cross-tenant existence enumeration. - * - * MIME handling: - * - Inline-safe MIMEs (image/*, audio/*, video/*, application/pdf, text/plain, application/vnd.seclai.manifest+json) are served with their declared type. - * - Everything else is served as ``application/octet-stream`` with an attachment disposition to prevent stored-XSS. - */ - get: operations["serve_agent_run_attachment_api_v2_agent_runs__run_id__attachments__attachment_id__get"]; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/version": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Get the account's API version - * @description Returns the account's pinned `Seclai-Version` (null when unpinned), the version this request resolved to, and the default/latest/known versions. Pin your account with `PUT /version` or override per request with the `Seclai-Version` header. - */ - get: operations["get_api_version_api_version_get"]; - /** - * Pin (or clear) the account's API version - * @description Sets the account's sticky `Seclai-Version` to the given `YYYY-MM-DD` date, or clears it with `null`. The new pin applies to subsequent header-less requests; a `Seclai-Version` request header still overrides it. Owner/admin only. `effective_version` in the response reflects the current request, not the new pin. - */ - put: operations["update_api_version_api_version_put"]; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; -} -export type webhooks = Record; -export interface components { - schemas: { - /** AcceptedAttachmentSlot */ - AcceptedAttachmentSlot: { - /** - * Content Types - * @description Accepted types, e.g. ``application/pdf`` or ``image/*``; empty accepts any type. - */ - content_types?: string[]; - /** - * Label - * @description Shown to people. - */ - label?: string | null; - /** - * Max - * @description Most files a run may include; empty is no limit. - */ - max?: number | null; - /** - * Min - * @description Fewest files a run must include; fewer refuses the run, except on an email trigger set to run anyway, which lists the shortfall. - * @default 0 - */ - min: number; - /** - * Name - * @description Lowercase letters, digits and underscores, starting with a letter. Steps reference the files as ``{{agent.attachments.}}``. - */ - name: string; - /** - * Name Pattern - * @description Filename glob a file must also match, ignoring case. - */ - name_pattern?: string | null; - }; - /** AcceptedAttachmentsResponse */ - AcceptedAttachmentsResponse: { - /** Accepted Attachments */ - accepted_attachments: components["schemas"]["AcceptedAttachmentSlot"][]; - /** - * Agent Id - * Format: uuid - */ - agent_id: string; - /** - * Trigger Id - * Format: uuid - */ - trigger_id: string; - }; - /** AddConversationTurnRequest */ - AddConversationTurnRequest: { - /** - * Actions Taken - * @description Actions taken by the AI - */ - actions_taken?: { - [key: string]: unknown; - } | null; - /** - * Ai Response - * @description AI response text - */ - ai_response?: string | null; - /** - * User Input - * @description User input text - */ - user_input: string; - }; - /** AddEmailDomainRequest */ - AddEmailDomainRequest: { - /** - * Delegated - * @default false - */ - delegated: boolean; - /** - * Kind - * @description 'vanity' or 'custom' - */ - kind: string; - /** Value */ - value: string; - }; - /** - * AgentAttachmentRefsApiResponse - * @description The input attachments an agent's trigger declares. - * - * Mirrors the MCP ``get_agent_attachment_references`` tool, so API - * consumers can stage uploads that fit before calling - * ``POST /agents/{id}/runs``. - */ - AgentAttachmentRefsApiResponse: { - /** - * Accepted Attachments - * @description The attachments the agent's trigger declares. A run's files are each assigned to one; a file none accepts, or an attachment with fewer files than its ``min``, rejects the run with HTTP 400. Steps reference one as ``{{agent.attachments.}}``. - */ - accepted_attachments?: components["schemas"]["AcceptedAttachmentSlot"][]; - /** @description Aggregated summary of the agent-file references in the steps. Informational: which files a run accepts is ``accepted_attachments``. */ - agent?: components["schemas"]["AttachmentRefsSourceApiSummary"]; - /** - * Requires Uploads - * @description When ``false`` the agent takes no files through the API — it has no ``dynamic_input`` trigger, or that trigger declares no attachments — and ``POST /agents/{id}/upload-input`` will reject with HTTP 400. When ``true`` ``accepted_attachments`` lists what a run's files must fit. - */ - requires_uploads: boolean; - }; - /** - * AgentCallerApiResponse - * @description One agent that calls another (blocks disabling the callee while live). - */ - AgentCallerApiResponse: { - /** Disabled */ - disabled: boolean; - /** - * Id - * Format: uuid - */ - id: string; - /** Name */ - name: string; - }; - /** - * AgentDefinitionImportErrorResponse - * @description 422 body for invalid `agent_definition` payloads. - * - * Mirrors `AgentDefinitionImportError.to_response_dict`. - */ - AgentDefinitionImportErrorResponse: { - /** - * Error - * @description Stable machine-readable error code. - * @constant - */ - error: "invalid_agent_definition"; - /** Errors */ - errors: components["schemas"]["ImportFieldErrorModel"][]; - /** Message */ - message: string; - /** - * Source - * @description Canonical pretty-printed echo of the supplied payload — error line/column refer to this string. - */ - source: string; - }; - /** AgentDefinitionResponse */ - AgentDefinitionResponse: { - /** - * Change Id - * @description Current change ID (use as expected_change_id when updating). - */ - change_id: string; - /** - * Definition - * @description The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, regex_replace, gate, retry, evaluate_step, extract_data, extract_content, add_chat_turn, load_chat_history, add_memory, search_memory, load_memory, streaming_result, send_email, webhook_call, call_agent, write_metadata, write_content_attachment, load_content_attachment, load_content, display_result, merge, for_each, if_else, switch, and others. - */ - definition: { - [key: string]: unknown; - }; - /** - * Schema Version - * @description Agent schema version. - */ - schema_version: string; - /** - * Warnings - * @description Validation warnings, if any. - */ - warnings?: { - [key: string]: string; - }[] | null; - }; - /** - * AgentEmailOptOutListResponse - * @description A page of agent-email opt-outs plus the total (for pagination). - */ - AgentEmailOptOutListResponse: { - /** Items */ - items: components["schemas"]["AgentEmailOptOutResponse"][]; - /** Total */ - total: number; - }; - /** - * AgentEmailOptOutResponse - * @description A recipient's opt-out from an account's agent emails (one agent or all). - */ - AgentEmailOptOutResponse: { - /** Agent Id */ - agent_id: string | null; - /** Agent Name */ - agent_name: string | null; - /** Comment */ - comment: string | null; - /** Created At */ - created_at: string; - /** - * Id - * Format: uuid - */ - id: string; - /** Reason */ - reason: string | null; - /** Recipient Email */ - recipient_email: string; - }; - /** - * AgentEvaluationTier - * @description Controls model selection for agent evaluation. - * - * Labels shown in UI: - * FAST → "Fast and cheap" - * BALANCED → "Balanced speed and cost" - * THOROUGH → "Slow and thorough" - * @enum {string} - */ - AgentEvaluationTier: "fast" | "balanced" | "thorough"; - /** - * AgentExportResponse - * @description Portable JSON snapshot of an agent definition. - */ - AgentExportResponse: { - /** - * Agent - * @description Agent metadata and full definition. Keys: name, description, schema_version, definition, default_evaluation_tier, evaluation_mode, sampling_config, max_retries, retry_on_failure, prompt_model_auto_upgrade_strategy, prompt_model_auto_rollback_enabled, prompt_model_auto_rollback_triggers, created_at, updated_at. - */ - agent: { - [key: string]: unknown; - }; - /** - * Alert Configs - * @description Alert configurations. - */ - alert_configs?: { - [key: string]: unknown; - }[] | null; - /** - * Dependencies - * @description Resolved dependency manifest. Keys: knowledge_bases, memory_banks, source_connections, agents, users — each a list of {id, name, description, …}. - */ - dependencies?: { - [key: string]: unknown; - } | null; - /** - * Evaluation Criteria - * @description Evaluation criteria for agent steps. - */ - evaluation_criteria?: { - [key: string]: unknown; - }[] | null; - /** - * Export Version - * @description Schema version of the export format (currently "5"). - */ - export_version: string; - /** - * Exported At - * @description ISO-8601 timestamp of when the export was generated. - */ - exported_at: string; - /** - * Governance Policies - * @description Agent-scoped governance policies. - */ - governance_policies?: { - [key: string]: unknown; - }[] | null; - /** - * Software Version - * @description Application version that produced this export. - */ - software_version: string; - /** - * Trigger - * @description Trigger configuration with schedules. - */ - trigger?: { - [key: string]: unknown; - } | null; - }; - /** AgentRunAttemptResponse */ - AgentRunAttemptResponse: { - /** - * Duration - * @description Duration of the attempt in seconds. - */ - duration: number | null; - /** - * Ended At - * @description Timestamp when the attempt ended. - */ - ended_at: string | null; - /** - * Error - * @description Error message if the attempt failed. - */ - error: string | null; - /** - * Started At - * @description Timestamp when the attempt started. - */ - started_at: string | null; - /** @description Status of the agent run attempt. */ - status: components["schemas"]["PendingProcessingCompletedFailedStatus"]; - }; - /** - * AgentRunFileResponse - * @description A file in a run's or a step's output. - */ - AgentRunFileResponse: { - /** - * Bytes - * @description Size of the file in bytes, when known. - */ - bytes: number | null; - /** - * Download Url - * @description `GET` URL that streams the file; accepts an API key or OAuth token. - */ - download_url: string; - /** - * Id - * Format: uuid - * @description File identifier, used to download it. - */ - id: string; - /** - * Mime - * @description MIME type of the file. - */ - mime: string; - /** - * Name - * @description The file's name in this run, as sent to email recipients and webhooks and matched by `{{attachments[...]}}` selectors. - */ - name: string | null; - }; - /** AgentRunRequest */ - AgentRunRequest: { - /** - * Input - * @description Input to provide to the agent upon running for agents with dynamic triggers. - */ - input?: string | null; - /** - * Input Upload Id - * @description ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` — use that field to attach multiple files. May be combined with ``input``: the prompt text leads and the file follows under a ``# {filename}`` heading (before ``Seclai-Version: 2026-10-16``, followed by its extracted text). - * - * **Which steps receive it:** a step that sends or stores files takes the files its ``attachments`` field selects. An LLM step (``prompt_call``, ``extract_data``, ``evaluate_step``) takes the files its ``attachments`` field names, or else the files its plain-text templates reference: ``{{agent.attachments.}}`` for one attachment the trigger declares, or ``{{agent.input}}`` for every upload unless a template also names an agent attachment. - * - * **Per-batch validation:** the batch must fit the trigger's ``accepted_attachments`` — every file fits one declared attachment and each attachment gets at least its ``min`` files — or the run is rejected with HTTP 400. - */ - input_upload_id?: string | null; - /** - * Input Upload Ids - * @description IDs of multiple previously uploaded files. Each upload gets a heading in ``input`` (before ``Seclai-Version: 2026-10-16``, followed by its extracted text); each upload reaches steps as a separate file (before ``Seclai-Version: 2026-10-16``, a text upload in the open ``files`` attachment is written into ``input`` instead). Steps choose files as described under ``input_upload_id``. The batch must fit the trigger's ``accepted_attachments``; a mismatch returns HTTP 400 listing what does not fit. Mutually exclusive with ``input_upload_id`` (two spellings of the same batch), but may be combined with ``input`` — the prompt text leads and the per-file sections follow, so "a photo plus a sentence about it" needs no synthetic text upload. Max 20 uploads per run. - */ - input_upload_ids?: string[] | null; - /** - * Metadata - * @description Metadata to make available for string substitution expressions in agent tasks. - */ - metadata?: { - [key: string]: components["schemas"]["JsonValue"]; - } | null; - /** - * Priority - * @description If true, the agent run will be treated as priority execution. - * @default false - */ - priority: boolean; - /** - * Replay Of Run Id - * @description Re-run this agent reusing a prior run's uploaded input files. The files are re-resolved server-side from the source run (which must belong to this account and agent) — you do not re-upload them. Combine with ``input`` to change the text while keeping the files. A fresh upload batch (``input_upload_id(s)``) takes precedence and disables replay. Binaries swept by retention fall back to their extracted text. Files the trigger's ``accepted_attachments`` no longer accepts are left out. - */ - replay_of_run_id?: string | null; - }; - /** AgentRunResponse */ - AgentRunResponse: { - /** - * Attachments - * @description Files in the run's output, in order. Empty for runs that produced none, for runs made before files were listed here, and once the run's trace is purged. - */ - attachments?: components["schemas"]["AgentRunFileResponse"][]; - /** - * Attempts - * @description List of attempts made for this agent run. - */ - attempts: components["schemas"]["AgentRunAttemptResponse"][]; - /** - * Blocked Policies - * @description Governance policies that produced at least one BLOCK verdict during this run. Deduplicated by policy id. - */ - blocked_policies?: components["schemas"]["routers__api__agents__GovernancePolicyRefResponse"][]; - /** - * Credits - * @description Credits consumed by the agent run, if applicable. Can still rise briefly after the run ends, while governance screening finishes. - */ - credits: number | null; - /** - * Error Count - * @description Number of errors encountered during the run. - */ - error_count: number; - /** - * Flagged Policies - * @description Governance policies that produced at least one FLAG verdict during this run. Deduplicated by policy id. - */ - flagged_policies?: components["schemas"]["routers__api__agents__GovernancePolicyRefResponse"][]; - /** - * Governance Input Status - * @description Result of the governance input evaluation: safe, blocked, skipped, or timed_out. - */ - governance_input_status?: string | null; - /** - * Governance Input Wait Ms - * @description Milliseconds spent waiting for governance input evaluation. - */ - governance_input_wait_ms?: number | null; - /** - * Hitl Wait Ms - * @description Cumulative milliseconds the run was parked waiting for a human decision on a human_in_the_loop step. Subtracted from active duration in run-detail and duration-stats responses. - */ - hitl_wait_ms?: number | null; - /** - * Input - * @description Input provided to the agent for this run. - */ - input: string | null; - /** - * Input Scan Status - * @description Result of the prompt injection scan: safe, unsafe, skipped, timed_out, or error. - */ - input_scan_status?: string | null; - /** - * Output - * @description The run's output text; its files are in `attachments`. Below `Seclai-Version: 2026-09-30` an output that has files is instead the manifest JSON `{schema, text, attachments: [{storage_key, mime, name, label, bytes}]}`; `bytes` can be `null` on runs made before that version shipped. - */ - output: string | null; - /** - * Output Content Type - * @description MIME type of `output` — mirrors the terminal step's `output_content_type`. `text/plain` / `text/*` are free-form text and `application/json` is a JSON document. Below `Seclai-Version: 2026-09-30` an output that has files reads `application/vnd.seclai.manifest+json` (see `output`); the same files are in `attachments` on every version, each with a `download_url`. Null on runs that produced no terminal output or that pre-date this column. - */ - output_content_type?: string | null; - /** - * Priority - * @description Indicates if the run was treated as a priority execution. - */ - priority: boolean; - /** - * Run Id - * @description Unique identifier for the agent run. - */ - run_id: string; - /** - * Scan Wait Ms - * @description Milliseconds spent waiting for prompt injection scan. - */ - scan_wait_ms?: number | null; - /** @description Current status of the agent run. */ - status: components["schemas"]["PendingProcessingCompletedFailedStatus"]; - /** - * Steps - * @description Step outputs and per-step timing/credits. Only included when requested. - */ - steps?: components["schemas"]["AgentRunStepResponse"][] | null; - /** - * Trace Purged At - * @description When this run's trace content was deleted under the account's agent-trace retention window. Non-null means `input`, `output` and every step's and tool call's I/O are null **by design** and will never be available again — the run aged out, it did not fail. A tool call's `error` may be null as well, so a failed tool call can report its status without a message. Branch on this rather than on a null `output`: a run that genuinely produced nothing looks identical. Status, timing and credits remain accurate. - */ - trace_purged_at?: string | null; - /** - * Wait Ms - * @description Cumulative milliseconds the run was parked on standard-mode wait steps. Subtracted from active duration in run-detail and duration-stats responses, exactly like hitl_wait_ms. Priority waits block inline and are not counted here. - */ - wait_ms?: number | null; - }; - /** AgentRunStepResponse */ - AgentRunStepResponse: { - /** - * Agent Step Id - * @description Agent step identifier. - */ - agent_step_id: string; - /** - * Attachments - * @description Files in this step's output, in order. Empty for steps that produced none, for steps run before files were listed here, and once the run's trace is purged. - */ - attachments?: components["schemas"]["AgentRunFileResponse"][]; - /** - * Credits Used - * @description Credits consumed by this step across every attempt it made. Some charges made outside any step, such as governance screening of the run's input, count toward the run's total but no step's. The timestamps above and the tool calls below describe the latest attempt only. - */ - credits_used: number; - /** - * Duration Seconds - * @description Duration of the step attempt in seconds. - */ - duration_seconds: number | null; - /** - * Ended At - * @description Timestamp when the step attempt ended. - */ - ended_at: string | null; - /** - * Input - * @description Input text provided to the step, if any. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step that produced it output files and is not a `for_each`. - */ - input: string | null; - /** - * Output - * @description Output text produced by the step, if any; its files are in `attachments`. Below `Seclai-Version: 2026-09-30`, the manifest JSON when the step output files and is not a `for_each`. - */ - output: string | null; - /** - * Output Content Type - * @description Content type of the step output, if any. - */ - output_content_type: string | null; - /** - * Started At - * @description Timestamp when the step attempt started. - */ - started_at: string | null; - /** @description Status of the step run. */ - status: components["schemas"]["PendingProcessingCompletedFailedStatus"]; - /** - * Step Type - * @description Type of the agent step. - */ - step_type: string; - /** - * Tool Calls - * @description LLM tool calls made during this step (prompt_call steps only), ordered by execution. Empty for steps that invoked no tools. - */ - tool_calls?: components["schemas"]["AgentRunToolCallResponse"][]; - /** - * Warnings - * @description Problems the step ran into, whether or not it then failed, such as a file name selector that matched none of its source's files, or a model that returned no answer. - */ - warnings?: string[] | null; - }; - /** AgentRunStreamRequest */ - AgentRunStreamRequest: { - /** - * Include Reasoning - * @description Receive `stream_reasoning` events carrying the model's reasoning while it thinks. They are sent only for a `streaming_result` step whose author enabled `show_reasoning`, and never when a governance policy redacts that step. - * @default false - */ - include_reasoning: boolean; - /** - * Input - * @description Input to provide to the agent upon running for agents with dynamic triggers. - */ - input?: string | null; - /** - * Input Upload Id - * @description ID of a previously uploaded file (via POST /{agent_id}/upload-input) to use as the run input for dynamic-input triggers. Mutually exclusive with ``input_upload_ids`` — use that field to attach multiple files. May be combined with ``input``. Must fit the trigger's ``accepted_attachments``, as on the non-streaming endpoint. - */ - input_upload_id?: string | null; - /** - * Input Upload Ids - * @description IDs of multiple previously uploaded files. See the non-streaming endpoint for full semantics, including fitting the trigger's ``accepted_attachments`` (else HTTP 400) and combining the batch with ``input`` prompt text. Max 20. - */ - input_upload_ids?: string[] | null; - /** - * Metadata - * @description Metadata to make available for string substitution expressions in agent tasks. - */ - metadata?: { - [key: string]: components["schemas"]["JsonValue"]; - } | null; - /** - * Replay Of Run Id - * @description Re-run reusing a prior run's uploaded input files (re-resolved server-side from the source run, which must belong to this account and agent). A fresh upload batch takes precedence. Files the trigger's ``accepted_attachments`` no longer accepts are left out. - */ - replay_of_run_id?: string | null; - }; - /** - * AgentRunToolCallResponse - * @description A single LLM tool call made during a prompt_call step. - */ - AgentRunToolCallResponse: { - /** - * Credits Used - * @description Credits consumed by this tool call (0 for tools that don't bill). - * @default 0 - */ - credits_used: number; - /** - * Duration Seconds - * @description Duration of the tool call in seconds. - */ - duration_seconds?: number | null; - /** - * Ended At - * @description Timestamp when the tool call ended. - */ - ended_at?: string | null; - /** - * Error - * @description Error message when the tool call failed. - */ - error?: string | null; - /** - * Function Name - * @description Name of the tool/function invoked. - */ - function_name: string; - /** - * Id - * @description Tool call identifier. - */ - id: string; - /** - * Input - * @description JSON arguments the LLM passed to the tool, if persisted. - */ - input?: string | null; - /** - * Output - * @description JSON result the tool returned to the LLM, if persisted. - */ - output?: string | null; - /** - * Round Index - * @description 0-based tool-loop round this call belonged to. - * @default 0 - */ - round_index: number; - /** - * Sequence - * @description 0-based ordinal of this call within one attempt of the step, so it repeats across a retried step's attempts. This list holds the latest attempt only. - * @default 0 - */ - sequence: number; - /** - * Started At - * @description Timestamp when the tool call started. - */ - started_at?: string | null; - /** - * Succeeded - * @description Whether the tool call completed without error. - * @default true - */ - succeeded: boolean; - }; - /** AgentSummaryResponse */ - AgentSummaryResponse: { - /** - * Created At - * @description ISO 8601 creation timestamp. - */ - created_at: string; - /** - * Default Evaluation Tier - * @description Default evaluation tier: fast, balanced, or thorough. - */ - default_evaluation_tier?: string | null; - /** - * Description - * @description Agent description. - */ - description: string | null; - /** - * Disabled - * @description Whether the agent is paused (disabled). - * @default false - */ - disabled: boolean; - /** - * Disabled At - * @description ISO 8601 timestamp the agent was paused. - */ - disabled_at?: string | null; - /** - * Disabled Reason - * @description Why the agent is paused: 'manual' or 'email_overload'. - */ - disabled_reason?: string | null; - /** - * Evaluation Mode - * @description Evaluation mode: output_expectation, eval_and_retry, or sample_and_flag. - * @default eval_and_retry - */ - evaluation_mode: string; - /** - * Id - * @description Unique agent identifier. - */ - id: string; - /** - * Import Warnings - * @description One entry per item dropped or substituted during import. Present only on endpoints that accept agent_definition; null on non-import calls; [] when the import had no skips. - */ - import_warnings?: components["schemas"]["ImportSkipResponse"][] | null; - /** - * Max Retries - * @description Max retries for eval_and_retry mode. - * @default 3 - */ - max_retries: number; - /** - * Name - * @description Agent name. - */ - name: string; - /** - * Prompt Model Auto Rollback Enabled - * @description Whether automatic rollback is enabled for upgraded models. - * @default false - */ - prompt_model_auto_rollback_enabled: boolean; - /** - * Prompt Model Auto Rollback Triggers - * @description Failure signals that trigger rollback. Defaults to agent_eval_fail, governance_block, agent_run_failed when null. - */ - prompt_model_auto_rollback_triggers?: string[] | null; - /** - * Prompt Model Auto Upgrade Strategy - * @description Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter. - * @default none - */ - prompt_model_auto_upgrade_strategy: string; - /** - * Retry On Failure - * @description Whether to retry on evaluation failure. - * @default true - */ - retry_on_failure: boolean; - /** - * Sampling Config - * @description Sampling configuration for sample_and_flag mode. - */ - sampling_config?: { - [key: string]: unknown; - } | null; - /** - * Trigger Id - * @description ID of the agent's trigger, for the `/agents/{agent_id}/triggers/{trigger_id}/…` endpoints such as `accepted-attachments` and `email-config`. - */ - trigger_id?: string | null; - /** - * Trigger Type - * @description Trigger type for the agent. - */ - trigger_type?: string | null; - /** - * Updated At - * @description ISO 8601 last-updated timestamp. - */ - updated_at: string; - }; - /** AgentTraceMatchResponse */ - AgentTraceMatchResponse: { - /** - * Agent Id - * @description Agent ID. - */ - agent_id: string | null; - /** - * Agent Run Id - * @description Agent run ID. - */ - agent_run_id: string | null; - /** - * Agent Run Status - * @description Status of the agent run. - */ - agent_run_status: string | null; - /** - * Agent Step Id - * @description Step identifier. - */ - agent_step_id: string | null; - /** - * Agent Step Run Id - * @description Agent step run ID. - */ - agent_step_run_id: string | null; - /** - * Agent Step Type - * @description Type of the step. - */ - agent_step_type: string | null; - /** - * Score - * @description Similarity score (0-1, higher is better). - */ - score: number; - /** - * Text - * @description Matching text chunk. - */ - text: string; - /** - * Title - * @description Title of the indexed entry. - */ - title: string | null; - }; - /** AgentTraceSearchResponse */ - AgentTraceSearchResponse: { - /** - * Matches - * @description List of matching entries. - */ - matches: components["schemas"]["AgentTraceMatchResponse"][]; - /** - * Total - * @description Number of matches returned. - */ - total: number; - }; - /** AgentUsingCloudDriveResponseModel */ - AgentUsingCloudDriveResponseModel: { - /** - * Agent Id - * @description Agent identifier. - */ - agent_id: string; - /** - * Agent Name - * @description Agent name. - */ - agent_name: string; - /** - * Trigger Types - * @description File-change trigger types bound to this drive. - */ - trigger_types: string[]; - /** - * Via Prompt Tool - * @description Uses a prompt_call cloud-drive tool. - */ - via_prompt_tool: boolean; - /** - * Via Step - * @description Uses a list/read/write cloud-drive step. - */ - via_step: boolean; - }; - /** - * AiAssistantAcceptResponse - * @description Response from accepting and executing a plan. - */ - AiAssistantAcceptResponse: { - /** - * Conversation Id - * Format: uuid - * @description Conversation ID. - */ - conversation_id: string; - /** - * Error - * @description Error message if failed. - */ - error?: string | null; - /** - * Executed Actions - * @description Results of each executed action. - */ - executed_actions: components["schemas"]["ExecutedActionResponse"][]; - /** - * Solution Id - * @description Solution ID when a new solution was auto-created. - */ - solution_id?: string | null; - /** - * Success - * @description Whether execution succeeded. - * @default true - */ - success: boolean; - }; - /** - * AiAssistantFeedbackResponse - * @description Response after submitting feedback. - */ - AiAssistantFeedbackResponse: { - /** - * Feedback Id - * Format: uuid - */ - feedback_id: string; - /** Flag Reason */ - flag_reason?: string | null; - /** Flagged */ - flagged: boolean; - }; - /** - * AiAssistantGenerateResponse - * @description Response from an AI assistant generate endpoint. - */ - AiAssistantGenerateResponse: { - /** - * Conversation Id - * Format: uuid - * @description Conversation ID for accept/decline. - */ - conversation_id: string; - /** - * Example Prompts - * @description Example natural-language prompts that demonstrate the capabilities of this AI assistant. - */ - example_prompts?: components["schemas"]["ExamplePrompt"][]; - /** - * Note - * @description AI-generated note about the plan. - */ - note: string; - /** - * Proposed Actions - * @description List of proposed actions. - */ - proposed_actions: components["schemas"]["ProposedActionResponse"][]; - /** - * Requires Delete Confirmation - * @description Whether destructive actions require explicit confirmation. - * @default false - */ - requires_delete_confirmation: boolean; - /** - * Success - * @description Whether plan generation succeeded. - * @default false - */ - success: boolean; - }; - /** AiConversationHistoryResponse */ - AiConversationHistoryResponse: { - /** - * Total - * @description Total number of conversation turns available. - */ - total: number; - /** - * Turns - * @description Conversation turns, ordered oldest first. - */ - turns: components["schemas"]["AiConversationTurnResponse"][]; - }; - /** AiConversationTurnResponse */ - AiConversationTurnResponse: { - /** - * Accepted - * @description Whether the user accepted this proposal (null if pending). - */ - accepted: boolean | null; - /** - * Ai Note - * @description AI explanation from this turn. - */ - ai_note: string | null; - /** - * Conversation Id - * @description Unique conversation turn ID. - */ - conversation_id: string; - /** - * Resulting Config - * @description The proposed configuration from this turn. - */ - resulting_config: { - [key: string]: unknown; - } | null; - /** - * Step Id - * @description Step ID for this conversation. - */ - step_id: string | null; - /** - * Step Type - * @description Step type for this conversation. - */ - step_type: string | null; - /** - * User Input - * @description User input for this turn. - */ - user_input: string; - }; - /** - * AlertConfigListResponse - * @description ``GET /alerts/configs`` legacy/default shape (header-less clients). - * - * ``Seclai-Version: 2026-07-27+`` clients receive the canonical - * ``{data, pagination}`` envelope instead (the handler returns a ``JSONResponse`` - * that bypasses this ``response_model``); this documents the default shape. - */ - AlertConfigListResponse: { - /** Configs */ - configs: components["schemas"]["AlertConfigResponse"][]; - /** Total */ - total: number; - }; - /** AlertConfigResponse */ - AlertConfigResponse: { - /** Account Id */ - account_id: string; - /** Agent Id */ - agent_id: string | null; - /** Alert Type */ - alert_type: string; - /** Cooldown Minutes */ - cooldown_minutes: number; - /** Created At */ - created_at: string | null; - /** Distribution Type */ - distribution_type: string; - /** Enabled */ - enabled: boolean; - /** Id */ - id: string; - /** Last Alerted At */ - last_alerted_at: string | null; - /** Recipient User Ids */ - recipient_user_ids: string[]; - /** Source Connection Id */ - source_connection_id: string | null; - /** Threshold */ - threshold: { - [key: string]: unknown; - } | null; - /** Updated At */ - updated_at: string | null; - }; - /** AlertHistoryEntryResponse */ - AlertHistoryEntryResponse: { - /** Changed By Name */ - changed_by_name: string | null; - /** Changed By User Id */ - changed_by_user_id: string | null; - /** Created At */ - created_at: string | null; - /** Id */ - id: string; - /** New Status */ - new_status: string; - /** Note */ - note: string | null; - /** Previous Status */ - previous_status: string | null; - }; - /** ApiVersionResponse */ - ApiVersionResponse: { - /** - * Default Version - * @description Baseline for an unpinned, header-less caller. - */ - default_version: string; - /** - * Effective Version - * @description The version THIS request resolved to (header > pin > default). - */ - effective_version: string; - /** - * Known Versions - * @description All dated versions, oldest first. - */ - known_versions: string[]; - /** - * Latest Version - * @description Newest version the server knows about. - */ - latest_version: string; - /** - * Pinned Version - * @description The account's sticky pinned version, or null when unpinned (the account resolves to the default). Applies to header-less requests. - */ - pinned_version: string | null; - }; - /** - * AppliedActionResponse - * @description Result of a single executed governance action. - */ - AppliedActionResponse: { - /** - * Action Type - * @description Type of action that was executed. - */ - action_type: string; - /** - * Description - * @description Human-readable description of the executed action. - */ - description: string; - /** - * Error - * @description Error message if this action failed, or null. - */ - error?: string | null; - /** - * Policy Id - * @description ID of the policy that was created or modified, or null. - */ - policy_id?: string | null; - /** - * Success - * @description Whether this individual action succeeded. - */ - success: boolean; - }; - /** - * AttachmentRefsSourceApiSummary - * @description Per-source attachment-reference summary. - */ - AttachmentRefsSourceApiSummary: { - /** Exact Names */ - exact_names?: string[]; - /** Indexes Max */ - indexes_max?: number | null; - /** Kinds */ - kinds?: string[]; - /** Patterns */ - patterns?: string[]; - }; - /** - * BlockEmailSenderRequest - * @description Add one sender/domain to the account blocklist (shared REST request). - */ - BlockEmailSenderRequest: { - /** - * Match Type - * @default address - */ - match_type: string; - /** Note */ - note?: string | null; - /** Sender Email */ - sender_email: string; - }; - /** - * BlockedEmailSenderListResponse - * @description A page of blocked senders + the account's auto-block mode. - */ - BlockedEmailSenderListResponse: { - /** Auto Block Mode */ - auto_block_mode: string; - /** Items */ - items: components["schemas"]["BlockedEmailSenderResponse"][]; - /** Total */ - total: number; - }; - /** - * BlockedEmailSenderResponse - * @description A single blocked inbound email sender. - */ - BlockedEmailSenderResponse: { - /** Created At */ - created_at: string; - /** - * Id - * Format: uuid - */ - id: string; - /** Match Type */ - match_type: string; - /** Note */ - note: string | null; - /** Sender Email */ - sender_email: string; - /** Source */ - source: string; - }; - /** Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post */ - Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post: { - /** - * File - * Format: binary - * @description File to upload - */ - file: string; - /** - * Metadata - * @description Optional JSON object string of metadata. Example: `{"category":"docs","author":"Ada"}`. `title` will be merged into this dictionary as `metadata.title` if it is not already present. - */ - metadata?: string | null; - /** - * Title - * @description Optional title for the content - */ - title?: string; - }; - /** Body_upload_file_to_source_api_sources__source_connection_id__upload_post */ - Body_upload_file_to_source_api_sources__source_connection_id__upload_post: { - /** - * File - * Format: binary - * @description File to upload - */ - file: string; - /** - * Metadata - * @description Optional JSON object string of metadata. Example: `{"author":"Ada","category":"docs"}`. `title` will be merged into this dictionary as `metadata.title` if it is not already present. - */ - metadata?: string | null; - /** - * Title - * @description Optional title for the content - */ - title?: string; - }; - /** CancelExperimentResponse */ - CancelExperimentResponse: { - /** Status */ - status: string; - }; - /** CancelQueuedRunsResponse */ - CancelQueuedRunsResponse: { - /** Cancelled */ - cancelled: number; - }; - /** ChangeStatusRequest */ - ChangeStatusRequest: { - /** - * Note - * @description Optional note - */ - note?: string | null; - /** - * Status - * @description New alert status - */ - status: string; - }; - /** CloudDriveAccessLevelResponseModel */ - CloudDriveAccessLevelResponseModel: { - /** - * Default - * @description Whether connecting without a choice uses it. - */ - default: boolean; - /** - * Description - * @description What agents can do at this level. - */ - description: string; - /** - * Key - * @description Level identifier, e.g. `read_write`/`read_only`. - */ - key: string; - /** - * Label - * @description Short human-readable name. - */ - label: string; - }; - /** CloudDriveProviderResponseModel */ - CloudDriveProviderResponseModel: { - /** - * Access Levels - * @description Mutually-exclusive permission bundles offered when connecting. Connecting happens in the app, so this is informational here — it explains what a connection's `access_level` can be. - */ - access_levels: components["schemas"]["CloudDriveAccessLevelResponseModel"][]; - /** - * Display Name - * @description Human-readable provider name. - */ - display_name: string; - /** - * Key - * @description Provider key used as `provider` on a connection. - */ - key: string; - /** - * Scopes - * @description OAuth permissions this provider can request. - */ - scopes: components["schemas"]["CloudDriveScopeResponseModel"][]; - }; - /** - * CloudDriveRejectionResponseModel - * @description One file the connection deliberately did not process. - */ - CloudDriveRejectionResponseModel: { - /** - * Created At - * @description When the file was skipped. - */ - created_at: string; - /** - * Detail - * @description Extra context, e.g. the cap that was hit. - */ - detail?: string | null; - /** - * File Id - * @description The provider's file id, when the file was known. - */ - file_id?: string | null; - /** - * File Path - * @description Path of the skipped file, when known. - */ - file_path?: string | null; - /** - * Id - * @description Rejection identifier. - */ - id: string; - /** - * Reason - * @description `too_large`, `download_failed`, or `flood`. - */ - reason: string; - }; - /** - * CloudDriveResponseModel - * @description A cloud-drive connection, without any secret material. - */ - CloudDriveResponseModel: { - /** - * Access Level - * @description The permission bundle the granted scopes correspond to — `read_write` or `read_only`. Null when the grant matches no level the provider currently offers; treat that as unknown rather than assuming write access. - */ - access_level?: string | null; - /** - * Connected - * @description True when the connection is usable. - */ - connected: boolean; - /** - * Created At - * @description When the connection was created. - */ - created_at: string; - /** - * Drive Id - * @description Opaque id of the shared drive the folder resolves to, or null for the user's own drive. Stable across renames — compare on this rather than on the name in `folder_path`. - */ - drive_id?: string | null; - /** - * Drive Name - * @description Display name the shared drive last resolved to. Presentation only; never match on it. - */ - drive_name?: string | null; - /** - * Drive Name Stale - * @description True when `drive_name` could not be re-confirmed (the drive was deleted, access was lost, or the provider was unreachable). The last known name is still reported — treat it as possibly out of date rather than current. - */ - drive_name_stale: boolean; - /** - * External Account Id - * @description The provider's own opaque account identifier (never an email). - */ - external_account_id?: string | null; - /** - * Folder Path - * @description Watched folder; empty string means the drive root. A folder on a shared drive is written `/Shared drives//`. - */ - folder_path: string; - /** - * Id - * @description Connection identifier. - */ - id: string; - /** - * Last Error - * @description Most recent sync or authorization error, if any. - */ - last_error?: string | null; - /** - * Last Synced At - * @description When the connection last synced successfully. - */ - last_synced_at?: string | null; - /** - * Name - * @description Human-readable name. - */ - name?: string | null; - /** - * Oauth Scopes - * @description Space-separated OAuth scopes granted to this connection. - */ - oauth_scopes?: string | null; - /** - * Provider - * @description Provider key, e.g. `dropbox` or `google_drive`. - */ - provider: string; - /** - * Realtime Updates - * @description True when changes arrive via the provider's push notifications. False means the drive still syncs, but only on the scheduled backstop sweep rather than within seconds of a change. - */ - realtime_updates: boolean; - /** - * Status - * @description One of `active`, `pending_auth`, `error`, `disconnected`. - */ - status: string; - /** - * Updated At - * @description When the connection was last modified. - */ - updated_at: string; - }; - /** CloudDriveScopeResponseModel */ - CloudDriveScopeResponseModel: { - /** - * Description - * @description What the scope allows. - */ - description: string; - /** - * Key - * @description The OAuth scope string sent to the provider. - */ - key: string; - /** - * Label - * @description Short human-readable name. - */ - label: string; - /** - * Recommended - * @description Whether this scope is requested by default on connect. - */ - recommended: boolean; - }; - /** CloudDriveUpdateRequest */ - CloudDriveUpdateRequest: { - /** - * Folder Path - * @description New watched folder; empty means the whole drive. A folder on a shared drive is written `/Shared drives//`. Changing it resets the sync cursor, so files already in the new folder are NOT replayed as triggers — only subsequent changes fire, matching connect-time behaviour. Rejected when the new folder would make an agent that writes there re-trigger itself. - */ - folder_path?: string | null; - /** - * Name - * @description New display name for the connection. - */ - name?: string | null; - }; - /** - * CompactionEvaluationModel - * @description Structured LLM-as-judge evaluation result. - */ - CompactionEvaluationModel: { - /** - * Reasoning - * @description Explanation of the evaluation. - */ - reasoning: string; - /** - * Score - * @description Quality score from 1 to 5. - */ - score: number; - /** - * Verdict - * @description 'pass' or 'fail'. - */ - verdict: string; - }; - /** - * CompactionScheduledResponse - * @description Acknowledgement that an on-demand compaction run was scheduled. - */ - CompactionScheduledResponse: { - /** Memory Bank Id */ - memory_bank_id: string; - /** Status */ - status: string; - }; - /** - * CompactionTestResponseModel - * @description Response from a compaction prompt test. - */ - CompactionTestResponseModel: { - /** - * Compaction Summary - * @description The generated compaction summary. - */ - compaction_summary: string | null; - /** @description LLM-as-judge quality evaluation. */ - evaluation: components["schemas"]["CompactionEvaluationModel"]; - /** - * Generated - * @description True when entries were LLM-generated rather than real. - */ - generated: boolean; - /** - * Original Entries - * @description Entries fed into the compactor. - */ - original_entries: string[]; - /** - * Surviving Entries - * @description Entries that survived after compaction. - */ - surviving_entries: string[]; - }; - /** - * CompatibleRunListResponse - * @description Paginated list of compatible runs. - */ - CompatibleRunListResponse: { - /** Data */ - data: components["schemas"]["CompatibleRunResponse"][]; - /** Limit */ - limit: number; - /** Page */ - page: number; - /** Total */ - total: number; - }; - /** - * CompatibleRunResponse - * @description A run that has a completed step matching a criteria's step_id. - */ - CompatibleRunResponse: { - /** - * Agent Run Id - * Format: uuid - */ - agent_run_id: string; - /** - * Agent Step Run Id - * Format: uuid - */ - agent_step_run_id: string; - /** Completed At */ - completed_at: string | null; - /** Input Preview */ - input_preview?: string | null; - /** Output Storage Key */ - output_storage_key: string | null; - /** Run Status */ - run_status?: string | null; - /** Started At */ - started_at?: string | null; - }; - /** - * ContentAttachmentResponse - * @description A file attached to a content item. - */ - ContentAttachmentResponse: { - /** - * Content Type - * @description MIME type of the attached file. - */ - content_type: string; - /** - * Created At - * @description When the file was first attached. - */ - created_at: string; - /** - * Id - * @description The attachment's id, which the single-attachment endpoints take. - */ - id: string; - /** - * Indexed - * @description Whether indexing the file for search was asked for. - */ - indexed: boolean; - /** - * Indexing Error - * @description Why the file was not indexed, when `indexing_status` is `failed`. - */ - indexing_error: string | null; - /** - * Indexing Status - * @description `pending`, `completed` or `failed`; null when indexing was not asked for. Search finds the file only when `completed`. - */ - indexing_status: string | null; - /** - * Key - * @description The attachment's key, unique within the item. - */ - key: string; - /** - * Metadata - * @description What is known about the file beyond its bytes. An image extracted from a PDF carries its `page_number`, and `page_render: true` when it is a render of the whole page. An image or video from a web page carries `source_url` (the address it was fetched from), `position` (its place among the media the page listed, from 0) and, when the page gave one, `alt_text`. Empty for most files. A retrieval metadata filter matches these keys, except `alt_text`, which is indexed as the attachment's text. - */ - metadata: { - [key: string]: unknown; - }; - /** - * Size Bytes - * @description Size of the attached file in bytes. - */ - size_bytes: number; - /** - * Updated At - * @description When the attachment last changed. - */ - updated_at: string; - }; - /** - * ContentEmbeddingResponse - * @description Response model for content embedding. - */ - ContentEmbeddingResponse: { - /** Batch Duration */ - batch_duration: number; - /** Batch Size */ - batch_size: number; - /** Id */ - id: string; - /** Media Name */ - media_name?: string | null; - /** Page Number */ - page_number?: number | null; - /** Source Mime */ - source_mime?: string | null; - /** Source Url */ - source_url?: string | null; - /** Text */ - text: string; - /** Text End */ - text_end: number; - /** Text Start */ - text_start: number; - /** Vector */ - vector: number[]; - }; - /** CreateAlertConfigRequest */ - CreateAlertConfigRequest: { - /** - * Agent Id - * @description Agent ID (for agent alerts) - */ - agent_id?: string | null; - /** - * Alert Type - * @description Alert type - */ - alert_type: string; - /** - * Cooldown Minutes - * @description Cooldown period in minutes. Omit to use the per-alert-type default (1440 for credit alerts, 60 otherwise). - */ - cooldown_minutes?: number | null; - /** - * Distribution Type - * @description Distribution type (owner, owner_admins, selected_members) - * @default owner - */ - distribution_type: string; - /** - * Enabled - * @description Whether the alert config is enabled - * @default true - */ - enabled: boolean; - /** - * Recipient User Ids - * @description User IDs for selected_members distribution - */ - recipient_user_ids?: string[] | null; - /** - * Source Connection Id - * @description Source connection ID (for source alerts) - */ - source_connection_id?: string | null; - /** - * Threshold - * @description Threshold configuration - */ - threshold?: { - [key: string]: unknown; - } | null; - }; - /** - * CreateEvaluationCriteriaRequest - * @description Request body for creating an evaluation criteria. - * - * The evaluation mode, retry settings, and sample frequency are set at the - * agent level, not per-criteria. - */ - CreateEvaluationCriteriaRequest: { - /** Description */ - description?: string | null; - /** - * Enabled - * @default true - */ - enabled: boolean; - /** Evaluation Prompt */ - evaluation_prompt?: string | null; - evaluation_tier?: components["schemas"]["AgentEvaluationTier"] | null; - /** Expectation Config */ - expectation_config?: { - [key: string]: unknown; - } | null; - /** - * Pass Threshold - * @default 0.5 - */ - pass_threshold: number; - /** Step Id */ - step_id: string; - }; - /** - * CreateEvaluationResultRequest - * @description Request body for recording an evaluation result. - */ - CreateEvaluationResultRequest: { - /** - * Agent Run Id - * Format: uuid - */ - agent_run_id: string; - /** Agent Step Run Id */ - agent_step_run_id?: string | null; - /** Details */ - details?: { - [key: string]: unknown; - } | null; - /** - * Flagged - * @default false - */ - flagged: boolean; - /** - * Retry Count - * @default 0 - */ - retry_count: number; - /** - * Retry Triggered - * @default false - */ - retry_triggered: boolean; - /** Score */ - score?: number | null; - status: components["schemas"]["EvaluationStatus"]; - }; - /** CreateExperimentResponse */ - CreateExperimentResponse: { - /** Experiment Id */ - experiment_id: string; - /** Status */ - status: string; - }; - /** - * CreateKnowledgeBaseBody - * @description Request body for creating a knowledge base. - */ - CreateKnowledgeBaseBody: { - /** - * Default Score Threshold - * @description Prefilled into Minimum Rerank Score on a new retrieval step in the editor. Not applied at retrieval time — the step's own value is used. - */ - default_score_threshold?: number | null; - /** - * Default Top K - * @description Prefilled into Top K on a new retrieval step in the editor. Not applied at retrieval time. - */ - default_top_k?: number | null; - /** - * Default Top N - * @description Prefilled into Top N on a new retrieval step in the editor. Not applied at retrieval time — the step's own value is used. - */ - default_top_n?: number | null; - /** - * Description - * @description Optional description. - */ - description?: string | null; - /** - * Name - * @description Knowledge base name. - */ - name: string; - /** - * Reranker Model - * @description Reranker model to use — a `model_type` from `GET /models/rerankers`. Pass "none" to disable reranking (not a value from that list). Omit it for a default chosen from the sources ("none" when every source embeds media natively, whose chunks carry no text for a reranker to score). "" is accepted as a synonym for "none". - */ - reranker_model?: string | null; - /** - * Source Ids - * @description List of source connection IDs to link. - */ - source_ids: string[]; - }; - /** - * CreateMemoryBankBody - * @description Request body for creating a memory bank. - */ - CreateMemoryBankBody: { - /** - * Chunk Overlap - * @description Chunk overlap (custom mode only). - */ - chunk_overlap?: number | null; - /** - * Chunk Size - * @description Chunk size (custom mode only). - */ - chunk_size?: number | null; - /** - * Compaction Prompt - * @description Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted. - */ - compaction_prompt?: string | null; - /** - * Description - * @description Optional description of the bank's purpose. - */ - description?: string | null; - /** - * Dimensions - * @description Embedding dimensions (custom mode only). - */ - dimensions?: number | null; - /** - * Embedding Model - * @description Custom embedding model (custom mode only). - */ - embedding_model?: string | null; - /** - * Max Age Days - * @description DEPRECATED and no longer applied. Age used to trigger compaction, which duplicated retention_days — both removed the same entries at the same age. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending Seclai-Version 2026-08-03 or later; accepted and stored but inert for older clients. - */ - max_age_days?: number | null; - /** - * Max Size Tokens - * @description Max total tokens (per partition) before compaction. Checked inline after each write and by the hourly background sweep. - */ - max_size_tokens?: number | null; - /** - * Max Turns - * @description Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep. - */ - max_turns?: number | null; - /** - * Mode - * @description Embedding quality / cost trade-off. One of: fast_and_cheap, balanced, slow_and_thorough, custom. - * @default fast_and_cheap - */ - mode: string; - /** - * Name - * @description Memory bank name. - */ - name: string; - /** - * Retention Days - * @description Retention in days — when entries are deleted outright, text and embeddings. This is the only age-based control; compaction triggers on max_size_tokens and max_turns. For clients sending Seclai-Version 2026-08-03 or later, omitting the field resolves per bank type: 90 days for a conversation bank, indefinite for a general bank. Older clients keep the previous default of 30 days for a conversation bank — unless a longer max_age_days was sent, which wins, since the window is never lowered beneath the only age the caller expressed — while a general bank keeps entries indefinitely. Send an explicit value (or null for indefinite) to be unambiguous on every version. - */ - retention_days?: number | null; - /** - * Strip Quoted Reply Chains - * @description Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation. - * @default false - */ - strip_quoted_reply_chains: boolean; - /** - * Type - * @description Bank type. 'conversation' for chat-turn data with conversation_key + speaker; 'general' for flat entries with optional group_key. - * @default conversation - */ - type: string; - }; - /** - * CreateSolutionRequest - * @description Request model for creating a new solution - */ - CreateSolutionRequest: { - /** - * Description - * @description Description of the solution - * @default - */ - description: string; - /** - * Name - * @description Name of the solution - */ - name: string; - }; - /** - * CreateSourceBody - * @description Request body for creating a content source. - */ - CreateSourceBody: { - /** - * Chunk Overlap - * @description Chunk overlap for content processing. - */ - chunk_overlap?: number | null; - /** - * Chunk Size - * @description Chunk size for content processing. - */ - chunk_size?: number | null; - /** - * Cloud Drive Connection Id - * @description Required for a cloud_drive source, and ignored on any other: the id of a connected drive, from GET /cloud-drives. - */ - cloud_drive_connection_id?: string | null; - /** - * Cloud Drive Content Types - * @description For a cloud_drive source: comma-separated MIME types a file must have to be indexed. Omit for no filter. - */ - cloud_drive_content_types?: string | null; - /** - * Cloud Drive Folder Path - * @description For a cloud_drive source: the folder to index, as a path inside the drive. Omit to index the connected drive's own folder. - */ - cloud_drive_folder_path?: string | null; - /** - * Cloud Drive Max File Mb - * @description For a cloud_drive source: files larger than this many megabytes are skipped. Omit for no limit of the source's own. - */ - cloud_drive_max_file_mb?: number | null; - /** - * Cloud Drive Path Pattern - * @description For a cloud_drive source: a glob a file's path must match to be indexed, such as `**\/*.pdf` or `/reports/*`. Omit for no filter. - */ - cloud_drive_path_pattern?: string | null; - /** - * Content Filter - * @description Content filter type. - */ - content_filter?: string | null; - /** - * Dimensions - * @description Embedding dimensions override. - */ - dimensions?: number | null; - /** - * Document Images - * @description Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to the item and indexed; on a text-only embedder, by the text in each image. Applies to documents added after it changes. Defaults to true; below Seclai-Version 2026-10-18 it defaults to false on a text-only embedder. On a website or RSS source it is ignored: `media_types` decides. - */ - document_images?: boolean | null; - /** - * Email Allowed Senders - * @description Required for an email source, and only valid there: the senders whose mail is stored. Each entry is a full address (news@example.com) or a bare domain (example.com), which also matches its sub-domains. Matched against the message's From address, which must pass DMARC. - */ - email_allowed_senders?: string[] | null; - /** - * Embedding Model - * @description Embedding model override — a `model_type` from `GET /models/embedders`, which also reports each embedder's `supported_input_media`. Defaults to the platform embedder (`default_model_type` on that endpoint) when omitted. Indexing images or video requires an embedder that lists that modality. - */ - embedding_model?: string | null; - /** - * Feed Attachments - * @description Kinds of file listed beside a feed item's content to attach to the item and index, on an RSS source. Subset of ['enclosures', 'item_image', 'media_rss']; any other value is refused. None are attached unless chosen. - */ - feed_attachments?: string[] | null; - /** @description Index mode for custom_index sources: fast_and_cheap (default), balanced, slow_and_thorough, or custom. */ - index_mode?: components["schemas"]["SourceIndexMode"] | null; - /** - * Media Types - * @description Media kinds in a web page's main content to attach to the page's item and index, on a website or RSS source. Subset of ['images', 'video']. From `Seclai-Version: 2026-10-13` any other value, and any kind on another source type, is refused with a 400; older versions drop an unknown value and store the rest. A kind the source's embedder cannot index is stored and not indexed (see `supported_input_media` on GET /models/embedders). 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files. Applies to pages and documents added after it is set. - */ - media_types?: string[] | null; - /** - * Name - * @description Source name. - */ - name: string; - /** - * Polling - * @description Polling interval (e.g. hourly, daily). - */ - polling?: string | null; - /** - * Polling Action - * @description Polling action. - */ - polling_action?: string | null; - /** - * Polling Max Items - * @description The most new feed items a scheduled poll takes. Read for RSS feeds only: from Seclai-Version 2026-10-19 any other source type rejects it with 400. Earlier versions store it there. An email source rejects it at every version. - */ - polling_max_items?: number | null; - /** - * Retention - * @description Retention period in days. - */ - retention?: number | null; - /** - * Source Type - * @description Source type: rss_feed, website, custom_index, cloud_drive or email. The legacy value 'file_uploads' is accepted as an alias for custom_index. - */ - source_type: string; - /** - * Url Id - * @description URL record ID (required for rss/website sources). - */ - url_id?: string | null; - }; - /** DmarcFailingSourceResponse */ - DmarcFailingSourceResponse: { - /** Failed Count */ - failed_count: number; - /** Header From */ - header_from?: string | null; - /** Source Ip */ - source_ip: string; - }; - /** DmarcSummaryResponse */ - DmarcSummaryResponse: { - /** Dispositions */ - dispositions?: { - [key: string]: number; - }; - /** Failed Messages */ - failed_messages: number; - /** - * Monitored - * @default true - */ - monitored: boolean; - /** Pass Rate */ - pass_rate?: number | null; - /** Passed Messages */ - passed_messages: number; - /** Report Count */ - report_count: number; - /** Top Failing Sources */ - top_failing_sources?: components["schemas"]["DmarcFailingSourceResponse"][]; - /** Total Messages */ - total_messages: number; - /** Window Days */ - window_days: number; - }; - /** DnsProviderResponse */ - DnsProviderResponse: { - /** Dashboard Url */ - dashboard_url?: string | null; - /** Key */ - key: string; - /** - * Mx Priority Separate - * @default true - */ - mx_priority_separate: boolean; - /** Name */ - name: string; - /** Tips */ - tips?: string[]; - /** - * Txt Quotes - * @default strip - */ - txt_quotes: string; - }; - /** DnsRecordResponse */ - DnsRecordResponse: { - /** Detail */ - detail?: string | null; - /** Key */ - key: string; - /** Mx Host */ - mx_host?: string | null; - /** Mx Priority */ - mx_priority?: number | null; - /** Name */ - name: string; - /** Ok */ - ok: boolean; - /** Relative Name */ - relative_name: string; - /** Type */ - type: string; - /** Value */ - value: string; - }; - /** DocsSearchResultResponse */ - DocsSearchResultResponse: { - /** Anchor */ - anchor: string | null; - /** Doc Slug */ - doc_slug: string; - /** Highlight */ - highlight: string | null; - /** Score */ - score: number; - /** Snippet */ - snippet: string | null; - /** Title */ - title: string; - }; - /** - * EffortOptionsResponse - * @description The reasoning-effort values a model accepts. - */ - EffortOptionsResponse: { - /** - * Default - * @description The vendor's default level, when known. - */ - default?: string | null; - /** - * Kind - * @description `levels` today: `values` lists them. - */ - kind: string; - /** - * Values - * @description Accepted values, weakest first. - */ - values?: string[]; - }; - /** EmailDomainResponse */ - EmailDomainResponse: { - /** - * Delegated - * @default false - */ - delegated: boolean; - /** Dns Records */ - dns_records?: components["schemas"]["DnsRecordResponse"][]; - /** Domain */ - domain: string; - /** Error Message */ - error_message?: string | null; - /** - * Id - * Format: uuid - */ - id: string; - /** Is Primary */ - is_primary: boolean; - /** Kind */ - kind: string; - /** Last Checked At */ - last_checked_at?: string | null; - provider?: components["schemas"]["DnsProviderResponse"] | null; - /** - * Regressing - * @default false - */ - regressing: boolean; - /** Status */ - status: string; - /** - * Verified - * @default false - */ - verified: boolean; - /** Verified At */ - verified_at?: string | null; - /** - * Zone Apex - * @default - */ - zone_apex: string; - }; - /** EmailDomainsListResponse */ - EmailDomainsListResponse: { - /** - * Can Add Custom - * @default false - */ - can_add_custom: boolean; - /** - * Can Add Vanity - * @default false - */ - can_add_vanity: boolean; - /** Custom Plan Names */ - custom_plan_names?: string[]; - /** Domains */ - domains?: components["schemas"]["EmailDomainResponse"][]; - /** - * Has Custom - * @default false - */ - has_custom: boolean; - /** - * Has Vanity - * @default false - */ - has_vanity: boolean; - /** Vanity Plan Names */ - vanity_plan_names?: string[]; - }; - /** - * EmailSourceRejectionListResponse - * @description A page of mail an email content source refused. - */ - EmailSourceRejectionListResponse: { - /** Data */ - data: components["schemas"]["EmailSourceRejectionResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * EmailSourceRejectionResponse - * @description Mail an email content source refused: who sent it and why, never what - * it said. - */ - EmailSourceRejectionResponse: { - /** - * Auth Verdicts - * @description The SPF, DKIM and DMARC verdicts reported for the message. - */ - auth_verdicts?: { - [key: string]: string; - }; - /** - * Authenticated - * @description Whether the message passed DMARC, which is what authenticates its From address. Adding an unauthenticated sender to the allowed senders does not let its mail in. - */ - authenticated: boolean; - /** - * Created At - * @description When the mail was refused. - */ - created_at: string; - /** - * From Address - * @description The address in the message's From line, which the source's allowed senders are matched against. Null when no single From address could be read from the message unambiguously. - */ - from_address?: string | null; - /** - * Id - * @description Unique identifier of the refusal. - */ - id: string; - /** - * Reason - * @description Why it was refused: sender_not_allowed, unauthenticated_sender, unreadable_from, sender_blocked, spam, virus, unsafe_content, rate_limited, account_not_chargeable or empty_message; or, for a message the source received before, what became of the earlier one: repeat_stored, repeat_held, repeat_deleted or repeat_in_progress. - */ - reason: string; - /** - * Recipient - * @description The source address it was sent to. - */ - recipient: string; - /** - * Sender - * @description The envelope sender. For bulk mail this is the delivery provider's bounce address, not the From address. - */ - sender: string; - /** - * Sender Ip - * @description IP address the mail came from. - */ - sender_ip: string | null; - }; - /** - * EmailTriggerConfigResponse - * @description An EMAIL_RECEIVED trigger's resolved address(es) and config. - */ - EmailTriggerConfigResponse: { - /** - * Agent Id - * Format: uuid - */ - agent_id: string; - /** Email Addresses */ - email_addresses?: string[]; - /** Email Alias */ - email_alias?: string | null; - /** Email Allowed Senders */ - email_allowed_senders?: string[] | null; - /** - * Email Ignore Auto Generated - * @default true - */ - email_ignore_auto_generated: boolean; - /** - * Email Queue On Quota - * @default false - */ - email_queue_on_quota: boolean; - /** - * Email Require Sender Auth - * @default true - */ - email_require_sender_auth: boolean; - /** - * Email Run On Attachment Mismatch - * @default false - */ - email_run_on_attachment_mismatch: boolean; - /** - * Trigger Id - * Format: uuid - */ - trigger_id: string; - /** Trigger Type */ - trigger_type: string; - }; - /** - * EmbeddingModalityRateResponse - * @description Per-modality rate for a multi-modal embedder. - * - * The default ``credits`` field on :class:`EmbeddingModelResponse` is the - * text rate (credits per ~1k English words). Embedders that index image or - * video chunks natively charge those modalities at a different rate and unit - * — e.g. Cohere Embed v4 prices images per record; Nova 2 Multimodal prices - * video per second. Surfacing the modality and unit lets a caller render an - * honest cost breakdown alongside the text rate. - */ - EmbeddingModalityRateResponse: { - /** - * Credits - * @description Rate value in the unit below - */ - credits: number; - /** - * Modality - * @description Modality kind, e.g. image / video - */ - modality: string; - /** - * Unit - * @description Billing unit for this rate (credit_per_record / credit_per_second / credit_per_1000_tokens). - */ - unit: string; - }; - /** - * EmbeddingModelListResponse - * @description Legacy (header-less) response shape for the embedder catalog. - */ - EmbeddingModelListResponse: { - /** - * Default Dimension - * @description Dimensions used with the default embedding model - */ - default_dimension?: number | null; - /** - * Default Model Type - * @description Embedding model used when a source does not override it - */ - default_model_type?: string | null; - /** - * File Processing Credits Per Mb - * @description Credits per MB for file processing at ingest - */ - file_processing_credits_per_mb: number; - /** - * Models - * @description Available embedding models - */ - models: components["schemas"]["EmbeddingModelResponse"][]; - /** - * Storage Credits - * @description Monthly storage credits per dimension count - */ - storage_credits: components["schemas"]["EmbeddingStorageCreditsResponse"][]; - }; - /** - * EmbeddingModelResponse - * @description Information about an embedding model. - */ - EmbeddingModelResponse: { - /** - * Credits - * @description Estimated credits per 1,000 English words - */ - credits: number; - /** - * Description - * @description Model description - */ - description?: string | null; - /** - * Dimensions - * @description Dimensions options - */ - dimensions: number[]; - /** - * Is New - * @description Whether the model is newly released - * @default false - */ - is_new: boolean; - /** - * Max Input Tokens - * @description Max input tokens per request - */ - max_input_tokens?: number | null; - /** - * Model Id - * @description Model identifier - */ - model_id: string; - /** - * Model Type - * @description Full model type identifier (enum value). This is the value to send as embedding_model when creating a source. - */ - model_type: string; - /** - * Mteb Retrieval Score - * @description MTEB retrieval score - */ - mteb_retrieval_score?: number | null; - /** - * Name - * @description Human-readable model name - */ - name?: string | null; - /** - * Per Modality Rates - * @description Non-text rates the vendor charges for this embedder (image, video, audio). Empty for text-only embedders. - */ - per_modality_rates?: components["schemas"]["EmbeddingModalityRateResponse"][]; - /** - * Provider - * @description Model provider identifier - */ - provider?: string | null; - /** - * Speed - * @description Model processing speed - */ - speed?: string | null; - /** - * Supported Input Media - * @description Modalities the embedder accepts on input (short kinds like text / image / video, or full MIMEs). null means text-only. A source only honours a media_types entry its embedder lists here. - */ - supported_input_media?: string[] | null; - /** - * Supported Languages - * @description Supported languages - */ - supported_languages?: string[] | null; - /** - * Url - * @description Model documentation URL - */ - url?: string | null; - }; - /** - * EmbeddingStorageCreditsResponse - * @description Monthly storage credits per stored record at a dimension count. - */ - EmbeddingStorageCreditsResponse: { - /** - * Credits - * @description Credits per record per month - */ - credits: number; - /** - * Dimensions - * @description Number of embedding dimensions - */ - dimensions: number; - }; - /** - * EvaluationCriteriaResponse - * @description Response schema for evaluation criteria. - */ - EvaluationCriteriaResponse: { - /** - * Account Id - * Format: uuid - */ - account_id: string; - /** - * Agent Id - * Format: uuid - */ - agent_id: string; - /** Created At */ - created_at: string; - /** Description */ - description: string | null; - /** Enabled */ - enabled: boolean; - /** - * Evaluation Mode - * @description Runtime behavior mode. output_expectation (manual validation), eval_and_retry (every run + retry), sample_and_flag (sampled monitoring). - */ - evaluation_mode: string; - /** Evaluation Prompt */ - evaluation_prompt: string | null; - /** Evaluation Tier */ - evaluation_tier: string | null; - /** Expectation Config */ - expectation_config: { - [key: string]: unknown; - } | null; - /** - * Id - * Format: uuid - */ - id: string; - /** Max Retries */ - max_retries: number; - /** - * Pass Threshold - * @description Score cutoff for pass/fail, inclusive (0.0 to 1.0). - */ - pass_threshold: number; - /** Result Summary */ - result_summary: { - [key: string]: number; - }; - /** Retry On Failure */ - retry_on_failure: boolean; - /** Step Id */ - step_id: string | null; - /** Updated At */ - updated_at: string; - }; - /** - * EvaluationResultListResponse - * @description Paginated list of evaluation results. - */ - EvaluationResultListResponse: { - /** Data */ - data: components["schemas"]["EvaluationResultResponse"][]; - /** Limit */ - limit: number; - /** Page */ - page: number; - /** Total */ - total: number; - }; - /** - * EvaluationResultResponse - * @description Response schema for a single evaluation result. - */ - EvaluationResultResponse: { - /** - * Agent Run Id - * Format: uuid - */ - agent_run_id: string; - /** Agent Step Run Id */ - agent_step_run_id: string | null; - /** Created At */ - created_at: string; - /** - * Criteria Id - * Format: uuid - */ - criteria_id: string; - /** - * Details - * @description Evaluation details including explanation and raw LLM response. - */ - details?: { - [key: string]: unknown; - } | null; - /** Evaluated At */ - evaluated_at: string; - /** - * Flagged - * @description True when the result was flagged for human review. - */ - flagged: boolean; - /** - * Id - * Format: uuid - */ - id: string; - /** Retry Count */ - retry_count: number; - /** Retry Triggered */ - retry_triggered: boolean; - /** - * Score - * @description LLM-assigned quality score between 0.0 (worst) and 1.0 (best). - */ - score?: number | null; - /** - * Status - * @description Outcome status: pending, passed, failed, skipped, or error. - */ - status: string; - }; - /** - * EvaluationResultSummaryResponse - * @description Aggregated pass/fail/error counts and average score for a criteria. - */ - EvaluationResultSummaryResponse: { - /** - * Average Score - * @description Mean score of the final passed and failed results, or null if none. On /api before Seclai-Version 2026-10-21 it averages every final result's stored score, `error` included. - */ - average_score?: number | null; - /** Error */ - error: number; - /** Failed */ - failed: number; - /** Flagged */ - flagged: number; - /** Passed */ - passed: number; - /** Total */ - total: number; - }; - /** - * EvaluationResultWithCriteriaListResponse - * @description Paginated list of evaluation results with criteria context. - */ - EvaluationResultWithCriteriaListResponse: { - /** Data */ - data: components["schemas"]["EvaluationResultWithCriteriaResponse"][]; - /** Limit */ - limit: number; - /** Page */ - page: number; - /** Total */ - total: number; - }; - /** - * EvaluationResultWithCriteriaResponse - * @description Evaluation result including criteria context for aggregated listing. - */ - EvaluationResultWithCriteriaResponse: { - /** - * Agent Run Id - * Format: uuid - */ - agent_run_id: string; - /** Agent Step Run Id */ - agent_step_run_id: string | null; - /** Created At */ - created_at: string; - /** Criteria Description */ - criteria_description: string | null; - /** - * Criteria Id - * Format: uuid - */ - criteria_id: string; - /** - * Details - * @description Evaluation details including explanation and raw LLM response. - */ - details?: { - [key: string]: unknown; - } | null; - /** Evaluated At */ - evaluated_at: string; - /** - * Flagged - * @description True when the result was flagged for human review. - */ - flagged: boolean; - /** - * Id - * Format: uuid - */ - id: string; - /** Retry Count */ - retry_count: number; - /** Retry Triggered */ - retry_triggered: boolean; - /** - * Score - * @description LLM-assigned quality score between 0.0 (worst) and 1.0 (best). - */ - score?: number | null; - /** - * Status - * @description Outcome status: pending, passed, failed, skipped, or error. - */ - status: string; - /** Step Id */ - step_id: string | null; - }; - /** - * EvaluationRunSummaryListResponse - * @description Paginated list of per-run evaluation summaries. - */ - EvaluationRunSummaryListResponse: { - /** Data */ - data: components["schemas"]["EvaluationRunSummaryResponse"][]; - /** Limit */ - limit: number; - /** Page */ - page: number; - /** Total */ - total: number; - }; - /** - * EvaluationRunSummaryResponse - * @description Per-run evaluation summary with pass/fail/error breakdown. - */ - EvaluationRunSummaryResponse: { - /** - * Agent Run Id - * Format: uuid - */ - agent_run_id: string; - /** Error Count */ - error_count: number; - /** Failed Count */ - failed_count: number; - /** Flagged Count */ - flagged_count: number; - /** Passed Count */ - passed_count: number; - /** Run Created At */ - run_created_at: string; - /** - * Run Status - * @description Status of the agent run (processing, completed, failed). - */ - run_status: string; - /** Skipped Count */ - skipped_count: number; - /** Total Evaluations */ - total_evaluations: number; - }; - /** - * EvaluationStatus - * @description Result status of a single evaluation run. - * @enum {string} - */ - EvaluationStatus: "pending" | "passed" | "failed" | "skipped" | "error"; - ExamplePrompt: { - [key: string]: string; - }; - /** - * ExecutedActionResponse - * @description A single executed action result. - */ - ExecutedActionResponse: { - /** - * Action Type - * @description Type of the executed action. - */ - action_type: string; - /** - * Description - * @description Human-readable description. - */ - description: string; - /** - * Error - * @description Error message if failed. - */ - error?: string | null; - /** - * Needs Clarification - * @description True when the action paused for a clarifying question rather than failing. The created resource is kept and the question is in ``description``/``error``. - * @default false - */ - needs_clarification: boolean; - /** - * Resource Id - * @description ID of the affected resource. - */ - resource_id?: string | null; - /** - * Resource Type - * @description Type of the affected resource. - */ - resource_type?: string | null; - /** - * Success - * @description Whether the action succeeded. - * @default true - */ - success: boolean; - }; - /** ExperimentDetailResponse */ - ExperimentDetailResponse: { - /** Completed At */ - completed_at: string | null; - /** Created At */ - created_at: string; - /** - * Effort - * @description The reasoning effort each model was run at, by model ID. - */ - effort?: { - [key: string]: string; - }; - /** Error Message */ - error_message: string | null; - /** Evaluation Complexity */ - evaluation_complexity: string; - /** Evaluation Mode */ - evaluation_mode: string; - /** Evaluator Model Id */ - evaluator_model_id: string | null; - /** Id */ - id: string; - /** Include Step Output In Evaluation */ - include_step_output_in_evaluation: boolean; - /** Json Template */ - json_template: string | null; - /** Progress Current */ - progress_current: number | null; - /** Progress Message */ - progress_message: string | null; - /** Progress Total */ - progress_total: number | null; - /** Prompt */ - prompt: string; - /** Result Data */ - result_data: { - [key: string]: unknown; - } | null; - /** Selected Model Ids */ - selected_model_ids: string[]; - /** Selected Step Output */ - selected_step_output: string | null; - /** Started At */ - started_at: string | null; - /** Status */ - status: string; - /** System Prompt */ - system_prompt: string; - }; - /** - * ExperimentListResponse - * @description ``GET /models/playground/experiments`` legacy/default shape; 2026-07-27+ - * clients get the canonical ``{data, pagination}`` envelope. - */ - ExperimentListResponse: { - /** Experiments */ - experiments: components["schemas"]["ExperimentSummaryResponse"][]; - /** Total */ - total: number; - }; - /** ExperimentSummaryResponse */ - ExperimentSummaryResponse: { - /** Created At */ - created_at: string; - /** Evaluation Complexity */ - evaluation_complexity: string; - /** Evaluation Mode */ - evaluation_mode: string; - /** Id */ - id: string; - /** Selected Model Ids */ - selected_model_ids: string[]; - /** Status */ - status: string; - }; - /** - * ExportFormat - * @description Supported export file formats. - * @enum {string} - */ - ExportFormat: "jsonl" | "csv" | "parquet" | "zip"; - /** - * ExportListResponse - * @description Paginated list of export jobs. - */ - ExportListResponse: { - /** Data */ - data: unknown[]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** GenerateAgentStepsRequest */ - GenerateAgentStepsRequest: { - /** - * Agent Description - * @description Agent description for additional AI context. - */ - agent_description?: string | null; - /** - * Agent Steps - * @description Current agent step hierarchy for context when modifying. - */ - agent_steps?: { - [key: string]: unknown; - }[] | null; - /** - * Mode - * @description 'generate_full' to create from scratch, 'modify_workflow' to refine. - * @default generate_full - */ - mode: string; - /** - * Trigger Type - * @description Agent trigger type for context (e.g. 'dynamic_input', 'content_added'). - */ - trigger_type?: string | null; - /** - * User Input - * @description Natural language description of the desired agent workflow. - */ - user_input: string; - }; - /** GenerateAgentStepsResponse */ - GenerateAgentStepsResponse: { - /** - * Agent Config - * @description Suggested agent-level configuration, if any. For an email_received agent it may carry `email_run_on_attachment_mismatch`, which the caller applies through the trigger's email-config endpoint. For a dynamic_input or email_received agent it may carry `accepted_attachments`, which the caller passes with the steps to `PUT /agents/{agent_id}/definition` so both save together. - */ - agent_config?: { - [key: string]: unknown; - } | null; - /** - * Conversation Id - * @description Conversation turn ID for tracking. - */ - conversation_id: string; - /** - * Example Prompts - * @description Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given mode. - */ - example_prompts?: components["schemas"]["ExamplePrompt"][]; - /** - * Intent Assessment - * @description How the assistant interpreted the request: 'clear' when steps were generated, or an ask-path value (e.g. 'ambiguous_output', 'cannot_build') when it returned no steps and put a clarifying question or blocker in `note`. Mirrors the MCP surface so callers can distinguish a clarification pause from a hard failure. - */ - intent_assessment?: string | null; - /** - * Note - * @description AI explanation of the proposed workflow. - */ - note: string; - /** - * Steps - * @description Generated agent steps. - */ - steps: { - [key: string]: unknown; - }[]; - /** - * Success - * @description Whether steps were successfully generated. - */ - success: boolean; - }; - /** GenerateStepConfigRequest */ - GenerateStepConfigRequest: { - /** - * Agent Steps - * @description Current agent step hierarchy for context. - */ - agent_steps?: { - [key: string]: unknown; - }[] | null; - /** - * Current Config - * @description Current step configuration to refine, if any. - */ - current_config?: { - [key: string]: unknown; - } | null; - /** - * Step Id - * @description ID of the specific step to refine. Omit for new steps. - */ - step_id?: string | null; - /** - * Step Type - * @description The step type to generate config for (e.g. 'regex_replace', 'gate', 'text', 'prompt_call', 'retrieval'). - */ - step_type: string; - /** - * User Input - * @description Natural language description of what the step should do. - */ - user_input: string; - }; - /** GenerateStepConfigResponse */ - GenerateStepConfigResponse: { - /** - * Conversation Id - * @description Conversation turn ID for tracking. - */ - conversation_id: string; - /** - * Example Prompts - * @description Example natural-language prompts that demonstrate the capabilities of this AI assistant for the given step type. - */ - example_prompts?: components["schemas"]["ExamplePrompt"][]; - /** - * Note - * @description AI explanation of the proposed configuration. - */ - note: string; - /** - * Resulting Config - * @description The proposed step configuration. - */ - resulting_config?: { - [key: string]: unknown; - } | null; - /** - * Step Type - * @description The step type that was generated. - */ - step_type: string; - /** - * Success - * @description Whether a valid configuration was generated. - */ - success: boolean; - }; - /** - * GenerationTierListResponse - * @description ``GET /models/generation-tiers`` legacy/default shape; 2026-07-27+ clients - * get the canonical ``{data, pagination}`` envelope. - */ - GenerationTierListResponse: { - /** Tiers */ - tiers: components["schemas"]["GenerationTierResponse"][]; - }; - /** GenerationTierResponse */ - GenerationTierResponse: { - /** Credits Per Unit */ - credits_per_unit: number | null; - /** Modality */ - modality: string; - /** Model Id */ - model_id: string; - /** Model Name */ - model_name: string; - /** Price Label */ - price_label: string | null; - /** Tier */ - tier: string; - /** Unit Label */ - unit_label: string | null; - }; - /** - * GovernanceAiAcceptResponse - * @description Response from accepting a governance AI assistant plan. - */ - GovernanceAiAcceptResponse: { - /** - * Actions Applied - * @description Results of each action that was executed. - */ - actions_applied: components["schemas"]["AppliedActionResponse"][]; - /** - * Conversation Id - * @description Conversation ID that was accepted. - */ - conversation_id: string; - /** - * Error - * @description Overall error message if the plan failed, or null. - */ - error?: string | null; - /** - * Success - * @description Whether all actions were applied successfully. - */ - success: boolean; - }; - /** - * GovernanceAiAssistantResponse - * @description Response from the governance AI assistant generate endpoint. - */ - GovernanceAiAssistantResponse: { - /** - * Conversation Id - * @description Conversation ID to accept or decline this plan. - */ - conversation_id: string; - /** - * Example Prompts - * @description Example natural-language prompts that demonstrate the capabilities of the governance AI assistant. - */ - example_prompts?: components["schemas"]["ExamplePrompt"][]; - /** - * Note - * @description AI-generated summary of the proposed changes. - */ - note: string; - /** - * Prompt Call Id - * @description Prompt call ID for credit tracking, or null. - */ - prompt_call_id?: string | null; - /** - * Proposed Actions - * @description Ordered list of policy actions the AI proposes to execute. - */ - proposed_actions: components["schemas"]["ProposedPolicyActionResponse"][]; - /** - * Success - * @description Whether the plan was generated successfully. - */ - success: boolean; - }; - /** HTTPValidationError */ - HTTPValidationError: { - /** Detail */ - detail?: components["schemas"]["ValidationError"][]; - }; - /** - * ImportFieldErrorModel - * @description Single agent_definition validation error with source position. - */ - ImportFieldErrorModel: { - /** - * Column - * @description 1-indexed column in `source`. - */ - column: number; - /** - * Line - * @description 1-indexed line in `source`. - */ - line: number; - /** - * Message - * @description Human-readable description of the problem. - */ - message: string; - /** - * Path - * @description Dotted path of the offending field, e.g. `agent.definition.child_steps[0].step_type`. - */ - path: string; - }; - /** - * ImportSkipResponse - * @description One item that was not applied during an agent import. - * - * Used as the element type for ``import_warnings`` on every - * response model that accepts an ``agent_definition`` payload. - * See ``services.agent_definition_import.AgentImportSkip`` for the - * full category list. - * - * Lives here (not on each router) so the authenticated and public - * API responses share one definition — keeping the shape that - * clients (UI modal, MCP, OpenAPI consumers) depend on aligned. - */ - ImportSkipResponse: { - /** - * Category - * @description The kind of item that was skipped or substituted: 'schedule', 'evaluation_criteria', 'alert_config', 'alert_recipient', 'governance_policy', 'governance_kb_link', 'solution_link'. - */ - category: string; - /** - * Details - * @description Category-specific identifiers for the skipped item (step_id, alert_type, kb_name, etc.). Stable keys per category; absent keys are simply not applicable. - */ - details?: { - [key: string]: unknown; - }; - /** - * Message - * @description Human-readable explanation of what was skipped and why. - */ - message: string; - }; - /** - * InboundEmailRejectionResponse - * @description An inbound email that was discarded without running an agent. - */ - InboundEmailRejectionResponse: { - /** Agent Id */ - agent_id: string | null; - /** Created At */ - created_at: string; - /** - * Id - * Format: uuid - */ - id: string; - /** Message Id */ - message_id: string | null; - /** Reason */ - reason: string; - /** Recipient */ - recipient: string; - /** Sender */ - sender: string; - /** Sender Ip */ - sender_ip: string | null; - /** Subject */ - subject: string | null; - }; - /** InboundEmailStatusResponse */ - InboundEmailStatusResponse: { - /** Paused */ - paused: boolean; - /** Queued Backlog */ - queued_backlog: number; - }; - /** - * InlineTextReplaceRequest - * @description Request model for inline text content replacement. - */ - InlineTextReplaceRequest: { - /** - * Content Type - * @description MIME type for the text content - * @default text/plain - */ - content_type: string | null; - /** - * Metadata - * @description Optional metadata object - */ - metadata?: { - [key: string]: unknown; - } | null; - /** - * Text - * @description Text content to upload - */ - text: string; - /** - * Title - * @description Optional title - */ - title?: string | null; - }; - /** - * InlineTextUploadRequest - * @description Request model for inline text uploads. - */ - InlineTextUploadRequest: { - /** - * Content Type - * @description MIME type for the text content - * @default text/plain - */ - content_type: string | null; - /** - * Metadata - * @description Optional metadata object - */ - metadata?: { - [key: string]: unknown; - } | null; - /** - * Text - * @description Text content to upload - */ - text: string; - /** - * Title - * @description Optional title - */ - title?: string | null; - }; - /** - * InsufficientCreditsDetail - * @description ``error`` body of a 402 ``insufficient_credits`` response. - */ - InsufficientCreditsDetail: { - /** - * Account Id - * @description UUID of the account that ran out of credits. - */ - account_id: string; - /** - * Code - * @description Stable machine-readable error code. - * @constant - */ - code: "insufficient_credits"; - /** - * Message - * @description Human-readable explanation. - */ - message: string; - }; - /** - * InsufficientCreditsResponse - * @description 402 envelope returned when the account has exhausted its credits. - * - * The wire shape ``http_exception_handler`` and ``insufficient_credits_exception_handler`` send. - */ - InsufficientCreditsResponse: { - error: components["schemas"]["InsufficientCreditsDetail"]; - }; - JsonValue: unknown; - /** - * KnowledgeBaseListResponseModel - * @description Paginated list of knowledge bases. - */ - KnowledgeBaseListResponseModel: { - /** - * Knowledge Bases - * @description List of knowledge bases on this page. - */ - knowledge_bases: components["schemas"]["KnowledgeBaseResponseModel"][]; - /** - * Limit - * @description Items per page. - */ - limit: number; - /** - * Page - * @description Current page number (1-based). - */ - page: number; - /** - * Total - * @description Total number of knowledge bases. - */ - total: number; - }; - /** - * KnowledgeBase - * @description Response model for a single knowledge base. - */ - KnowledgeBaseResponseModel: { - /** - * Created At - * @description ISO-8601 creation timestamp. - */ - created_at: string; - /** - * Default Score Threshold - * @description Editor default for a new retrieval step's Minimum Rerank Score. - */ - default_score_threshold?: number | null; - /** - * Default Top K - * @description Editor default for a new retrieval step's Top K. - */ - default_top_k?: number | null; - /** - * Default Top N - * @description Editor default for a new retrieval step's Top N. - */ - default_top_n?: number | null; - /** - * Description - * @description Optional description. - */ - description?: string | null; - /** - * Id - * @description Unique knowledge base identifier. - */ - id: string; - /** - * Name - * @description Human-readable name. - */ - name: string; - /** - * Readonly - * @description Whether the knowledge base is read-only. - * @default false - */ - readonly: boolean; - /** - * Reranker Model - * @description Reranker model in use. - */ - reranker_model?: string | null; - /** - * Sources - * @description Linked source connections. - */ - sources?: components["schemas"]["SourceConnectionResponseModel"][]; - /** - * Updated At - * @description ISO-8601 last-update timestamp. - */ - updated_at: string; - }; - /** LinkResourcesRequest */ - LinkResourcesRequest: { - /** - * Ids - * @description Resource IDs to link - */ - ids: string[]; - }; - /** MarkAiSuggestionRequest */ - MarkAiSuggestionRequest: { - /** - * Accepted - * @description True to accept the suggestion, false to decline it. - */ - accepted: boolean; - }; - /** MarkConversationTurnRequest */ - MarkConversationTurnRequest: { - /** - * Accepted - * @description Whether the suggestion was accepted - */ - accepted: boolean; - }; - /** MeResponse */ - MeResponse: { - /** - * Account Id - * Format: uuid - */ - account_id: string; - /** Organizations */ - organizations: components["schemas"]["OrganizationInfoResponse"][]; - }; - /** - * MemoryBankAiAssistantResponse - * @description Response from the memory bank AI assistant. - */ - MemoryBankAiAssistantResponse: { - /** @description Proposed configuration, or null. */ - config?: components["schemas"]["MemoryBankConfigResponse"] | null; - /** - * Conversation Id - * @description Conversation ID for follow-up. - */ - conversation_id: string; - /** - * Example Prompts - * @description Example natural-language prompts that demonstrate the capabilities of the memory bank AI assistant. - */ - example_prompts?: components["schemas"]["ExamplePrompt"][]; - /** - * Note - * @description AI-generated explanation. - */ - note: string; - /** - * Prompt Call Id - * @description Prompt call ID for credit tracking. - */ - prompt_call_id?: string | null; - /** - * Success - * @description Whether generation succeeded. - * @default false - */ - success: boolean; - }; - /** - * MemoryBankConfigResponse - * @description Suggested memory bank configuration from the AI assistant. - */ - MemoryBankConfigResponse: { - /** - * Compaction Prompt - * @description Suggested compaction prompt. - */ - compaction_prompt?: string | null; - /** - * Description - * @description Suggested description. - */ - description?: string | null; - /** - * Max Age Days - * @description Always null. Age-based compaction is retired — the assistant never suggests it. Kept so an SDK generated before the change still validates this response. - */ - max_age_days?: number | null; - /** - * Max Size Tokens - * @description Max size in tokens. - */ - max_size_tokens?: number | null; - /** - * Max Turns - * @description Max conversation turns. - */ - max_turns?: number | null; - /** - * Mode - * @description Memory bank mode. - */ - mode: string; - /** - * Name - * @description Suggested name. - */ - name: string; - /** - * Retention Days - * @description Retention in days. - */ - retention_days?: number | null; - /** - * Type - * @description Memory bank type: conversation or general. - */ - type: string; - }; - /** - * MemoryBankListResponseModel - * @description Paginated list of memory banks. - */ - MemoryBankListResponseModel: { - /** - * Limit - * @description Items per page. - */ - limit: number; - /** - * Memory Banks - * @description List of memory banks on this page. - */ - memory_banks: components["schemas"]["MemoryBankResponseModel"][]; - /** - * Page - * @description Current page number (1-based). - */ - page: number; - /** - * Total - * @description Total number of memory banks. - */ - total: number; - }; - /** - * MemoryBank - * @description Response model for a single memory bank. - */ - MemoryBankResponseModel: { - /** - * Chunk Overlap - * @description Character overlap between chunks. - */ - chunk_overlap?: number | null; - /** - * Chunk Size - * @description Characters per chunk. - */ - chunk_size?: number | null; - /** - * Compaction Prompt - * @description Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted. - */ - compaction_prompt?: string | null; - /** - * Created At - * @description ISO-8601 creation timestamp. - */ - created_at: string; - /** - * Description - * @description Optional description of the memory bank's purpose. - */ - description?: string | null; - /** - * Dimensions - * @description Vector embedding dimensions. - */ - dimensions?: number | null; - /** - * Embedding Model - * @description Embedding model identifier. - */ - embedding_model?: string | null; - /** - * Id - * @description Unique memory bank identifier. - */ - id: string; - /** - * Max Age Days - * @description DEPRECATED and no longer applied. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Always null for clients sending Seclai-Version 2026-08-03 or later; older clients keep reading whatever value was stored. - */ - max_age_days?: number | null; - /** - * Max Size Tokens - * @description Max total tokens (per partition) before compaction. Checked both inline after each write and by the hourly background sweep. - */ - max_size_tokens?: number | null; - /** - * Max Turns - * @description Max conversation turns (per partition) before compaction. Checked both inline after each write and by the hourly background sweep. - */ - max_turns?: number | null; - /** - * Mode - * @description Embedding mode: fast_and_cheap, balanced, slow_and_thorough, or custom. - */ - mode: string; - /** - * Name - * @description Human-readable name. - */ - name: string; - /** - * Retention Days - * @description Content retention period in days (null = indefinite). - */ - retention_days?: number | null; - /** - * Source Connection Id - * @description Linked content source ID (null if not yet provisioned). - */ - source_connection_id?: string | null; - /** - * Strip Quoted Reply Chains - * @description Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation. - * @default false - */ - strip_quoted_reply_chains: boolean; - /** - * Type - * @description Bank type: conversation (chat-turn with speaker) or general (flat entries). - */ - type: string; - /** - * Updated At - * @description ISO-8601 last-update timestamp. - */ - updated_at: string; - }; - /** - * ModalityRateResponse - * @description Per-modality rate for an LLM that prices image/audio/video output - * (or input) at a rate distinct from the default text rate. - * - * Example: Gemini 3.1 Flash Image charges $3/1M output tokens for - * text but $60/1M output tokens for generated images. The image rate - * surfaces here with ``modality="image"`` and ``output_credits_per_1000_tokens`` - * set; the default text rate stays on the parent model fields. - */ - ModalityRateResponse: { - /** Input Credits Per 1000 Tokens */ - input_credits_per_1000_tokens?: number | null; - /** Modality */ - modality: string; - /** Output Credits Per 1000 Tokens */ - output_credits_per_1000_tokens?: number | null; - }; - /** - * OkResponse - * @description A minimal ``{"ok": true}`` acknowledgement for state-mutating actions - * that have no richer resource to return (e.g. accept/decline a suggestion). - */ - OkResponse: { - /** Ok */ - ok: boolean; - }; - /** OrganizationAlertPreferenceListResponse */ - OrganizationAlertPreferenceListResponse: { - /** Preferences */ - preferences: components["schemas"]["routers__api__alerts__OrganizationAlertPreferenceResponse"][]; - /** Total */ - total: number; - }; - /** OrganizationInfoResponse */ - OrganizationInfoResponse: { - /** - * Account Id - * Format: uuid - */ - account_id: string; - /** - * Id - * Format: uuid - */ - id: string; - /** Name */ - name: string; - }; - /** - * PaginationResponse - * @description Pagination information. - */ - PaginationResponse: { - /** Has Next */ - has_next: boolean; - /** Has Prev */ - has_prev: boolean; - /** Limit */ - limit: number; - /** Page */ - page: number; - /** Pages */ - pages: number; - /** Total */ - total: number; - }; - /** - * PendingProcessingCompletedFailedStatus - * @enum {string} - */ - PendingProcessingCompletedFailedStatus: "pending" | "processing" | "completed" | "failed" | "queued" | "waiting_human" | "waiting_scheduled"; - /** - * PlaygroundCreateRequest - * @description Create a model playground experiment via the public API. - */ - PlaygroundCreateRequest: { - /** - * Effort - * @description Reasoning effort per model id, each one of that model's `effort_options` values. Not combinable with `json_template`. - */ - effort?: { - [key: string]: string; - } | null; - /** - * Evaluation Complexity - * @description simple, medium, or complex - * @default medium - * @enum {string} - */ - evaluation_complexity: "simple" | "medium" | "complex"; - /** - * Evaluation Mode - * @description manual or prompt - * @default manual - * @enum {string} - */ - evaluation_mode: "manual" | "prompt"; - /** - * Evaluator Model Id - * @description Evaluator model ID when evaluation_mode is prompt. - */ - evaluator_model_id?: string | null; - /** - * Include Step Output In Evaluation - * @description Whether to include selected step output as evaluator context. - * @default false - */ - include_step_output_in_evaluation: boolean; - /** - * Json Template - * @description Optional JSON template for advanced mode. - */ - json_template?: string | null; - /** - * Model Ids - * @description Selected model IDs (1-10). - */ - model_ids: string[]; - /** - * Prompt - * @description Prompt text for the experiment. - */ - prompt: string; - /** - * Selected Step Output - * @description Optional step output text for evaluator context. - */ - selected_step_output?: string | null; - /** - * System Prompt - * @description Optional system prompt. - * @default - */ - system_prompt: string; - }; - /** - * PromptModelAutoUpgradeStrategy - * @enum {string} - */ - PromptModelAutoUpgradeStrategy: "none" | "early_adopter" | "middle_of_road" | "cautious_adopter"; - /** - * PromptToolResponse - * @description Response model for a prompt tool. - */ - PromptToolResponse: { - /** Description */ - description?: string | null; - /** Documentation Url */ - documentation_url?: string | null; - /** Example */ - example?: string | null; - /** Headers */ - headers?: { - [key: string]: string; - } | null; - /** Id */ - id: string; - /** Name */ - name: string; - /** Notes */ - notes?: string | null; - /** Tool Name */ - tool_name?: string | null; - /** Tool Type */ - tool_type: string; - /** Tool Type Pattern */ - tool_type_pattern?: string | null; - }; - /** - * ProposedActionResponse - * @description A single proposed action. - */ - ProposedActionResponse: { - /** - * Action Type - * @description Type of the proposed action. - */ - action_type: string; - /** - * Description - * @description Human-readable description of the action. - */ - description: string; - /** - * Is Destructive - * @description Whether the action is destructive. - * @default false - */ - is_destructive: boolean; - /** - * Params - * @description Parameters for the action. - */ - params: { - [key: string]: unknown; - }; - /** - * Preview - * @description Planning-time dry-run preview attached by the solution AI assistant for create_agent / update_agent actions. Contains ``steps`` (the generated step tree), ``step_count``, ``warnings`` (a mix of heuristic structural issues — e.g. brittle JSONPath, pass-through ``regex_replace``, ``prompt_call`` missing a model — and deterministic resource-usage issues: every pre-bound knowledge base / memory bank must be referenced by at least one step, and no step may reference an unknown id), and ``skipped`` / ``skipped_reason`` when preview couldn't run (e.g. the action depends on resources created earlier in the same plan). ``None`` for non-agent actions or when generation failed. - */ - preview?: { - [key: string]: unknown; - } | null; - }; - /** - * ProposedPolicyActionResponse - * @description A single proposed governance policy action. - */ - ProposedPolicyActionResponse: { - /** - * Action Type - * @description Type of action: create, update, delete, enable, or disable. - */ - action_type: string; - /** - * Description - * @description Human-readable description of what this action will do. - */ - description: string; - /** - * Params - * @description Parameters for the action (e.g. policy_document_id, thresholds). - */ - params: { - [key: string]: unknown; - }; - }; - /** RemoveEmailDomainResponse */ - RemoveEmailDomainResponse: { - /** Cleanup Note */ - cleanup_note?: string | null; - /** - * Removed - * @default true - */ - removed: boolean; - }; - /** - * RerankerModelListResponse - * @description Legacy (header-less) response shape for the reranker catalog. - */ - RerankerModelListResponse: { - /** - * Default Model Type - * @description Reranker used when a knowledge base does not choose one - */ - default_model_type: string; - /** - * Models - * @description Available reranker models - */ - models: components["schemas"]["RerankerModelResponse"][]; - /** - * Search Processing Credits - * @description Credits charged for processing a search request - */ - search_processing_credits: number; - }; - /** - * RerankerModelResponse - * @description Information about a reranker model. - */ - RerankerModelResponse: { - /** - * Credits Per Action - * @description Credits charged per rerank action - */ - credits_per_action: number; - /** - * Description - * @description Model description - */ - description?: string | null; - /** - * Is Default - * @description Whether this is the platform default reranker - */ - is_default: boolean; - /** - * Is New - * @description Whether the model is newly released - * @default false - */ - is_new: boolean; - /** - * Max Input Tokens - * @description Max input tokens per request - */ - max_input_tokens?: number | null; - /** - * Model Type - * @description Full model type identifier. This is the value to send as reranker_model on a knowledge base; send "none" or an empty string to disable reranking. - */ - model_type: string; - /** - * Name - * @description Human-readable model name - */ - name: string; - /** - * Provider - * @description Model provider identifier - */ - provider?: string | null; - /** - * Supported Languages - * @description Supported languages - */ - supported_languages?: string[] | null; - /** - * Url - * @description Model documentation URL - */ - url?: string | null; - }; - /** ResumeInboundResponse */ - ResumeInboundResponse: { - /** Resumed */ - resumed: boolean; - }; - /** SendTestEmailResponse */ - SendTestEmailResponse: { - /** - * Sent - * @default true - */ - sent: boolean; - }; - /** ServiceUnavailableError */ - ServiceUnavailableError: { - error: { - /** @enum {string} */ - code: "database_unavailable" | "vector_store_unavailable"; - message: string; - }; - }; - /** SetAcceptedAttachmentsRequest */ - SetAcceptedAttachmentsRequest: { - /** - * Accepted Attachments - * @description The input attachments the trigger accepts; ``null`` accepts any files (one attachment named ``files``). Only ``dynamic_input`` and ``email_received`` triggers take files. - */ - accepted_attachments: components["schemas"]["AcceptedAttachmentSlot"][] | null; - }; - /** - * SetAutoBlockModeRequest - * @description Set the account's governance auto-block mode (shared REST request). - */ - SetAutoBlockModeRequest: { - /** Mode */ - mode: string; - }; - /** - * SkippedAttachmentReason - * @enum {string} - */ - SkippedAttachmentReason: "displayed_in_body" | "over_cap" | "no_filename" | "undecodable"; - /** - * SkippedAttachmentResponse - * @description A part of an email that was not stored as an attachment. - */ - SkippedAttachmentResponse: { - /** - * Content Type - * @description The part's declared media type. - */ - content_type: string; - /** - * Filename - * @description The file name the part is listed under; null when it had none. - */ - filename: string | null; - /** @description Why the part was not stored. */ - reason: components["schemas"]["SkippedAttachmentReason"]; - /** - * Size Bytes - * @description Decoded size in bytes. - */ - size_bytes: number | null; - }; - /** SolutionSourceConnectionResponse */ - SolutionSourceConnectionResponse: { - /** - * Id - * Format: uuid - */ - id: string; - /** Name */ - name: string; - }; - /** - * SolutionSummaryResponse - * @description Response model for solution summary. - */ - SolutionSummaryResponse: { - /** - * Agent Count - * @description Number of linked agents. - */ - agent_count: number; - /** - * Created At - * @description Timestamp when the solution was created. - */ - created_at: string; - /** - * Description - * @description Description of the solution. - */ - description: string; - /** - * Id - * Format: uuid - * @description Unique identifier for the solution. - */ - id: string; - /** - * Knowledge Base Count - * @description Number of linked knowledge bases. - */ - knowledge_base_count: number; - /** - * Memory Bank Count - * @description Number of linked memory banks. - */ - memory_bank_count: number; - /** - * Name - * @description Name of the solution. - */ - name: string; - /** - * Source Connection Count - * @description Number of linked source connections. - */ - source_connection_count: number; - /** - * Updated At - * @description Timestamp when the solution was last updated. - */ - updated_at: string; - }; - /** - * SourceConnectionResponseModel - * @description Nested source connection summary within a knowledge base response. - */ - SourceConnectionResponseModel: { - /** - * Id - * @description Source connection identifier. - */ - id: string; - /** - * Name - * @description Source connection name. - */ - name: string; - /** - * Polling - * @description Polling configuration. - */ - polling?: string | null; - /** - * Source Type - * @description Type of source (rss, website, etc.). - */ - source_type: string; - /** - * Url - * @description Source URL. - */ - url: string; - }; - /** - * SourceContentStatusListResponse - * @description Response model for a paginated per-item indexing status list. - */ - SourceContentStatusListResponse: { - /** Data */ - data: components["schemas"]["SourceContentStatusResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * SourceContentStatusResponse - * @description Response model for one content item's indexing status. - */ - SourceContentStatusResponse: { - /** - * Awaiting Reindex - * @description True when the item is linked and reports completed but its content is not yet embedded under the index the source connection currently uses, because it still sits under the index that connection used before an embedding migration switched it. Anything ingested while a migration ran can land in this state. Semantic and content search will not match it until it is re-embedded; a title keyword match can still return it, so the item may appear in results while its body is unsearchable. It clears on its own — a reconciliation pass re-embeds the item under the current index, typically within minutes of the migration finishing, and a daily sweep retries whatever is still outstanding, so a large backlog can take more than one sweep to drain. The re-embedding is not charged to your account: nothing you did caused it, so Seclai absorbs the cost. Never true for an item that is simply still indexing; content_status covers that. - * @default false - */ - awaiting_reindex: boolean; - /** - * Content Status - * @description Indexing status: pending, fetching, transcribing, scanning, indexing, completed, or failed. - */ - content_status: string; - /** - * Content Token Count - * @description Extracted token count. - */ - content_token_count: number | null; - /** - * Content Type - * @description Content type group: text, audio, video, image, or document. - */ - content_type: string; - /** - * Content Url - * @description Internal URL identifying the item. Uploaded files use a `file-upload://` URL. - */ - content_url: string | null; - /** - * Content Version Id - * @description ID of the content version. This is the `content_version_id` returned by the upload endpoints, so it is what you match an upload against. - */ - content_version_id: string; - /** - * Content Word Count - * @description Extracted word count. - */ - content_word_count: number | null; - /** - * Error - * @description Why the item failed, when `content_status` is `failed`. - */ - error: string | null; - /** - * Extracted Media Capped - * @description True when extraction stopped with media still unread, so the item references more media than was attached and media search will not match anything past the cut. The cause is a web page that ran out of the budget for fetching remote assets or listed more media than is recorded, or a web page or document that could not be read to the end. - * @default false - */ - extracted_media_capped: boolean; - /** - * Extracted Media Count - * @description Number of images / videos in this web page's main content, or of images inside this PDF or Office document, that were attached to the item on this source; a file over the per-file size limit, listed as a failed attachment, is not counted. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container or this source's settings, or found nothing. Treat null as 'unknown', never as zero. - */ - extracted_media_count?: number | null; - /** - * Extracted Media Limit - * @description The bound that was reached, when extracted_media_capped is true and the stop was a bound — a number of fetch attempts, of seconds, of bytes, or of media listed. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired. - */ - extracted_media_limit?: number | null; - /** - * Held For Review - * @description An ENFORCE governance policy blocked this item at import. It is held for review and is not retrievable: resolving its blocking evaluations releases it into the source, and it is purged when the hold window ends. - * @default false - */ - held_for_review: boolean; - /** - * Indexed At - * @description Timestamp when the item finished indexing and became retrievable. `null` until then. - */ - indexed_at: string | null; - /** - * Mime Type - * @description MIME type the item was ingested as, when known. - */ - mime_type: string | null; - /** - * Published At - * @description Publication timestamp of the item, when known. - */ - published_at: string | null; - /** - * Pulled At - * @description Timestamp when the item was uploaded or pulled. - */ - pulled_at: string; - /** - * Source Connection Content Version Id - * @description ID to pass to `GET /contents/{id}`. `null` until the item has finished indexing — an item that is still processing, or that failed, has no retrievable content and keeps this `null`. - */ - source_connection_content_version_id: string | null; - /** - * Title - * @description Title of the content item. - */ - title: string | null; - }; - /** - * SourceEmbeddingMigrationResponse - * @description Response model for source embedding migration status. - */ - SourceEmbeddingMigrationResponse: { - /** Completed At */ - completed_at: string | null; - /** Created At */ - created_at: string; - /** Failure Message */ - failure_message: string | null; - /** Id */ - id: string; - /** Notification Recipients */ - notification_recipients: string[] | null; - /** Phase */ - phase: string; - /** Progress Current */ - progress_current: number; - /** Progress Message */ - progress_message: string | null; - /** Progress Total */ - progress_total: number; - /** Source Connection Id */ - source_connection_id: string; - /** Source Id New */ - source_id_new: string; - /** Source Id Old */ - source_id_old: string; - /** Started At */ - started_at: string | null; - /** Status */ - status: string; - /** Target Dimensions */ - target_dimensions: number; - /** Target Embedding Model */ - target_embedding_model: string; - /** Task Execution Id */ - task_execution_id: string | null; - /** Updated At */ - updated_at: string; - }; - /** - * SourceIndexMode - * @description Embedding quality / cost trade-off preset for custom_index sources. - * - * Each preset controls the default embedding dimensions, chunk size, and - * chunk overlap. The embedding model is always the account-level default - * (currently ``AWS_BEDROCK_AMAZON_NOVA_2_MULTIMODAL``). - * - * Presets: - * FAST_AND_CHEAP: 256 dimensions, 3 000 char chunks, 500 char overlap. - * BALANCED: 384 dimensions, 1 500 char chunks, 300 char overlap. - * SLOW_AND_THOROUGH: 1 024 dimensions, 1 000 char chunks, 200 char overlap. - * CUSTOM: Caller supplies embedding model, dimensions, and chunk config. - * @enum {string} - */ - SourceIndexMode: "fast_and_cheap" | "balanced" | "slow_and_thorough" | "custom"; - /** - * SourceResponse - * @description Response model for source data. - */ - SourceResponse: { - /** - * Account Id - * Format: uuid - * @description Account ID associated with the source. - */ - account_id: string; - /** - * Avg Episodes Per Month - * @description Average number of episodes per month. - */ - avg_episodes_per_month?: number | null; - /** - * Avg Words Per Episode - * @description Average number of words per episode. - */ - avg_words_per_episode?: number | null; - /** - * Chunk Language - * @description Language used for chunking content. - */ - chunk_language?: string | null; - /** - * Chunk Overlap - * @description Chunk overlap for content processing. - */ - chunk_overlap?: number | null; - /** - * Chunk Regex Separators - * @description Indicates if chunk separators are regex patterns. - */ - chunk_regex_separators?: boolean | null; - /** - * Chunk Separators - * @description Chunk separators used for content processing. - */ - chunk_separators?: string | null; - /** - * Chunk Size - * @description Chunk size for content processing. - */ - chunk_size?: number | null; - /** - * Cloud Drive Connection Id - * @description For a cloud_drive source: the id of the connected drive it indexes. Null for every other source type. - */ - cloud_drive_connection_id?: string | null; - /** - * Cloud Drive Content Types - * @description For a cloud_drive source: the comma-separated MIME types a file must have to be indexed. Null when there is no filter. - */ - cloud_drive_content_types?: string | null; - /** - * Cloud Drive Folder Path - * @description For a cloud_drive source: the folder it indexes. Null when it indexes the connected drive's own folder. - */ - cloud_drive_folder_path?: string | null; - /** - * Cloud Drive Max File Mb - * @description For a cloud_drive source: the size in megabytes above which a file is skipped. Null when the source sets no limit of its own. - */ - cloud_drive_max_file_mb?: number | null; - /** - * Cloud Drive Path Pattern - * @description For a cloud_drive source: the glob a file's path must match to be indexed. Null when there is none. - */ - cloud_drive_path_pattern?: string | null; - /** - * Content Count - * @description Number of content items associated with the source connection. - * @default 0 - */ - content_count: number; - /** - * Content Filter - * @description Content filter for the source connection. - */ - content_filter: string; - /** - * Created At - * @description Timestamp when the source connection was created. - */ - created_at: string; - /** - * Dimensions - * @description Dimensions of the embedding model. - */ - dimensions?: number | null; - /** - * Document Images - * @description Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to the item and indexed; on a source that follows no web pages and has a text-only embedder, by the text in each image. Applies to documents added after it changes. On a website or RSS source it reports whether `media_types` holds 'images', and the images are attached only when the source's embedder indexes images. - * @default true - */ - document_images: boolean; - /** - * Email Address - * @description For an email source: the address to send mail to. Null for every other source type. - */ - email_address?: string | null; - /** - * Email Allowed Senders - * @description For an email source: the addresses and domains whose mail is stored. Null for every other source type. - */ - email_allowed_senders?: string[] | null; - /** - * Embedding Model - * @description Embedding model used for the source connection. - */ - embedding_model?: string | null; - /** - * Embedding Model Type - * @description Type of the embedding model. - */ - embedding_model_type?: string | null; - /** - * Feed Attachments - * @description Kinds of file listed beside a feed item's content that an RSS source attaches to the item and indexes (subset of ['enclosures', 'item_image', 'media_rss']). - */ - feed_attachments?: string[]; - /** - * Free Retention Days - * @description Number of days content is stored for free before billing applies. - */ - free_retention_days?: number | null; - /** - * Has Historical Data - * @description Indicates if the source connection has historical data. - * @default false - */ - has_historical_data: boolean; - /** - * Id - * @description Unique identifier for the source connection. - */ - id: string; - /** @description Index mode for custom_index sources: fast_and_cheap, balanced, slow_and_thorough, or custom. */ - index_mode?: components["schemas"]["SourceIndexMode"] | null; - /** - * Media Types - * @description Media kinds in a web page's main content that are attached to the page's item and indexed (subset of ['images', 'video']). On a website or RSS source 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files. - */ - media_types?: string[]; - /** - * Name - * @description Name of the source connection. - */ - name: string; - /** - * Next Poll At - * @description Timestamp for the next scheduled poll. - */ - next_poll_at: string | null; - /** - * Polling - * @description Polling configuration for the source connection. - */ - polling: string | null; - /** - * Polling Action - * @description Polling action for the source connection. - */ - polling_action: string | null; - /** - * Polling Max Items - * @description The most new feed items a scheduled poll takes. Read for RSS feeds only. - */ - polling_max_items: number | null; - /** - * Pulled At - * @description Timestamp when content was last pulled. - */ - pulled_at: string | null; - /** - * Readonly - * @description Indicates if the source connection is read-only. - * @default false - */ - readonly: boolean; - /** - * Retention - * @description Retention period for the source connection. - */ - retention: number | null; - /** - * Source Type - * @description Type of the source connection. - */ - source_type: string; - /** - * System Managed - * @description Indicates if this source is automatically managed by the system (e.g., agent traces). - * @default false - */ - system_managed: boolean; - /** - * Updated At - * @description Timestamp when the source connection was last updated. - */ - updated_at: string; - /** - * Url - * @description URL of the source connection. - */ - url: string | null; - }; - /** - * StandaloneTestCompactionRequest - * @description Request body for testing a compaction prompt *without* an existing bank. - * - * Used on the create-memory-bank page where no bank ID exists yet. - * ``compaction_prompt`` is required (no bank to fall back to). - * Content must come from ``sample_entries`` or ``generate_direction`` - * (no existing entries to fetch). - */ - StandaloneTestCompactionRequest: { - /** - * Bank Type - * @description Memory bank type ('conversation' or 'general') — controls the style of generated entries. - * @default conversation - */ - bank_type: string; - /** - * Compaction Prompt - * @description Compaction prompt to test. - */ - compaction_prompt: string; - /** - * Entry Count - * @description Number of entries to generate when using generate_direction. - * @default 5 - */ - entry_count: number; - /** - * Generate Direction - * @description Direction for the LLM to generate sample entries. - */ - generate_direction?: string | null; - /** - * Sample Entries - * @description Explicit sample entries to compact. - */ - sample_entries?: string[] | null; - }; - /** - * StartSourceEmbeddingMigrationRequest - * @description Request payload to start a source embedding migration. - */ - StartSourceEmbeddingMigrationRequest: { - /** - * Chunk Language - * @description Language-specific chunking language code - */ - chunk_language?: string | null; - /** - * Chunk Overlap - * @description Override chunk overlap (characters) - */ - chunk_overlap?: number | null; - /** - * Chunk Regex Separators - * @description Whether chunk separators are regex patterns - */ - chunk_regex_separators?: boolean | null; - /** - * Chunk Separators - * @description Custom chunk separators (JSON-encoded list) - */ - chunk_separators?: string | null; - /** - * Chunk Size - * @description Override chunk size (characters per chunk) - */ - chunk_size?: number | null; - /** - * Notification Recipients - * @description Optional notification recipient emails - */ - notification_recipients?: string[] | null; - /** - * Target Dimensions - * @description Target embedding dimensions - */ - target_dimensions: number; - /** - * Target Embedding Model - * @description Target embedding model — a `model_type` from `GET /models/embedders`, which also reports the `dimensions` each embedder supports and the modalities it can index. - */ - target_embedding_model: string; - }; - /** - * TestCompactionRequest - * @description Request body for testing a compaction prompt against an existing bank. - * - * The user may supply a ``compaction_prompt`` to override (or provide when - * the bank has none). Content can come from three sources: - * - * 1. Existing entries in the bank (default when neither field is set). - * 2. ``sample_entries`` – caller-provided list of strings. - * 3. ``generate_direction`` – an instruction to the LLM to generate sample - * memory entries. Useful for trying a prompt before any real data - * exists. - * - * At most one of ``sample_entries`` / ``generate_direction`` may be given. - */ - TestCompactionRequest: { - /** - * Compaction Prompt - * @description Compaction prompt to test. Falls back to the bank's current prompt when omitted. - */ - compaction_prompt?: string | null; - /** - * Entry Count - * @description Number of entries to generate when using generate_direction. - * @default 5 - */ - entry_count: number; - /** - * Generate Direction - * @description Direction for the LLM to generate sample entries (e.g. 'Generate 5 entries about a customer support interaction'). - */ - generate_direction?: string | null; - /** - * Sample Entries - * @description Explicit sample entries to compact. - */ - sample_entries?: string[] | null; - }; - /** - * TestDraftEvaluationRequest - * @description Request body for ephemeral (non-persisted) evaluation testing. - * - * Provide either ``step_output`` (raw text) **or** ``agent_step_run_id`` - * (to load output from storage). Exactly one must be supplied. - */ - TestDraftEvaluationRequest: { - /** - * Agent Input - * @description The original agent run input for context. When agent_step_run_id is supplied this is loaded automatically from the parent run if omitted. - */ - agent_input?: string | null; - /** - * Agent Step Run Id - * @description Load step output from this completed step run instead of supplying text. - */ - agent_step_run_id?: string | null; - /** Evaluation Prompt */ - evaluation_prompt?: string | null; - evaluation_tier?: components["schemas"]["AgentEvaluationTier"] | null; - /** Expectation Config */ - expectation_config?: { - [key: string]: unknown; - } | null; - /** - * Pass Threshold - * @default 0.5 - */ - pass_threshold: number; - /** - * Step Output - * @description The step output text to evaluate. Omit if agent_step_run_id is supplied. - */ - step_output?: string | null; - }; - /** - * TestDraftEvaluationResponse - * @description Response for an ephemeral evaluation test. - */ - TestDraftEvaluationResponse: { - /** Explanation */ - explanation: string | null; - /** Passed */ - passed: boolean; - /** Score */ - score: number; - /** @description `passed`, `failed`, or `error` when the evaluator returned no verdict. */ - status: components["schemas"]["EvaluationStatus"]; - }; - /** UnlinkResourcesRequest */ - UnlinkResourcesRequest: { - /** - * Ids - * @description Resource IDs to unlink - */ - ids: string[]; - }; - /** UnreadCountResponse */ - UnreadCountResponse: { - /** Count */ - count: number; - }; - /** UpdateAgentDefinitionRequest */ - UpdateAgentDefinitionRequest: { - /** - * Accepted Attachments - * @description When given, declared on the main branch's file-taking triggers in the same save, so the steps may read its slots as `{{agent.attachments.}}`; omitted, the triggers keep theirs. - */ - accepted_attachments?: components["schemas"]["AcceptedAttachmentSlot"][] | null; - /** - * Definition - * @description The full agent definition (name, description, tags, steps). Steps form a tree workflow. Each step has a `step_type`, `id`, `name`, and type-specific config. Content enrichment steps (write_metadata, write_content_attachment, load_content_attachment, load_content) require content-triggered agents. - */ - definition: { - [key: string]: unknown; - }; - /** - * Expected Change Id - * @description The change_id from the last GET, for optimistic locking. - */ - expected_change_id: string; - }; - /** UpdateAlertConfigRequest */ - UpdateAlertConfigRequest: { - /** - * Cooldown Minutes - * @description Cooldown period in minutes - */ - cooldown_minutes?: number | null; - /** - * Distribution Type - * @description Distribution type - */ - distribution_type?: string | null; - /** - * Enabled - * @description Whether the alert config is enabled - */ - enabled?: boolean | null; - /** - * Recipient User Ids - * @description User IDs for selected_members distribution - */ - recipient_user_ids?: string[] | null; - /** - * Threshold - * @description Threshold configuration - */ - threshold?: { - [key: string]: unknown; - } | null; - }; - /** UpdateApiVersionRequest */ - UpdateApiVersionRequest: { - /** - * Version - * @description A YYYY-MM-DD date to pin the account to, or null to clear the pin (revert to the default baseline). - */ - version?: string | null; - }; - /** - * UpdateEvaluationCriteriaRequest - * @description Request body for updating an evaluation criteria. - * - * Retry settings and sample frequency are set at the agent level. - */ - UpdateEvaluationCriteriaRequest: { - /** Description */ - description?: string | null; - /** Enabled */ - enabled?: boolean | null; - /** Evaluation Prompt */ - evaluation_prompt?: string | null; - evaluation_tier?: components["schemas"]["AgentEvaluationTier"] | null; - /** Expectation Config */ - expectation_config?: { - [key: string]: unknown; - } | null; - /** Pass Threshold */ - pass_threshold?: number | null; - /** Step Id */ - step_id?: string | null; - }; - /** - * UpdateKnowledgeBaseBody - * @description Request body for updating a knowledge base. - */ - UpdateKnowledgeBaseBody: { - /** - * Default Score Threshold - * @description Prefilled into Minimum Rerank Score on a new retrieval step (-1 to clear). - */ - default_score_threshold?: number | null; - /** - * Default Top K - * @description Prefilled into Top K on a new retrieval step (0 to clear). - */ - default_top_k?: number | null; - /** - * Default Top N - * @description Prefilled into Top N on a new retrieval step (0 to clear). - */ - default_top_n?: number | null; - /** - * Description - * @description New description. - */ - description?: string | null; - /** - * Name - * @description New name. - */ - name?: string | null; - /** - * Reranker Model - * @description New reranker model — a `model_type` from `GET /models/rerankers`. Pass "none" to turn reranking off (not a value from that list). Omitting the field (or sending null) leaves the current reranker in place — it does NOT turn it off. "" is accepted as a synonym for "none", but prefer "none": an empty string does not survive every client's serialization. - */ - reranker_model?: string | null; - /** - * Source Ids - * @description New list of source connection IDs. - */ - source_ids?: string[] | null; - }; - /** - * UpdateMemoryBankBody - * @description Request body for updating a memory bank. - * - * Omitted fields are left unchanged. To **clear** a field back to null, - * send a zero-value sentinel: ``0`` for integers, ``""`` for strings. - */ - UpdateMemoryBankBody: { - /** - * Compaction Prompt - * @description Custom prompt used when compacting older entries. When set, entries that exceed a threshold are summarized into a new entry before being soft-deleted. Send empty string "" to clear and disable summarisation. - */ - compaction_prompt?: string | null; - /** - * Description - * @description Optional description. Send empty string "" to clear. - */ - description?: string | null; - /** - * Max Age Days - * @description DEPRECATED and no longer applied. Age now belongs solely to retention_days, which deletes; compaction triggers on max_size_tokens and max_turns. Rejected with 400 for clients sending Seclai-Version 2026-08-03 or later, except 0, which clears a value stored earlier. Accepted and stored but inert for older clients. - */ - max_age_days?: number | null; - /** - * Max Size Tokens - * @description Max total tokens (per partition) before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable. - */ - max_size_tokens?: number | null; - /** - * Max Turns - * @description Max conversation turns (per partition) before compaction. Checked inline after each write and by the hourly background sweep. Send 0 to disable. - */ - max_turns?: number | null; - /** - * Name - * @description New name. - */ - name?: string | null; - /** - * Retention Days - * @description Content source retention in days. Send 0 to clear (indefinite). - */ - retention_days?: number | null; - /** - * Strip Quoted Reply Chains - * @description Conversation banks only. When true, a conversation turn written to this bank has the quoted reply chain an email client prepends to a reply dropped from it. Only inbound (user) turns are affected, and only words in a run of at least ~40 matching a recent turn word for word are dropped (line wrapping and punctuation at a word's edge are ignored). A word the sender changed is kept, including a one-character change inside a link, address or amount, unless the change is only to that edge punctuation. - */ - strip_quoted_reply_chains?: boolean | null; - }; - /** - * UpdateSolutionRequest - * @description Request model for updating a solution - */ - UpdateSolutionRequest: { - /** - * Description - * @description Description of the solution - */ - description?: string | null; - /** - * Name - * @description Name of the solution - */ - name?: string | null; - }; - /** - * UpdateSourceBody - * @description Request body for updating a content source. - */ - UpdateSourceBody: { - /** - * Cloud Drive Content Types - * @description For a cloud_drive source: comma-separated MIME types a file must have to be indexed. Send an empty string to clear it; omit to leave it unchanged. - */ - cloud_drive_content_types?: string | null; - /** - * Cloud Drive Folder Path - * @description For a cloud_drive source: the folder to index, as a path inside the drive. Send an empty string to index the connected drive's own folder; omit to leave it unchanged. - */ - cloud_drive_folder_path?: string | null; - /** - * Cloud Drive Max File Mb - * @description For a cloud_drive source: files larger than this many megabytes are skipped. Send 0 to clear the source's own limit; omit to leave it unchanged. - */ - cloud_drive_max_file_mb?: number | null; - /** - * Cloud Drive Path Pattern - * @description For a cloud_drive source: a glob a file's path must match to be indexed, such as `**\/*.pdf` or `/reports/*`. Send an empty string to clear it; omit to leave it unchanged. - */ - cloud_drive_path_pattern?: string | null; - /** - * Document Images - * @description Whether the images inside PDF, DOCX, PPTX and XLSX files are attached to the item and indexed; on a text-only embedder, by the text in each image. Applies to documents added after it changes. Omit the field to leave it unchanged. On a website or RSS source it is ignored: `media_types` decides. - */ - document_images?: boolean | null; - /** - * Email Allowed Senders - * @description For an email source: replaces the allowed senders. Each entry is a full address or a bare domain. The list cannot be emptied. Omit to leave it unchanged. - */ - email_allowed_senders?: string[] | null; - /** - * Feed Attachments - * @description Kinds of file listed beside a feed item's content to attach to the item and index, on an RSS source. Subset of ['enclosures', 'item_image', 'media_rss']; any other value is refused. [] attaches none. Applies to items added after it changes. Omit the field to leave it unchanged. - */ - feed_attachments?: string[] | null; - /** - * Media Types - * @description Media kinds in a web page's main content to attach to the page's item and index, on a website or RSS source. Subset of ['images', 'video']. From `Seclai-Version: 2026-10-13` any other value, and any kind on another source type, is refused with a 400; older versions drop an unknown value and store the rest. A kind the source's embedder cannot index is stored and not indexed (see `supported_input_media` on GET /models/embedders). [] attaches no media from web pages. 'images' also covers the images inside PDF, DOCX, PPTX and XLSX files. Applies to pages and documents added after it changes. - */ - media_types?: string[] | null; - /** - * Name - * @description New name. - */ - name?: string | null; - /** - * Polling - * @description New polling interval. - */ - polling?: string | null; - /** - * Retention Days - * @description New retention period in days — content older than this is deleted permanently. Send null to clear the window: content is then kept indefinitely. Omit the field to leave it unchanged. - */ - retention_days?: number | null; - }; - /** UploadAgentInputApiResponse */ - UploadAgentInputApiResponse: { - /** - * Content Type - * @description Resolved MIME type. - */ - content_type: string; - /** - * Error - * @description Error message if status is failed. - */ - error?: string | null; - /** - * File Size - * @description Size in bytes. - */ - file_size: number; - /** - * Filename - * @description Original filename. - */ - filename: string; - /** - * Id - * @description Unique identifier for the upload. - */ - id: string; - /** - * Status - * @description processing, ready, or failed. - */ - status: string; - }; - /** ValidationError */ - ValidationError: { - /** Location */ - loc: (string | number)[]; - /** Message */ - msg: string; - /** Error Type */ - type: string; - }; - /** - * VariantCategoryResponse - * @description Response model for a variant category - */ - VariantCategoryResponse: { - /** Category */ - category: string; - /** Configurable */ - configurable: boolean; - /** Description */ - description: string; - /** Options */ - options: components["schemas"]["VariantOptionResponse"][]; - /** Title */ - title: string; - }; - /** - * VariantOptionResponse - * @description Response model for a variant option - */ - VariantOptionResponse: { - /** Default */ - default: boolean; - /** Description */ - description?: string | null; - /** - * Input 1H Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 1-hour prompt cache. - */ - input_1h_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input 30M Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 30-minute prompt cache. - */ - input_30m_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input 5M Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 5-minute prompt cache. - */ - input_5m_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input Cache Hit Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens read from a prompt cache. - */ - input_cache_hit_credits_per_1000_tokens?: number | null; - /** Input Credits Per 1000 Tokens */ - input_credits_per_1000_tokens?: number | null; - /** - * Long Context Input Cache Hit Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens read from a prompt cache, on a call whose input exceeds `long_context_threshold` tokens. - */ - long_context_input_cache_hit_credits_per_1000_tokens?: number | null; - /** Long Context Input Credits Per 1000 Tokens */ - long_context_input_credits_per_1000_tokens?: number | null; - /** Long Context Output Credits Per 1000 Tokens */ - long_context_output_credits_per_1000_tokens?: number | null; - /** Long Context Threshold */ - long_context_threshold?: number | null; - /** Output Credits Per 1000 Tokens */ - output_credits_per_1000_tokens?: number | null; - /** Title */ - title: string; - /** Value */ - value: string; - }; - /** - * AgentImportPreviewRequest - * @description Dry-run import request — same payload shape as the export endpoint. - */ - routers__api__agents__AgentImportPreviewRequest: { - /** - * Agent Definition - * @description Payload in the same shape as GET /agents/{agent_id}/export. - */ - agent_definition: { - [key: string]: unknown; - }; - }; - /** - * AgentImportPreviewResponse - * @description Summary of a successfully validated import payload (no DB writes). - * - * Counts are derived from the validated payload as supplied — they - * reflect what was requested, not what would eventually be persisted - * (cross-account skips for recipients and KB names happen later, only - * on commit). - */ - routers__api__agents__AgentImportPreviewResponse: { - /** - * Agent Name - * @description Imported agent name, if any. - */ - agent_name: string | null; - /** - * Alert Configs - * @description Number of alert configs in the payload. - */ - alert_configs: number; - /** - * Description - * @description Imported agent description, if any. - */ - description: string | null; - /** - * Evaluation Criteria - * @description Number of evaluation criteria in the payload. - */ - evaluation_criteria: number; - /** - * Governance Policies - * @description Number of agent-scoped governance policies in the payload. - */ - governance_policies: number; - /** - * Ok - * @description Always true on a 200 response; failures use HTTP 422. - */ - ok: boolean; - /** - * Payload Export Version - * @description Export-format version the payload claims (or ``null`` for legacy payloads). When this differs from ``supported_export_version``, fields may have been silently dropped or defaulted on import. - */ - payload_export_version?: string | null; - /** - * Schedules - * @description Number of trigger schedules in the payload. - */ - schedules: number; - /** - * Solutions - * @description Number of solutions the source agent belonged to. On import these are matched by name in the target account; unmatched names are silently skipped. - * @default 0 - */ - solutions: number; - /** - * Step Count - * @description Total number of steps in the workflow tree (recursive). - */ - step_count: number; - /** - * Supported Export Version - * @description Export-format version this server understands. Compare against ``payload_export_version`` to detect cross-version imports. - * @default 2 - */ - supported_export_version: string; - /** - * Unresolved Refs - * @description Entity references in the imported workflow that don't exist in the target account. Each entry: {category, ref_id, ref_name?, locations:[step:], alternatives:[{id, name, description?}]}. Pass {source_uuid: target_uuid} as ``entity_remap`` on the create/update call to substitute these references before save. - */ - unresolved_refs?: { - [key: string]: unknown; - }[]; - }; - /** AgentListResponse */ - routers__api__agents__AgentListResponse: { - /** - * Data - * @description List of agents. - */ - data: components["schemas"]["AgentSummaryResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** AgentRunListResponse */ - routers__api__agents__AgentRunListResponse: { - /** - * Data - * @description List of agent runs. - */ - data: components["schemas"]["AgentRunResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** AgentTraceSearchRequest */ - routers__api__agents__AgentTraceSearchRequest: { - /** - * Agent Id - * @description Filter by agent ID. - */ - agent_id?: string | null; - /** - * Query - * @description Search query text. - */ - query: string; - /** - * Run Status - * @description Filter by run status. - */ - run_status?: string | null; - /** - * Step Type - * @description Filter by step type. - */ - step_type?: string | null; - /** - * Top N - * @description Maximum number of results. - * @default 10 - */ - top_n: number; - }; - /** CreateAgentRequest */ - routers__api__agents__CreateAgentRequest: { - /** - * Accepted Attachments - * @description The input attachments the trigger accepts. Omitted, the ``agent_definition`` trigger's declaration is kept when the export carries one and both trigger types take files; otherwise a dynamic_input or email_received trigger accepts any files (one attachment named ``files``), and any other trigger none. - */ - accepted_attachments?: components["schemas"]["AcceptedAttachmentSlot"][] | null; - /** - * Agent Definition - * @description Optional payload in the same format produced by GET /agents/{id}/export. When provided, replaces any template-derived workflow and pre-fills metadata/trigger fields the request does not specify explicitly. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload. - */ - agent_definition?: { - [key: string]: unknown; - } | null; - /** - * Agent Template - * @description Template to initialize the agent from. Values: blank, retrieval_example, simple_qa, summarizer, json_extractor, content_change_notifier, scheduled_report, webhook_pipeline. - */ - agent_template?: string | null; - /** - * Description - * @description Optional description. - */ - description?: string | null; - /** - * Entity Remap - * @description Optional UUID-substitution map applied to the imported workflow before save. Each key is a source-account UUID (as returned by /agents/preview-import's ``unresolved_refs``); each value is the target-account UUID to substitute. Used to relink knowledge bases, memory banks, source connections, and sub-agents on cross-account imports. - */ - entity_remap?: { - [key: string]: string; - } | null; - /** - * Name - * @description Name for the new agent. - */ - name: string; - /** - * Trigger Type - * @description Trigger type: dynamic_input, template_input, schedule, new_content, email_received. - * @default dynamic_input - */ - trigger_type: string; - }; - /** - * GovernancePolicyRefResponse - * @description Reference to a governance policy by id and name. - */ - routers__api__agents__GovernancePolicyRefResponse: { - /** - * Policy Id - * @description Governance policy identifier. - */ - policy_id: string; - /** - * Policy Name - * @description Display name of the policy at evaluation time. May be null when the policy has been deleted. - */ - policy_name?: string | null; - }; - /** - * SetEmailTriggerConfigRequest - * @description Alias and/or sender allowlist for an EMAIL_RECEIVED trigger. - * - * A field omitted is left unchanged; passing ``null`` (or ``""`` for - * ``alias``) clears it. - */ - routers__api__agents__SetEmailTriggerConfigRequest: { - /** - * Alias - * @description Custom alias, unique per account, answering as `.@agent.seclai.com` and as `@` on each verified account email domain (alphanumeric plus '+', '.', '-'; 1–32 chars; not starting/ending with '+', '.', '-'; not UUID-shaped). Pass null/empty to clear. - */ - alias?: string | null; - /** - * Allowed Senders - * @description Allowlist of full sender addresses and/or bare domains (a bare domain also matches sub-domains). Empty/null accepts any sender. - */ - allowed_senders?: string[] | null; - /** - * Ignore Auto Generated - * @description When true (default for new triggers), machine-generated inbound mail (auto-replies, bulk/list mail, bounces) is dropped before a run to prevent auto-reply loops. Set false to process automated mail. - */ - ignore_auto_generated?: boolean | null; - /** - * Queue On Quota - * @description When true (default false), inbound mail that exceeds the account's hourly email-trigger rate is parked in a QUEUED run and drained later by the catch-up sweep instead of being failed; when false, over-rate mail fails immediately. - */ - queue_on_quota?: boolean | null; - /** - * Require Sender Auth - * @description When true (default for new triggers), the envelope sender must pass SPF or DMARC even on an open inbox (no allowlist); unauthenticated, spoofable mail is rejected. Set false to accept fully unauthenticated mail on an open inbox. - */ - require_sender_auth?: boolean | null; - /** - * Run On Attachment Mismatch - * @description When true (default false), an email whose attachments don't fit what the agent expects still runs: files the agent can't take are left out and the problems are listed in the `email_attachment_issues` run metadata. When false, the run fails. - */ - run_on_attachment_mismatch?: boolean | null; - }; - /** UpdateAgentRequest */ - routers__api__agents__UpdateAgentRequest: { - /** - * Agent Definition - * @description Optional payload in the same format produced by GET /agents/{id}/export. When provided, agent metadata fields the request does not set explicitly are taken from the payload, and the agent's workflow is replaced from `agent.definition`. The previous version is preserved in history. Validation errors include line/column references against a canonical pretty-printed echo of the supplied payload. - */ - agent_definition?: { - [key: string]: unknown; - } | null; - /** - * Default Evaluation Tier - * @description Default evaluation tier: 'fast', 'balanced', or 'thorough'. - */ - default_evaluation_tier?: string | null; - /** - * Description - * @description New description for the agent. - */ - description?: string | null; - /** - * Entity Remap - * @description Optional UUID-substitution map applied to the imported workflow before save (same shape as on POST /agents). - */ - entity_remap?: { - [key: string]: string; - } | null; - /** - * Evaluation Mode - * @description Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'. - */ - evaluation_mode?: string | null; - /** - * Max Retries - * @description Max retries for eval_and_retry mode (1-10). - */ - max_retries?: number | null; - /** - * Name - * @description New name for the agent. - */ - name?: string | null; - /** - * Prompt Model Auto Rollback Enabled - * @description Enable or disable automatic rollback for upgraded models. - */ - prompt_model_auto_rollback_enabled?: boolean | null; - /** - * Prompt Model Auto Rollback Triggers - * @description Failure signals that trigger rollback: agent_eval_fail, governance_flag, governance_block, agent_run_failed. - */ - prompt_model_auto_rollback_triggers?: string[] | null; - /** @description Auto-upgrade strategy: none, early_adopter, middle_of_road, cautious_adopter. */ - prompt_model_auto_upgrade_strategy?: components["schemas"]["PromptModelAutoUpgradeStrategy"] | null; - /** - * Retry On Failure - * @description Whether to retry on evaluation failure. - */ - retry_on_failure?: boolean | null; - /** - * Sampling Config - * @description Sampling configuration for sample_and_flag mode. Format: {combinator: 'and'|'or', rules: [...]}. - */ - sampling_config?: { - [key: string]: unknown; - } | null; - /** - * Set Default Evaluation Tier - * @description When true and default_evaluation_tier is omitted, clears the tier to null (system default). - * @default false - */ - set_default_evaluation_tier: boolean; - /** - * Set Prompt Model Auto Rollback Triggers - * @description When true and prompt_model_auto_rollback_triggers is omitted, clears the list to null (revert to system defaults). - * @default false - */ - set_prompt_model_auto_rollback_triggers: boolean; - /** - * Set Sampling Config - * @description When true and sampling_config is omitted, clears the config to null. - * @default false - */ - set_sampling_config: boolean; - }; - /** - * AiAssistantFeedbackRequest - * @description Request body for submitting AI assistant feedback. - */ - routers__api__ai_assistant__AiAssistantFeedbackRequest: { - /** - * Agent Conversation Id - * @description Agent conversation ID, if applicable. - */ - agent_conversation_id?: string | null; - /** - * Comment - * @description Optional comment. - */ - comment?: string | null; - /** - * Context - * @description Additional context. - */ - context?: { - [key: string]: unknown; - } | null; - /** - * Conversation Id - * @description Conversation ID for the interaction. - */ - conversation_id?: string | null; - /** - * Feature - * @description Feature name (e.g. 'source', 'solution'). - */ - feature: string; - /** - * Governance Conversation Id - * @description Governance conversation ID, if applicable. - */ - governance_conversation_id?: string | null; - /** - * Prompt Call Id - * @description Prompt call ID for credit tracking. - */ - prompt_call_id?: string | null; - /** - * Rating - * @description Rating: 'thumbs_up' or 'thumbs_down'. - */ - rating: string; - }; - /** AddCommentRequest */ - routers__api__alerts__AddCommentRequest: { - /** - * Body - * @description Comment text - */ - body: string; - }; - /** AlertCommentResponse */ - routers__api__alerts__AlertCommentResponse: { - /** Body */ - body: string; - /** Created At */ - created_at: string | null; - /** Id */ - id: string; - /** User Id */ - user_id: string; - /** User Name */ - user_name: string | null; - }; - /** AlertDetailResponse */ - routers__api__alerts__AlertDetailResponse: { - alert: components["schemas"]["routers__api__alerts__AlertResponse"]; - /** Comments */ - comments: components["schemas"]["routers__api__alerts__AlertCommentResponse"][]; - /** History */ - history: components["schemas"]["AlertHistoryEntryResponse"][]; - /** Subscribers */ - subscribers: components["schemas"]["routers__api__alerts__AlertSubscriberResponse"][]; - }; - /** - * AlertListResponse - * @description ``GET /alerts`` — always the canonical ``{data, pagination}`` envelope. - */ - routers__api__alerts__AlertListResponse: { - /** Data */ - data: components["schemas"]["routers__api__alerts__AlertResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** AlertResponse */ - routers__api__alerts__AlertResponse: { - /** Account Id */ - account_id: string; - /** Agent Id */ - agent_id: string | null; - /** Agent Run Id */ - agent_run_id: string | null; - /** Alert Config Id */ - alert_config_id: string | null; - /** Alert Type */ - alert_type: string; - /** Comment Count */ - comment_count: number; - /** Created At */ - created_at: string | null; - /** Description */ - description: string | null; - /** Details */ - details?: unknown; - /** Id */ - id: string; - /** Is Subscribed */ - is_subscribed: boolean; - /** Mcp Client Id */ - mcp_client_id: string | null; - /** Source Connection Id */ - source_connection_id: string | null; - /** Source Connection Pull Id */ - source_connection_pull_id: string | null; - /** Status */ - status: string; - /** Subscriber Count */ - subscriber_count: number; - /** Title */ - title: string; - /** Updated At */ - updated_at: string | null; - }; - /** AlertSubscriberResponse */ - routers__api__alerts__AlertSubscriberResponse: { - /** Created At */ - created_at: string | null; - /** Id */ - id: string; - /** User Id */ - user_id: string; - /** User Name */ - user_name: string | null; - }; - /** OrganizationAlertPreferenceResponse */ - routers__api__alerts__OrganizationAlertPreferenceResponse: { - /** Alert Type */ - alert_type: string; - /** Is Override */ - is_override: boolean; - /** Organization Id */ - organization_id: string; - /** Subscribed */ - subscribed: boolean; - }; - /** UpdateOrganizationAlertPreferenceRequest */ - routers__api__alerts__UpdateOrganizationAlertPreferenceRequest: { - /** - * Subscribed - * @description Whether the user should receive this alert for the organization - */ - subscribed: boolean; - }; - /** - * ContentAttachmentDetailResponse - * @description One attached file, with the text indexed from it. - */ - routers__api__contents__ContentAttachmentDetailResponse: { - /** - * Content Type - * @description MIME type of the attached file. - */ - content_type: string; - /** - * Created At - * @description When the file was first attached. - */ - created_at: string; - /** - * File Withheld - * @description Why the file's bytes are not served, or null when they are: `blocked_by_governance_policy`, `redacted_by_governance_policy` (any text below is the redacted text), or `pending_screening`. - */ - file_withheld: string | null; - /** - * Id - * @description The attachment's id, which the single-attachment endpoints take. - */ - id: string; - /** - * Indexed - * @description Whether indexing the file for search was asked for. - */ - indexed: boolean; - /** - * Indexing Error - * @description Why the file was not indexed, when `indexing_status` is `failed`. - */ - indexing_error: string | null; - /** - * Indexing Status - * @description `pending`, `completed` or `failed`; null when indexing was not asked for. Search finds the file only when `completed`. - */ - indexing_status: string | null; - /** - * Key - * @description The attachment's key, unique within the item. - */ - key: string; - /** - * Metadata - * @description What is known about the file beyond its bytes. An image extracted from a PDF carries its `page_number`, and `page_render: true` when it is a render of the whole page. An image or video from a web page carries `source_url` (the address it was fetched from), `position` (its place among the media the page listed, from 0) and, when the page gave one, `alt_text`. Empty for most files. A retrieval metadata filter matches these keys, except `alt_text`, which is indexed as the attachment's text. - */ - metadata: { - [key: string]: unknown; - }; - /** - * Size Bytes - * @description Size of the attached file in bytes. - */ - size_bytes: number; - /** - * Text Content - * @description The requested range of the text the file is indexed by; null when the file has no completed index or was indexed without text. - */ - text_content: string | null; - /** Text Content End */ - text_content_end: number; - /** Text Content Start */ - text_content_start: number; - /** Text Content Total Length */ - text_content_total_length: number; - /** - * Updated At - * @description When the attachment last changed. - */ - updated_at: string; - }; - /** - * ContentAttachmentsListResponse - * @description Response model for a content item's attachments. - */ - routers__api__contents__ContentAttachmentsListResponse: { - /** Data */ - data: components["schemas"]["ContentAttachmentResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * ContentDetailResponse - * @description Response model for content detail. - */ - routers__api__contents__ContentDetailResponse: { - /** - * Content Duration - * @description Duration of the content in seconds. - */ - content_duration: number | null; - /** - * Content Duration Display - * @description Display string for content duration. - */ - content_duration_display: string | null; - /** - * Content Status - * @description Status of the content. - */ - content_status: string; - /** - * Content Type - * @description Type of the content. - */ - content_type: string; - /** - * Content Type Display - * @description Display name of the content type. - */ - content_type_display: string; - /** - * Content Url - * @description URL of the content. - */ - content_url: string; - /** - * Content Word Count - * @description Word count of the content. - */ - content_word_count: number | null; - /** - * Description - * @description Description of the content. - */ - description: string | null; - /** - * Error - * @description Error message, if any. - */ - error: string | null; - /** - * Extracted Media Capped - * @description True when extraction stopped with media still unread, so the item references more media than was attached and media search will not match anything past the cut. The cause is a web page that ran out of the budget for fetching remote assets or listed more media than is recorded, or a web page or document that could not be read to the end. - * @default false - */ - extracted_media_capped: boolean; - /** - * Extracted Media Count - * @description Number of images / videos in this web page's main content, or of images inside this PDF or Office document, that were attached to the item on this source; a file over the per-file size limit, listed as a failed attachment, is not counted. Null when there is no media record for the item: the extraction pass has not run, does not apply to this container or this source's settings, or found nothing. Treat null as 'unknown', never as zero. - */ - extracted_media_count?: number | null; - /** - * Extracted Media Limit - * @description The bound that was reached, when extracted_media_capped is true and the stop was a bound — a number of fetch attempts, of seconds, of bytes, or of media listed. Null when extraction was not capped, or when it stopped because the container could not be read rather than because a bound fired. - */ - extracted_media_limit?: number | null; - /** - * Id - * @description Unique identifier for the content version. - */ - id: string; - /** - * Metadata - * @description Metadata associated with the content. - */ - metadata: { - [key: string]: string; - }[] | null; - /** - * Published At - * @description Timestamp when the content was published. - */ - published_at: string | null; - /** - * Pulled At - * @description Timestamp when the content was pulled. - */ - pulled_at: string; - /** - * Skipped Attachments - * @description Parts of an email delivered to an email content source that were not stored as attachments of this item, each with the reason: displayed_in_body (an image the message body shows, such as a signature logo), over_cap (beyond the per-message attachment limit), no_filename, or undecodable. size_bytes is null for a part that was never decoded. Empty for every other item. - */ - skipped_attachments?: components["schemas"]["SkippedAttachmentResponse"][]; - /** - * Source Connection Content Version Id - * @description ID of the source connection content version. - */ - source_connection_content_version_id: string; - /** - * Source Connection Id - * @description ID of the source connection. - */ - source_connection_id: string; - /** - * Source Name - * @description Name of the source. - */ - source_name: string; - /** - * Source Type - * @description Type of the source. - */ - source_type: string; - /** - * Text Content - * @description Text content. - */ - text_content: string | null; - /** - * Text Content End - * @description End position of the text content. - */ - text_content_end: number; - /** - * Text Content Start - * @description Start position of the text content. - */ - text_content_start: number; - /** - * Text Content Total Length - * @description Total length of the text content. - */ - text_content_total_length: number; - /** - * Title - * @description Title of the content. - */ - title: string | null; - }; - /** - * ContentEmbeddingsListResponse - * @description Response model for paginated content embeddings. - */ - routers__api__contents__ContentEmbeddingsListResponse: { - /** Data */ - data: components["schemas"]["ContentEmbeddingResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * FileUploadResponse - * @description Response model for content file replacement upload. - */ - routers__api__contents__FileUploadResponse: { - /** - * Content Version Id - * @description ID of the newly created content version. A replacement creates a new version rather than overwriting the previous one. - */ - content_version_id: string | null; - /** - * Embedder Warning - * @description Set when the file's type is not embedded directly on this source, so indexing relies on extracted text. Content with none (e.g. a photograph) will be marked FAILED. - */ - embedder_warning?: string | null; - /** - * Filename - * @description Original filename - */ - filename: string; - /** - * Source Connection Content Version Id - * @description ID of the source connection content version. Unchanged by a replacement, so it stays a stable handle for the content. - */ - source_connection_content_version_id: string | null; - /** - * Status - * @description Always `uploaded`. Unlike the create endpoints, a replacement is never rejected as a duplicate of another item. - */ - status: string; - }; - /** - * DocsSearchResponse - * @description Ranked results, NOT a paginated collection — the ``{results}`` shape is a - * deliberate carve-out matching the MCP ``search_docs`` tool. - */ - routers__api__docs_search__DocsSearchResponse: { - /** Results */ - results: components["schemas"]["DocsSearchResultResponse"][]; - }; - /** - * GovernanceAiAssistantRequest - * @description Request body for the governance AI assistant. - */ - routers__api__governance__GovernanceAiAssistantRequest: { - /** - * User Input - * @description Natural-language request for the governance AI assistant. - */ - user_input: string; - }; - /** - * GovernanceConversationResponse - * @description A governance AI assistant conversation entry. - */ - routers__api__governance__GovernanceConversationResponse: { - /** - * Accepted - * @description True if accepted, false if declined, null if pending. - */ - accepted: boolean | null; - /** - * Ai Response - * @description The AI assistant's response note, or null. - */ - ai_response: string | null; - /** - * Created At - * @description ISO 8601 creation timestamp. - */ - created_at: string; - /** - * Id - * @description Conversation ID. - */ - id: string; - /** - * Proposed Actions - * @description JSON of proposed actions, or null. - */ - proposed_actions: { - [key: string]: unknown; - } | null; - /** - * User Input - * @description The original user request. - */ - user_input: string; - }; - /** - * MemoryBankAcceptRequest - * @description Accept or decline a memory bank AI suggestion. - */ - routers__api__memory_banks__MemoryBankAcceptRequest: { - /** - * Accepted - * @description Whether the user accepted the proposed configuration. - */ - accepted: boolean; - }; - /** - * MemoryBankAiAssistantRequest - * @description Request body for the memory bank AI assistant. - */ - routers__api__memory_banks__MemoryBankAiAssistantRequest: { - /** - * Current Config - * @description Current configuration to refine, if any. - */ - current_config?: { - [key: string]: unknown; - } | null; - /** - * History Since - * @description Optional ISO 8601 timestamp. When set, only conversation turns created at or after this timestamp are loaded as context, scoping history to the current session so the assistant remembers earlier turns in a multi-turn refinement. - */ - history_since?: string | null; - /** - * User Input - * @description Natural-language description of the memory bank. - */ - user_input: string; - }; - /** - * MemoryBankConversationTurnResponse - * @description A single turn of memory bank AI assistant conversation. - */ - routers__api__memory_banks__MemoryBankConversationTurnResponse: { - /** - * Accepted - * @description Whether the user accepted this proposal. - */ - accepted?: boolean | null; - /** - * Ai Note - * @description AI note from this turn. - */ - ai_note?: string | null; - /** - * Conversation Id - * @description Unique ID for this conversation turn. - */ - conversation_id: string; - /** - * Resulting Config - * @description The proposed configuration from this turn. - */ - resulting_config?: { - [key: string]: unknown; - } | null; - /** - * User Input - * @description User input for this turn. - */ - user_input: string; - }; - /** - * MemoryBankLastConversationResponse - * @description Response for fetching memory bank conversation history. - */ - routers__api__memory_banks__MemoryBankLastConversationResponse: { - /** - * Accepted - * @description Whether the user accepted the last proposal. - */ - accepted?: boolean | null; - /** - * Ai Note - * @description AI note from the most recent turn. - */ - ai_note?: string | null; - /** - * Total - * @description Total conversation turns. - * @default 0 - */ - total: number; - /** - * Turns - * @description Recent conversation turns (oldest first). - */ - turns?: components["schemas"]["routers__api__memory_banks__MemoryBankConversationTurnResponse"][]; - /** - * User Input - * @description Most recent user input. - */ - user_input?: string | null; - }; - /** - * ModelAlertListResponse - * @description ``GET /models/alerts`` legacy/default shape; 2026-07-27+ clients get the - * canonical ``{data, pagination}`` envelope (bypasses this ``response_model``). - */ - routers__api__model_lifecycle__ModelAlertListResponse: { - /** Alerts */ - alerts: components["schemas"]["routers__api__model_lifecycle__ModelAlertResponse"][]; - /** Total */ - total: number; - }; - /** ModelAlertResponse */ - routers__api__model_lifecycle__ModelAlertResponse: { - /** Account Id */ - account_id: string; - /** Agent Id */ - agent_id: string | null; - /** Alert Type */ - alert_type: string; - /** Created At */ - created_at: string; - /** Id */ - id: string; - /** Message */ - message: string; - /** Model Name */ - model_name: string; - /** Prompt Model Id */ - prompt_model_id: string; - /** Read At */ - read_at: string | null; - /** Successor Model Name */ - successor_model_name: string | null; - }; - /** ModelRecommendationResponse */ - routers__api__model_lifecycle__ModelRecommendationResponse: { - /** Deprecated At */ - deprecated_at?: string | null; - /** Description */ - description: string; - effort_options?: components["schemas"]["EffortOptionsResponse"] | null; - /** Family */ - family?: string | null; - /** Family Generation */ - family_generation?: number | null; - /** Id */ - id: string; - /** Max Context Tokens */ - max_context_tokens: number; - /** Max Output Tokens */ - max_output_tokens: number; - /** Model Id */ - model_id: string; - /** Name */ - name: string; - /** Provider */ - provider: string; - /** Reason */ - reason: string; - /** Recommendation Type */ - recommendation_type: string; - /** Released At */ - released_at?: string | null; - /** Sunset At */ - sunset_at?: string | null; - /** Supports Openai Arguments */ - supports_openai_arguments: boolean; - /** Supports Streaming */ - supports_streaming: boolean; - /** Supports Structured Output */ - supports_structured_output: boolean; - /** Supports Thinking */ - supports_thinking: boolean; - /** Supports Tool Use */ - supports_tool_use: boolean; - }; - /** ModelRecommendationsResponse */ - routers__api__model_lifecycle__ModelRecommendationsResponse: { - /** Alternatives */ - alternatives: components["schemas"]["routers__api__model_lifecycle__ModelRecommendationResponse"][]; - /** Current Model Id */ - current_model_id: string; - /** Current Model Name */ - current_model_name: string; - /** Same Provider */ - same_provider: components["schemas"]["routers__api__model_lifecycle__ModelRecommendationResponse"][]; - successor?: components["schemas"]["routers__api__model_lifecycle__ModelRecommendationResponse"] | null; - /** Upgrades */ - upgrades: components["schemas"]["routers__api__model_lifecycle__ModelRecommendationResponse"][]; - }; - /** - * SearchResponse - * @description Ranked results, NOT a paginated collection — the ``{results}`` shape is a - * deliberate carve-out matching the MCP ``search_resources`` tool. - */ - routers__api__search__SearchResponse: { - /** Results */ - results: components["schemas"]["routers__api__search__SearchResultResponse"][]; - }; - /** SearchResultResponse */ - routers__api__search__SearchResultResponse: { - /** Description */ - description: string | null; - /** Entity Type */ - entity_type: string; - /** Id */ - id: string; - /** Name */ - name: string; - }; - /** - * AiAssistantAcceptRequest - * @description Request body for accepting a proposed plan. - */ - routers__api__solutions__AiAssistantAcceptRequest: { - /** - * Confirm Deletions - * @description Must be true when the plan contains destructive actions - * @default false - */ - confirm_deletions: boolean; - /** - * Solution Description - * @description When running in standalone mode (no pre-existing solution), provide a description for the auto-created solution. - */ - solution_description?: string | null; - /** - * Solution Name - * @description When running in standalone mode (no pre-existing solution), provide a name to auto-create a solution and link resources. - */ - solution_name?: string | null; - }; - /** - * AiAssistantGenerateRequest - * @description Request body for AI assistant generate endpoints. - */ - routers__api__solutions__AiAssistantGenerateRequest: { - /** - * History Since - * @description Optional ISO 8601 timestamp. When set, only conversation turns created at or after this timestamp are loaded as context, scoping history to the current session so the assistant remembers earlier turns in a create flow. - */ - history_since?: string | null; - /** - * User Input - * @description User input describing what to do - */ - user_input: string; - }; - /** SolutionAgentResponse */ - routers__api__solutions__SolutionAgentResponse: { - /** - * Id - * Format: uuid - */ - id: string; - /** - * Knowledge Base Ids - * @description Knowledge base IDs connected to this agent via triggers. - */ - knowledge_base_ids?: string[]; - /** Name */ - name: string; - }; - /** - * SolutionConversationResponse - * @description Response model for a conversation turn. - */ - routers__api__solutions__SolutionConversationResponse: { - /** - * Accepted - * @description Whether the suggestion was accepted or declined. - */ - accepted: boolean | null; - /** - * Actions Taken - * @description Actions taken by the AI. - */ - actions_taken: { - [key: string]: unknown; - } | null; - /** - * Ai Response - * @description AI response text. - */ - ai_response: string | null; - /** - * Created At - * @description Timestamp when the conversation was created. - */ - created_at: string; - /** - * Id - * Format: uuid - * @description Unique identifier for the conversation turn. - */ - id: string; - /** - * User Input - * @description User input text. - */ - user_input: string; - }; - /** SolutionKnowledgeBaseResponse */ - routers__api__solutions__SolutionKnowledgeBaseResponse: { - /** - * Id - * Format: uuid - */ - id: string; - /** Name */ - name: string; - /** - * Source Connection Ids - * @description Source connection IDs linked to this knowledge base. - */ - source_connection_ids?: string[]; - }; - /** - * SolutionListResponse - * @description Response model for paginated solution list. - */ - routers__api__solutions__SolutionListResponse: { - /** Data */ - data: components["schemas"]["SolutionSummaryResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * SolutionResponse - * @description Response model for solution data. - */ - routers__api__solutions__SolutionResponse: { - /** - * Agents - * @description Agents linked to the solution. - */ - agents: components["schemas"]["routers__api__solutions__SolutionAgentResponse"][]; - /** - * Created At - * @description Timestamp when the solution was created. - */ - created_at: string; - /** - * Description - * @description Description of the solution. - */ - description: string; - /** - * Id - * Format: uuid - * @description Unique identifier for the solution. - */ - id: string; - /** - * Knowledge Bases - * @description Knowledge bases linked to the solution. - */ - knowledge_bases: components["schemas"]["routers__api__solutions__SolutionKnowledgeBaseResponse"][]; - /** - * Name - * @description Name of the solution. - */ - name: string; - /** - * Source Connections - * @description Source connections linked to the solution. - */ - source_connections: components["schemas"]["SolutionSourceConnectionResponse"][]; - /** - * Updated At - * @description Timestamp when the solution was last updated. - */ - updated_at: string; - }; - /** - * CreateExportRequest - * @description Parameters for creating a new export job. - */ - routers__api__source_exports__CreateExportRequest: { - /** - * Date From - * @description Only include content created on or after this timestamp. - */ - date_from?: string | null; - /** - * Date To - * @description Only include content created on or before this timestamp. - */ - date_to?: string | null; - /** @description Output file format (jsonl, csv, parquet, zip). */ - format: components["schemas"]["ExportFormat"]; - /** - * Metadata Filter - * @description JSONB containment filter applied to content metadata. - */ - metadata_filter?: { - [key: string]: unknown; - } | null; - /** - * Query Filter - * @description Title substring filter (case-insensitive ILIKE). - */ - query_filter?: string | null; - }; - /** - * EstimateExportRequest - * @description Parameters for estimating export size. - */ - routers__api__source_exports__EstimateExportRequest: { - /** - * Date From - * @description Only include content created on or after this timestamp. - */ - date_from?: string | null; - /** - * Date To - * @description Only include content created on or before this timestamp. - */ - date_to?: string | null; - /** @description Output file format. */ - format: components["schemas"]["ExportFormat"]; - /** - * Metadata Filter - * @description JSONB containment filter applied to content metadata. - */ - metadata_filter?: { - [key: string]: unknown; - } | null; - /** - * Query Filter - * @description Title substring filter (case-insensitive ILIKE). - */ - query_filter?: string | null; - }; - /** - * EstimateExportResponse - * @description Rough size estimate for a potential export. - */ - routers__api__source_exports__EstimateExportResponse: { - /** - * Estimated Size Bytes - * @description Estimated export file size in bytes. - */ - estimated_size_bytes: number; - /** - * Source Connection Id - * @description Source connection ID. - */ - source_connection_id: string; - }; - /** - * ExportResponse - * @description Status and metadata for a content source export job. - */ - routers__api__source_exports__ExportResponse: { - /** - * Account Id - * @description Owning account ID. - */ - account_id: string; - /** - * Completed At - * @description Completion time. - */ - completed_at?: string | null; - /** - * Created At - * @description Creation time. - */ - created_at: string; - /** - * Date From - * @description Date-from filter applied to this export. - */ - date_from?: string | null; - /** - * Date To - * @description Date-to filter applied to this export. - */ - date_to?: string | null; - /** - * Destination - * @description Storage destination. - */ - destination: string; - /** - * Error - * @description Error message if failed. - */ - error?: string | null; - /** - * Estimated Size Bytes - * @description Pre-run size estimate. - */ - estimated_size_bytes?: number | null; - /** - * Expires At - * @description Download expiry time. - */ - expires_at?: string | null; - /** - * File Size Bytes - * @description File size in bytes. - */ - file_size_bytes?: number | null; - /** - * Format - * @description Output format. - */ - format: string; - /** - * Id - * @description Export job ID. - */ - id: string; - /** - * Item Count - * @description Items exported. - */ - item_count?: number | null; - /** - * Metadata Filter - * @description Metadata filter applied to this export. - */ - metadata_filter?: { - [key: string]: unknown; - } | null; - /** - * Progress Current - * @description Items processed so far. - */ - progress_current?: number | null; - /** - * Progress Total - * @description Total items to process. - */ - progress_total?: number | null; - /** - * Query Filter - * @description Query filter applied to this export. - */ - query_filter?: string | null; - /** - * Requested By User Id - * @description ID of the user who requested this export. - */ - requested_by_user_id?: string | null; - /** - * Requested By User Name - * @description Name of the user who requested this export. - */ - requested_by_user_name?: string | null; - /** - * Source Connection Id - * @description Source connection ID. - */ - source_connection_id: string; - /** - * Started At - * @description Processing start time. - */ - started_at?: string | null; - /** - * Status - * @description Job status. - */ - status: string; - /** - * Storage Key - * @description S3 key of exported file. - */ - storage_key?: string | null; - /** - * Updated At - * @description Last update time. - */ - updated_at: string; - }; - /** - * FileUploadResponse - * @description Response model for file upload - */ - routers__api__sources__FileUploadResponse: { - /** - * Content Version Id - * @description ID of the created content version, and what the source content status endpoints take. Set when `status` is `uploaded`; `null` when `status` is `duplicate`, because no new version was created. - */ - content_version_id: string | null; - /** - * Embedder Warning - * @description Set when a file that is not text is indexed from its extracted text alone rather than embedded whole: the item is FAILED if no text can be extracted. Says so when the images inside a document are attached to the item and indexed as well. - */ - embedder_warning?: string | null; - /** - * Filename - * @description Original filename - */ - filename: string; - /** - * Source Connection Content Version Id - * @description ID of the existing, already-indexed item this file duplicates, and what `GET /contents/{id}` takes. Set only when `status` is `duplicate`; `null` on a new upload, which has no such id until it finishes indexing. - */ - source_connection_content_version_id: string | null; - /** - * Status - * @description `uploaded` for a new item, or `duplicate` when this exact file is already on the source. - */ - status: string; - }; - /** - * SourceListResponse - * @description Response model for paginated source list - */ - routers__api__sources__SourceListResponse: { - /** Data */ - data: components["schemas"]["SourceResponse"][]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * PromptModelResponse - * @description Response model for prompt model data - */ - schemas__model_responses__PromptModelResponse: { - /** - * Chat Capable - * @description Whether this model can serve a chat request (`prompt_call`, `extract_data`). True for every plain text LLM, and for a dual-capability model that generates media AND holds a conversation; false for a dedicated generator (Imagen, Veo, a TTS voice), which bills per produced unit and has no chat interface. Authoritative: consumers must read this rather than inferring it from `generation_params` or `supported_output_media`, because the answer also depends on which inference interface serves the model — something no response field exposes. - * @default true - */ - chat_capable: boolean; - /** Default */ - default: boolean; - /** Deprecated At */ - deprecated_at?: string | null; - /** Description */ - description: string; - /** @description The reasoning-effort values a prompt_call or extract_data step may set as `effort` with this model. Null when the model takes none. */ - effort_options?: components["schemas"]["EffortOptionsResponse"] | null; - /** Enabled */ - enabled: boolean; - /** Family */ - family?: string | null; - /** Family Generation */ - family_generation?: number | null; - /** - * Generation Credits Per Unit - * @description Per-unit credit cost for a dedicated media-generation model, in the unit named by ``generation_params.pricing_unit`` (per image / per second / per character / per output token). Multiply by the produced unit count (images, seconds, characters) for the run cost. None for models with no generation descriptor. This rate applies when the model is used in a generate_image/audio/video step; a model that also serves the chat path is billed per token there instead, using the input/output token rates on this same record. When `generation_params.price_varies_by` is set the model has one rate per value of that option and this is the **highest** of them — read `generation_credits_per_variant` for the real spread rather than presenting this as the price. - */ - generation_credits_per_unit?: number | null; - /** - * Generation Credits Per Variant - * @description Per-unit credit cost keyed by the value of the option named in `generation_params.price_varies_by` (e.g. `{'720p': 1330, '1080p': 1995}`). None for a model with a single rate, where `generation_credits_per_unit` already describes it exactly. - */ - generation_credits_per_variant?: { - [key: string]: number; - } | null; - /** - * Generation Params - * @description Media-generation descriptor (modality, pricing_unit, and modality-specific constraints). NULL for text LLMs; present for image/audio/video generation models. See schemas.generation_params. A present descriptor does NOT imply the model is generation-only: some models serve both paths (they generate media AND hold a chat conversation). Read `chat_capable` to tell whether a model with a descriptor can also be used as a chat model — do not branch on this field being non-null alone, and do not re-derive the answer from `supported_output_media`. - */ - generation_params?: { - [key: string]: unknown; - } | null; - /** - * Generation Unit Label - * @description Human suffix for the per-unit generation rate (e.g. ``/image``, ``/second``, ``/1k chars``, ``/1k tokens``) — single-sourced from the pricing unit so clients render cost without re-deriving the mapping. None for non-generation models. Char/token rates are shown per 1,000 (the ``/1k …`` suffix), so scale ``generation_credits_per_unit`` accordingly for those units. - */ - generation_unit_label?: string | null; - /** Id */ - id: string; - /** - * Image Generation Tool Credits Per Image - * @description Per-image credit cost of using the built-in image_generation tool (it runs gpt-image-1). Set only for models that actually support the tool (tool-use capable); None otherwise. - */ - image_generation_tool_credits_per_image?: number | null; - /** - * Input 1H Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 1-hour prompt cache. - */ - input_1h_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input 30M Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 30-minute prompt cache. - */ - input_30m_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input 5M Cache Write Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens written to a 5-minute prompt cache. - */ - input_5m_cache_write_credits_per_1000_tokens?: number | null; - /** - * Input Cache Hit Credits Per 1000 Tokens - * @description Credits per 1,000 input tokens read from a prompt cache. - */ - input_cache_hit_credits_per_1000_tokens?: number | null; - /** Input Credits Per 1000 Tokens */ - input_credits_per_1000_tokens?: number | null; - /** - * Is New - * @default false - */ - is_new: boolean; - /** - * Last Used - * @default false - */ - last_used: boolean; - /** Max Context Tokens */ - max_context_tokens: number; - /** Max Conversation Length */ - max_conversation_length: number; - /** Max Output Tokens */ - max_output_tokens: number; - /** Model Id */ - model_id: string; - /** Name */ - name: string; - /** Output Credits Per 1000 Tokens */ - output_credits_per_1000_tokens?: number | null; - /** - * Payload Schema - * @description Model-specific JSON schema for advanced prompt_call json_template payloads. - */ - payload_schema?: { - [key: string]: unknown; - } | null; - /** - * Payload Schema Source Url - * @description Source URL used to derive payload_schema guidance for this model. - */ - payload_schema_source_url?: string | null; - /** Per Modality Rates */ - per_modality_rates?: components["schemas"]["ModalityRateResponse"][]; - /** Provider */ - provider: string; - /** Released At */ - released_at?: string | null; - /** - * Schema Documentation Url - * @description Model documentation URL with request/response payload details. - */ - schema_documentation_url?: string | null; - /** - * Schema Notes - * @description Human-readable notes about request payload compatibility. - */ - schema_notes?: string | null; - /** Successor Model Id */ - successor_model_id?: string | null; - /** Sunset At */ - sunset_at?: string | null; - /** Supported Input Media */ - supported_input_media?: string[] | null; - /** Supported Languages */ - supported_languages?: string[] | null; - /** Supported Output Media */ - supported_output_media?: string[] | null; - /** - * Supports Openai Arguments - * @default false - */ - supports_openai_arguments: boolean; - /** - * Supports Streaming - * @default false - */ - supports_streaming: boolean; - /** - * Supports Structured Output - * @default true - */ - supports_structured_output: boolean; - /** - * Supports Thinking - * @default false - */ - supports_thinking: boolean; - /** - * Supports Tool Use - * @default true - */ - supports_tool_use: boolean; - /** Tools Disabled */ - tools_disabled?: components["schemas"]["PromptToolResponse"][]; - /** Tools Enabled */ - tools_enabled?: components["schemas"]["PromptToolResponse"][]; - /** Training Cutoff At */ - training_cutoff_at?: string | null; - /** Url */ - url?: string | null; - /** Variants */ - variants?: components["schemas"]["VariantCategoryResponse"][] | null; - }; - /** - * ProviderGroupResponse - * @description Response model for provider group with models - */ - schemas__model_responses__ProviderGroupResponse: { - /** Models */ - models: components["schemas"]["schemas__model_responses__PromptModelResponse"][]; - /** Provider */ - provider: string; - }; - /** - * NonManualEvaluationModeStatResponse - * @description Per-mode rollup for evaluation activity. - */ - schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse: { - /** - * Error - * @description Results whose evaluator returned no verdict. - */ - error: number; - /** Failed */ - failed: number; - /** Failure Rate */ - failure_rate: number; - /** Flagged */ - flagged: number; - /** Mode */ - mode: string; - /** Pass Rate */ - pass_rate: number; - /** Passed */ - passed: number; - /** Total */ - total: number; - }; - /** - * NonManualEvaluationSummaryResponse - * @description Account-level summary for evaluations. - */ - schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse: { - /** By Mode */ - by_mode: components["schemas"]["schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse"][]; - /** - * Error - * @description Results whose evaluator returned no verdict. - */ - error: number; - /** Failed */ - failed: number; - /** Failure Rate */ - failure_rate: number; - /** Flagged */ - flagged: number; - /** Pass Rate */ - pass_rate: number; - /** Passed */ - passed: number; - /** Total */ - total: number; - }; - }; - responses: never; - parameters: { - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version": string; - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id": string; - }; - requestBodies: never; - headers: never; - pathItems: never; -} -export type $defs = Record; -export interface operations { - list_agents_api_agents_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__agents__AgentListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_agent_api_agents_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__agents__CreateAgentRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentSummaryResponse"]; - }; - }; - /** @description Plan limit exceeded — the account has reached the maximum number of agents allowed by its subscription plan. */ - 402: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`). */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentDefinitionImportErrorResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_agent_email_optouts_api_api_agents_agent_email_optouts_get: { - parameters: { - query?: { - /** @description Filter to one agent (account-wide opt-outs still apply) */ - agent_id?: string | null; - limit?: number; - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentEmailOptOutListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - remove_agent_email_optout_api_api_agents_agent_email_optouts__optout_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - optout_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_blocked_email_senders_api_api_agents_blocked_email_senders_get: { - parameters: { - query?: { - limit?: number; - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BlockedEmailSenderListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - block_email_sender_api_api_agents_blocked_email_senders_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["BlockEmailSenderRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BlockedEmailSenderResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - set_auto_block_mode_api_api_agents_blocked_email_senders_mode_put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["SetAutoBlockModeRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BlockedEmailSenderListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - unblock_email_sender_api_api_agents_blocked_email_senders__blocked_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - blocked_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationCriteriaResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateEvaluationCriteriaRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationCriteriaResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_compatible_runs_api_agents_evaluation_criteria__criteria_id__compatible_runs_get: { - parameters: { - query?: { - page?: number; - limit?: number; - started_after?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CompatibleRunListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_evaluation_results_api_agents_evaluation_criteria__criteria_id__results_get: { - parameters: { - query?: { - status?: string | null; - flagged_only?: boolean; - time_from?: string | null; - time_to?: string | null; - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationResultListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_evaluation_result_api_agents_evaluation_criteria__criteria_id__results_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateEvaluationResultRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationResultResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_evaluation_summary_api_agents_evaluation_criteria__criteria_id__summary_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - criteria_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationResultSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_non_manual_evaluation_summary_api_agents_evaluation_results_non_manual_summary_get: { - parameters: { - query?: { - /** @description Scope the summary to a single agent. Omit for account-wide. */ - agent_id?: string | null; - days?: number; - start_date?: string | null; - end_date?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_inbound_email_rejections_api_api_agents_inbound_email_rejections_get: { - parameters: { - query?: { - /** @description Filter to a single agent's rejections */ - agent_id?: string | null; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["InboundEmailRejectionResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_inbound_email_status_api_api_agents_inbound_email_status_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["InboundEmailStatusResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - cancel_queued_email_runs_api_api_agents_inbound_email_status_cancel_queued_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CancelQueuedRunsResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - resume_inbound_email_api_api_agents_inbound_email_status_resume_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ResumeInboundResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - preview_import_agent_api_agents_preview_import_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__agents__AgentImportPreviewRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__agents__AgentImportPreviewResponse"]; - }; - }; - /** @description The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`). */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentDefinitionImportErrorResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - search_agent_runs_api_agents_runs_search_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__agents__AgentTraceSearchRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentTraceSearchResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agent_run_api_agents_runs__run_id__get: { - parameters: { - query?: { - /** @description If true, include per-step outputs with timing, durations, and credits. */ - include_step_outputs?: boolean; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - run_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentRunResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_agent_run_api_agents_runs__run_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - run_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentRunResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agent_metadata_api_agents__agent_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_agent_api_agents__agent_id__put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__agents__UpdateAgentRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentSummaryResponse"]; - }; - }; - /** @description The supplied `agent_definition` payload failed validation. The body lists each error with a 1-indexed line/column pointing into the canonical pretty-printed echo of the payload (also returned in `source`). */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentDefinitionImportErrorResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_agent_api_agents__agent_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_ai_conversation_history_api_agents__agent_id__ai_assistant_conversations_get: { - parameters: { - query: { - /** @description Step type to look up. */ - step_type: string; - /** @description Step ID to filter by. */ - step_id?: string | null; - /** @description Max turns to return. */ - limit?: number; - /** @description Number of recent turns to skip. */ - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiConversationHistoryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - generate_agent_steps_api_agents__agent_id__ai_assistant_generate_steps_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["GenerateAgentStepsRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GenerateAgentStepsResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - generate_step_config_api_agents__agent_id__ai_assistant_step_config_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["GenerateStepConfigRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GenerateStepConfigResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - mark_ai_suggestion_api_agents__agent_id__ai_assistant__conversation_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["MarkAiSuggestionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["OkResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_get_agent_attachment_references_api_agents__agent_id__attachment_references_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentAttachmentRefsApiResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agent_callers_api_api_agents__agent_id__callers_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentCallerApiResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agent_definition_api_agents__agent_id__definition_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentDefinitionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_agent_definition_api_agents__agent_id__definition_put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateAgentDefinitionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentDefinitionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - disable_agent_api_api_agents__agent_id__disable_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - enable_agent_api_api_agents__agent_id__enable_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_evaluation_criteria_api_agents__agent_id__evaluation_criteria_get: { - parameters: { - query?: { - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationCriteriaResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_evaluation_criteria_api_agents__agent_id__evaluation_criteria_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateEvaluationCriteriaRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationCriteriaResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - test_draft_evaluation_api_agents__agent_id__evaluation_criteria_test_draft_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["TestDraftEvaluationRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["TestDraftEvaluationResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_agent_evaluation_results_api_agents__agent_id__evaluation_results_get: { - parameters: { - query?: { - status?: string | null; - step?: string | null; - flagged_only?: boolean; - time_from?: string | null; - time_to?: string | null; - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationResultWithCriteriaListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_evaluation_runs_api_agents__agent_id__evaluation_runs_get: { - parameters: { - query?: { - status?: string | null; - step?: string | null; - time_from?: string | null; - time_to?: string | null; - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationRunSummaryListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - export_agent_api_agents__agent_id__export_get: { - parameters: { - query?: { - /** @description Return as file download */ - download?: boolean; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentExportResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_get_agent_input_upload_status_api_agents__agent_id__input_uploads__upload_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - upload_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["UploadAgentInputApiResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_agent_runs_api_agents__agent_id__runs_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - /** @description Filter runs by status */ - status?: components["schemas"]["PendingProcessingCompletedFailedStatus"] | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__agents__AgentRunListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - run_agent_api_agents__agent_id__runs_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["AgentRunRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentRunResponse"]; - }; - }; - /** @description Insufficient credits — the account has exhausted its credits. */ - 402: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["InsufficientCreditsResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - run_streaming_agent_api_agents__agent_id__runs_stream_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["AgentRunStreamRequest"]; - }; - }; - responses: { - /** - * @description Streams agent run events via Server-Sent Events (SSE); run is always created as priority. - * - * SSE events: - * - `event: init` — `data` is an `AgentRunResponse` snapshot (includes `run_id`). - * - `event: done` — `data` is the final `AgentRunResponse` snapshot (includes `output`, `credits`, etc). - * - Other events (e.g. `status`, step events) are forwarded from the run event stream. - * - On `timeout` / `error`, the payload includes `run_id` so clients can fetch status via `GET /agents/runs/{run_id}`. - */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": unknown; - /** - * @example : keepalive - * - * event: init - * data: {"run_id":"...","status":"pending","error_count":0,"credits":0.0,"priority":true,"input":"...","output":null,"attempts":[]} - * - * event: done - * data: {"run_id":"...","status":"completed","error_count":0,"credits":0.0,"priority":true,"input":"...","output":"...","attempts":[]} - */ - "text/event-stream": string; - }; - }; - /** @description Insufficient credits — the account has exhausted its credits. */ - 402: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["InsufficientCreditsResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_run_evaluation_results_api_agents__agent_id__runs__run_id__evaluation_results_get: { - parameters: { - query?: { - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - run_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EvaluationResultWithCriteriaResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - set_accepted_attachments_api_api_agents__agent_id__triggers__trigger_id__accepted_attachments_put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - trigger_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["SetAcceptedAttachmentsRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AcceptedAttachmentsResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - set_email_trigger_config_api_api_agents__agent_id__triggers__trigger_id__email_config_put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - trigger_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__agents__SetEmailTriggerConfigRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailTriggerConfigResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_upload_agent_input_api_agents__agent_id__upload_input_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - agent_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 202: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["UploadAgentInputApiResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_feedback_api_ai_assistant_feedback_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__ai_assistant__AiAssistantFeedbackRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantFeedbackResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_knowledge_base_api_ai_assistant_knowledge_base_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_memory_bank_api_ai_assistant_memory_bank_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankAiAssistantRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankAiAssistantResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_memory_bank_history_api_ai_assistant_memory_bank_last_conversation_get: { - parameters: { - query?: { - /** @description Max turns. */ - limit?: number; - /** @description Skip count. */ - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankLastConversationResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_memory_bank_accept_api_ai_assistant_memory_bank__conversation_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankAcceptRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["OkResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_solution_api_ai_assistant_solution_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_source_api_ai_assistant_source_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_accept_api_ai_assistant__conversation_id__accept_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantAcceptRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantAcceptResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - api_ai_decline_api_ai_assistant__conversation_id__decline_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_alerts_api_alerts_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - /** @description Filter by alert status */ - status?: string | null; - /** @description Filter by agent ID */ - agent_id?: string | null; - /** @description Filter by source connection ID */ - source_connection_id?: string | null; - /** @description From (ISO 8601) */ - time_from?: string | null; - /** @description To (ISO 8601) */ - time_to?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_alert_configs_api_alerts_configs_get: { - parameters: { - query?: { - /** @description Filter by agent ID */ - agent_id?: string | null; - /** @description Filter by source connection ID */ - source_connection_id?: string | null; - /** @description Set to 'source' to list account-level source alert configs */ - scope?: string | null; - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AlertConfigListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_alert_config_api_alerts_configs_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateAlertConfigRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AlertConfigResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_alert_config_api_alerts_configs__config_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - config_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AlertConfigResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_alert_config_api_alerts_configs__config_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - config_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_alert_config_api_alerts_configs__config_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - config_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateAlertConfigRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AlertConfigResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_organization_preferences_api_alerts_organization_preferences_list_get: { - parameters: { - query?: { - /** @description Optional organization filter */ - organization_id?: string | null; - /** @description Include default subscribed entries for all alert types */ - include_defaults?: boolean; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["OrganizationAlertPreferenceListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_organization_preference_api_alerts_organization_preferences__organization_id___alert_type__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - organization_id: string; - alert_type: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__alerts__UpdateOrganizationAlertPreferenceRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__OrganizationAlertPreferenceResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_alert_detail_api_alerts__alert_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - add_alert_comment_api_alerts__alert_id__comments_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__alerts__AddCommentRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - change_alert_status_api_alerts__alert_id__status_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["ChangeStatusRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - subscribe_to_alert_api_alerts__alert_id__subscribe_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - unsubscribe_from_alert_api_alerts__alert_id__unsubscribe_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_cloud_drives_api_api_cloud_drives_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveResponseModel"][]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_cloud_drive_providers_api_api_cloud_drives_providers_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveProviderResponseModel"][]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_cloud_drive_api_api_cloud_drives__connection_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_cloud_drive_api_api_cloud_drives__connection_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["OkResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_cloud_drive_api_api_cloud_drives__connection_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CloudDriveUpdateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agents_using_cloud_drive_api_api_cloud_drives__connection_id__agents_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AgentUsingCloudDriveResponseModel"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - disconnect_cloud_drive_api_api_cloud_drives__connection_id__disconnect_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_cloud_drive_rejections_api_api_cloud_drives__connection_id__rejections_get: { - parameters: { - query?: { - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CloudDriveRejectionResponseModel"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_content_detail_api_contents__source_connection_content_version__get: { - parameters: { - query?: { - start?: number; - end?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__ContentDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - replace_content_with_inline_text_api_contents__source_connection_content_version__put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["InlineTextReplaceRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__FileUploadResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_content_api_contents__source_connection_content_version__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description The key's user is a member of the account but not an owner or administrator (`error.code` is `permission_denied`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_content_attachments_api_contents__source_connection_content_version__attachments_get: { - parameters: { - query?: { - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__ContentAttachmentsListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_content_attachment_api_contents__source_connection_content_version__attachments__attachment_id__get: { - parameters: { - query?: { - start?: number; - end?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - attachment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__ContentAttachmentDetailResponse"]; - }; - }; - /** @description The account has no credits left (`error.code` is `insufficient_credits`). */ - 402: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_content_attachment_embeddings_api_contents__source_connection_content_version__attachments__attachment_id__embeddings_get: { - parameters: { - query?: { - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - attachment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__ContentEmbeddingsListResponse"]; - }; - }; - /** @description The account has no credits left (`error.code` is `insufficient_credits`). */ - 402: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_content_attachment_file_api_contents__source_connection_content_version__attachments__attachment_id__file_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - attachment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description The file's bytes. */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/octet-stream": string; - "application/pdf": string; - "audio/*": string; - "image/*": string; - "text/plain": string; - "video/*": string; - }; - }; - /** @description The account has no credits left (`error.code` is `insufficient_credits`). */ - 402: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description The file is withheld; `error.code` says why. */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_content_embeddings_api_contents__source_connection_content_version__embeddings_get: { - parameters: { - query?: { - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__ContentEmbeddingsListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - upload_file_to_content_api_contents__source_connection_content_version__upload_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_content_version: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "multipart/form-data": components["schemas"]["Body_upload_file_to_content_api_contents__source_connection_content_version__upload_post"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__contents__FileUploadResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - docs_search_api_docs_search_get: { - parameters: { - query: { - /** @description Search query */ - q: string; - /** @description Search strategy */ - mode?: "keyword" | "semantic"; - /** @description Maximum results */ - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__docs_search__DocsSearchResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_email_domains_api_api_email_domains_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailDomainsListResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - add_email_domain_api_api_email_domains_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["AddEmailDomainRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailDomainResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - use_shared_domain_api_api_email_domains_use_shared_domain_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - remove_email_domain_api_api_email_domains__domain_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - domain_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["RemoveEmailDomainResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_dmarc_summary_api_api_email_domains__domain_id__dmarc_get: { - parameters: { - query?: { - days?: number; - top_sources?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - domain_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["DmarcSummaryResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - set_primary_email_domain_api_api_email_domains__domain_id__primary_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - domain_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailDomainResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - send_test_email_api_api_email_domains__domain_id__test_email_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - domain_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SendTestEmailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - verify_email_domain_api_api_email_domains__domain_id__verify_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - domain_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailDomainResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - governance_ai_generate_api_governance_ai_assistant_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__governance__GovernanceAiAssistantRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GovernanceAiAssistantResponse"]; - }; - }; - /** @description AI assistant error. */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Plan does not include governance access. */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_governance_ai_conversations_api_governance_ai_assistant_conversations_get: { - parameters: { - query?: { - /** @description Number of conversations. */ - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__governance__GovernanceConversationResponse"][]; - }; - }; - /** @description Plan does not include governance access. */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - governance_ai_accept_api_governance_ai_assistant__conversation_id__accept_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GovernanceAiAcceptResponse"]; - }; - }; - /** @description Plan already accepted/declined or AI error. */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Plan does not include governance access. */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - governance_ai_decline_api_governance_ai_assistant__conversation_id__decline_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Plan already accepted/declined or AI error. */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Plan does not include governance access. */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_knowledge_bases_api_knowledge_bases_get: { - parameters: { - query?: { - /** @description Page number (1-based). */ - page?: number; - /** @description Items per page. */ - limit?: number; - /** @description Sort field. One of: created_at, updated_at, name. */ - sort?: string; - /** @description Sort direction: asc or desc. */ - order?: string; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["KnowledgeBaseListResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_knowledge_base_api_knowledge_bases_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateKnowledgeBaseBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["KnowledgeBaseResponseModel"]; - }; - }; - /** @description Insufficient credits or no active subscription — the account has exhausted its credits or does not have a valid subscription. */ - 402: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_knowledge_base_api_knowledge_bases__knowledge_base_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - knowledge_base_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["KnowledgeBaseResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_knowledge_base_api_knowledge_bases__knowledge_base_id__put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - knowledge_base_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateKnowledgeBaseBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["KnowledgeBaseResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_knowledge_base_api_knowledge_bases__knowledge_base_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - knowledge_base_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_me_api_me_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MeResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_memory_banks_api_memory_banks_get: { - parameters: { - query?: { - /** @description Page number (1-based). */ - page?: number; - /** @description Items per page. */ - limit?: number; - /** @description Sort field. One of: created_at, updated_at, name. */ - sort?: string; - /** @description Sort direction: asc or desc. */ - order?: string; - /** @description Filter by bank type: conversation or general. */ - type?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankListResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_memory_bank_api_memory_banks_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateMemoryBankBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - memory_bank_ai_generate_api_memory_banks_ai_assistant_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankAiAssistantRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankAiAssistantResponse"]; - }; - }; - /** @description AI assistant error. */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - memory_bank_ai_last_conversation_api_memory_banks_ai_assistant_last_conversation_get: { - parameters: { - query?: { - /** @description Max turns to return. */ - limit?: number; - /** @description Number of most-recent turns to skip. */ - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankLastConversationResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - memory_bank_ai_accept_api_memory_banks_ai_assistant__conversation_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__memory_banks__MemoryBankAcceptRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["OkResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_templates_api_memory_banks_templates_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": unknown; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - test_compaction_prompt_standalone_api_memory_banks_test_compaction_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["StandaloneTestCompactionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CompactionTestResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_memory_bank_api_memory_banks__memory_bank_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_memory_bank_api_memory_banks__memory_bank_id__put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateMemoryBankBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["MemoryBankResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_memory_bank_api_memory_banks__memory_bank_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_agents_using_bank_api_memory_banks__memory_bank_id__agents_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": unknown; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - compact_memory_bank_api_memory_banks__memory_bank_id__compact_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 202: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CompactionScheduledResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_memory_bank_source_api_memory_banks__memory_bank_id__source_delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_memory_bank_entry_stats_api_memory_banks__memory_bank_id__stats_get: { - parameters: { - query?: { - days?: number; - start_date?: string | null; - end_date?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - [key: string]: unknown; - }; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - test_compaction_prompt_api_memory_banks__memory_bank_id__test_compaction_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - memory_bank_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["TestCompactionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CompactionTestResponseModel"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_models_api_models_get: { - parameters: { - query?: { - /** @description Filter by provider name */ - provider?: string | null; - /** @description Filter to models that support tool use */ - supports_tool_use?: boolean | null; - /** @description Filter to models that support extended thinking */ - supports_thinking?: boolean | null; - /** @description Filter to models that accept this input modality — a coarse kind (`image`, `audio`, `video`, `pdf`) or a full MIME. */ - supports_input_media?: string | null; - /** @description Filter to models that produce this output modality — a coarse kind (`image`, `audio`, `video`) or a full MIME. Use to find image/audio/video generation models. */ - supports_output_media?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["schemas__model_responses__ProviderGroupResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_alerts_api_models_alerts_get: { - parameters: { - query?: { - /** @description Filter alerts to a specific agent UUID. */ - agent_id?: string | null; - /** @description When true, only return unread alerts. */ - unread_only?: boolean; - /** @description Maximum number of alerts to return (1-100). */ - limit?: number; - /** @description Pagination offset. */ - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__model_lifecycle__ModelAlertListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - mark_all_read_api_models_alerts_mark_all_read_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_alert_unread_count_api_models_alerts_unread_count_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["UnreadCountResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - mark_read_api_models_alerts__alert_id__read_patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - alert_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_embedding_models_api_models_embedders_get: { - parameters: { - query?: { - /** @description Filter to embedders that can index this input modality — a coarse kind (text, image, video, audio) or a full MIME. */ - supports_input_media?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmbeddingModelListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_generation_tiers_api_models_generation_tiers_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GenerationTierListResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_experiments_api_models_playground_experiments_get: { - parameters: { - query?: { - /** @description Look-back window in days. */ - days?: number; - /** @description Explicit start date (overrides days). */ - start_date?: string | null; - /** @description Explicit end date (overrides days). */ - end_date?: string | null; - /** @description Page size. */ - limit?: number; - /** @description Pagination offset. */ - offset?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ExperimentListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_experiment_api_models_playground_experiments_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["PlaygroundCreateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CreateExperimentResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_experiment_api_models_playground_experiments__experiment_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - experiment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ExperimentDetailResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_experiment_endpoint_api_models_playground_experiments__experiment_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - experiment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - cancel_experiment_endpoint_api_models_playground_experiments__experiment_id__cancel_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - experiment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CancelExperimentResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_reranker_models_api_models_rerankers_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["RerankerModelListResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_model_api_models__model_id__details_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - model_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["schemas__model_responses__PromptModelResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_recommendations_api_models__model_id__recommendations_get: { - parameters: { - query?: { - /** @description Only recommend models that support tool use. */ - require_tool_use?: boolean | null; - /** @description Only recommend models that support structured output. */ - require_structured_output?: boolean | null; - /** @description Only recommend models that support thinking/reasoning. */ - require_thinking?: boolean | null; - /** @description Minimum context window size in tokens. */ - min_context_tokens?: number | null; - /** @description Minimum output token limit. */ - min_output_tokens?: number | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - model_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__model_lifecycle__ModelRecommendationsResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - search_api_search_get: { - parameters: { - query: { - /** @description Search query */ - q: string; - /** @description Maximum results */ - limit?: number; - /** @description Optional entity type filter (e.g. 'agent', 'knowledge_base') */ - entity_type?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__search__SearchResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_solutions_api_solutions_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - /** @description Sort field */ - sort?: string; - /** @description Sort order */ - order?: string; - /** @description Filter by solution name (case-insensitive partial match) */ - search?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_solution_api_solutions_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateSolutionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_solution_api_solutions__solution_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_solution_api_solutions__solution_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_solution_api_solutions__solution_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateSolutionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - link_agents_api_solutions__solution_id__agents_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["LinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - unlink_agents_api_solutions__solution_id__agents_delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UnlinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - ai_assistant_generate_api_solutions__solution_id__ai_assistant_generate_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - ai_assistant_knowledge_base_api_solutions__solution_id__ai_assistant_knowledge_base_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - ai_assistant_source_api_solutions__solution_id__ai_assistant_source_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantGenerateResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - ai_assistant_accept_api_solutions__solution_id__ai_assistant__conversation_id__accept_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__solutions__AiAssistantAcceptRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["AiAssistantAcceptResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - ai_assistant_decline_api_solutions__solution_id__ai_assistant__conversation_id__decline_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - conversation_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_conversations_api_solutions__solution_id__conversations_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionConversationResponse"][]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - add_conversation_turn_api_solutions__solution_id__conversations_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["AddConversationTurnRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionConversationResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - mark_conversation_turn_api_solutions__solution_id__conversations__conversation_id__patch: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - conversation_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["MarkConversationTurnRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - link_knowledge_bases_api_solutions__solution_id__knowledge_bases_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["LinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - unlink_knowledge_bases_api_solutions__solution_id__knowledge_bases_delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UnlinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - link_source_connections_api_solutions__solution_id__source_connections_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["LinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - unlink_source_connections_api_solutions__solution_id__source_connections_delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - solution_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UnlinkResourcesRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__solutions__SolutionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_sources_api_sources_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - /** @description Sort field */ - sort?: string; - /** @description Sort order */ - order?: string; - /** @description List sources for the given account. Defaults to the caller's account. */ - account_id?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__sources__SourceListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_source_api_sources_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateSourceBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceResponse"]; - }; - }; - /** @description Insufficient credits or no active subscription — the account has exhausted its credits or does not have a valid subscription. */ - 402: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_source_api_sources__source_connection_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_source_api_sources__source_connection_id__put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateSourceBody"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - upload_inline_text_to_source_api_sources__source_connection_id__post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["InlineTextUploadRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__sources__FileUploadResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_source_api_sources__source_connection_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_source_contents_api_sources__source_connection_id__contents_get: { - parameters: { - query?: { - /** @description Page number */ - page?: number; - /** @description Items per page */ - limit?: number; - /** @description Sort field (created_at/title/status) */ - sort?: string; - /** @description Sort order */ - order?: string; - /** @description Filter to one status: pending, fetching, transcribing, scanning, indexing, completed, or failed. Use `failed` to list only the items that could not be indexed. */ - status?: string | null; - /** @description Filter to specific content versions, repeatable. Pass the `content_version_id` values returned by the upload endpoints to poll exactly the items you uploaded in a single request. The ids travel in the query string, so keep a request to about 100: a URL longer than 8,192 bytes is rejected before it reaches the API. The API itself accepts at most 500 — beyond either limit, split the poll or page through the unfiltered listing. */ - content_version_id?: string[] | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceContentStatusListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_source_content_status_endpoint_api_sources__source_connection_id__contents__content_version_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - content_version_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceContentStatusResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_email_source_rejections_api_api_sources__source_connection_id__email_rejections_get: { - parameters: { - query?: { - /** @description Page number. */ - page?: number; - /** @description Items per page. */ - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EmailSourceRejectionListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_source_embedding_migration_api_sources__source_connection_id__embedding_migration_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceEmbeddingMigrationResponse"] | null; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - start_source_embedding_migration_api_sources__source_connection_id__embedding_migration_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["StartSourceEmbeddingMigrationRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceEmbeddingMigrationResponse"]; - }; - }; - /** @description A migration is already active for this source, or the target matches the current settings. */ - 409: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - cancel_source_embedding_migration_api_sources__source_connection_id__embedding_migration_cancel_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SourceEmbeddingMigrationResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - list_source_exports_api_sources__source_connection_id__exports_get: { - parameters: { - query?: { - page?: number; - limit?: number; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ExportListResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - create_source_export_api_sources__source_connection_id__exports_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__source_exports__CreateExportRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 202: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__source_exports__ExportResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - estimate_source_export_api_sources__source_connection_id__exports_estimate_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["routers__api__source_exports__EstimateExportRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__source_exports__EstimateExportResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_source_export_api_sources__source_connection_id__exports__export_id__get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - export_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__source_exports__ExportResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - delete_source_export_api_sources__source_connection_id__exports__export_id__delete: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - export_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 204: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - cancel_source_export_api_sources__source_connection_id__exports__export_id__cancel_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - export_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__source_exports__ExportResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the organization account (`error.code` is `permission_denied`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - download_source_export_api_sources__source_connection_id__exports__export_id__download_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - export_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": unknown; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - upload_file_to_source_api_sources__source_connection_id__upload_post: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - source_connection_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "multipart/form-data": components["schemas"]["Body_upload_file_to_source_api_sources__source_connection_id__upload_post"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["routers__api__sources__FileUploadResponse"]; - }; - }; - /** @description The key's user is not an owner or administrator of the account (`error.code` is `permission_denied`), or the account is suspended (`suspended_account`). */ - 403: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - serve_agent_run_attachment_api_v2_agent_runs__run_id__attachments__attachment_id__get: { - parameters: { - query?: { - download_name?: string | null; - }; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path: { - run_id: string; - attachment_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Attachment bytes streamed with the resolved MIME type (inline-safe types keep their declared type; everything else is ``application/octet-stream``). */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/octet-stream": string; - "application/pdf": string; - "application/vnd.seclai.manifest+json": string; - "audio/*": string; - "image/*": string; - "text/plain": string; - "video/*": string; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - get_api_version_api_version_get: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ApiVersionResponse"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; - update_api_version_api_version_put: { - parameters: { - query?: never; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned a bare array, a flat `{data, total, page, limit}`, a `{configs, total}`, or another per-resource key. */ - "Seclai-Version"?: components["parameters"]["Seclai-Version"]; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UpdateApiVersionRequest"]; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ApiVersionResponse"]; - }; - }; - /** @description Validation Error */ - 422: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["HTTPValidationError"]; - }; - }; - /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ - 503: { - headers: { - /** @description Seconds to wait before retrying. Sent only with `database_unavailable`. */ - "Retry-After"?: number; - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ServiceUnavailableError"]; - }; - }; - }; - }; -} diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index 2f6bbc4..0000000 --- a/src/types.ts +++ /dev/null @@ -1,893 +0,0 @@ -/** - * @module - * - * Developer-friendly type aliases for Seclai API request and response shapes. - * - * Every type is an alias over the auto-generated OpenAPI schema in `openapi.ts`, - * giving a stable, readable name that won't change if the generated identifiers - * are regenerated. - */ -import type { components } from "./openapi"; - -// ─── General ───────────────────────────────────────────────────────────────── - -/** JSON-serializable values accepted/returned by the SDK's low-level `request()` method. */ -export type JSONValue = - | { [key: string]: JSONValue } - | JSONValue[] - | string - | number - | boolean - | null; - -/** Standard OpenAPI validation error shape (typically HTTP 422). */ -export type HTTPValidationError = components["schemas"]["HTTPValidationError"]; - -/** Individual validation error entry within an {@link HTTPValidationError}. */ -export type ValidationError = components["schemas"]["ValidationError"]; - -/** Pagination metadata included in list responses. */ -export type PaginationResponse = components["schemas"]["PaginationResponse"]; - -/** - * A list response whose endpoint is version-gated. `T` is the default shape, - * which the client returns on every version; `data` and `pagination` are also - * present when `apiVersion` is `2026-07-27` or later. - */ -type VersionedList = T & { data?: T[K]; pagination?: PaginationResponse }; - -// ─── Identity ──────────────────────────────────────────────────────────────── - -/** The authenticated user's personal account ID and the organizations they belong to. */ -export type MeResponse = components["schemas"]["MeResponse"]; - -/** One organization the authenticated user belongs to, within a {@link MeResponse}. */ -export type OrganizationInfoResponse = components["schemas"]["OrganizationInfoResponse"]; - -// ─── Agents ────────────────────────────────────────────────────────────────── - -/** Paginated list of agents. */ -export type AgentListResponse = components["schemas"]["routers__api__agents__AgentListResponse"]; - -/** Full agent configuration including definition and metadata. */ -export type AgentDefinitionResponse = components["schemas"]["AgentDefinitionResponse"]; - -/** Portable JSON snapshot of an agent definition. */ -export type AgentExportResponse = components["schemas"]["AgentExportResponse"]; - -/** Summary of an agent (returned on create/update). */ -export type AgentSummaryResponse = components["schemas"]["AgentSummaryResponse"]; - -/** - * Request body for creating an agent. - * - * `accepted_attachments` takes {@link AcceptedAttachmentSlotInput}, so a slot's - * server-defaulted `min` can be omitted. - */ -export type CreateAgentRequest = Omit< - components["schemas"]["routers__api__agents__CreateAgentRequest"], - "accepted_attachments" -> & { accepted_attachments?: AcceptedAttachmentSlotInput[] | null }; - -/** Request body for updating an agent. */ -export type UpdateAgentRequest = components["schemas"]["routers__api__agents__UpdateAgentRequest"]; - -/** - * Request body for updating an agent definition (steps, model, etc.). - * - * `accepted_attachments` takes {@link AcceptedAttachmentSlotInput}, so a slot's - * server-defaulted `min` can be omitted. - */ -export type UpdateAgentDefinitionRequest = Omit< - components["schemas"]["UpdateAgentDefinitionRequest"], - "accepted_attachments" -> & { accepted_attachments?: AcceptedAttachmentSlotInput[] | null }; - -/** - * One input attachment a trigger accepts: a named slot that a run's files are - * assigned to before any step runs. Steps reference it as - * `{{agent.attachments.}}`. - */ -export type AcceptedAttachmentSlot = components["schemas"]["AcceptedAttachmentSlot"]; - -/** - * An {@link AcceptedAttachmentSlot} as written: `min` has a server-side - * default of `0` and can be omitted — the generated type marks - * it required only because the schema declares a default. - */ -export type AcceptedAttachmentSlotInput = Omit & { min?: number }; - -/** - * Request body for {@link Seclai.setAcceptedAttachments}: the full list of - * accepted attachments, with each slot's server-defaulted `min` optional. - */ -export type SetAcceptedAttachmentsInput = Omit< - components["schemas"]["SetAcceptedAttachmentsRequest"], - "accepted_attachments" -> & { accepted_attachments: AcceptedAttachmentSlotInput[] | null }; - -/** - * Request body for declaring the input attachments a trigger accepts. The same - * type as {@link SetAcceptedAttachmentsInput}, so a slot's `min` can be omitted. - */ -export type SetAcceptedAttachmentsRequest = SetAcceptedAttachmentsInput; - -/** The input attachments a trigger now accepts. */ -export type AcceptedAttachmentsResponse = components["schemas"]["AcceptedAttachmentsResponse"]; - -/** Request body for previewing an agent_definition import (dry-run validation). */ -export type AgentImportPreviewRequest = components["schemas"]["routers__api__agents__AgentImportPreviewRequest"]; - -/** Response body summarising a successfully validated agent_definition import payload. */ -export type AgentImportPreviewResponse = components["schemas"]["routers__api__agents__AgentImportPreviewResponse"]; - -/** - * 422 response body for invalid `agent_definition` payloads on create/update/preview-import. - * Errors carry 1-indexed line/column references into the canonical `source` echo. - */ -export type AgentDefinitionImportErrorResponse = components["schemas"]["AgentDefinitionImportErrorResponse"]; - -/** Single validation error within an {@link AgentDefinitionImportErrorResponse} (with source position). */ -export type ImportFieldErrorModel = components["schemas"]["ImportFieldErrorModel"]; - -/** One item dropped or substituted during an agent import (emitted in `import_warnings`). */ -export type ImportSkipResponse = components["schemas"]["ImportSkipResponse"]; - -/** Reference to a governance policy (id and optional display name). */ -export type GovernancePolicyRefResponse = components["schemas"]["routers__api__agents__GovernancePolicyRefResponse"]; - -/** A live agent that calls another agent via a `call_agent` step (blocks disabling the callee). */ -export type AgentCallerApiResponse = components["schemas"]["AgentCallerApiResponse"]; - -// ─── Agent Email Triggers ──────────────────────────────────────────────────── - -/** - * Request body for configuring an `EMAIL_RECEIVED` trigger. - * - * An omitted field is left unchanged; passing `null` (or `""` for `alias`) clears it. - */ -export type SetEmailTriggerConfigRequest = components["schemas"]["routers__api__agents__SetEmailTriggerConfigRequest"]; - -/** An `EMAIL_RECEIVED` trigger's resolved email address(es) and inbound-handling config. */ -export type EmailTriggerConfigResponse = components["schemas"]["EmailTriggerConfigResponse"]; - -// ─── Agent Email Governance ────────────────────────────────────────────────── - -/** A recipient's opt-out from an account's agent emails (one agent, or account-wide). */ -export type AgentEmailOptOutResponse = components["schemas"]["AgentEmailOptOutResponse"]; - -/** A page of agent-email opt-outs plus the total count. */ -export type AgentEmailOptOutListResponse = VersionedList; - -/** Request body for blocking an inbound email sender or domain. */ -export type BlockEmailSenderRequest = components["schemas"]["BlockEmailSenderRequest"]; - -/** A single blocked inbound email sender. */ -export type BlockedEmailSenderResponse = components["schemas"]["BlockedEmailSenderResponse"]; - -/** A page of blocked senders plus the account's governance auto-block mode. */ -export type BlockedEmailSenderListResponse = VersionedList; - -/** Request body for setting the governance auto-block mode. */ -export type SetAutoBlockModeRequest = components["schemas"]["SetAutoBlockModeRequest"]; - -/** An inbound email that was discarded before running an agent. */ -export type InboundEmailRejectionResponse = components["schemas"]["InboundEmailRejectionResponse"]; - -/** Mail an email content source refused: who sent it and why, never its subject or body. */ -export type EmailSourceRejectionResponse = components["schemas"]["EmailSourceRejectionResponse"]; - -/** A page of an email source's refused mail, under `data` with `pagination`. */ -export type EmailSourceRejectionListResponse = components["schemas"]["EmailSourceRejectionListResponse"]; - -/** Account-wide inbound-email overload state (breaker paused + queued backlog size). */ -export type InboundEmailStatusResponse = components["schemas"]["InboundEmailStatusResponse"]; - -/** Number of queued inbound-email runs cancelled. */ -export type CancelQueuedRunsResponse = components["schemas"]["CancelQueuedRunsResponse"]; - -/** Result of manually lifting the inbound-email pause. */ -export type ResumeInboundResponse = components["schemas"]["ResumeInboundResponse"]; - -// ─── Agent Runs ────────────────────────────────────────────────────────────── - -/** Request body for starting an agent run. */ -export type AgentRunRequest = components["schemas"]["AgentRunRequest"]; - -/** - * Request body for starting an agent run in streaming mode (SSE). - * - * `include_reasoning` has a server-side default of `false` and stays optional — - * the generated type marks it required only because the schema declares a default. - */ -export type AgentRunStreamRequest = Omit & - Partial>; - -/** Response body describing an agent run. */ -export type AgentRunResponse = components["schemas"]["AgentRunResponse"]; - -/** Paginated list of agent runs. */ -export type AgentRunListResponse = components["schemas"]["routers__api__agents__AgentRunListResponse"]; - -/** Details of a single step within an agent run. */ -export type AgentRunStepResponse = components["schemas"]["AgentRunStepResponse"]; - -/** Details of a single attempt within an agent run step. */ -export type AgentRunAttemptResponse = components["schemas"]["AgentRunAttemptResponse"]; - -/** A file a run or step produced or received (within `attachments`). */ -export type AgentRunFileResponse = components["schemas"]["AgentRunFileResponse"]; - -/** A single LLM tool call made during a `prompt_call` step (within {@link AgentRunStepResponse}'s `tool_calls`). */ -export type AgentRunToolCallResponse = components["schemas"]["AgentRunToolCallResponse"]; - -/** Search request for agent runs (traces). */ -export type AgentTraceSearchRequest = components["schemas"]["routers__api__agents__AgentTraceSearchRequest"]; - -/** Search response containing matching agent runs. */ -export type AgentTraceSearchResponse = components["schemas"]["AgentTraceSearchResponse"]; - -/** Individual match within an agent trace search. */ -export type AgentTraceMatchResponse = components["schemas"]["AgentTraceMatchResponse"]; - -// ─── Agent Input Uploads ───────────────────────────────────────────────────── - -/** Response from uploading a file input for an agent run. */ -export type UploadAgentInputApiResponse = components["schemas"]["UploadAgentInputApiResponse"]; - -/** - * Static attachment-reference contract for an agent — what files (if any) its - * templates expect on a run, so uploads can be staged before calling `runAgent`. - */ -export type AgentAttachmentRefsApiResponse = components["schemas"]["AgentAttachmentRefsApiResponse"]; - -/** Per-source attachment-reference summary (exact names, indexes, glob patterns) within an {@link AgentAttachmentRefsApiResponse}. */ -export type AttachmentRefsSourceApiSummary = components["schemas"]["AttachmentRefsSourceApiSummary"]; - -// ─── Agent Steps AI Assistant ──────────────────────────────────────────────── - -/** Request body for generating agent workflow steps via AI. */ -export type GenerateAgentStepsRequest = components["schemas"]["GenerateAgentStepsRequest"]; - -/** Response containing AI-generated agent workflow steps. */ -export type GenerateAgentStepsResponse = components["schemas"]["GenerateAgentStepsResponse"]; - -/** Request body for generating a single step config via AI. */ -export type GenerateStepConfigRequest = components["schemas"]["GenerateStepConfigRequest"]; - -/** Response containing an AI-generated step config. */ -export type GenerateStepConfigResponse = components["schemas"]["GenerateStepConfigResponse"]; - -/** Example prompt entry used in step config generation. */ -export type ExamplePrompt = components["schemas"]["ExamplePrompt"]; - -/** Request body for marking an AI suggestion as accepted/rejected. */ -export type MarkAiSuggestionRequest = components["schemas"]["MarkAiSuggestionRequest"]; - -/** AI conversation history for an agent. */ -export type AiConversationHistoryResponse = components["schemas"]["AiConversationHistoryResponse"]; - -/** Individual turn in an AI conversation. */ -export type AiConversationTurnResponse = components["schemas"]["AiConversationTurnResponse"]; - -// ─── Agent Evaluations ─────────────────────────────────────────────────────── - -/** Evaluation tier: fast, balanced, or thorough. */ -export type AgentEvaluationTier = components["schemas"]["AgentEvaluationTier"]; - -/** Evaluation criteria configuration for an agent. */ -export type EvaluationCriteriaResponse = components["schemas"]["EvaluationCriteriaResponse"]; - -/** A page of alerts. Always the canonical `{data, pagination}` envelope. */ -export type AlertListResponse = components["schemas"]["routers__api__alerts__AlertListResponse"]; - -/** A single alert. */ -export type AlertResponse = components["schemas"]["routers__api__alerts__AlertResponse"]; - -/** A single alert configuration. */ -export type AlertConfigResponse = components["schemas"]["AlertConfigResponse"]; - -/** - * A page of alert configurations. - * - * `configs` and `total` are populated on every API version; `data` and - * `pagination` are also present once `apiVersion` is `2026-07-27` or later. - */ -export type AlertConfigListResponse = { - configs?: AlertConfigResponse[]; - data?: AlertConfigResponse[]; - pagination?: PaginationResponse; - total?: number; -}; - -/** A single model lifecycle alert. */ -export type ModelAlertResponse = components["schemas"]["routers__api__model_lifecycle__ModelAlertResponse"]; - -/** - * A page of model lifecycle alerts. - * - * `alerts` and `total` are populated on every API version; `data` and - * `pagination` are also present once `apiVersion` is `2026-07-27` or later. - */ -export type ModelAlertListResponse = { - alerts?: ModelAlertResponse[]; - data?: ModelAlertResponse[]; - pagination?: PaginationResponse; - total?: number; -}; - -/** A single alert with its comments, subscribers and history. */ -export type AlertDetailResponse = components["schemas"]["routers__api__alerts__AlertDetailResponse"]; - -/** A comment on an alert. */ -export type AlertCommentResponse = components["schemas"]["routers__api__alerts__AlertCommentResponse"]; - -/** A subscriber to an alert. */ -export type AlertSubscriberResponse = components["schemas"]["routers__api__alerts__AlertSubscriberResponse"]; - -/** A count of unread items. */ -export type UnreadCountResponse = components["schemas"]["UnreadCountResponse"]; - -/** Successor recommendations for a model. */ -export type ModelRecommendationsResponse = components["schemas"]["routers__api__model_lifecycle__ModelRecommendationsResponse"]; - -/** A single successor recommendation. */ -export type ModelRecommendationResponse = components["schemas"]["routers__api__model_lifecycle__ModelRecommendationResponse"]; - -/** A page of model playground experiments. */ -export type ExperimentListResponse = VersionedList; - -/** A model playground experiment in a listing. */ -export type ExperimentSummaryResponse = components["schemas"]["ExperimentSummaryResponse"]; - -/** A model playground experiment with its results. */ -export type ExperimentDetailResponse = components["schemas"]["ExperimentDetailResponse"]; - -/** Acknowledgement of a created experiment. */ -export type CreateExperimentResponse = components["schemas"]["CreateExperimentResponse"]; - -/** Acknowledgement of a cancelled experiment. */ -export type CancelExperimentResponse = components["schemas"]["CancelExperimentResponse"]; - -/** A ranked set of search results. Deliberately not paginated. */ -export type SearchResponse = components["schemas"]["routers__api__search__SearchResponse"]; - -/** A single search hit. */ -export type SearchResultResponse = components["schemas"]["routers__api__search__SearchResultResponse"]; - -/** A simple acknowledgement. */ -export type OkResponse = components["schemas"]["OkResponse"]; - -/** The API version a request resolved to, and the versions available. */ -export type ApiVersionResponse = components["schemas"]["ApiVersionResponse"]; - -/** - * A page of evaluation criteria. - * - * Not a generated type: the endpoint returns a bare array by default, and only - * emits the canonical `{data, pagination}` envelope once the caller opts in with - * `apiVersion: "2026-07-27"` or later. `pagination` is therefore absent unless - * opted in. - */ -export type EvaluationCriteriaListResponse = { - data: EvaluationCriteriaResponse[]; - pagination?: PaginationResponse; -}; - -/** Request body for creating evaluation criteria. */ -export type CreateEvaluationCriteriaRequest = components["schemas"]["CreateEvaluationCriteriaRequest"]; - -/** Request body for updating evaluation criteria. */ -export type UpdateEvaluationCriteriaRequest = components["schemas"]["UpdateEvaluationCriteriaRequest"]; - -/** Individual evaluation result. */ -export type EvaluationResultResponse = components["schemas"]["EvaluationResultResponse"]; - -/** Paginated list of evaluation results. */ -export type EvaluationResultListResponse = VersionedList; - -/** Request body for creating a manual evaluation result. */ -export type CreateEvaluationResultRequest = components["schemas"]["CreateEvaluationResultRequest"]; - -/** Summary of evaluation results for a criteria. */ -export type EvaluationResultSummaryResponse = components["schemas"]["EvaluationResultSummaryResponse"]; - -/** Evaluation result with its associated criteria. */ -export type EvaluationResultWithCriteriaResponse = components["schemas"]["EvaluationResultWithCriteriaResponse"]; - -/** Paginated list of evaluation results with criteria. */ -/** - * A page of evaluation results with criteria context. - * - * Not a generated type: two endpoints share this shape and populate different - * halves of it. - * - * - `GET /agents/{id}/evaluation-results` is always paginated and fills `total`, - * `page` and `limit`. - * - `GET /agents/{id}/runs/{runId}/evaluation-results` is version-gated: a bare - * array by default, and the canonical `{data, pagination}` envelope once - * `apiVersion` is `2026-07-27` or later. The client then fills `total`, - * `page` and `limit` from `pagination`; on the bare array they are absent. - */ -export type EvaluationResultWithCriteriaListResponse = Omit< - components["schemas"]["EvaluationResultWithCriteriaListResponse"], - "total" | "page" | "limit" -> & { - pagination?: PaginationResponse; - total?: number; - page?: number; - limit?: number; -}; - -/** Summary of an evaluation run. */ -export type EvaluationRunSummaryResponse = components["schemas"]["EvaluationRunSummaryResponse"]; - -/** Paginated list of evaluation run summaries. */ -export type EvaluationRunSummaryListResponse = VersionedList; - -/** Status of an evaluation: pending, passed, failed, skipped, or error. */ -export type EvaluationStatus = components["schemas"]["EvaluationStatus"]; - -/** Summary of non-manual (automated) evaluation results. */ -export type NonManualEvaluationSummaryResponse = components["schemas"]["schemas__v1__agent_evaluations__NonManualEvaluationSummaryResponse"]; - -/** Per-mode stats within a non-manual evaluation summary. */ -export type NonManualEvaluationModeStatResponse = components["schemas"]["schemas__v1__agent_evaluations__NonManualEvaluationModeStatResponse"]; - -/** Request for testing a draft evaluation. */ -export type TestDraftEvaluationRequest = components["schemas"]["TestDraftEvaluationRequest"]; - -/** - * Response from testing a draft evaluation. When `status` is `error` (no - * verdict), `score` and `passed` are `null` with `apiVersion` `2026-10-21` or - * later, and 0.5 and `false` below it; the spec documents only the latter. - */ -export type TestDraftEvaluationResponse = Omit< - components["schemas"]["TestDraftEvaluationResponse"], - "status" | "score" | "passed" -> & - ( - | { status: Exclude; score: number; passed: boolean } - | { status: "error"; score: number | null; passed: boolean | null } - ); - -/** Paginated list of runs compatible with a specific evaluation criteria. */ -export type CompatibleRunListResponse = VersionedList; - -/** Individual compatible run. */ -export type CompatibleRunResponse = components["schemas"]["CompatibleRunResponse"]; - -// ─── Knowledge Bases ───────────────────────────────────────────────────────── - -/** Paginated list of knowledge bases. */ -export type KnowledgeBaseListResponse = VersionedList; - -/** Full knowledge base configuration and metadata. */ -export type KnowledgeBaseResponse = components["schemas"]["KnowledgeBaseResponseModel"]; - -/** Request body for creating a knowledge base. */ -export type CreateKnowledgeBaseBody = components["schemas"]["CreateKnowledgeBaseBody"]; - -/** Request body for updating a knowledge base. */ -export type UpdateKnowledgeBaseBody = components["schemas"]["UpdateKnowledgeBaseBody"]; - -// ─── Memory Banks ──────────────────────────────────────────────────────────── - -/** Paginated list of memory banks. */ -export type MemoryBankListResponse = VersionedList; - -/** Full memory bank configuration and metadata. */ -export type MemoryBankResponse = components["schemas"]["MemoryBankResponseModel"]; - -/** Request body for creating a memory bank. */ -export type CreateMemoryBankBody = components["schemas"]["CreateMemoryBankBody"]; - -/** Request body for updating a memory bank. */ -export type UpdateMemoryBankBody = components["schemas"]["UpdateMemoryBankBody"]; - -/** Memory bank AI assistant request. */ -export type MemoryBankAiAssistantRequest = components["schemas"]["routers__api__memory_banks__MemoryBankAiAssistantRequest"]; - -/** Memory bank AI assistant response. */ -export type MemoryBankAiAssistantResponse = components["schemas"]["MemoryBankAiAssistantResponse"]; - -/** Memory bank AI accept request. */ -export type MemoryBankAcceptRequest = components["schemas"]["routers__api__memory_banks__MemoryBankAcceptRequest"]; - -/** Memory bank configuration generated by AI. */ -export type MemoryBankConfigResponse = components["schemas"]["MemoryBankConfigResponse"]; - -/** Last conversation for a memory bank AI assistant. */ -export type MemoryBankLastConversationResponse = components["schemas"]["routers__api__memory_banks__MemoryBankLastConversationResponse"]; - -/** Individual turn in a memory bank AI conversation. */ -export type MemoryBankConversationTurnResponse = components["schemas"]["routers__api__memory_banks__MemoryBankConversationTurnResponse"]; - -/** Compaction test request for memory banks. */ -export type TestCompactionRequest = components["schemas"]["TestCompactionRequest"]; - -/** Compaction test response. */ -export type CompactionTestResponse = components["schemas"]["CompactionTestResponseModel"]; - -/** Standalone compaction test request. */ -export type StandaloneTestCompactionRequest = components["schemas"]["StandaloneTestCompactionRequest"]; - -/** Compaction evaluation model result. */ -export type CompactionEvaluationModel = components["schemas"]["CompactionEvaluationModel"]; - -// ─── Sources ───────────────────────────────────────────────────────────────── - -/** Paginated list of sources. */ -export type SourceListResponse = components["schemas"]["routers__api__sources__SourceListResponse"]; - -/** Full source response with metadata, sync status, and configuration. */ -export type SourceResponse = components["schemas"]["SourceResponse"]; - -/** Detailed source connection model. */ -export type SourceConnectionResponse = components["schemas"]["SourceConnectionResponseModel"]; - -/** Request body for creating a source. */ -export type CreateSourceBody = components["schemas"]["CreateSourceBody"]; - -/** Request body for updating a source. */ -export type UpdateSourceBody = components["schemas"]["UpdateSourceBody"]; - -/** Upload response for file uploads to a source. */ -export type FileUploadResponse = components["schemas"]["routers__api__sources__FileUploadResponse"]; - -/** Request body for uploading inline text to a source. */ -export type InlineTextUploadRequest = components["schemas"]["InlineTextUploadRequest"]; - -/** Request body for replacing content with inline text. */ -export type InlineTextReplaceRequest = components["schemas"]["InlineTextReplaceRequest"]; - -/** One content item's indexing status within a source. */ -export type SourceContentStatusResponse = components["schemas"]["SourceContentStatusResponse"]; - -/** Paginated list of a source's content items and their indexing status. */ -export type SourceContentStatusListResponse = components["schemas"]["SourceContentStatusListResponse"]; - -/** Filters for {@link Seclai.listSourceContents}. */ -export interface ListSourceContentsOptions extends SortableListOptions { - /** Keep only one status: pending, fetching, transcribing, scanning, indexing, completed or failed. */ - status?: string; - /** - * Keep only these items — the `content_version_id` values the upload methods - * return. Keep it to about 100: the ids travel in the query string, and a URL - * over 8,192 bytes is rejected with a 414. The API itself accepts at most 500. - */ - contentVersionIds?: string[]; -} - -// ─── Cloud Drives ──────────────────────────────────────────────────────────── - -/** A cloud-drive provider this deployment has configured. */ -export type CloudDriveProviderResponse = components["schemas"]["CloudDriveProviderResponseModel"]; - -/** An OAuth scope a {@link CloudDriveProviderResponse} can request. */ -export type CloudDriveScopeResponse = components["schemas"]["CloudDriveScopeResponseModel"]; - -/** An access level a {@link CloudDriveProviderResponse} offers. */ -export type CloudDriveAccessLevelResponse = components["schemas"]["CloudDriveAccessLevelResponseModel"]; - -/** A cloud-drive connection. */ -export type CloudDriveResponse = components["schemas"]["CloudDriveResponseModel"]; - -/** Request body for updating a cloud-drive connection. */ -export type CloudDriveUpdateRequest = components["schemas"]["CloudDriveUpdateRequest"]; - -/** An agent that uses a cloud-drive connection. */ -export type AgentUsingCloudDriveResponse = components["schemas"]["AgentUsingCloudDriveResponseModel"]; - -/** A file a cloud-drive connection skipped, and why. */ -export type CloudDriveRejectionResponse = components["schemas"]["CloudDriveRejectionResponseModel"]; - -// ─── Source Exports ────────────────────────────────────────────────────────── - -/** Paginated list of source exports. */ -export type ExportListResponse = components["schemas"]["ExportListResponse"]; - -/** Response for a single source export. */ -export type ExportResponse = components["schemas"]["routers__api__source_exports__ExportResponse"]; - -/** Request body for creating a source export. */ -export type CreateExportRequest = components["schemas"]["routers__api__source_exports__CreateExportRequest"]; - -/** Request body for estimating a source export. */ -export type EstimateExportRequest = components["schemas"]["routers__api__source_exports__EstimateExportRequest"]; - -/** Response for a source export estimate. */ -export type EstimateExportResponse = components["schemas"]["routers__api__source_exports__EstimateExportResponse"]; - -/** Supported export formats. */ -export type ExportFormat = components["schemas"]["ExportFormat"]; - -// ─── Source Embedding Migrations ───────────────────────────────────────────── - -/** Response for a source embedding migration. */ -export type SourceEmbeddingMigrationResponse = components["schemas"]["SourceEmbeddingMigrationResponse"]; - -/** Request body for starting a source embedding migration. */ -export type StartSourceEmbeddingMigrationRequest = components["schemas"]["StartSourceEmbeddingMigrationRequest"]; - -// ─── Content ───────────────────────────────────────────────────────────────── - -/** Content detail response for a specific content version. */ -export type ContentDetailResponse = components["schemas"]["routers__api__contents__ContentDetailResponse"]; - -/** Paginated list of content embeddings. */ -export type ContentEmbeddingsListResponse = components["schemas"]["routers__api__contents__ContentEmbeddingsListResponse"]; - -/** Individual content embedding. */ -export type ContentEmbeddingResponse = components["schemas"]["ContentEmbeddingResponse"]; - -/** A file attached to a content item, with whether it is indexed and, if indexing failed, why. */ -export type ContentAttachmentResponse = components["schemas"]["ContentAttachmentResponse"]; - -/** A page of a content item's attachments, under `data` with `pagination`. */ -export type ContentAttachmentsListResponse = components["schemas"]["routers__api__contents__ContentAttachmentsListResponse"]; - -/** One content attachment with its indexing status, metadata and a range of the text it is indexed by. */ -export type ContentAttachmentDetailResponse = components["schemas"]["routers__api__contents__ContentAttachmentDetailResponse"]; - -/** A file on an email that was not attached to the content item, with the reason. */ -export type SkippedAttachmentResponse = components["schemas"]["SkippedAttachmentResponse"]; - -/** Why an email's file was not attached: `displayed_in_body`, `over_cap`, `no_filename` or `undecodable`. */ -export type SkippedAttachmentReason = components["schemas"]["SkippedAttachmentReason"]; - -/** Upload response for content replacement uploads. */ -export type ContentFileUploadResponse = components["schemas"]["routers__api__contents__FileUploadResponse"]; - -// ─── Solutions ─────────────────────────────────────────────────────────────── - -/** Paginated list of solutions. */ -export type SolutionListResponse = components["schemas"]["routers__api__solutions__SolutionListResponse"]; - -/** Full solution configuration and metadata. */ -export type SolutionResponse = components["schemas"]["routers__api__solutions__SolutionResponse"]; - -/** Summary of a solution. */ -export type SolutionSummaryResponse = components["schemas"]["SolutionSummaryResponse"]; - -/** Request body for creating a solution. */ -export type CreateSolutionRequest = components["schemas"]["CreateSolutionRequest"]; - -/** Request body for updating a solution. */ -export type UpdateSolutionRequest = components["schemas"]["UpdateSolutionRequest"]; - -/** Agent within a solution. */ -export type SolutionAgentResponse = components["schemas"]["routers__api__solutions__SolutionAgentResponse"]; - -/** Knowledge base within a solution. */ -export type SolutionKnowledgeBaseResponse = components["schemas"]["routers__api__solutions__SolutionKnowledgeBaseResponse"]; - -/** Source connection within a solution. */ -export type SolutionSourceConnectionResponse = components["schemas"]["SolutionSourceConnectionResponse"]; - -/** Conversation in a solution AI assistant. */ -export type SolutionConversationResponse = components["schemas"]["routers__api__solutions__SolutionConversationResponse"]; - -/** Request body for adding a conversation turn. */ -export type AddConversationTurnRequest = components["schemas"]["AddConversationTurnRequest"]; - -/** Request body for marking a conversation turn. */ -export type MarkConversationTurnRequest = components["schemas"]["MarkConversationTurnRequest"]; - -/** AI assistant generate request for solutions. */ -export type AiAssistantGenerateRequest = components["schemas"]["routers__api__solutions__AiAssistantGenerateRequest"]; - -/** AI assistant generate response for solutions. */ -export type AiAssistantGenerateResponse = components["schemas"]["AiAssistantGenerateResponse"]; - -/** AI assistant accept request for solutions. */ -export type AiAssistantAcceptRequest = components["schemas"]["routers__api__solutions__AiAssistantAcceptRequest"]; - -/** AI assistant accept response for solutions. */ -export type AiAssistantAcceptResponse = components["schemas"]["AiAssistantAcceptResponse"]; - -/** Proposed action in a solution AI plan. */ -export type ProposedActionResponse = components["schemas"]["ProposedActionResponse"]; - -/** Executed action in a solution AI plan. */ -export type ExecutedActionResponse = components["schemas"]["ExecutedActionResponse"]; - -// ─── Resource Linking ──────────────────────────────────────────────────────── - -/** Request body for linking resources (agents, KBs, sources) to a parent. */ -export type LinkResourcesRequest = components["schemas"]["LinkResourcesRequest"]; - -/** Request body for unlinking resources from a parent. */ -export type UnlinkResourcesRequest = components["schemas"]["UnlinkResourcesRequest"]; - -// ─── Governance ────────────────────────────────────────────────────────────── - -/** Governance AI assistant request. */ -export type GovernanceAiAssistantRequest = components["schemas"]["routers__api__governance__GovernanceAiAssistantRequest"]; - -/** Governance AI assistant response. */ -export type GovernanceAiAssistantResponse = components["schemas"]["GovernanceAiAssistantResponse"]; - -/** Governance AI accept response. */ -export type GovernanceAiAcceptResponse = components["schemas"]["GovernanceAiAcceptResponse"]; - -/** Governance conversation turn. */ -export type GovernanceConversationResponse = components["schemas"]["routers__api__governance__GovernanceConversationResponse"]; - -/** Proposed policy action from governance AI. */ -export type GovernanceProposedPolicyActionResponse = components["schemas"]["ProposedPolicyActionResponse"]; - -/** Applied policy action from governance AI. */ -export type GovernanceAppliedActionResponse = components["schemas"]["AppliedActionResponse"]; - -// ─── Alerts ────────────────────────────────────────────────────────────────── - -/** Request body for creating an alert config. */ -export type CreateAlertConfigRequest = components["schemas"]["CreateAlertConfigRequest"]; - -/** Request body for updating an alert config. */ -export type UpdateAlertConfigRequest = components["schemas"]["UpdateAlertConfigRequest"]; - -/** Request body to change alert status. */ -export type ChangeStatusRequest = components["schemas"]["ChangeStatusRequest"]; - -/** Request to add a comment to an alert. */ -export type AddCommentRequest = components["schemas"]["routers__api__alerts__AddCommentRequest"]; - -/** Organization alert preference. */ -export type OrganizationAlertPreferenceResponse = components["schemas"]["routers__api__alerts__OrganizationAlertPreferenceResponse"]; - -/** Paginated list of organization alert preferences. */ -export type OrganizationAlertPreferenceListResponse = VersionedList; - -/** Request to update an organization alert preference. */ -export type UpdateOrganizationAlertPreferenceRequest = components["schemas"]["routers__api__alerts__UpdateOrganizationAlertPreferenceRequest"]; - -// ─── AI Assistant (top-level) ──────────────────────────────────────────────── - -/** Request body for AI assistant feedback. */ -export type AiAssistantFeedbackRequest = components["schemas"]["routers__api__ai_assistant__AiAssistantFeedbackRequest"]; - -/** AI assistant feedback response. */ -export type AiAssistantFeedbackResponse = components["schemas"]["AiAssistantFeedbackResponse"]; - -// ─── Models ────────────────────────────────────────────────────────────────── - -/** Prompt model auto-upgrade strategy. */ -export type PromptModelAutoUpgradeStrategy = components["schemas"]["PromptModelAutoUpgradeStrategy"]; - -/** Models grouped by provider. */ -export type ProviderGroupResponse = components["schemas"]["schemas__model_responses__ProviderGroupResponse"]; - -/** Full model details including capabilities, pricing, and lifecycle status. */ -export type PromptModelResponse = components["schemas"]["schemas__model_responses__PromptModelResponse"]; - -/** Prompt tool configuration within a model. */ -export type PromptToolResponse = components["schemas"]["PromptToolResponse"]; - -/** Per-modality rate for a model that prices image/audio/video distinctly from its default text rate. */ -export type ModalityRateResponse = components["schemas"]["ModalityRateResponse"]; - -/** The effort levels a model accepts, and its default. */ -export type EffortOptionsResponse = components["schemas"]["EffortOptionsResponse"]; - -/** An embedding model a source can index with. */ -export type EmbeddingModelResponse = components["schemas"]["EmbeddingModelResponse"]; - -/** The embedding models, with the defaults and pricing that apply to all of them. */ -export type EmbeddingModelListResponse = VersionedList; - -/** Per-modality rate for an embedding model. */ -export type EmbeddingModalityRateResponse = components["schemas"]["EmbeddingModalityRateResponse"]; - -/** Storage credits for one embedding dimension. */ -export type EmbeddingStorageCreditsResponse = components["schemas"]["EmbeddingStorageCreditsResponse"]; - -/** A reranker model a knowledge base can use. */ -export type RerankerModelResponse = components["schemas"]["RerankerModelResponse"]; - -/** The reranker models, with the default and pricing that apply to all of them. */ -export type RerankerModelListResponse = VersionedList; - -/** Variant category for model pricing tiers. */ -export type VariantCategoryResponse = components["schemas"]["VariantCategoryResponse"]; - -/** Variant option with credit pricing and context limits. */ -export type VariantOptionResponse = components["schemas"]["VariantOptionResponse"]; - -/** Request body for creating a model playground experiment. */ -export type PlaygroundCreateRequest = components["schemas"]["PlaygroundCreateRequest"]; - -/** - * Input type for {@link SeclaiClient.createExperiment}. - * - * Only `model_ids` and `prompt` are required — every other field has a - * server-side default and can be omitted. - */ -export type CreateExperimentInput = Pick & - Partial>; - -// ─── Email Domains ─────────────────────────────────────────────────────────── - -/** Request body for adding a vanity or custom agent-email domain. */ -export type AddEmailDomainRequest = components["schemas"]["AddEmailDomainRequest"]; - -/** - * Input type for {@link Seclai.addEmailDomain}. - * - * Only `kind` and `value` are required. `delegated` has a server-side default - * of `false` and can be omitted — the generated {@link AddEmailDomainRequest} - * marks it required only because the schema declares a default. - */ -export type AddEmailDomainInput = Pick & - Partial>; - -/** An agent-email domain with its verification status and required DNS records. */ -export type EmailDomainResponse = components["schemas"]["EmailDomainResponse"]; - -/** The account's email domains plus the plan capabilities for adding more. */ -export type EmailDomainsListResponse = VersionedList; - -/** Result of removing an email domain (with an optional registrar `cleanup_note`). */ -export type RemoveEmailDomainResponse = components["schemas"]["RemoveEmailDomainResponse"]; - -/** Result of sending a test email from a verified domain. */ -export type SendTestEmailResponse = components["schemas"]["SendTestEmailResponse"]; - -/** A DNS record the customer must publish for a domain, plus whether it currently resolves. */ -export type DnsRecordResponse = components["schemas"]["DnsRecordResponse"]; - -/** Detected DNS provider for a domain, with dashboard URL and provider-specific tips. */ -export type DnsProviderResponse = components["schemas"]["DnsProviderResponse"]; - -/** DMARC aggregate-report summary for a domain over a time window. */ -export type DmarcSummaryResponse = components["schemas"]["DmarcSummaryResponse"]; - -/** A top DMARC-failing source IP within a {@link DmarcSummaryResponse}. */ -export type DmarcFailingSourceResponse = components["schemas"]["DmarcFailingSourceResponse"]; - -// ─── Errors ────────────────────────────────────────────────────────────────── - -/** 402 envelope returned when an account has exhausted its credits. */ -export type InsufficientCreditsResponse = components["schemas"]["InsufficientCreditsResponse"]; - -/** `error` body of an {@link InsufficientCreditsResponse} (`code`, message, and account id). */ -export type InsufficientCreditsDetail = components["schemas"]["InsufficientCreditsDetail"]; - -// ─── Sources (enums) ───────────────────────────────────────────────────────── - -/** Source index mode: fast_and_cheap, balanced, slow_and_thorough, or custom. */ -export type SourceIndexMode = components["schemas"]["SourceIndexMode"]; - -// ─── Enums ─────────────────────────────────────────────────────────────────── - -/** Processing status: pending, processing, completed, or failed. */ -export type PendingProcessingCompletedFailedStatus = components["schemas"]["PendingProcessingCompletedFailedStatus"]; - -// ─── SSE Event Types ───────────────────────────────────────────────────────── - -/** An SSE event emitted during a streaming agent run. */ -export interface AgentRunEvent { - /** The SSE event type (e.g. "init", "step", "done", "error", "timeout"). */ - event: string; - /** Parsed JSON payload (typically an {@link AgentRunResponse}). */ - data: unknown; -} - -// ─── Pagination Options ────────────────────────────────────────────────────── - -/** Common pagination + sorting options for list endpoints. */ -export interface ListOptions { - /** Page number (1-indexed). */ - page?: number; - /** Items per page. */ - limit?: number; -} - -/** Pagination + sorting options. */ -export interface SortableListOptions extends ListOptions { - /** Field to sort by (e.g. "created_at"). */ - sort?: string; - /** Sort order. */ - order?: "asc" | "desc"; -} diff --git a/src/versions.ts b/src/versions.ts deleted file mode 100644 index e24e4d4..0000000 --- a/src/versions.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Dated API versions known to this release, for use with the `apiVersion` - * client option. - * - * The set is open: the API adds versions without an SDK release, and - * {@link ApiVersion} widens to `string`, so a date newer than this release - * knows about can be passed directly. Treat these as convenience constants - * rather than an exhaustive list — `getApiVersion()` reports what the server - * actually supports. - */ -export const SeclaiApiVersion = { - V2026_07_01: "2026-07-01", - V2026_07_27: "2026-07-27", - V2026_08_03: "2026-08-03", - V2026_08_21: "2026-08-21", - V2026_09_28: "2026-09-28", - V2026_09_30: "2026-09-30", - V2026_10_03: "2026-10-03", - V2026_10_05: "2026-10-05", - V2026_10_13: "2026-10-13", - V2026_10_16: "2026-10-16", - V2026_10_18: "2026-10-18", - V2026_10_19: "2026-10-19", - V2026_10_21: "2026-10-21", - /** Baseline applied to an unpinned, header-less caller. */ - Default: "2026-07-01", - /** Newest version known to this SDK release. May lag the server. */ - Latest: "2026-10-21", -} as const; - -/** - * A dated API version. Known values autocomplete; any `YYYY-MM-DD` string still - * typechecks, but one this release was not built against is rejected at - * construction unless `allowUnknownApiVersion` is set. - */ -export type ApiVersion = - | (typeof SeclaiApiVersion)[keyof typeof SeclaiApiVersion] - // eslint-disable-next-line @typescript-eslint/ban-types - | (string & {}); - -/** Every version this release was built against, oldest first. */ -export const KNOWN_API_VERSIONS: readonly string[] = Object.entries(SeclaiApiVersion) - .filter(([k]) => k.startsWith("V")) - .map(([, v]) => v); diff --git a/tests/client.test.ts b/tests/client.test.ts deleted file mode 100644 index 55d9e67..0000000 --- a/tests/client.test.ts +++ /dev/null @@ -1,3767 +0,0 @@ -import { readFileSync } from "node:fs"; -import { describe, expect, test } from "vitest"; - -import { - Seclai, - SeclaiAPIStatusError, - SeclaiAPIValidationError, - SeclaiConfigurationError, - SeclaiError, - SeclaiStreamingError, - SeclaiApiVersion, -} from "../src/index"; -import type { SetAcceptedAttachmentsRequest } from "../src/index"; -import { parseIni, isTokenValid } from "../src/auth"; - -type RecordedRequest = { - url: string; - method: string; - headers: Record; - bodyText?: string; - body?: BodyInit; - signal?: AbortSignal | null; -}; - -function makeFetch(handler: (req: RecordedRequest) => Response | Promise) { - return async (input: RequestInfo | URL, init?: RequestInit): Promise => { - const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url; - const method = init?.method ?? "GET"; - - const headersObj = new Headers(init?.headers); - const headers: Record = {}; - for (const [k, v] of headersObj.entries()) headers[k.toLowerCase()] = v; - - let bodyText: string | undefined; - if (typeof init?.body === "string") { - bodyText = init.body; - } - - return await handler({ - url, - method, - headers, - bodyText, - body: init?.body ?? undefined, - signal: init?.signal ?? null, - }); - }; -} - -function jsonResponse(data: unknown, status = 200): Response { - return new Response(JSON.stringify(data), { - status, - headers: { "content-type": "application/json" }, - }); -} - -function makeSseResponse( - chunks: string[], - opts?: { signal?: AbortSignal | null; contentType?: string } -): Response { - const encoder = new TextEncoder(); - const stream = new ReadableStream({ - start(controller) { - let cancelled = false; - const onAbort = () => { - cancelled = true; - try { controller.error(new Error("aborted")); } catch { /* ignore */ } - }; - opts?.signal?.addEventListener("abort", onAbort, { once: true }); - (async () => { - for (const chunk of chunks) { - if (cancelled) return; - controller.enqueue(encoder.encode(chunk)); - await Promise.resolve(); - } - controller.close(); - })().catch((e) => controller.error(e)); - }, - }); - return new Response(stream as any, { - status: 200, - headers: { "content-type": opts?.contentType ?? "text/event-stream" }, - }); -} - -/** Like fetch, never answers: rejects with an AbortError once `init.signal` aborts. */ -function hangUntilAborted(_input: RequestInfo | URL, init?: RequestInit): Promise { - return new Promise((_resolve, reject) => { - const signal = init?.signal; - if (!signal) return; - const abort = () => reject(new DOMException("The operation was aborted.", "AbortError")); - if (signal.aborted) abort(); - else signal.addEventListener("abort", abort, { once: true }); - }); -} - -function makeClient( - handler: (req: RecordedRequest) => Response | Promise, - extra: Partial[0]> = {}, -) { - return new Seclai({ - apiKey: "test-key", - baseUrl: "https://test.invalid", - fetch: makeFetch(handler), - ...extra, - }); -} - -// ───────────────────────────────────────────────────────────────────────────── -// Configuration & Auth -// ───────────────────────────────────────────────────────────────────────────── - -describe("Configuration & Auth", () => { - test("constructor throws when both apiKey and accessToken provided", () => { - expect(() => new Seclai({ - apiKey: "k", - accessToken: "t", - fetch: makeFetch(() => new Response("ok")), - })).toThrow(SeclaiConfigurationError); - }); - - test("first request rejects when no credentials can be resolved", async () => { - const p = (globalThis as any).process; - const prev = p?.env?.SECLAI_API_KEY; - const prevDir = p?.env?.SECLAI_CONFIG_DIR; - if (p?.env) { - delete p.env.SECLAI_API_KEY; - p.env.SECLAI_CONFIG_DIR = "/nonexistent-seclai-dir"; - } - const client = new Seclai({ fetch: makeFetch(() => new Response("ok")) }); - await expect(client.request("GET", "/test")).rejects.toThrow(/SSO token expired/); - if (p?.env) { - if (prev === undefined) delete p.env.SECLAI_API_KEY; - else p.env.SECLAI_API_KEY = prev; - if (prevDir === undefined) delete p.env.SECLAI_CONFIG_DIR; - else p.env.SECLAI_CONFIG_DIR = prevDir; - } - }); - - test("injects x-api-key header", async () => { - const client = makeClient((req) => { - expect(req.headers["x-api-key"]).toBe("test-key"); - return jsonResponse({ ok: true }); - }); - await client.request("GET", "/test"); - }); - - test("uses SECLAI_API_URL env var", async () => { - const p = (globalThis as any).process; - const prev = p?.env?.SECLAI_API_URL; - if (p?.env) p.env.SECLAI_API_URL = "https://env.example.invalid"; - - const client = new Seclai({ - apiKey: "k", - fetch: makeFetch((req) => { - expect(new URL(req.url).origin).toBe("https://env.example.invalid"); - return jsonResponse({}); - }), - }); - await client.request("GET", "/test"); - - if (p?.env) { - if (prev === undefined) delete p.env.SECLAI_API_URL; - else p.env.SECLAI_API_URL = prev; - } - }); - - test("preserves path prefix in baseUrl", async () => { - const client = new Seclai({ - apiKey: "k", - baseUrl: "https://proxy.example.invalid/v1/api", - fetch: makeFetch((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/v1/api/agents"); - return jsonResponse([]); - }), - }); - await client.request("GET", "/agents"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Error Handling -// ───────────────────────────────────────────────────────────────────────────── - -describe("Error Handling", () => { - test("throws SeclaiAPIValidationError on 422", async () => { - const client = makeClient(() => - new Response(JSON.stringify({ detail: [{ loc: ["body"], msg: "bad", type: "value_error" }] }), { - status: 422, headers: { "content-type": "application/json" }, - }), - ); - await expect(client.listSources()).rejects.toBeInstanceOf(SeclaiAPIValidationError); - }); - - test("throws SeclaiAPIStatusError on non-2xx", async () => { - const client = makeClient(() => new Response("nope", { status: 401 })); - await expect(client.listSources()).rejects.toBeInstanceOf(SeclaiAPIStatusError); - }); - - test("SeclaiStreamingError has runId", () => { - const err = new SeclaiStreamingError("timeout", "run_xyz"); - expect(err.runId).toBe("run_xyz"); - expect(err.name).toBe("SeclaiStreamingError"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agents — CRUD -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agents — CRUD", () => { - test("listAgents sends GET /agents with pagination", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - const u = new URL(req.url); - expect(u.pathname).toBe("/agents"); - expect(u.searchParams.get("page")).toBe("2"); - expect(u.searchParams.get("limit")).toBe("10"); - return jsonResponse({ items: [], pagination: {} }); - }); - await client.listAgents({ page: 2, limit: 10 }); - }); - - test("createAgent sends POST /agents", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents"); - const body = JSON.parse(req.bodyText!); - expect(body.name).toBe("test-agent"); - return jsonResponse({ id: "ag_1", name: "test-agent" }, 201); - }); - await client.createAgent({ name: "test-agent" } as any); - }); - - test("getAgent sends GET /agents/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1"); - return jsonResponse({ id: "ag_1" }); - }); - await client.getAgent("ag_1"); - }); - - test("updateAgent sends PUT /agents/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1"); - return jsonResponse({ id: "ag_1" }); - }); - await client.updateAgent("ag_1", { name: "updated" } as any); - }); - - test("deleteAgent sends DELETE /agents/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1"); - return new Response(null, { status: 204 }); - }); - await client.deleteAgent("ag_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Export -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Export", () => { - test("exportAgent sends GET /agents/:id/export with download=true by default", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - const url = new URL(req.url); - expect(url.pathname).toBe("/agents/ag_1/export"); - expect(url.searchParams.get("download")).toBe("true"); - return jsonResponse({ export_version: "2", agent: {} }); - }); - await client.exportAgent("ag_1"); - }); - - test("exportAgent passes download=false when specified", async () => { - const client = makeClient((req) => { - const url = new URL(req.url); - expect(url.searchParams.get("download")).toBe("false"); - return jsonResponse({ export_version: "2", agent: {} }); - }); - await client.exportAgent("ag_1", false); - }); - - test("previewImportAgent sends POST /agents/preview-import", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/preview-import"); - const body = JSON.parse(req.bodyText!); - expect(body.agent_definition).toEqual({ agent: { name: "n" } }); - return jsonResponse({ - ok: true, - agent_name: "n", - description: null, - step_count: 0, - schedules: 0, - alert_configs: 0, - evaluation_criteria: 0, - governance_policies: 0, - }); - }); - await client.previewImportAgent({ agent_definition: { agent: { name: "n" } } } as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Definitions -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Definitions", () => { - test("getAgentDefinition sends GET /agents/:id/definition", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/ag_1/definition"); - return jsonResponse({ steps: [] }); - }); - await client.getAgentDefinition("ag_1"); - }); - - test("updateAgentDefinition sends PUT /agents/:id/definition", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/definition"); - return jsonResponse({ steps: [] }); - }); - await client.updateAgentDefinition("ag_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Runs -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Runs", () => { - test("runAgent sends POST /agents/:id/runs", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/runs"); - const body = JSON.parse(req.bodyText!); - expect(body.input).toBe("hello"); - return jsonResponse({ id: "run_1", status: "pending" }); - }); - await client.runAgent("ag_1", { input: "hello" } as any); - }); - - test("listAgentRuns sends GET /agents/:id/runs with status filter", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/ag_1/runs"); - expect(u.searchParams.get("status")).toBe("completed"); - return jsonResponse({ items: [] }); - }); - await client.listAgentRuns("ag_1", { status: "completed" }); - }); - - test("searchAgentRuns sends POST /agents/runs/search", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/runs/search"); - return jsonResponse({ items: [] }); - }); - await client.searchAgentRuns({} as any); - }); - - test("getAgentRun includes step outputs via query param", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/runs/run_1"); - expect(u.searchParams.get("include_step_outputs")).toBe("true"); - return jsonResponse({ id: "run_1", status: "completed" }); - }); - await client.getAgentRun("run_1", { includeStepOutputs: true }); - }); - - test("deleteAgentRun is a deprecated alias that cancels", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/runs/run_1"); - return jsonResponse({ id: "run_1", status: "cancelled" }); - }); - await client.deleteAgentRun("run_1"); - }); - - test("cancelAgentRun sends DELETE /agents/runs/:id", async () => { - // Cancellation is DELETE on the run resource. This test asserted - // POST /agents/runs/:id/cancel, a path the API has never had, so it - // confirmed a 404-ing method rather than catching it. - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/runs/run_1"); - return jsonResponse({ id: "run_1", status: "cancelled" }); - }); - const run = await client.cancelAgentRun("run_1"); - expect((run as { status: string }).status).toBe("cancelled"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Streaming -// ───────────────────────────────────────────────────────────────────────────── - -describe("Streaming", () => { - test("runStreamingAgentAndWait parses SSE and returns done payload", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/ag_1/runs/stream"); - expect(req.headers["accept"]).toContain("text/event-stream"); - - const sse = [ - ": keepalive\n\n", - `event: init\ndata: ${JSON.stringify({ run_id: "run_1", status: "running" })}\n\n`, - `event: done\ndata: ${JSON.stringify({ run_id: "run_1", status: "completed", output: "ok" })}\n\n`, - ]; - return makeSseResponse(sse, { signal: req.signal }); - }); - - const result = await client.runStreamingAgentAndWait( - "ag_1", - { input: "hello", metadata: {} as any }, - { timeoutMs: 5_000 }, - ); - expect((result as any).status).toBe("completed"); - expect((result as any).output).toBe("ok"); - }); - - test("runStreamingAgentAndWait times out", async () => { - const client = makeClient((req) => - makeSseResponse([": keepalive\n\n", "event: init\ndata: {}\n\n"], { signal: req.signal }), - ); - - await expect( - client.runStreamingAgentAndWait("ag_1", { input: "hello", metadata: {} as any }, { timeoutMs: 5 }), - ).rejects.toBeInstanceOf(SeclaiStreamingError); - }); - - test("runStreamingAgent yields events as async iterable", async () => { - const client = makeClient((req) => { - const sse = [ - `event: init\ndata: ${JSON.stringify({ run_id: "run_1", status: "running" })}\n\n`, - `event: step\ndata: ${JSON.stringify({ step: 1 })}\n\n`, - `event: done\ndata: ${JSON.stringify({ run_id: "run_1", status: "completed" })}\n\n`, - ]; - return makeSseResponse(sse, { signal: req.signal }); - }); - - const events: { event: string; data: unknown }[] = []; - for await (const event of client.runStreamingAgent("ag_1", { input: "hi" } as any, { timeoutMs: 5_000 })) { - events.push(event); - } - - expect(events.length).toBe(3); - expect(events[0].event).toBe("init"); - expect(events[1].event).toBe("step"); - expect(events[2].event).toBe("done"); - expect((events[2].data as any).status).toBe("completed"); - }); - - test("runStreamingAgent sends include_reasoning and keeps it optional", async () => { - const bodies: unknown[] = []; - const client = makeClient((req) => { - bodies.push(JSON.parse(req.bodyText!)); - return makeSseResponse([`event: done\ndata: ${JSON.stringify({ run_id: "run_1" })}\n\n`], { signal: req.signal }); - }); - // No cast: `include_reasoning` is server-defaulted and must not be required. - for await (const _ of client.runStreamingAgent("ag_1", { input: "hi" })) void _; - for await (const _ of client.runStreamingAgent("ag_1", { input: "hi", include_reasoning: true })) void _; - expect(bodies).toEqual([{ input: "hi" }, { input: "hi", include_reasoning: true }]); - }); - test("runStreamingAgentAndWait does not send include_reasoning from an untyped caller", async () => { - const bodies: unknown[] = []; - const client = makeClient((req) => { - bodies.push(JSON.parse(req.bodyText!)); - return makeSseResponse([`event: done\ndata: ${JSON.stringify({ run_id: "run_1" })}\n\n`], { signal: req.signal }); - }); - // A plain-JS caller can pass the key the TypeScript signature omits. - const body = { input: "hi", include_reasoning: true } as unknown as { input: string }; - await client.runStreamingAgentAndWait("ag_1", body); - expect(bodies).toEqual([{ input: "hi" }]); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Polling -// ───────────────────────────────────────────────────────────────────────────── - -describe("Polling", () => { - test("runAgentAndPoll polls until completed", async () => { - let callCount = 0; - const client = makeClient((req) => { - callCount++; - const u = new URL(req.url); - if (req.method === "POST" && u.pathname.endsWith("/runs")) { - return jsonResponse({ id: "run_1", status: "pending" }); - } - // GET /agents/runs/run_1 - if (callCount <= 3) { - return jsonResponse({ id: "run_1", status: "running" }); - } - return jsonResponse({ id: "run_1", status: "completed", output: "done" }); - }); - - const result = await client.runAgentAndPoll("ag_1", { input: "hi" } as any, { - pollIntervalMs: 10, - timeoutMs: 5_000, - }); - expect((result as any).status).toBe("completed"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Knowledge Bases -// ───────────────────────────────────────────────────────────────────────────── - -describe("Knowledge Bases", () => { - test("listKnowledgeBases sends GET /knowledge_bases", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/knowledge_bases"); - return jsonResponse({ knowledge_bases: [], page: 1, limit: 20, total: 0 }); - }); - await client.listKnowledgeBases(); - }); - - test("createKnowledgeBase sends POST /knowledge_bases", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/knowledge_bases"); - return jsonResponse({ id: "kb_1" }, 201); - }); - await client.createKnowledgeBase({ name: "test" } as any); - }); - - test("getKnowledgeBase sends GET /knowledge_bases/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/knowledge_bases/kb_1"); - return jsonResponse({ id: "kb_1" }); - }); - await client.getKnowledgeBase("kb_1"); - }); - - test("updateKnowledgeBase sends PUT /knowledge_bases/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - return jsonResponse({ id: "kb_1" }); - }); - await client.updateKnowledgeBase("kb_1", {} as any); - }); - - test("deleteKnowledgeBase sends DELETE /knowledge_bases/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteKnowledgeBase("kb_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Memory Banks -// ───────────────────────────────────────────────────────────────────────────── - -describe("Memory Banks", () => { - test("listMemoryBanks sends GET /memory_banks", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks"); - return jsonResponse({ memory_banks: [], page: 1, limit: 20, total: 0 }); - }); - await client.listMemoryBanks(); - }); - - test("createMemoryBank sends POST /memory_banks", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - return jsonResponse({ id: "mb_1" }, 201); - }); - await client.createMemoryBank({ name: "test" } as any); - }); - - test("getMemoryBank sends GET /memory_banks/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1"); - return jsonResponse({ id: "mb_1" }); - }); - await client.getMemoryBank("mb_1"); - }); - - test("updateMemoryBank sends PUT /memory_banks/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - return jsonResponse({ id: "mb_1" }); - }); - await client.updateMemoryBank("mb_1", {} as any); - }); - - test("deleteMemoryBank sends DELETE /memory_banks/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteMemoryBank("mb_1"); - }); - - test("getMemoryBankStats sends GET /memory_banks/:id/stats", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1/stats"); - return jsonResponse({}); - }); - await client.getMemoryBankStats("mb_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Sources -// ───────────────────────────────────────────────────────────────────────────── - -describe("Sources", () => { - test("listEmailSourceRejections sends GET /sources/:id/email-rejections with page/limit", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(req.method).toBe("GET"); - expect(u.pathname).toBe("/sources/src_1/email-rejections"); - expect(u.searchParams.get("page")).toBe("3"); - expect(u.searchParams.get("limit")).toBe("10"); - return jsonResponse({ - data: [ - { - id: "r1", - created_at: "2026-10-21T00:00:00Z", - recipient: "inbox@example.seclai.com", - sender: "bounce@example.com", - sender_ip: "203.0.113.5", - from_address: "a@example.com", - reason: "sender_not_allowed", - authenticated: true, - }, - ], - pagination: { page: 3, limit: 10, total: 21, pages: 3, has_next: false, has_prev: true }, - }); - }); - const res = await client.listEmailSourceRejections("src_1", { page: 3, limit: 10 }); - expect(res.data[0]!.reason).toBe("sender_not_allowed"); - expect(res.pagination.pages).toBe(3); - }); - - test("listEmailSourceRejections sends no query by default", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).search).toBe(""); - return jsonResponse({ data: [], pagination: {} }); - }); - await client.listEmailSourceRejections("src_1"); - }); - - test("createSource and updateSource send the new source settings", async () => { - const bodies: unknown[] = []; - const client = makeClient((req) => { - bodies.push(JSON.parse(req.bodyText!)); - return jsonResponse({ id: "src_1" }); - }); - await client.createSource({ - name: "Inbox", - source_type: "email", - email_allowed_senders: ["example.com"], - document_images: true, - }); - await client.updateSource("src_1", { feed_attachments: ["enclosures"], cloud_drive_max_file_mb: 25 }); - expect(bodies).toEqual([ - { name: "Inbox", source_type: "email", email_allowed_senders: ["example.com"], document_images: true }, - { feed_attachments: ["enclosures"], cloud_drive_max_file_mb: 25 }, - ]); - }); - - test("listSources sends GET /sources with query params", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/sources"); - expect(u.searchParams.get("page")).toBe("2"); - expect(u.searchParams.get("order")).toBe("asc"); - expect(u.searchParams.get("account_id")).toBe("acc_1"); - return jsonResponse({ items: [] }); - }); - await client.listSources({ page: 2, order: "asc", accountId: "acc_1" }); - }); - - test("createSource sends POST /sources", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/sources"); - return jsonResponse({ id: "src_1" }, 201); - }); - await client.createSource({ name: "test" } as any); - }); - - test("getSource sends GET /sources/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/sources/src_1"); - return jsonResponse({ id: "src_1" }); - }); - await client.getSource("src_1"); - }); - - test("updateSource sends PUT /sources/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - return jsonResponse({ id: "src_1" }); - }); - await client.updateSource("src_1", {} as any); - }); - - test("deleteSource sends DELETE /sources/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteSource("src_1"); - }); - - test("uploadFileToSource sends multipart form data", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/sources/src_1/upload"); - expect(req.method).toBe("POST"); - expect(req.headers["content-type"]).toBeUndefined(); - expect(req.body).toBeInstanceOf(FormData); - - const form = req.body as FormData; - expect(form.get("title")).toBe("My title"); - expect(form.get("metadata")).toBe(JSON.stringify({ category: "docs" })); - const file = form.get("file") as any; - expect(file).toBeInstanceOf(Blob); - expect(file.type).toBe("text/plain"); - if (typeof file?.name === "string") expect(file.name).toBe("hello.txt"); - - return jsonResponse({ ok: true }); - }); - - await client.uploadFileToSource("src_1", { - file: new Uint8Array([104, 101, 108, 108, 111]), - title: "My title", - metadata: { category: "docs" }, - fileName: "hello.txt", - mimeType: "text/plain", - }); - }); - - test("uploadFileToSource infers MIME type from fileName", async () => { - const client = makeClient((req) => { - const form = req.body as FormData; - const file = form.get("file") as any; - expect(file.type).toBe("application/pdf"); - return jsonResponse({ ok: true }); - }); - - await client.uploadFileToSource("src_1", { - file: new Uint8Array([1, 2, 3]), - fileName: "document.pdf", - }); - }); - - test("uploadInlineTextToSource sends POST /sources/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/sources/src_1"); - return jsonResponse({ ok: true }); - }); - await client.uploadInlineTextToSource("src_1", { text: "hello" } as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Source Exports -// ───────────────────────────────────────────────────────────────────────────── - -describe("Source Exports", () => { - test("listSourceExports sends GET /sources/:id/exports", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/sources/src_1/exports"); - return jsonResponse({ items: [] }); - }); - await client.listSourceExports("src_1"); - }); - - test("createSourceExport sends POST /sources/:id/exports", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - return jsonResponse({ id: "exp_1" }); - }); - await client.createSourceExport("src_1", {} as any); - }); - - test("downloadSourceExport returns raw Response", async () => { - const client = makeClient(() => new Response("binary-data", { status: 200 })); - const resp = await client.downloadSourceExport("src_1", "exp_1"); - const text = await resp.text(); - expect(text).toBe("binary-data"); - }); - - test("downloadSourceExport forwards the abort signal", async () => { - const controller = new AbortController(); - const client = makeClient((req) => { - expect(req.signal).toBe(controller.signal); - return new Response("binary-data", { status: 200 }); - }); - await client.downloadSourceExport("src_1", "exp_1", { signal: controller.signal }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Source Embedding Migrations -// ───────────────────────────────────────────────────────────────────────────── - -describe("Source Embedding Migrations", () => { - test("getSourceEmbeddingMigration sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/sources/src_1/embedding-migration"); - return jsonResponse({ status: "idle" }); - }); - await client.getSourceEmbeddingMigration("src_1"); - }); - - test("startSourceEmbeddingMigration sends POST", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - return jsonResponse({ status: "running" }); - }); - await client.startSourceEmbeddingMigration("src_1", {} as any); - }); - - test("cancelSourceEmbeddingMigration sends POST /cancel", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/sources/src_1/embedding-migration/cancel"); - return jsonResponse({ status: "cancelled" }); - }); - await client.cancelSourceEmbeddingMigration("src_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Content -// ───────────────────────────────────────────────────────────────────────────── - -describe("Content", () => { - test("getContentDetail sends GET with range params", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/contents/cv_1"); - expect(u.searchParams.get("start")).toBe("100"); - expect(u.searchParams.get("end")).toBe("200"); - return jsonResponse({ text: "hello" }); - }); - await client.getContentDetail("cv_1", { start: 100, end: 200 }); - }); - - test("deleteContent sends DELETE /contents/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteContent("cv_1"); - }); - - test("listContentEmbeddings sends GET with pagination", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/contents/cv_1/embeddings"); - return jsonResponse({ items: [] }); - }); - await client.listContentEmbeddings("cv_1"); - }); - - test("listContentAttachments sends GET /contents/:id/attachments with page/limit", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(req.method).toBe("GET"); - expect(u.pathname).toBe("/contents/cv_1/attachments"); - expect(u.searchParams.get("page")).toBe("2"); - expect(u.searchParams.get("limit")).toBe("50"); - return jsonResponse({ - data: [{ id: "att_1", key: "k", content_type: "image/png", size_bytes: 3, indexed: true }], - pagination: { page: 2, limit: 50, total: 51, pages: 2, has_next: false, has_prev: true }, - }); - }); - const res = await client.listContentAttachments("cv_1", { page: 2, limit: 50 }); - expect(res.data[0]!.id).toBe("att_1"); - expect(res.pagination.total).toBe(51); - }); - - test("listContentAttachments sends no query by default", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).search).toBe(""); - return jsonResponse({ data: [], pagination: {} }); - }); - await client.listContentAttachments("cv_1"); - }); - - test("getContentAttachment sends GET with start/end", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(req.method).toBe("GET"); - expect(u.pathname).toBe("/contents/cv_1/attachments/att_1"); - expect(u.searchParams.get("start")).toBe("10"); - expect(u.searchParams.get("end")).toBe("20"); - return jsonResponse({ id: "att_1", text_content: "hello", file_withheld: null }); - }); - const res = await client.getContentAttachment("cv_1", "att_1", { start: 10, end: 20 }); - expect(res.text_content).toBe("hello"); - }); - - test("listContentAttachmentEmbeddings sends GET .../embeddings with page/limit", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(req.method).toBe("GET"); - expect(u.pathname).toBe("/contents/cv_1/attachments/att_1/embeddings"); - expect(u.searchParams.get("page")).toBe("1"); - expect(u.searchParams.get("limit")).toBe("100"); - return jsonResponse({ items: [] }); - }); - await client.listContentAttachmentEmbeddings("cv_1", "att_1", { page: 1, limit: 100 }); - }); - - test("downloadContentAttachment returns the raw Response", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(req.method).toBe("GET"); - expect(u.pathname).toBe("/contents/cv_1/attachments/att_1/file"); - expect(u.search).toBe(""); - return new Response("png-bytes", { status: 200, headers: { "content-type": "image/png" } }); - }); - const resp = await client.downloadContentAttachment("cv_1", "att_1"); - expect(resp.headers.get("content-type")).toBe("image/png"); - expect(await resp.text()).toBe("png-bytes"); - }); - - test("getContentAttachment sends end=0", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.searchParams.get("start")).toBe("0"); - expect(u.searchParams.get("end")).toBe("0"); - return jsonResponse({ id: "att_1", text_content: "", file_withheld: null }); - }); - await client.getContentAttachment("cv_1", "att_1", { start: 0, end: 0 }); - }); - - test("downloadContentAttachment forwards the abort signal", async () => { - const controller = new AbortController(); - const client = makeClient((req) => { - expect(req.signal).toBe(controller.signal); - return new Response("bytes", { status: 200 }); - }); - await client.downloadContentAttachment("cv_1", "att_1", { signal: controller.signal }); - }); - - test("downloadContentAttachment throws on a withheld file", async () => { - const client = makeClient(() => jsonResponse({ detail: "withheld" }, 403)); - await expect(client.downloadContentAttachment("cv_1", "att_1")).rejects.toThrow(); - }); - - test("uploadFileToContent sends multipart", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/contents/cv_1/upload"); - expect(req.body).toBeInstanceOf(FormData); - return jsonResponse({ ok: true }); - }); - await client.uploadFileToContent("cv_1", { - file: new Uint8Array([1, 2, 3]), - fileName: "update.pdf", - mimeType: "application/pdf", - }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Solutions -// ───────────────────────────────────────────────────────────────────────────── - -describe("Solutions", () => { - test("listSolutions sends GET /solutions", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions"); - return jsonResponse({ items: [] }); - }); - await client.listSolutions(); - }); - - test("createSolution sends POST /solutions", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - return jsonResponse({ id: "sol_1" }, 201); - }); - await client.createSolution({ name: "test" } as any); - }); - - test("getSolution sends GET /solutions/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1"); - return jsonResponse({ id: "sol_1" }); - }); - await client.getSolution("sol_1"); - }); - - test("updateSolution sends PATCH /solutions/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - return jsonResponse({ id: "sol_1" }); - }); - await client.updateSolution("sol_1", {} as any); - }); - - test("deleteSolution sends DELETE /solutions/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteSolution("sol_1"); - }); - - test("linkAgentsToSolution sends POST /solutions/:id/agents", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/agents"); - return jsonResponse({ id: "sol_1" }); - }); - await client.linkAgentsToSolution("sol_1", { ids: ["ag_1"] } as any); - }); - - test("unlinkAgentsFromSolution sends DELETE /solutions/:id/agents", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/agents"); - return jsonResponse({ id: "sol_1" }); - }); - await client.unlinkAgentsFromSolution("sol_1", { ids: ["ag_1"] } as any); - }); - - test("linkKnowledgeBasesToSolution sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/knowledge-bases"); - return jsonResponse({ id: "sol_1" }); - }); - await client.linkKnowledgeBasesToSolution("sol_1", { ids: ["kb_1"] } as any); - }); - - test("linkSourceConnectionsToSolution sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/source-connections"); - return jsonResponse({ id: "sol_1" }); - }); - await client.linkSourceConnectionsToSolution("sol_1", { ids: ["src_1"] } as any); - }); - - test("listSolutionConversations sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/conversations"); - return jsonResponse([]); - }); - await client.listSolutionConversations("sol_1"); - }); - - test("generateSolutionAiPlan sends POST /solutions/:id/ai-assistant/generate", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/ai-assistant/generate"); - return jsonResponse({ actions: [] }); - }); - await client.generateSolutionAiPlan("sol_1", { user_input: "setup" } as any); - }); - - test("acceptSolutionAiPlan sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/ai-assistant/conv_1/accept"); - return jsonResponse({ actions: [] }); - }); - await client.acceptSolutionAiPlan("sol_1", "conv_1", {} as any); - }); - - test("declineSolutionAiPlan sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/ai-assistant/conv_1/decline"); - return new Response(null, { status: 204 }); - }); - await client.declineSolutionAiPlan("sol_1", "conv_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Governance -// ───────────────────────────────────────────────────────────────────────────── - -describe("Governance", () => { - test("generateGovernanceAiPlan sends POST /governance/ai-assistant", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/governance/ai-assistant"); - return jsonResponse({ actions: [] }); - }); - await client.generateGovernanceAiPlan({} as any); - }); - - test("listGovernanceAiConversations sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/governance/ai-assistant/conversations"); - return jsonResponse([]); - }); - await client.listGovernanceAiConversations(); - }); - - test("acceptGovernanceAiPlan sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/governance/ai-assistant/conv_1/accept"); - return jsonResponse({ actions: [] }); - }); - await client.acceptGovernanceAiPlan("conv_1"); - }); - - test("declineGovernanceAiPlan sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/governance/ai-assistant/conv_1/decline"); - return new Response(null, { status: 204 }); - }); - await client.declineGovernanceAiPlan("conv_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Alerts -// ───────────────────────────────────────────────────────────────────────────── - -describe("Alerts", () => { - test("listAlerts sends GET /alerts with filters", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/alerts"); - expect(u.searchParams.get("status")).toBe("active"); - return jsonResponse({ items: [] }); - }); - await client.listAlerts({ status: "active" }); - }); - - test("getAlert sends GET /alerts/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/alerts/alert_1"); - return jsonResponse({ id: "alert_1" }); - }); - await client.getAlert("alert_1"); - }); - - test("changeAlertStatus sends POST /alerts/:id/status", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/alerts/alert_1/status"); - return jsonResponse({ id: "alert_1" }); - }); - await client.changeAlertStatus("alert_1", {} as any); - }); - - test("listAlertConfigs sends GET /alerts/configs", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/alerts/configs"); - return jsonResponse({ configs: [], total: 0 }); - }); - await client.listAlertConfigs(); - }); - - test("createAlertConfig sends POST /alerts/configs", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - return jsonResponse({ id: "cfg_1" }); - }); - await client.createAlertConfig({} as any); - }); - - test("updateAlertConfig sends PATCH /alerts/configs/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/alerts/configs/cfg_1"); - return jsonResponse({ id: "cfg_1" }); - }); - await client.updateAlertConfig("cfg_1", {} as any); - }); - - test("deleteAlertConfig sends DELETE /alerts/configs/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - return new Response(null, { status: 204 }); - }); - await client.deleteAlertConfig("cfg_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Input Uploads -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Input Uploads", () => { - test("uploadAgentInput sends multipart to /agents/:id/upload-input", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/upload-input"); - expect(req.body).toBeInstanceOf(FormData); - return jsonResponse({ upload_id: "upl_1", status: "processing" }); - }); - await client.uploadAgentInput("ag_1", { - file: new Uint8Array([1, 2, 3]), - fileName: "input.txt", - }); - }); - - test("getAgentInputUploadStatus sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/ag_1/input-uploads/upl_1"); - return jsonResponse({ upload_id: "upl_1", status: "ready" }); - }); - await client.getAgentInputUploadStatus("ag_1", "upl_1"); - }); - - test("getAgentAttachmentReferences sends GET /agents/:id/attachment-references", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/attachment-references"); - return jsonResponse({ requires_uploads: false }); - }); - const refs = await client.getAgentAttachmentReferences("ag_1"); - expect(refs.requires_uploads).toBe(false); - }); - - test("downloadAgentRunAttachment returns raw Response with download_name", async () => { - const client = makeClient((req) => { - const url = new URL(req.url); - expect(req.method).toBe("GET"); - expect(url.pathname).toBe("/v2/agent-runs/run_1/attachments/att_1"); - expect(url.searchParams.get("download_name")).toBe("report.pdf"); - return new Response("file-bytes", { status: 200 }); - }); - const resp = await client.downloadAgentRunAttachment("run_1", "att_1", { - downloadName: "report.pdf", - }); - expect(await resp.text()).toBe("file-bytes"); - }); - - test("downloadAgentRunAttachment forwards the abort signal", async () => { - const controller = new AbortController(); - const client = makeClient((req) => { - expect(req.signal).toBe(controller.signal); - return new Response("file-bytes", { status: 200 }); - }); - await client.downloadAgentRunAttachment("run_1", "att_1", { signal: controller.signal }); - }); - - test("downloadAgentRunAttachment rejects when the signal is already aborted", async () => { - const controller = new AbortController(); - controller.abort(); - const client = makeClient(() => new Response("unused"), { fetch: hangUntilAborted }); - await expect( - client.downloadAgentRunAttachment("run_1", "att_1", { signal: controller.signal }), - ).rejects.toMatchObject({ name: "AbortError" }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent AI Assistant -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent AI Assistant", () => { - test("generateAgentSteps sends POST /agents/:id/ai-assistant/generate-steps", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/ai-assistant/generate-steps"); - return jsonResponse({ steps: [] }); - }); - await client.generateAgentSteps("ag_1", {} as any); - }); - - test("generateStepConfig sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/ag_1/ai-assistant/step-config"); - return jsonResponse({}); - }); - await client.generateStepConfig("ag_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Evaluations -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Evaluations", () => { - test("listEvaluationCriteria sends GET /agents/:id/evaluation-criteria", async () => { - // Asserting only the path let the 2026-07 change through: the endpoint - // began returning a paginated envelope instead of a bare list, and this - // test discarded the body, so it stayed green while callers broke. - const client = makeClient((req) => { - const url = new URL(req.url); - expect(url.pathname).toBe("/agents/ag_1/evaluation-criteria"); - expect(url.searchParams.get("page")).toBe("2"); - expect(url.searchParams.get("limit")).toBe("25"); - return jsonResponse({ - data: [{ id: "ec1" }], - pagination: { page: 2, limit: 25, total: 7, pages: 1, has_next: false, has_prev: true }, - }); - }); - const result = await client.listEvaluationCriteria("ag_1", { page: 2, limit: 25 }); - expect(result).toEqual([{ id: "ec1" }]); - }); - - test("listEvaluationCriteria unwraps the canonical envelope", async () => { - const client = makeClient(() => - jsonResponse({ - data: [{ id: "ec1" }], - pagination: { page: 1, limit: 50, total: 1, pages: 1, has_next: false, has_prev: false }, - }), - ); - expect(await client.listEvaluationCriteria("ag_1")).toEqual([{ id: "ec1" }]); - }); - - test("listEvaluationCriteria accepts a bare array too", async () => { - // Both shapes are live realities: the envelope is merged on main but not - // yet deployed, so decoding only one breaks the day the other ships. - const client = makeClient(() => jsonResponse([{ id: "ec1" }])); - expect(await client.listEvaluationCriteria("ag_1")).toEqual([{ id: "ec1" }]); - }); - - test("listEvaluationCriteriaPage exposes pagination metadata", async () => { - // The canonical {data, pagination} envelope, which the endpoint only emits - // once the caller opts in with apiVersion 2026-07-27 or later. - const client = makeClient(() => - jsonResponse({ - data: [{ id: "ec1" }], - pagination: { page: 2, limit: 25, total: 7, pages: 1, has_next: false, has_prev: true }, - }), - ); - const page = await client.listEvaluationCriteriaPage("ag_1", { page: 2, limit: 25 }); - expect(page.data).toEqual([{ id: "ec1" }]); - expect(page.pagination?.total).toBe(7); - }); - - test("createEvaluationCriteria sends POST", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/evaluation-criteria"); - return jsonResponse({ id: "crit_1" }); - }); - await client.createEvaluationCriteria("ag_1", {} as any); - }); - - test("getEvaluationCriteria sends GET /agents/evaluation-criteria/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1"); - return jsonResponse({ id: "crit_1" }); - }); - await client.getEvaluationCriteria("crit_1"); - }); - - test("deleteEvaluationCriteria sends DELETE", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1"); - return new Response(null, { status: 204 }); - }); - await client.deleteEvaluationCriteria("crit_1"); - }); - - test("testDraftEvaluation sends POST /agents/:id/evaluation-criteria/test-draft", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/evaluation-criteria/test-draft"); - return jsonResponse({}); - }); - await client.testDraftEvaluation("ag_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Models -// ───────────────────────────────────────────────────────────────────────────── - -describe("Models", () => { - test("listModelAlerts sends GET /models/alerts", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/models/alerts"); - return jsonResponse({ alerts: [], total: 0 }); - }); - await client.listModelAlerts(); - }); - - test("getModelRecommendations sends GET /models/:id/recommendations", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/models/m_1/recommendations"); - return jsonResponse({}); - }); - await client.getModelRecommendations("m_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Search -// ───────────────────────────────────────────────────────────────────────────── - -describe("Search", () => { - test("search sends GET /search with query params", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - const u = new URL(req.url); - expect(u.pathname).toBe("/search"); - expect(u.searchParams.get("q")).toBe("hello"); - expect(u.searchParams.get("limit")).toBe("5"); - expect(u.searchParams.get("entity_type")).toBe("agent"); - return jsonResponse({ results: [] }); - }); - await client.search({ query: "hello", limit: 5, entityType: "agent" }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Pagination Helper -// ───────────────────────────────────────────────────────────────────────────── - -describe("Pagination Helper", () => { - const pageOf = (page: number, pages: number, limit: number, total: number) => ({ - page, - limit, - total, - pages, - has_next: page < pages, - has_prev: page > 1, - }); - - // Two full-envelope pages, as the server sends them, then nothing more. - function twoPageClient(path: string, seen: string[]) { - return makeClient((req) => { - const url = new URL(req.url); - expect(url.pathname).toBe(path); - seen.push(url.search); - const page = Number(url.searchParams.get("page")); - return jsonResponse({ - data: page === 1 ? [{ id: "a" }, { id: "b" }] : [{ id: "c" }], - pagination: pageOf(page, 2, 2, 3), - }); - }); - } - - test("paginate walks listSources and stops after the last page", async () => { - const seen: string[] = []; - const client = twoPageClient("/sources", seen); - const ids: string[] = []; - for await (const source of client.paginate((opts) => client.listSources(opts), { limit: 2 })) { - ids.push(source.id); - } - expect(ids).toEqual(["a", "b", "c"]); - expect(seen).toEqual(["?page=1&limit=2", "?page=2&limit=2"]); - }); - - test("paginate walks listAgents and stops after the last page", async () => { - const seen: string[] = []; - const client = twoPageClient("/agents", seen); - const ids: string[] = []; - for await (const agent of client.paginate((opts) => client.listAgents(opts), { limit: 2 })) { - ids.push(agent.id); - } - expect(ids).toEqual(["a", "b", "c"]); - expect(seen).toEqual(["?page=1&limit=2", "?page=2&limit=2"]); - }); - - // The four evaluation listings answer `{data, total, page, limit}` with no - // `pagination` key unless the client opts into 2026-07-27. - test.each([ - { total: 3, requests: 2, ids: ["p1a", "p1b", "p2a"] }, - { total: 4, requests: 2, ids: ["p1a", "p1b", "p2a", "p2b"] }, - { total: 2, requests: 1, ids: ["p1a", "p1b"] }, - ])("paginate walks a flat-shaped listing of $total", async ({ total, requests, ids }) => { - const seen: string[] = []; - const client = makeClient((req) => { - const url = new URL(req.url); - expect(url.pathname).toBe("/agents/evaluation-criteria/c1/results"); - seen.push(url.search); - const page = Number(url.searchParams.get("page")); - const all = [`p${page}a`, `p${page}b`].map((id) => ({ id })); - return jsonResponse({ data: all.slice(0, total - (page - 1) * 2), total, page, limit: 2 }); - }); - const got: string[] = []; - for await (const result of client.paginate((opts) => client.listEvaluationResults("c1", opts), { - limit: 2, - })) { - got.push(result.id); - } - expect(got).toEqual(ids); - expect(seen).toHaveLength(requests); - }); - - test("paginate stops on a flat-shaped listing whose server ignores page", async () => { - let calls = 0; - const client = makeClient(() => { - calls++; - return jsonResponse({ data: [{ id: "a" }, { id: "b" }], total: 3, page: 1, limit: 2 }); - }); - const got: string[] = []; - for await (const result of client.paginate((opts) => client.listEvaluationResults("c1", opts), { - limit: 2, - })) { - got.push(result.id); - } - expect(calls).toBe(2); - }); - - test("paginate makes one request for a single full page", async () => { - let requests = 0; - const client = makeClient(() => { - requests += 1; - return jsonResponse({ data: [{ id: "a" }, { id: "b" }], pagination: pageOf(1, 1, 2, 2) }); - }); - const ids: string[] = []; - for await (const source of client.paginate((opts) => client.listSources(opts), { limit: 2 })) { - ids.push(source.id); - } - expect(ids).toEqual(["a", "b"]); - expect(requests).toBe(1); - }); - - test("paginate follows pages when has_next is absent", async () => { - const client = makeClient(() => jsonResponse({})); - let fetched = 0; - const items: string[] = []; - for await (const item of client.paginate( - async ({ page }) => { - fetched += 1; - return { data: page === 1 ? ["a", "b"] : ["c"], pagination: { pages: 2 } }; - }, - { limit: 2 }, - )) { - items.push(item); - } - expect(items).toEqual(["a", "b", "c"]); - expect(fetched).toBe(2); - }); - - test("paginate yields a bare array once", async () => { - let requests = 0; - const client = makeClient(() => { - requests += 1; - return jsonResponse([{ id: "p1" }, { id: "p2" }]); - }); - const ids: string[] = []; - for await (const drive of client.paginate(() => client.listCloudDrives(), { limit: 2 })) { - ids.push(drive.id); - } - expect(ids).toEqual(["p1", "p2"]); - expect(requests).toBe(1); - }); - - test("paginate still accepts a custom fetcher's items and total_pages", async () => { - let pagesFetched = 0; - const client = makeClient(() => jsonResponse({})); - - const allItems: string[] = []; - for await (const item of client.paginate( - async (opts) => { - pagesFetched++; - if (opts.page === 1) { - return { items: ["a", "b"], pagination: { page: 1, total_pages: 2 } }; - } - return { items: ["c"], pagination: { page: 2, total_pages: 2 } }; - }, - { limit: 2 }, - )) { - allItems.push(item); - } - - expect(allItems).toEqual(["a", "b", "c"]); - expect(pagesFetched).toBe(2); - }); - - test("paginate treats a null data as an empty page", async () => { - const client = makeClient(() => jsonResponse({})); - const items: unknown[] = []; - for await (const item of client.paginate(async () => ({ data: null }))) items.push(item); - expect(items).toEqual([]); - }); - - test("paginate throws SeclaiError on a page with no items key", async () => { - const client = makeClient(() => jsonResponse({ configs: [{ id: "c1" }], total: 1 })); - const run = async () => { - // The legacy `configs` shape is not one paginate() reads; the cast stands - // in for a caller whose fetcher is typed more loosely than it behaves. - for await (const _ of client.paginate( - async (opts) => (await client.listAlertConfigs(opts)) as { data?: unknown[] }, - )) { - void _; - } - }; - await expect(run()).rejects.toThrow(SeclaiError); - await expect(run()).rejects.not.toThrow(TypeError); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Raw Request -// ───────────────────────────────────────────────────────────────────────────── - -describe("Raw Requests", () => { - test("request sends JSON body and content-type", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(req.headers["content-type"]).toContain("application/json"); - expect(req.bodyText).toBe(JSON.stringify({ hello: "world" })); - return jsonResponse({ ok: true }); - }); - await client.request("POST", "/test", { json: { hello: "world" } }); - }); - - test("requestRaw returns raw Response", async () => { - const client = makeClient(() => new Response("raw-data", { status: 200 })); - const resp = await client.requestRaw("GET", "/download"); - expect(await resp.text()).toBe("raw-data"); - }); - - test("requestRaw throws on error status", async () => { - const client = makeClient(() => new Response("error", { status: 500 })); - await expect(client.requestRaw("GET", "/fail")).rejects.toBeInstanceOf(SeclaiAPIStatusError); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// AbortSignal Support -// ───────────────────────────────────────────────────────────────────────────── - -describe("AbortSignal Support", () => { - test("request passes signal to fetch", async () => { - const controller = new AbortController(); - const client = new Seclai({ - apiKey: "test-key", - baseUrl: "https://test.invalid", - fetch: async (_input: RequestInfo | URL, init?: RequestInit) => { - expect(init?.signal).toBe(controller.signal); - return jsonResponse({ ok: true }); - }, - }); - await client.request("GET", "/test", { signal: controller.signal }); - }); - - test("requestRaw passes signal to fetch", async () => { - const controller = new AbortController(); - const client = new Seclai({ - apiKey: "test-key", - baseUrl: "https://test.invalid", - fetch: async (_input: RequestInfo | URL, init?: RequestInit) => { - expect(init?.signal).toBe(controller.signal); - return new Response("ok"); - }, - }); - await client.requestRaw("GET", "/test", { signal: controller.signal }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Source Exports (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Source Exports — extended", () => { - test("deleteSourceExport sends DELETE /sources/:id/exports/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/sources/src_1/exports/exp_1"); - return new Response(null, { status: 204 }); - }); - await client.deleteSourceExport("src_1", "exp_1"); - }); - - test("getSourceExport sends GET /sources/:id/exports/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/sources/src_1/exports/exp_1"); - return jsonResponse({ id: "exp_1", status: "completed" }); - }); - await client.getSourceExport("src_1", "exp_1"); - }); - - test("estimateSourceExport sends POST /sources/:id/exports/estimate", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/sources/src_1/exports/estimate"); - return jsonResponse({ size: 1024 }); - }); - await client.estimateSourceExport("src_1", {} as any); - }); - - test("cancelSourceExport sends POST /sources/:id/exports/:id/cancel", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/sources/src_1/exports/exp_1/cancel"); - return jsonResponse({ id: "exp_1" }); - }); - await client.cancelSourceExport("src_1", "exp_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Memory Banks (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Memory Banks — extended", () => { - test("getAgentsUsingMemoryBank sends GET /memory_banks/:id/agents", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1/agents"); - return jsonResponse([]); - }); - await client.getAgentsUsingMemoryBank("mb_1"); - }); - - test("compactMemoryBank sends POST /memory_banks/:id/compact", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1/compact"); - return new Response(null, { status: 204 }); - }); - await client.compactMemoryBank("mb_1"); - }); - - test("deleteMemoryBankSource sends DELETE /memory_banks/:id/source", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1/source"); - return new Response(null, { status: 204 }); - }); - await client.deleteMemoryBankSource("mb_1"); - }); - - test("testMemoryBankCompaction sends POST /memory_banks/:id/test-compaction", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/memory_banks/mb_1/test-compaction"); - return jsonResponse({ evaluation: {} }); - }); - await client.testMemoryBankCompaction("mb_1", {} as any); - }); - - test("testCompactionPromptStandalone sends POST /memory_banks/test-compaction", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/memory_banks/test-compaction"); - return jsonResponse({ evaluation: {} }); - }); - await client.testCompactionPromptStandalone({} as any); - }); - - test("listMemoryBankTemplates sends GET /memory_banks/templates", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks/templates"); - return jsonResponse([]); - }); - await client.listMemoryBankTemplates(); - }); - - test("generateMemoryBankConfig sends POST /memory_banks/ai-assistant", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/memory_banks/ai-assistant"); - return jsonResponse({}); - }); - await client.generateMemoryBankConfig({} as any); - }); - - test("getMemoryBankAiLastConversation sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/memory_banks/ai-assistant/last-conversation"); - return jsonResponse({}); - }); - await client.getMemoryBankAiLastConversation(); - }); - - test("acceptMemoryBankAiSuggestion sends PATCH", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/memory_banks/ai-assistant/conv_1"); - return jsonResponse({}); - }); - await client.acceptMemoryBankAiSuggestion("conv_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Alerts (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Alerts — extended", () => { - test("addAlertComment sends POST /alerts/:id/comments", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/alerts/alert_1/comments"); - return jsonResponse({}); - }); - await client.addAlertComment("alert_1", {} as any); - }); - - test("subscribeToAlert sends POST /alerts/:id/subscribe", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/alerts/alert_1/subscribe"); - return jsonResponse({}); - }); - await client.subscribeToAlert("alert_1"); - }); - - test("unsubscribeFromAlert sends POST /alerts/:id/unsubscribe", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/alerts/alert_1/unsubscribe"); - return jsonResponse({}); - }); - await client.unsubscribeFromAlert("alert_1"); - }); - - test("getAlertConfig sends GET /alerts/configs/:id", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/alerts/configs/cfg_1"); - return jsonResponse({ id: "cfg_1" }); - }); - await client.getAlertConfig("cfg_1"); - }); - - test("listOrganizationAlertPreferences sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/alerts/organization-preferences/list"); - return jsonResponse({ preferences: [], total: 0 }); - }); - await client.listOrganizationAlertPreferences(); - }); - - test("updateOrganizationAlertPreference sends PATCH and returns the typed preference", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/alerts/organization-preferences/org_1/model_alert"); - return jsonResponse({ - organization_id: "org_1", - alert_type: "model_alert", - subscribed: true, - is_override: false, - }); - }); - const pref = await client.updateOrganizationAlertPreference("org_1", "model_alert", {} as any); - // Typed fields are reachable without a cast. - expect(pref.subscribed).toBe(true); - expect(pref.alert_type).toBe("model_alert"); - expect(pref.is_override).toBe(false); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Models (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Models — extended", () => { - test("markAllModelAlertsRead sends POST /models/alerts/mark-all-read", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/models/alerts/mark-all-read"); - return new Response(null, { status: 204 }); - }); - await client.markAllModelAlertsRead(); - }); - - test("markModelAlertRead sends PATCH /models/alerts/:id/read", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/models/alerts/alert_1/read"); - return new Response(null, { status: 204 }); - }); - await client.markModelAlertRead("alert_1"); - }); - - test("getUnreadModelAlertCount sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/models/alerts/unread-count"); - return jsonResponse({ count: 3 }); - }); - await client.getUnreadModelAlertCount(); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Evaluations (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Evaluations — extended", () => { - test("updateEvaluationCriteria sends PATCH", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1"); - return jsonResponse({ id: "crit_1" }); - }); - await client.updateEvaluationCriteria("crit_1", {} as any); - }); - - test("getEvaluationCriteriaSummary sends GET /agents/evaluation-criteria/:id/summary", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1/summary"); - return jsonResponse({}); - }); - await client.getEvaluationCriteriaSummary("crit_1"); - }); - - test("listEvaluationResults sends GET /agents/evaluation-criteria/:id/results", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1/results"); - return jsonResponse({ data: [], total: 0, page: 1, limit: 20 }); - }); - await client.listEvaluationResults("crit_1"); - }); - - test("createEvaluationResult sends POST /agents/evaluation-criteria/:id/results", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1/results"); - return jsonResponse({ id: "res_1" }); - }); - await client.createEvaluationResult("crit_1", {} as any); - }); - - test("listEvaluationResults with pagination sends GET with query params", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/evaluation-criteria/crit_1/results"); - expect(u.searchParams.get("page")).toBe("2"); - expect(u.searchParams.get("limit")).toBe("10"); - return jsonResponse({ data: [], total: 0, page: 2, limit: 10 }); - }); - await client.listEvaluationResults("crit_1", { page: 2, limit: 10 }); - }); - - test("listCompatibleRuns sends GET /agents/evaluation-criteria/:id/compatible-runs", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/evaluation-criteria/crit_1/compatible-runs"); - return jsonResponse({ data: [], total: 0, page: 1, limit: 20 }); - }); - await client.listCompatibleRuns("crit_1"); - }); - - test("listRunEvaluationResults sends GET /agents/:agentId/runs/:runId/evaluation-results", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/ag_1/runs/run_1/evaluation-results"); - return jsonResponse([]); - }); - await client.listRunEvaluationResults("ag_1", "run_1"); - }); - - test("getNonManualEvaluationSummary sends GET with agent_id query", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/evaluation-results/non-manual-summary"); - expect(u.searchParams.get("agent_id")).toBe("ag_1"); - return jsonResponse({ by_mode: [] }); - }); - await client.getNonManualEvaluationSummary("ag_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Content (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Content — extended", () => { - test("replaceContentWithInlineText sends PUT /contents/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/contents/cv_1"); - return jsonResponse({ id: "cv_1" }); - }); - await client.replaceContentWithInlineText("cv_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Solutions (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Solutions — extended", () => { - test("unlinkKnowledgeBasesFromSolution sends DELETE", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/knowledge-bases"); - return jsonResponse({ id: "sol_1" }); - }); - await client.unlinkKnowledgeBasesFromSolution("sol_1", { ids: ["kb_1"] } as any); - }); - - test("unlinkSourceConnectionsFromSolution sends DELETE", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/source-connections"); - return jsonResponse({ id: "sol_1" }); - }); - await client.unlinkSourceConnectionsFromSolution("sol_1", { ids: ["src_1"] } as any); - }); - - test("addSolutionConversationTurn sends POST /solutions/:id/conversations", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/conversations"); - return jsonResponse({}); - }); - await client.addSolutionConversationTurn("sol_1", {} as any); - }); - - test("markSolutionConversationTurn sends PATCH", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/conversations/conv_1"); - return jsonResponse({}); - }); - await client.markSolutionConversationTurn("sol_1", "conv_1", {} as any); - }); - - test("generateSolutionAiKnowledgeBase sends POST", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/ai-assistant/knowledge-base"); - return jsonResponse({}); - }); - await client.generateSolutionAiKnowledgeBase("sol_1", {} as any); - }); - - test("generateSolutionAiSource sends POST", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/solutions/sol_1/ai-assistant/source"); - return jsonResponse({}); - }); - await client.generateSolutionAiSource("sol_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Top-Level AI Assistant -// ───────────────────────────────────────────────────────────────────────────── - -describe("Top-Level AI Assistant", () => { - test("submitAiFeedback sends POST /ai-assistant/feedback", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/ai-assistant/feedback"); - return jsonResponse({}); - }); - await client.submitAiFeedback({} as any); - }); - - test("aiAssistantKnowledgeBase sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/ai-assistant/knowledge-base"); - return jsonResponse({}); - }); - await client.aiAssistantKnowledgeBase({} as any); - }); - - test("aiAssistantSource sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/ai-assistant/source"); - return jsonResponse({}); - }); - await client.aiAssistantSource({} as any); - }); - - test("aiAssistantSolution sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/ai-assistant/solution"); - return jsonResponse({}); - }); - await client.aiAssistantSolution({} as any); - }); - - test("aiAssistantMemoryBank sends POST", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/ai-assistant/memory-bank"); - return jsonResponse({}); - }); - await client.aiAssistantMemoryBank({} as any); - }); - - test("getAiAssistantMemoryBankHistory sends GET", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/ai-assistant/memory-bank/last-conversation"); - return jsonResponse({}); - }); - await client.getAiAssistantMemoryBankHistory(); - }); - - test("acceptAiAssistantPlan sends POST with JSON body", async () => { - const requestBody = { confirm_deletions: true }; - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/ai-assistant/conv_1/accept"); - expect(req.headers["content-type"]).toContain("application/json"); - expect(JSON.parse(req.bodyText!)).toEqual(requestBody); - return jsonResponse({}); - }); - await client.acceptAiAssistantPlan("conv_1", requestBody as any); - }); - - test("declineAiAssistantPlan sends POST", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/ai-assistant/conv_1/decline"); - return new Response(null, { status: 204 }); - }); - await client.declineAiAssistantPlan("conv_1"); - }); - - test("acceptAiMemoryBankSuggestion sends PATCH with body", async () => { - const requestBody = { accepted: true }; - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/ai-assistant/memory-bank/conv_1"); - expect(req.headers["content-type"]).toContain("application/json"); - expect(JSON.parse(req.bodyText!)).toEqual(requestBody); - return jsonResponse({}); - }); - await client.acceptAiMemoryBankSuggestion("conv_1", requestBody as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent AI Assistant (extended) -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent AI Assistant — extended", () => { - test("getAgentAiConversationHistory sends GET with the required step_type", async () => { - const client = makeClient((req) => { - const url = new URL(req.url); - expect(url.pathname).toBe("/agents/ag_1/ai-assistant/conversations"); - // Asserting only the path is what let this method ship unable to send the - // parameter the API requires. - expect(url.searchParams.get("step_type")).toBe("llm"); - return jsonResponse([]); - }); - await client.getAgentAiConversationHistory("ag_1", { stepType: "llm" }); - }); - - test("getAgentAiConversationHistory rejects a call without stepType", async () => { - const client = makeClient(() => jsonResponse([])); - await expect(client.getAgentAiConversationHistory("ag_1")).rejects.toThrow( - /stepType/, - ); - }); - - test("markAgentAiSuggestion sends PATCH", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PATCH"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/ai-assistant/conv_1"); - return new Response(null, { status: 204 }); - }); - await client.markAgentAiSuggestion("ag_1", "conv_1", {} as any); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Bearer Token Auth -// ───────────────────────────────────────────────────────────────────────────── - -describe("Bearer Token Auth", () => { - test("static accessToken sends Authorization Bearer header", async () => { - const client = new Seclai({ - accessToken: "my-jwt-token", - baseUrl: "https://test.invalid", - fetch: makeFetch((req) => { - expect(req.headers["authorization"]).toBe("Bearer my-jwt-token"); - expect(req.headers["x-api-key"]).toBeUndefined(); - return jsonResponse({ ok: true }); - }), - }); - await client.request("GET", "/test"); - }); - - test("accessToken function provider is called per request", async () => { - let callCount = 0; - const provider = () => { - callCount++; - return `token-${callCount}`; - }; - const client = new Seclai({ - accessToken: provider, - baseUrl: "https://test.invalid", - fetch: makeFetch((req) => { - expect(req.headers["authorization"]).toMatch(/^Bearer token-\d+$/); - return jsonResponse({ ok: true }); - }), - }); - - await client.request("GET", "/test1"); - await client.request("GET", "/test2"); - expect(callCount).toBe(2); - }); - - test("async accessToken provider is supported", async () => { - const provider = async () => { - await new Promise((r) => setTimeout(r, 1)); - return "async-token"; - }; - const client = new Seclai({ - accessToken: provider, - baseUrl: "https://test.invalid", - fetch: makeFetch((req) => { - expect(req.headers["authorization"]).toBe("Bearer async-token"); - return jsonResponse({ ok: true }); - }), - }); - await client.request("GET", "/test"); - }); - - test("accountId sends X-Account-Id header", async () => { - const client = new Seclai({ - accessToken: "tok", - accountId: "550e8400-e29b-41d4-a716-446655440000", - baseUrl: "https://test.invalid", - fetch: makeFetch((req) => { - expect(req.headers["x-account-id"]).toBe("550e8400-e29b-41d4-a716-446655440000"); - expect(req.headers["authorization"]).toBe("Bearer tok"); - return jsonResponse({ ok: true }); - }), - }); - await client.request("GET", "/test"); - }); - - test("accountId also works with apiKey auth", async () => { - const client = new Seclai({ - apiKey: "k", - accountId: "acct-123", - baseUrl: "https://test.invalid", - fetch: makeFetch((req) => { - expect(req.headers["x-account-id"]).toBe("acct-123"); - expect(req.headers["x-api-key"]).toBe("k"); - return jsonResponse({ ok: true }); - }), - }); - await client.request("GET", "/test"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// INI Parser -// ───────────────────────────────────────────────────────────────────────────── - -describe("INI Parser", () => { - test("parses default and profile sections", () => { - const ini = ` -[default] -sso_account_id = acct-default -sso_region = us-east-1 -sso_client_id = client123 -sso_domain = auth.seclai.com - -# Comment line -[profile staging] -sso_account_id = acct-staging -`; - const result = parseIni(ini); - expect(result["default"]).toEqual({ - sso_account_id: "acct-default", - sso_region: "us-east-1", - sso_client_id: "client123", - sso_domain: "auth.seclai.com", - }); - expect(result["staging"]).toEqual({ - sso_account_id: "acct-staging", - }); - }); - - test("ignores comment and empty lines", () => { - const ini = ` -; semicolon comment -# hash comment - -[default] -key = value -`; - const result = parseIni(ini); - expect(result["default"]).toEqual({ key: "value" }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Model Playground Experiments -// ───────────────────────────────────────────────────────────────────────────── - -describe("Model Playground Experiments", () => { - test("deleteExperiment sends DELETE /models/playground/experiments/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/models/playground/experiments/exp_1"); - return new Response(null, { status: 204 }); - }); - await client.deleteExperiment("exp_1"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Identity -// ───────────────────────────────────────────────────────────────────────────── - -describe("Identity", () => { - test("getMe sends GET /me", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/me"); - return jsonResponse({ - account_id: "acct_personal", - organizations: [{ id: "org_1", name: "Acme", account_id: "acct_acme" }], - }); - }); - const me = await client.getMe(); - expect(me.account_id).toBe("acct_personal"); - expect(me.organizations[0].name).toBe("Acme"); - }); - - test("getMe sends X-Account-Id when the client targets an org", async () => { - const client = new Seclai({ - apiKey: "test-key", - baseUrl: "https://api.test", - accountId: "acct_acme", - fetch: makeFetch((req) => { - expect(req.headers["x-account-id"]).toBe("acct_acme"); - return jsonResponse({ account_id: "acct_acme", organizations: [] }); - }), - }); - await client.getMe(); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agents — Enable / Disable -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agents — Enable / Disable", () => { - test("disableAgent sends POST /agents/:id/disable", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/disable"); - return jsonResponse({ id: "ag_1", disabled: true }); - }); - const agent = await client.disableAgent("ag_1"); - expect(agent.disabled).toBe(true); - }); - - test("enableAgent sends POST /agents/:id/enable", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/enable"); - return jsonResponse({ id: "ag_1", disabled: false }); - }); - const agent = await client.enableAgent("ag_1"); - expect(agent.disabled).toBe(false); - }); - - test("getAgentCallers sends GET /agents/:id/callers", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/callers"); - return jsonResponse([{ id: "ag_2", name: "Caller", disabled: false }]); - }); - const callers = await client.getAgentCallers("ag_1"); - expect(callers).toHaveLength(1); - expect(callers[0].name).toBe("Caller"); - }); - - test("disableAgent surfaces a 409 as SeclaiAPIStatusError", async () => { - const client = makeClient(() => jsonResponse({ detail: "blocked by callers" }, 409)); - await expect(client.disableAgent("ag_1")).rejects.toThrow(SeclaiAPIStatusError); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Email Triggers -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Email Triggers", () => { - test("setEmailTriggerConfig sends PUT /agents/:id/triggers/:tid/email-config", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/agents/ag_1/triggers/tr_1/email-config"); - const body = JSON.parse(req.bodyText!); - expect(body.alias).toBe("support"); - expect(body.allowed_senders).toEqual(["example.com"]); - expect(body.require_sender_auth).toBe(false); - return jsonResponse({ - trigger_id: "tr_1", - agent_id: "ag_1", - trigger_type: "EMAIL_RECEIVED", - email_addresses: ["support.acct@agent.seclai.com"], - }); - }); - const config = await client.setEmailTriggerConfig("ag_1", "tr_1", { - alias: "support", - allowed_senders: ["example.com"], - require_sender_auth: false, - }); - expect(config.email_addresses).toEqual(["support.acct@agent.seclai.com"]); - }); - - test("setEmailTriggerConfig sends run_on_attachment_mismatch", async () => { - const client = makeClient((req) => { - expect(JSON.parse(req.bodyText!)).toEqual({ run_on_attachment_mismatch: true }); - return jsonResponse({ trigger_id: "tr_1", email_run_on_attachment_mismatch: true }); - }); - const config = await client.setEmailTriggerConfig("ag_1", "tr_1", { run_on_attachment_mismatch: true }); - expect(config.email_run_on_attachment_mismatch).toBe(true); - }); - - test("setAcceptedAttachments sends PUT /agents/:id/triggers/:tid/accepted-attachments", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(req.method).toBe("PUT"); - expect(u.pathname).toBe("/agents/ag_1/triggers/tr_1/accepted-attachments"); - expect(u.search).toBe(""); - expect(JSON.parse(req.bodyText!)).toEqual({ - accepted_attachments: [{ name: "invoice", content_types: ["application/pdf"], max: 1 }], - }); - return jsonResponse({ - trigger_id: "tr_1", - agent_id: "ag_1", - accepted_attachments: [{ name: "invoice", content_types: ["application/pdf"], min: 0, max: 1 }], - }); - }); - // `min` is server-defaulted, so a slot without it must typecheck. - const res = await client.setAcceptedAttachments("ag_1", "tr_1", { - accepted_attachments: [{ name: "invoice", content_types: ["application/pdf"], max: 1 }], - }); - expect(res.accepted_attachments[0]!.min).toBe(0); - }); - - test("SetAcceptedAttachmentsRequest accepts a slot without min", async () => { - const body: SetAcceptedAttachmentsRequest = { accepted_attachments: [{ name: "doc" }] }; - const client = makeClient((req) => { - expect(JSON.parse(req.bodyText!)).toEqual({ accepted_attachments: [{ name: "doc" }] }); - return jsonResponse({ trigger_id: "tr_1", agent_id: "ag_1", accepted_attachments: [{ name: "doc", min: 0 }] }); - }); - await client.setAcceptedAttachments("ag_1", "tr_1", body); - }); - - test("setAcceptedAttachments sends null to clear the declaration", async () => { - const client = makeClient((req) => { - expect(JSON.parse(req.bodyText!)).toEqual({ accepted_attachments: null }); - return jsonResponse({ trigger_id: "tr_1", agent_id: "ag_1", accepted_attachments: [] }); - }); - await client.setAcceptedAttachments("ag_1", "tr_1", { accepted_attachments: null }); - }); - - test("createAgent and updateAgentDefinition accept slots without min", async () => { - const bodies: unknown[] = []; - const client = makeClient((req) => { - bodies.push(JSON.parse(req.bodyText!)); - return jsonResponse({ id: "ag_1" }); - }); - await client.createAgent({ name: "A", trigger_type: "dynamic_input", accepted_attachments: [{ name: "doc" }] }); - await client.updateAgentDefinition("ag_1", { - expected_change_id: "chg_1", - definition: {}, - accepted_attachments: [{ name: "doc" }], - }); - expect(bodies).toEqual([ - { name: "A", trigger_type: "dynamic_input", accepted_attachments: [{ name: "doc" }] }, - { expected_change_id: "chg_1", definition: {}, accepted_attachments: [{ name: "doc" }] }, - ]); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Agent Email Governance -// ───────────────────────────────────────────────────────────────────────────── - -describe("Agent Email Governance", () => { - test("listAgentEmailOptOuts sends GET with agent_id/limit/offset", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/agent-email-optouts"); - expect(u.searchParams.get("agent_id")).toBe("ag_1"); - expect(u.searchParams.get("limit")).toBe("25"); - expect(u.searchParams.get("offset")).toBe("50"); - return jsonResponse({ items: [], total: 0 }); - }); - await client.listAgentEmailOptOuts({ agentId: "ag_1", limit: 25, offset: 50 }); - }); - - test("listAgentEmailOptOuts omits unset filters", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.searchParams.has("agent_id")).toBe(false); - expect(u.searchParams.has("limit")).toBe(false); - return jsonResponse({ items: [], total: 0 }); - }); - await client.listAgentEmailOptOuts(); - }); - - test("removeAgentEmailOptOut sends DELETE /agents/agent-email-optouts/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/agent-email-optouts/oo_1"); - return new Response(null, { status: 204 }); - }); - await client.removeAgentEmailOptOut("oo_1"); - }); - - test("listBlockedEmailSenders sends GET with limit/offset", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/blocked-email-senders"); - expect(u.searchParams.get("limit")).toBe("10"); - expect(u.searchParams.get("offset")).toBe("0"); - return jsonResponse({ items: [], total: 0, auto_block_mode: "disabled" }); - }); - const result = await client.listBlockedEmailSenders({ limit: 10, offset: 0 }); - expect(result.auto_block_mode).toBe("disabled"); - }); - - test("blockEmailSender sends POST /agents/blocked-email-senders", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/blocked-email-senders"); - const body = JSON.parse(req.bodyText!); - expect(body.sender_email).toBe("spam@example.com"); - expect(body.match_type).toBe("domain"); - return jsonResponse({ - id: "bl_1", - created_at: "2026-07-01T00:00:00Z", - sender_email: "spam@example.com", - match_type: "domain", - source: "manual", - note: null, - }, 201); - }); - const blocked = await client.blockEmailSender({ - sender_email: "spam@example.com", - match_type: "domain", - }); - expect(blocked.id).toBe("bl_1"); - }); - - test("unblockEmailSender sends DELETE /agents/blocked-email-senders/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/agents/blocked-email-senders/bl_1"); - return new Response(null, { status: 204 }); - }); - await client.unblockEmailSender("bl_1"); - }); - - test("setAutoBlockMode sends PUT /agents/blocked-email-senders/mode", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/agents/blocked-email-senders/mode"); - expect(JSON.parse(req.bodyText!).mode).toBe("input_and_output"); - return jsonResponse({ items: [], total: 0, auto_block_mode: "input_and_output" }); - }); - const result = await client.setAutoBlockMode({ mode: "input_and_output" }); - expect(result.auto_block_mode).toBe("input_and_output"); - }); - - test("listInboundEmailRejections sends GET with agent_id/limit", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/agents/inbound-email-rejections"); - expect(u.searchParams.get("agent_id")).toBe("ag_1"); - expect(u.searchParams.get("limit")).toBe("5"); - return jsonResponse([{ id: "rj_1", reason: "unauthorized_sender" }]); - }); - const rejections = await client.listInboundEmailRejections({ agentId: "ag_1", limit: 5 }); - expect(rejections).toHaveLength(1); - }); - - test("getInboundEmailStatus sends GET /agents/inbound-email-status", async () => { - const client = makeClient((req) => { - expect(new URL(req.url).pathname).toBe("/agents/inbound-email-status"); - return jsonResponse({ paused: true, queued_backlog: 42 }); - }); - const status = await client.getInboundEmailStatus(); - expect(status.paused).toBe(true); - expect(status.queued_backlog).toBe(42); - }); - - test("cancelQueuedEmailRuns sends POST .../cancel-queued", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/inbound-email-status/cancel-queued"); - return jsonResponse({ cancelled: 7 }); - }); - const result = await client.cancelQueuedEmailRuns(); - expect(result.cancelled).toBe(7); - }); - - test("resumeInboundEmail sends POST .../resume", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/agents/inbound-email-status/resume"); - return jsonResponse({ resumed: true }); - }); - const result = await client.resumeInboundEmail(); - expect(result.resumed).toBe(true); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Email Domains -// ───────────────────────────────────────────────────────────────────────────── - -describe("Email Domains", () => { - test("listEmailDomains sends GET /email-domains", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/email-domains"); - return jsonResponse({ domains: [], can_add_vanity: true, has_vanity: false }); - }); - const result = await client.listEmailDomains(); - expect(result.can_add_vanity).toBe(true); - }); - - test("addEmailDomain sends POST /email-domains", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/email-domains"); - const body = JSON.parse(req.bodyText!); - expect(body.kind).toBe("custom"); - expect(body.value).toBe("agent.example.com"); - expect(body.delegated).toBe(true); - return jsonResponse({ - id: "dom_1", - domain: "agent.example.com", - kind: "custom", - status: "pending", - is_primary: false, - }); - }); - const domain = await client.addEmailDomain({ - kind: "custom", - value: "agent.example.com", - delegated: true, - }); - expect(domain.id).toBe("dom_1"); - }); - - test("addEmailDomain accepts a vanity domain without `delegated`", async () => { - const client = makeClient((req) => { - const body = JSON.parse(req.bodyText!); - expect(body).toEqual({ kind: "vanity", value: "acme" }); - expect("delegated" in body).toBe(false); - return jsonResponse({ - id: "dom_2", domain: "acme.seclai.com", kind: "vanity", - status: "pending", is_primary: false, - }); - }); - // Compiles without `delegated` — the server defaults it to false. - const domain = await client.addEmailDomain({ kind: "vanity", value: "acme" }); - expect(domain.kind).toBe("vanity"); - }); - - test("removeEmailDomain sends DELETE /email-domains/:id", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("DELETE"); - expect(new URL(req.url).pathname).toBe("/email-domains/dom_1"); - return jsonResponse({ removed: true, cleanup_note: "Delete the NS record" }); - }); - const result = await client.removeEmailDomain("dom_1"); - expect(result.cleanup_note).toBe("Delete the NS record"); - }); - - test("verifyEmailDomain sends POST /email-domains/:id/verify", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/email-domains/dom_1/verify"); - return jsonResponse({ - id: "dom_1", domain: "agent.example.com", kind: "custom", - status: "verified", is_primary: false, verified: true, - }); - }); - const domain = await client.verifyEmailDomain("dom_1"); - expect(domain.verified).toBe(true); - }); - - test("setPrimaryEmailDomain sends POST /email-domains/:id/primary", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/email-domains/dom_1/primary"); - return jsonResponse({ - id: "dom_1", domain: "agent.example.com", kind: "custom", - status: "verified", is_primary: true, - }); - }); - const domain = await client.setPrimaryEmailDomain("dom_1"); - expect(domain.is_primary).toBe(true); - }); - - test("useSharedEmailDomain sends POST /email-domains/use-shared-domain", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/email-domains/use-shared-domain"); - return new Response(null, { status: 204 }); - }); - await client.useSharedEmailDomain(); - }); - - test("sendEmailDomainTestEmail sends POST /email-domains/:id/test-email", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("POST"); - expect(new URL(req.url).pathname).toBe("/email-domains/dom_1/test-email"); - return jsonResponse({ sent: true }); - }); - const result = await client.sendEmailDomainTestEmail("dom_1"); - expect(result.sent).toBe(true); - }); - - test("getDmarcSummary sends GET /email-domains/:id/dmarc with window params", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/email-domains/dom_1/dmarc"); - expect(u.searchParams.get("days")).toBe("7"); - expect(u.searchParams.get("top_sources")).toBe("3"); - return jsonResponse({ - window_days: 7, report_count: 2, total_messages: 100, - passed_messages: 99, failed_messages: 1, top_failing_sources: [], - }); - }); - const summary = await client.getDmarcSummary("dom_1", { days: 7, topSources: 3 }); - expect(summary.window_days).toBe(7); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Models — media filters & generation tiers -// ───────────────────────────────────────────────────────────────────────────── - -describe("Models — media filters & generation tiers", () => { - test("listModels forwards the media capability filters", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.pathname).toBe("/models"); - expect(u.searchParams.get("supports_input_media")).toBe("pdf"); - expect(u.searchParams.get("supports_output_media")).toBe("image"); - expect(u.searchParams.get("supports_tool_use")).toBe("true"); - return jsonResponse([]); - }); - await client.listModels({ - supportsInputMedia: "pdf", - supportsOutputMedia: "image", - supportsToolUse: true, - }); - }); - - test("getGenerationTiers sends GET /models/generation-tiers", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/models/generation-tiers"); - return jsonResponse({ tiers: [{ modality: "image", tier: "fast", model: "m_1" }] }); - }); - const tiers = await client.getGenerationTiers() as Record; - expect(tiers["tiers"]).toEqual([{ modality: "image", tier: "fast", model: "m_1" }]); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Docs Search -// ───────────────────────────────────────────────────────────────────────────── - -describe("Docs Search", () => { - test("searchDocs sends GET /docs-search with query params", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - const u = new URL(req.url); - expect(u.pathname).toBe("/docs-search"); - expect(u.searchParams.get("q")).toBe("agent triggers"); - expect(u.searchParams.get("mode")).toBe("semantic"); - expect(u.searchParams.get("limit")).toBe("3"); - return jsonResponse({ results: [] }); - }); - await client.searchDocs({ query: "agent triggers", mode: "semantic", limit: 3 }); - }); - - test("searchDocs omits mode and limit when unset", async () => { - const client = makeClient((req) => { - const u = new URL(req.url); - expect(u.searchParams.get("q")).toBe("webhooks"); - expect(u.searchParams.has("mode")).toBe(false); - expect(u.searchParams.has("limit")).toBe(false); - return jsonResponse({ results: [] }); - }); - await client.searchDocs({ query: "webhooks" }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Token Validation -// ───────────────────────────────────────────────────────────────────────────── - -describe("Token Validation", () => { - test("isTokenValid returns true for future expiry", () => { - const future = new Date(Date.now() + 3600_000).toISOString(); - expect(isTokenValid({ - accessToken: "t", expiresAt: future, clientId: "c", region: "r", cognitoDomain: "d", - })).toBe(true); - }); - - test("isTokenValid returns false for past expiry", () => { - const past = new Date(Date.now() - 1000).toISOString(); - expect(isTokenValid({ - accessToken: "t", expiresAt: past, clientId: "c", region: "r", cognitoDomain: "d", - })).toBe(false); - }); - - test("isTokenValid returns false within 30s buffer", () => { - const almostExpired = new Date(Date.now() + 10_000).toISOString(); // 10s out - expect(isTokenValid({ - accessToken: "t", expiresAt: almostExpired, clientId: "c", region: "r", cognitoDomain: "d", - })).toBe(false); - }); -}); - - -describe("API version", () => { - test("Seclai-Version header is omitted unless opted in", async () => { - // The point of the option: upgrading the SDK must not silently move an - // account onto a newer API version and change response shapes. - const client = makeClient((req) => { - expect(req.headers["seclai-version"]).toBeUndefined(); - return jsonResponse({ data: [] }); - }); - await client.listAgents(); - }); - - test("Seclai-Version header is sent when set", async () => { - const client = makeClient( - (req) => { - expect(req.headers["seclai-version"]).toBe("2026-07-27"); - return jsonResponse({ data: [] }); - }, - { apiVersion: "2026-07-27" }, - ); - await client.listAgents(); - }); - - test("getApiVersion sends GET /version", async () => { - const client = makeClient((req) => { - expect(req.method).toBe("GET"); - expect(new URL(req.url).pathname).toBe("/version"); - return jsonResponse({ - pinned_version: null, - effective_version: "2026-01-01", - default_version: "2026-01-01", - latest_version: "2026-07-27", - known_versions: ["2026-01-01", "2026-07-27"], - }); - }); - const res = await client.getApiVersion(); - expect(res.latest_version).toBe("2026-07-27"); - }); - - test("updateApiVersion sends explicit null to clear the pin", async () => { - // null is the documented way to clear the pin, so it must reach the wire. - let body: unknown; - const client = makeClient((req) => { - expect(req.method).toBe("PUT"); - expect(new URL(req.url).pathname).toBe("/version"); - body = JSON.parse(req.bodyText!); - return jsonResponse({ pinned_version: null }); - }); - await client.updateApiVersion(null); - expect(body).toEqual({ version: null }); - }); -}); - - -describe("Undeclared and required query params", () => { - test("listAlerts does not send severity", async () => { - // GET /alerts declares no severity filter: it never filtered anything, and - // sending it is a 422 once apiVersion is 2026-07-27 or later. - const client = makeClient((req) => { - expect(new URL(req.url).searchParams.has("severity")).toBe(false); - return jsonResponse({ data: [] }); - }); - await client.listAlerts({ severity: "high" }); - }); - - test("listModelAlerts translates page to offset", async () => { - // /models/alerts declares limit/offset, not page, so page 2 used to return - // page 1. - const client = makeClient((req) => { - const q = new URL(req.url).searchParams; - expect(q.get("offset")).toBe("50"); - expect(q.get("limit")).toBe("25"); - expect(q.has("page")).toBe(false); - return jsonResponse({ alerts: [], total: 0 }); - }); - await client.listModelAlerts({ page: 3, limit: 25 }); - }); - - test("getAgentAiConversationHistory sends step_type", async () => { - // step_type is required by the API and the method had no way to send it, - // so every call answered 422. - const client = makeClient((req) => { - expect(new URL(req.url).searchParams.get("step_type")).toBe("llm"); - return jsonResponse({ turns: [] }); - }); - await client.getAgentAiConversationHistory("ag_1", { stepType: "llm" }); - }); -}); - - -describe("Version-gated evaluation result shapes", () => { - test("listRunEvaluationResults reads the canonical pagination", async () => { - // The run-level endpoint is version-gated to {data, pagination}. Reading - // only the flat total/page/limit reported undefined for opted-in callers. - const client = makeClient( - () => - jsonResponse({ - data: [], - pagination: { page: 2, limit: 25, total: 7, pages: 1, has_next: false, has_prev: true }, - }), - { apiVersion: "2026-07-27" }, - ); - const res = await client.listRunEvaluationResults("ag_1", "r_1", { page: 2, limit: 25 }); - expect(res.pagination?.total).toBe(7); - }); - - test("listAgentEvaluationResults still reads the flat shape", async () => { - // The agent-level endpoint is not version-gated, so the shared type must - // keep serving both. - const client = makeClient(() => jsonResponse({ data: [], total: 7, page: 2, limit: 25 })); - const res = await client.listAgentEvaluationResults("ag_1", { page: 2, limit: 25 }); - expect(res.total).toBe(7); - expect(res.pagination).toBeUndefined(); - }); -}); - - -describe("Typed alert list shapes", () => { - test("listAlerts decodes the typed envelope", async () => { - const client = makeClient(() => - jsonResponse({ - data: [{ id: "al1", title: "Disk full", status: "triggered" }], - pagination: { page: 1, limit: 20, total: 1, pages: 1, has_next: false, has_prev: false }, - }), - ); - const res = await client.listAlerts(); - expect(res.data[0].id).toBe("al1"); - expect(res.pagination.total).toBe(1); - }); - - test("listAlertConfigs reads either top-level key", async () => { - // `configs` by default, `data` once opted in. - const legacy = makeClient(() => jsonResponse({ configs: [{ id: "c1" }], total: 1 })); - const a = await legacy.listAlertConfigs(); - expect(a.configs?.[0].id).toBe("c1"); - - const canonical = makeClient(() => - jsonResponse({ - data: [{ id: "c1" }], - pagination: { page: 1, limit: 20, total: 1, pages: 1, has_next: false, has_prev: false }, - }), - ); - const b = await canonical.listAlertConfigs(); - expect(b.data?.[0].id).toBe("c1"); - expect(b.pagination?.total).toBe(1); - }); - - test("listModelAlerts reads either top-level key", async () => { - const legacy = makeClient(() => jsonResponse({ alerts: [{ id: "m1" }], total: 1 })); - const a = await legacy.listModelAlerts(); - expect(a.alerts?.[0].id).toBe("m1"); - - const canonical = makeClient(() => - jsonResponse({ - data: [{ id: "m1" }], - pagination: { page: 1, limit: 20, total: 1, pages: 1, has_next: false, has_prev: false }, - }), - ); - const b = await canonical.listModelAlerts(); - expect(b.data?.[0].id).toBe("m1"); - }); -}); - -describe("Typed returns", () => { - test("search returns the typed envelope", async () => { - const client = makeClient(() => - jsonResponse({ results: [{ entity_type: "agent", name: "Support" }] }), - ); - const res = await client.search({ query: "support" }); - // Deliberately not paginated — the spec carves this shape out to match the - // MCP search_resources tool. - expect(res.results[0].name).toBe("Support"); - }); - - test("getAlert returns the typed detail", async () => { - const client = makeClient(() => - jsonResponse({ alert: { id: "al1", title: "Disk full" }, comments: [], subscribers: [] }), - ); - const res = await client.getAlert("al1"); - expect(res.alert.title).toBe("Disk full"); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Retyped methods — runtime smoke -// -// The 20 methods below had their return types narrowed from `unknown` by a bulk -// edit. A TypeScript `as` cast is unchecked, so neither the compiler nor the -// type tests can prove the body still issues the right request and hands back a -// parsed object. This table calls each one against a mock and asserts both. -// ───────────────────────────────────────────────────────────────────────────── - -describe("Retyped methods issue the right request and parse the body", () => { - const BODY = { id: "x1", alert: { id: "x1" }, results: [], data: [], ok: true }; - - const cases: Array<[string, string, string, (c: Seclai) => Promise]> = [ - ["getAlert", "GET", "/alerts/a1", (c) => c.getAlert("a1")], - ["changeAlertStatus", "POST", "/alerts/a1/status", (c) => c.changeAlertStatus("a1", { status: "resolved" })], - ["addAlertComment", "POST", "/alerts/a1/comments", (c) => c.addAlertComment("a1", { comment: "hi" })], - ["subscribeToAlert", "POST", "/alerts/a1/subscribe", (c) => c.subscribeToAlert("a1")], - ["unsubscribeFromAlert", "POST", "/alerts/a1/unsubscribe", (c) => c.unsubscribeFromAlert("a1")], - ["listAlerts", "GET", "/alerts", (c) => c.listAlerts()], - ["listAlertConfigs", "GET", "/alerts/configs", (c) => c.listAlertConfigs()], - ["createAlertConfig", "POST", "/alerts/configs", (c) => c.createAlertConfig({ alert_type: "x" } as never)], - ["getAlertConfig", "GET", "/alerts/configs/c1", (c) => c.getAlertConfig("c1")], - ["updateAlertConfig", "PATCH", "/alerts/configs/c1", (c) => c.updateAlertConfig("c1", {} as never)], - ["listModelAlerts", "GET", "/models/alerts", (c) => c.listModelAlerts()], - ["getUnreadModelAlertCount", "GET", "/models/alerts/unread-count", (c) => c.getUnreadModelAlertCount()], - ["getModelRecommendations", "GET", "/models/m1/recommendations", (c) => c.getModelRecommendations("m1")], - ["listExperiments", "GET", "/models/playground/experiments", (c) => c.listExperiments()], - ["createExperiment", "POST", "/models/playground/experiments", (c) => c.createExperiment({} as never)], - ["getExperiment", "GET", "/models/playground/experiments/e1", (c) => c.getExperiment("e1")], - ["cancelExperiment", "POST", "/models/playground/experiments/e1/cancel", (c) => c.cancelExperiment("e1")], - ["search", "GET", "/search", (c) => c.search({ query: "q" })], - ["acceptAiMemoryBankSuggestion", "PATCH", "/ai-assistant/memory-bank/cv1", (c) => c.acceptAiMemoryBankSuggestion("cv1", {} as never)], - ["acceptMemoryBankAiSuggestion", "PATCH", "/memory_banks/ai-assistant/cv1", (c) => c.acceptMemoryBankAiSuggestion("cv1", {} as never)], - ]; - - test.each(cases)("%s sends %s %s and returns a parsed object", async (_name, verb, path, call) => { - let seen: { method: string; pathname: string } | undefined; - const client = makeClient((req) => { - seen = { method: req.method, pathname: new URL(req.url).pathname }; - return jsonResponse(BODY); - }); - const res = await call(client); - expect(seen).toEqual({ method: verb, pathname: path }); - // A parsed object, not a Response and not a raw string. - expect(typeof res).toBe("object"); - expect(res).not.toBeNull(); - expect(res).toHaveProperty("id", "x1"); - }); -}); - -describe("API version constants", () => { - test("constants track the spec's x-seclai-versions block", async () => { - const spec = JSON.parse( - readFileSync(new URL("../openapi/seclai.openapi.json", import.meta.url), "utf8"), - ); - const v = spec["x-seclai-versions"]; - expect(SeclaiApiVersion.Default).toBe(v.default); - expect(SeclaiApiVersion.Latest).toBe(v.latest); - const known = Object.entries(SeclaiApiVersion) - .filter(([k]) => k.startsWith("V")) - .map(([, val]) => val); - expect(known).toEqual(v.known); - }); - - test("a constant reaches the wire", async () => { - const client = makeClient( - (req) => { - expect(req.headers["seclai-version"]).toBe("2026-10-21"); - return jsonResponse({ data: [] }); - }, - { apiVersion: SeclaiApiVersion.Latest }, - ); - await client.listAgents(); - }); - - test("an unknown version is rejected", () => { - // A newer server version can reshape responses, and this client would - // mis-decode them silently rather than error. Fail closed at construction. - expect(() => new Seclai({ apiKey: "k", apiVersion: "2099-01-01" })).toThrow( - /2099-01-01[\s\S]*allowUnknownApiVersion/, - ); - }); - - test("an unknown version is allowed when asked", async () => { - const client = makeClient( - (req) => { - expect(req.headers["seclai-version"]).toBe("2099-01-01"); - return jsonResponse({ data: [] }); - }, - { apiVersion: "2099-01-01", allowUnknownApiVersion: true }, - ); - await client.listAgents(); - }); - - test("a known version needs no escape hatch", async () => { - const client = makeClient( - (req) => { - expect(req.headers["seclai-version"]).toBe(SeclaiApiVersion.Latest); - return jsonResponse({ data: [] }); - }, - { apiVersion: SeclaiApiVersion.Latest }, - ); - await client.listAgents(); - }); -}); - -describe("API version guard cannot be bypassed via defaultHeaders", () => { - test("an unknown version in defaultHeaders is rejected", () => { - // defaultHeaders is spread last so it wins, which means it can carry a - // Seclai-Version. Validating only `apiVersion` left the guard one header - // away from being bypassed. - expect( - () => - new Seclai({ - apiKey: "k", - defaultHeaders: { "Seclai-Version": "2099-01-01" }, - }), - ).toThrow(/2099-01-01[\s\S]*defaultHeaders/); - }); - - test("a lowercase header key is caught too", () => { - expect( - () => - new Seclai({ - apiKey: "k", - defaultHeaders: { "seclai-version": "2099-01-01" }, - }), - ).toThrow(/2099-01-01/); - }); - - test("the escape hatch still covers the header form", async () => { - const client = makeClient( - (req) => { - expect(req.headers["seclai-version"]).toBe("2099-01-01"); - return jsonResponse({ data: [] }); - }, - { - defaultHeaders: { "Seclai-Version": "2099-01-01" }, - allowUnknownApiVersion: true, - }, - ); - await client.listAgents(); - }); - - test("a caller-supplied header overrides rather than duplicating", async () => { - const client = makeClient( - (req) => { - // One value, not two: differing cases would otherwise emit both keys and - // let the server pick arbitrarily. - expect(req.headers["seclai-version"]).toBe("2026-07-27"); - return jsonResponse({ data: [] }); - }, - { - apiVersion: SeclaiApiVersion.V2026_07_01, - defaultHeaders: { "seclai-version": SeclaiApiVersion.V2026_07_27 }, - }, - ); - await client.listAgents(); - }); - - test("a known version in defaultHeaders needs no escape hatch", () => { - expect( - () => - new Seclai({ - apiKey: "k", - defaultHeaders: { "Seclai-Version": SeclaiApiVersion.V2026_07_27 }, - }), - ).not.toThrow(); - }); -}); - -describe("API version guard validates what the merge produces", () => { - test("a second, differently-cased header cannot slip past the guard", () => { - // The merge lets the LAST entry win. Validating the first match would - // approve "2026-07-27" and then send "2099-01-01". - expect( - () => - new Seclai({ - apiKey: "k", - defaultHeaders: { - "Seclai-Version": SeclaiApiVersion.V2026_07_27, - "seclai-version": "2099-01-01", - }, - }), - ).toThrow(/2099-01-01/); - }); - - test("and the value it approves is the one that reaches the wire", async () => { - let seen: string[] = []; - const client = makeClient( - (req) => { - seen = [req.headers["seclai-version"] ?? ""]; - return jsonResponse({ data: [] }); - }, - { - defaultHeaders: { - "Seclai-Version": SeclaiApiVersion.V2026_07_01, - "seclai-version": SeclaiApiVersion.V2026_07_27, - }, - }, - ); - await client.listAgents(); - expect(seen).toEqual([SeclaiApiVersion.V2026_07_27]); - }); - - test("the option is still named as the source when it is the culprit", () => { - expect(() => new Seclai({ apiKey: "k", apiVersion: "2099-01-01" })).toThrow( - /via apiVersion/, - ); - }); -}); - -describe("Cloud drives, embedders/rerankers and source contents", () => { - const PAGINATION = { page: 1, limit: 1, total: 1, pages: 1, has_next: false, has_prev: false }; - - type Call = { - name: string; - run: (c: Seclai) => Promise; - verb: string; - path: string; - query?: [string, string][]; - body?: unknown; - }; - - const calls: Call[] = [ - { name: "listCloudDriveProviders", run: (c) => c.listCloudDriveProviders(), verb: "GET", path: "/cloud-drives/providers" }, - { name: "listCloudDrives", run: (c) => c.listCloudDrives(), verb: "GET", path: "/cloud-drives" }, - { name: "getCloudDrive", run: (c) => c.getCloudDrive("c1"), verb: "GET", path: "/cloud-drives/c1" }, - { - name: "updateCloudDrive", - run: (c) => c.updateCloudDrive("c1", { name: "Contracts" }), - verb: "PATCH", - path: "/cloud-drives/c1", - body: { name: "Contracts" }, - }, - { name: "disconnectCloudDrive", run: (c) => c.disconnectCloudDrive("c1"), verb: "POST", path: "/cloud-drives/c1/disconnect" }, - { name: "deleteCloudDrive", run: (c) => c.deleteCloudDrive("c1"), verb: "DELETE", path: "/cloud-drives/c1" }, - { name: "getAgentsUsingCloudDrive", run: (c) => c.getAgentsUsingCloudDrive("c1"), verb: "GET", path: "/cloud-drives/c1/agents" }, - { - name: "listCloudDriveRejections with a limit", - run: (c) => c.listCloudDriveRejections("c1", { limit: 20 }), - verb: "GET", - path: "/cloud-drives/c1/rejections", - query: [["limit", "20"]], - }, - { name: "listCloudDriveRejections", run: (c) => c.listCloudDriveRejections("c1"), verb: "GET", path: "/cloud-drives/c1/rejections" }, - { - name: "listEmbeddingModels with a filter", - run: (c) => c.listEmbeddingModels({ supportsInputMedia: "image" }), - verb: "GET", - path: "/models/embedders", - query: [["supports_input_media", "image"]], - }, - { name: "listEmbeddingModels", run: (c) => c.listEmbeddingModels(), verb: "GET", path: "/models/embedders" }, - { name: "listRerankerModels", run: (c) => c.listRerankerModels(), verb: "GET", path: "/models/rerankers" }, - { - name: "listSourceContents with every option", - run: (c) => - c.listSourceContents("s1", { - page: 2, - limit: 10, - sort: "title", - order: "asc", - status: "failed", - contentVersionIds: ["cv1", "cv2"], - }), - verb: "GET", - path: "/sources/s1/contents", - query: [ - ["page", "2"], - ["limit", "10"], - ["sort", "title"], - ["order", "asc"], - ["status", "failed"], - ["content_version_id", "cv1"], - ["content_version_id", "cv2"], - ], - }, - { name: "listSourceContents", run: (c) => c.listSourceContents("s1"), verb: "GET", path: "/sources/s1/contents" }, - { - name: "getSourceContentStatus", - run: (c) => c.getSourceContentStatus("s1", "cv1"), - verb: "GET", - path: "/sources/s1/contents/cv1", - }, - ]; - - test.each(calls)("$name sends $verb $path", async ({ run, verb, path, query, body }) => { - let seen: unknown; - const client = makeClient((req) => { - const url = new URL(req.url); - seen = { - verb: req.method, - path: url.pathname, - query: [...url.searchParams.entries()], - body: req.bodyText === undefined ? undefined : JSON.parse(req.bodyText), - }; - return jsonResponse({ data: [] }); - }); - await run(client); - expect(seen).toEqual({ verb, path, query: query ?? [], body }); - }); - - const lists: { name: string; run: (c: Seclai) => Promise }[] = [ - { name: "listCloudDriveProviders", run: (c) => c.listCloudDriveProviders() }, - { name: "listCloudDrives", run: (c) => c.listCloudDrives() }, - { name: "getAgentsUsingCloudDrive", run: (c) => c.getAgentsUsingCloudDrive("c1") }, - { name: "listCloudDriveRejections", run: (c) => c.listCloudDriveRejections("c1") }, - ]; - - test.each(lists)("$name reads the legacy bare array", async ({ run }) => { - const client = makeClient(() => jsonResponse([{ id: "x1" }])); - expect(await run(client)).toEqual([{ id: "x1" }]); - }); - - test.each(lists)("$name reads the 2026-07-27 envelope", async ({ run }) => { - const client = makeClient(() => jsonResponse({ data: [{ id: "x1" }], pagination: PAGINATION })); - expect(await run(client)).toEqual([{ id: "x1" }]); - }); - - const modelLists: { name: string; run: (c: Seclai) => Promise<{ models: unknown[] }> }[] = [ - { name: "listEmbeddingModels", run: (c) => c.listEmbeddingModels() }, - { name: "listRerankerModels", run: (c) => c.listRerankerModels() }, - ]; - - test.each(modelLists)("$name reads the legacy models key", async ({ run }) => { - const client = makeClient(() => - jsonResponse({ models: [{ model_type: "m1" }], default_model_type: "m1" }), - ); - const res = await run(client); - expect(res.models).toEqual([{ model_type: "m1" }]); - expect(res).toHaveProperty("default_model_type", "m1"); - }); - - test.each(modelLists)("$name keeps models and the pricing on the 2026-07-27 envelope", async ({ run }) => { - const client = makeClient(() => - jsonResponse({ data: [{ model_type: "m1" }], pagination: PAGINATION, default_model_type: "m1" }), - ); - const res = await run(client); - expect(res.models).toEqual([{ model_type: "m1" }]); - expect(res).toHaveProperty("default_model_type", "m1"); - expect(res).toHaveProperty("pagination", PAGINATION); - }); - - test("listSourceContents returns the envelope", async () => { - const body = { data: [{ content_version_id: "cv1" }], pagination: PAGINATION }; - const client = makeClient(() => jsonResponse(body)); - expect(await client.listSourceContents("s1")).toEqual(body); - }); - - test("listSourceContents with no ids returns an empty page without a request", async () => { - let requests = 0; - const client = makeClient(() => { - requests += 1; - return jsonResponse({ data: [{ content_version_id: "cv1" }], pagination: PAGINATION }); - }); - expect(await client.listSourceContents("s1", { contentVersionIds: [] })).toEqual({ - data: [], - pagination: { page: 1, limit: 20, total: 0, pages: 0, has_next: false, has_prev: false }, - }); - expect( - (await client.listSourceContents("s1", { contentVersionIds: [], page: 3, limit: 5 })).pagination, - ).toEqual({ page: 3, limit: 5, total: 0, pages: 0, has_next: false, has_prev: false }); - expect(requests).toBe(0); - }); - - test("deleteCloudDrive discards the acknowledgement", async () => { - const client = makeClient(() => jsonResponse({ ok: true })); - expect(await client.deleteCloudDrive("c1")).toBeUndefined(); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Version-gated lists: every gated endpoint, both response shapes -// ───────────────────────────────────────────────────────────────────────────── - -// Every `METHOD path` the API serves through a version gate. Regenerate from the -// backend (seclai/backend/api/src/api/routers/api): list each call to -// `versioned_list_response`, `versioned_offset_list_response` and -// `versioned_complete_list_response`, and write down the route of the handler it -// returns from — the router's prefix without `/api`, plus the decorator's verb -// and path. One entry per call site. -const GATED_ENDPOINTS = [ - "GET /agents/{agent_id}/evaluation-criteria", - "GET /agents/evaluation-criteria/{criteria_id}/results", - "GET /agents/{agent_id}/runs/{run_id}/evaluation-results", - "GET /agents/{agent_id}/evaluation-runs", - "GET /agents/{agent_id}/evaluation-results", - "GET /agents/evaluation-criteria/{criteria_id}/compatible-runs", - "GET /agents/inbound-email-rejections", - "GET /agents/agent-email-optouts", - "GET /agents/blocked-email-senders", - "PUT /agents/blocked-email-senders/mode", - "GET /agents/{agent_id}/callers", - "GET /alerts/configs", - "GET /alerts/organization-preferences/list", - "GET /cloud-drives/providers", - "GET /cloud-drives", - "GET /cloud-drives/{connection_id}/agents", - "GET /cloud-drives/{connection_id}/rejections", - "GET /email-domains", - "GET /governance/ai-assistant/conversations", - "GET /knowledge_bases", - "GET /memory_banks/templates", - "GET /memory_banks", - "GET /memory_banks/{memory_bank_id}/agents", - "GET /models/generation-tiers", - "GET /models/alerts", - "GET /models/playground/experiments", - "GET /models", - "GET /models/embedders", - "GET /models/rerankers", - "GET /solutions/{solution_id}/conversations", -] as const; - -describe("Version-gated lists", () => { - const ITEMS = [{ id: "x1" }]; - // `versioned_list_response` / `versioned_offset_list_response`: a real page. - const PAGED = { page: 1, limit: 50, total: 1, pages: 1, has_next: false, has_prev: false }; - // `versioned_complete_list_response`: one page spanning the whole list. - const COMPLETE = { page: 1, limit: 1, total: 1, pages: 1, has_next: false, has_prev: false }; - - type Row = { - endpoint: (typeof GATED_ENDPOINTS)[number]; - name: string; - call: (c: Seclai) => Promise; - /** The body below 2026-07-27, and what the method must return for it. */ - legacy: unknown; - wantLegacy: unknown; - /** The body from 2026-07-27, and what the method must return for it. */ - canonical: unknown; - wantCanonical: unknown; - }; - - /** A method declared as an array: the items on either shape. */ - const arrayRow = ( - endpoint: Row["endpoint"], - name: string, - call: Row["call"], - pagination: typeof PAGED, - ): Row => ({ - endpoint, - name, - call, - legacy: ITEMS, - wantLegacy: ITEMS, - canonical: { data: ITEMS, pagination }, - wantCanonical: ITEMS, - }); - - /** - * A method declared as an object. `legacy` is the default body; from - * 2026-07-27 its list moves to `data`, its counters into `pagination`, and - * `extras` stay beside them — and the method must still return every legacy - * field, with `data` and `pagination` kept. - */ - const keyedRow = ( - endpoint: Row["endpoint"], - name: string, - call: Row["call"], - pagination: typeof PAGED, - legacy: Record, - extras: Record = {}, - ): Row => ({ - endpoint, - name, - call, - legacy, - wantLegacy: legacy, - canonical: { data: ITEMS, pagination, ...extras }, - wantCanonical: { ...legacy, data: ITEMS, pagination }, - }); - - const FLAT = { data: ITEMS, total: 1, page: 1, limit: 50 }; - const BLOCKED = { auto_block_mode: "disabled" }; - const DOMAIN_CAPS = { - can_add_vanity: true, - can_add_custom: false, - has_vanity: false, - has_custom: false, - vanity_plan_names: ["Pro"], - custom_plan_names: ["Enterprise"], - }; - const EMBEDDER_EXTRAS = { - storage_credits: [{ dimension: 1024, credits: 1 }], - file_processing_credits_per_mb: 2, - default_model_type: "m1", - default_dimension: 1024, - }; - const RERANKER_EXTRAS = { default_model_type: "m1", search_processing_credits: 3 }; - - const rows: Row[] = [ - arrayRow("GET /agents/{agent_id}/evaluation-criteria", "listEvaluationCriteria", (c) => c.listEvaluationCriteria("a1"), PAGED), - { - endpoint: "GET /agents/{agent_id}/evaluation-criteria", - name: "listEvaluationCriteriaPage", - call: (c) => c.listEvaluationCriteriaPage("a1"), - legacy: ITEMS, - wantLegacy: { data: ITEMS }, - canonical: { data: ITEMS, pagination: PAGED }, - wantCanonical: { data: ITEMS, pagination: PAGED }, - }, - keyedRow("GET /agents/evaluation-criteria/{criteria_id}/results", "listEvaluationResults", (c) => c.listEvaluationResults("c1"), PAGED, FLAT), - { - endpoint: "GET /agents/{agent_id}/runs/{run_id}/evaluation-results", - name: "listRunEvaluationResults", - call: (c) => c.listRunEvaluationResults("a1", "r1"), - legacy: ITEMS, - wantLegacy: { data: ITEMS }, - canonical: { data: ITEMS, pagination: PAGED }, - wantCanonical: { ...FLAT, pagination: PAGED }, - }, - keyedRow("GET /agents/{agent_id}/evaluation-runs", "listEvaluationRuns", (c) => c.listEvaluationRuns("a1"), PAGED, FLAT), - keyedRow("GET /agents/{agent_id}/evaluation-results", "listAgentEvaluationResults", (c) => c.listAgentEvaluationResults("a1"), PAGED, FLAT), - keyedRow("GET /agents/evaluation-criteria/{criteria_id}/compatible-runs", "listCompatibleRuns", (c) => c.listCompatibleRuns("c1"), PAGED, FLAT), - arrayRow("GET /agents/inbound-email-rejections", "listInboundEmailRejections", (c) => c.listInboundEmailRejections(), PAGED), - keyedRow("GET /agents/agent-email-optouts", "listAgentEmailOptOuts", (c) => c.listAgentEmailOptOuts(), PAGED, { items: ITEMS, total: 1 }), - keyedRow("GET /agents/blocked-email-senders", "listBlockedEmailSenders", (c) => c.listBlockedEmailSenders(), PAGED, { items: ITEMS, total: 1, ...BLOCKED }, BLOCKED), - keyedRow("PUT /agents/blocked-email-senders/mode", "setAutoBlockMode", (c) => c.setAutoBlockMode({ mode: "disabled" }), COMPLETE, { items: ITEMS, total: 1, ...BLOCKED }, BLOCKED), - arrayRow("GET /agents/{agent_id}/callers", "getAgentCallers", (c) => c.getAgentCallers("a1"), COMPLETE), - keyedRow("GET /alerts/configs", "listAlertConfigs", (c) => c.listAlertConfigs(), PAGED, { configs: ITEMS, total: 1 }), - keyedRow("GET /alerts/organization-preferences/list", "listOrganizationAlertPreferences", (c) => c.listOrganizationAlertPreferences(), COMPLETE, { preferences: ITEMS, total: 1 }), - arrayRow("GET /cloud-drives/providers", "listCloudDriveProviders", (c) => c.listCloudDriveProviders(), COMPLETE), - arrayRow("GET /cloud-drives", "listCloudDrives", (c) => c.listCloudDrives(), COMPLETE), - arrayRow("GET /cloud-drives/{connection_id}/agents", "getAgentsUsingCloudDrive", (c) => c.getAgentsUsingCloudDrive("d1"), COMPLETE), - arrayRow("GET /cloud-drives/{connection_id}/rejections", "listCloudDriveRejections", (c) => c.listCloudDriveRejections("d1"), PAGED), - keyedRow("GET /email-domains", "listEmailDomains", (c) => c.listEmailDomains(), COMPLETE, { domains: ITEMS, ...DOMAIN_CAPS }, DOMAIN_CAPS), - arrayRow("GET /governance/ai-assistant/conversations", "listGovernanceAiConversations", (c) => c.listGovernanceAiConversations(), PAGED), - keyedRow("GET /knowledge_bases", "listKnowledgeBases", (c) => c.listKnowledgeBases(), PAGED, { knowledge_bases: ITEMS, page: 1, limit: 50, total: 1 }), - arrayRow("GET /memory_banks/templates", "listMemoryBankTemplates", (c) => c.listMemoryBankTemplates(), COMPLETE), - keyedRow("GET /memory_banks", "listMemoryBanks", (c) => c.listMemoryBanks(), PAGED, { memory_banks: ITEMS, page: 1, limit: 50, total: 1 }), - arrayRow("GET /memory_banks/{memory_bank_id}/agents", "getAgentsUsingMemoryBank", (c) => c.getAgentsUsingMemoryBank("m1"), COMPLETE), - keyedRow("GET /models/generation-tiers", "getGenerationTiers", (c) => c.getGenerationTiers(), COMPLETE, { tiers: ITEMS }), - keyedRow("GET /models/alerts", "listModelAlerts", (c) => c.listModelAlerts(), PAGED, { alerts: ITEMS, total: 1 }), - keyedRow("GET /models/playground/experiments", "listExperiments", (c) => c.listExperiments(), PAGED, { experiments: ITEMS, total: 1 }), - arrayRow("GET /models", "listModels", (c) => c.listModels(), COMPLETE), - keyedRow("GET /models/embedders", "listEmbeddingModels", (c) => c.listEmbeddingModels(), COMPLETE, { models: ITEMS, ...EMBEDDER_EXTRAS }, EMBEDDER_EXTRAS), - keyedRow("GET /models/rerankers", "listRerankerModels", (c) => c.listRerankerModels(), COMPLETE, { models: ITEMS, ...RERANKER_EXTRAS }, RERANKER_EXTRAS), - arrayRow("GET /solutions/{solution_id}/conversations", "listSolutionConversations", (c) => c.listSolutionConversations("s1"), COMPLETE), - ]; - - /** Serve `body`, failing unless the request is the row's `METHOD path`. */ - function clientFor(endpoint: string, body: unknown): Seclai { - const [verb, template] = endpoint.split(" "); - const path = new RegExp(`^${template.replace(/\{[^}]+\}/g, "[^/]+")}$`); - return makeClient((req) => { - expect(req.method).toBe(verb); - expect(new URL(req.url).pathname).toMatch(path); - return jsonResponse(body); - }); - } - - test("every gated endpoint has a row", () => { - expect(GATED_ENDPOINTS).toHaveLength(30); - expect([...new Set(rows.map((row) => row.endpoint))].sort()).toEqual([...GATED_ENDPOINTS].sort()); - }); - - test.each(rows)("$name returns its declared shape for the default body", async (row) => { - expect(await row.call(clientFor(row.endpoint, row.legacy))).toEqual(row.wantLegacy); - }); - - test.each(rows)("$name returns its declared shape for the 2026-07-27 body", async (row) => { - expect(await row.call(clientFor(row.endpoint, row.canonical))).toEqual(row.wantCanonical); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// Headers: one value per header, and a guarded Seclai-Version, on every path -// ───────────────────────────────────────────────────────────────────────────── - -describe("Request headers", () => { - // `makeFetch` reads headers through `Headers`, which joins two spellings of a - // name into one value. These tests need the object exactly as it was sent. - function recordingClient( - extra: Partial[0]>, - respond: () => Response = () => jsonResponse({ data: [] }), - ) { - const sent: { headers: Record; body: unknown }[] = []; - const client = new Seclai({ - baseUrl: "https://test.invalid", - fetch: async (_input, init) => { - sent.push({ headers: { ...(init?.headers as Record) }, body: init?.body }); - return respond(); - }, - ...extra, - }); - return { client, sent }; - } - - const done = () => - makeSseResponse([`event: done\ndata: ${JSON.stringify({ run_id: "r1", status: "completed" })}\n\n`]); - - const CREDENTIAL_DEFAULTS = { "X-API-KEY": "other", "X-Trace": "default" }; - - test("request() sends one value per header whatever the case", async () => { - const { client, sent } = recordingClient({ apiKey: "real", defaultHeaders: CREDENTIAL_DEFAULTS }); - await client.request("POST", "/agents", { - json: { name: "a" }, - headers: { "x-trace": "request", "Content-Type": "application/x-ndjson" }, - }); - expect(sent[0].headers).toEqual({ - "Content-Type": "application/x-ndjson", - "x-trace": "request", - "x-api-key": "real", - }); - }); - - test("request() sends the JSON content type when the caller sets none", async () => { - const { client, sent } = recordingClient({ apiKey: "real" }); - await client.request("POST", "/agents", { json: { name: "a" } }); - expect(sent[0].headers).toEqual({ "content-type": "application/json", "x-api-key": "real" }); - }); - - test("request() sends the bearer token and account id once", async () => { - const { client, sent } = recordingClient({ - accessToken: "tok", - accountId: "acct", - defaultHeaders: { Authorization: "Bearer other", "X-Account-Id": "other" }, - }); - await client.request("GET", "/agents", { headers: { AUTHORIZATION: "Bearer third" } }); - expect(sent[0].headers).toEqual({ authorization: "Bearer tok", "x-account-id": "acct" }); - }); - - test("requestRaw() sends one value per header whatever the case", async () => { - const { client, sent } = recordingClient({ apiKey: "real", defaultHeaders: CREDENTIAL_DEFAULTS }); - await client.requestRaw("POST", "/agents", { - json: { name: "a" }, - headers: { "x-trace": "request", "CONTENT-TYPE": "application/x-ndjson" }, - }); - expect(sent[0].headers).toEqual({ - "CONTENT-TYPE": "application/x-ndjson", - "x-trace": "request", - "x-api-key": "real", - }); - }); - - test("a download sends one value per header", async () => { - const { client, sent } = recordingClient({ apiKey: "real", defaultHeaders: CREDENTIAL_DEFAULTS }); - await client.downloadSourceExport("s1", "e1"); - expect(sent[0].headers).toEqual({ "X-Trace": "default", "x-api-key": "real" }); - }); - - test("an upload leaves the content type to the multipart body", async () => { - const { client, sent } = recordingClient({ - apiKey: "real", - defaultHeaders: { ...CREDENTIAL_DEFAULTS, "Content-type": "application/json" }, - }); - await client.uploadFileToSource("s1", { file: new Uint8Array([1]), fileName: "a.txt" }); - expect(sent[0].headers).toEqual({ "X-Trace": "default", "x-api-key": "real" }); - expect(sent[0].body).toBeInstanceOf(FormData); - }); - - const STREAM_DEFAULTS = { ...CREDENTIAL_DEFAULTS, Accept: "application/json", "Content-Type": "text/plain" }; - const STREAM_HEADERS = { - "X-Trace": "default", - "x-api-key": "real", - accept: "text/event-stream", - "content-type": "application/json", - }; - - test("runStreamingAgentAndWait() sends one value per header", async () => { - const { client, sent } = recordingClient({ apiKey: "real", defaultHeaders: STREAM_DEFAULTS }, done); - await client.runStreamingAgentAndWait("a1", { input: "x" } as never); - expect(sent[0].headers).toEqual(STREAM_HEADERS); - }); - - test("runStreamingAgent() sends one value per header", async () => { - const { client, sent } = recordingClient({ apiKey: "real", defaultHeaders: STREAM_DEFAULTS }, done); - for await (const _ of client.runStreamingAgent("a1", { input: "x" } as never)) void _; - expect(sent[0].headers).toEqual(STREAM_HEADERS); - }); - - test("a per-request Seclai-Version replaces the client's in any case", async () => { - const { client, sent } = recordingClient({ apiKey: "real", apiVersion: SeclaiApiVersion.V2026_07_01 }); - await client.request("GET", "/agents", { headers: { "seclai-version": SeclaiApiVersion.V2026_07_27 } }); - await client.requestRaw("GET", "/agents", { headers: { "SECLAI-VERSION": SeclaiApiVersion.V2026_07_27 } }); - expect(sent.map((s) => s.headers)).toEqual([ - { "seclai-version": "2026-07-27", "x-api-key": "real" }, - { "SECLAI-VERSION": "2026-07-27", "x-api-key": "real" }, - ]); - }); - - test.each(["Seclai-Version", "seclai-version"])( - "an unknown per-request %s is rejected before anything is sent", - async (name) => { - const { client, sent } = recordingClient({ apiKey: "real", apiVersion: SeclaiApiVersion.V2026_07_01 }); - const headers = { [name]: "2099-01-01" }; - await expect(client.request("GET", "/agents", { headers })).rejects.toThrow(SeclaiConfigurationError); - await expect(client.requestRaw("GET", "/agents", { headers })).rejects.toThrow( - `via headers['${name}']`, - ); - expect(sent).toEqual([]); - }, - ); - - test("an empty Seclai-Version is rejected, not treated as absent", async () => { - expect( - () => - new Seclai({ - apiKey: "real", - apiVersion: SeclaiApiVersion.Latest, - defaultHeaders: { "Seclai-Version": "" }, - }), - ).toThrow(/via defaultHeaders\['Seclai-Version'\]/); - - const { client, sent } = recordingClient({ apiKey: "real", apiVersion: SeclaiApiVersion.Latest }); - await expect(client.request("GET", "/agents", { headers: { "seclai-version": "" } })).rejects.toThrow( - SeclaiConfigurationError, - ); - expect(sent).toEqual([]); - }); - - test("allowUnknownApiVersion lets an unknown per-request version through", async () => { - const { client, sent } = recordingClient({ apiKey: "real", allowUnknownApiVersion: true }); - await client.request("GET", "/agents", { headers: { "Seclai-Version": "2099-01-01" } }); - expect(sent[0].headers).toEqual({ "Seclai-Version": "2099-01-01", "x-api-key": "real" }); - }); -}); - -describe("A list response that is not a list", () => { - const clientAnswering = (body: unknown) => makeClient(() => jsonResponse(body)); - - test.each([ - ["an error-shaped object", { error: "boom" }], - ["a string", "login"], - ["null", null], - ["a key holding a non-array", { knowledge_bases: { a: 1 }, models: { a: 1 } }], - ])("throws SeclaiError for %s rather than reading as no results", async (_name, body) => { - const client = clientAnswering(body); - await expect(client.listKnowledgeBases()).rejects.toThrow(SeclaiError); - await expect(client.listModels()).rejects.toThrow(SeclaiError); - await expect(client.listCloudDrives()).rejects.toThrow(SeclaiError); - await expect(client.listMemoryBankTemplates()).rejects.toThrow(SeclaiError); - }); - - test("an explicit null list is still an empty list", async () => { - const client = clientAnswering({ data: null, pagination: null }); - expect(await client.listModels()).toEqual([]); - expect((await client.listKnowledgeBases()).knowledge_bases).toEqual([]); - }); -}); - -describe("Header edge cases from untyped callers", () => { - function recording(extra: Partial[0]> = {}) { - const sent: Record[] = []; - const client = new Seclai({ - apiKey: "real", - baseUrl: "https://test.invalid", - fetch: async (_input, init) => { - sent.push({ ...(init?.headers as Record) }); - return jsonResponse({ data: [] }); - }, - ...extra, - }); - return { client, sent }; - } - - test.each([undefined, null])("a %s content-type does not displace the JSON one", async (value) => { - const { client, sent } = recording(); - const headers = { "content-type": value } as unknown as Record; - await client.request("POST", "/agents", { json: { a: 1 }, headers }); - expect(sent[0]).toEqual({ "content-type": "application/json", "x-api-key": "real" }); - }); - - test("the guard names the spelling that carried the rejected version", () => { - expect( - () => - new Seclai({ - apiKey: "real", - defaultHeaders: { "Seclai-Version": "2026-07-27", "seclai-version": "2099-01-01" }, - }), - ).toThrow("defaultHeaders['seclai-version']"); - }); -}); diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index f10bddd..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - "target": "ES2022", - "module": "ESNext", - "moduleResolution": "Bundler", - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "outDir": "dist", - "strict": true, - "noUncheckedIndexedAccess": true, - "exactOptionalPropertyTypes": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/tsup.config.ts b/tsup.config.ts deleted file mode 100644 index ff1a153..0000000 --- a/tsup.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: ["src/index.ts"], - format: ["esm", "cjs"], - dts: true, - sourcemap: true, - clean: true, -}); diff --git a/typedoc.json b/typedoc.json deleted file mode 100644 index f8b6b30..0000000 --- a/typedoc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://typedoc.org/schema.json", - "entryPoints": ["src/index.ts"], - "out": "build/docs", - "exclude": [ - "src/openapi.ts", - "dist/**", - "node_modules/**" - ], - "excludePrivate": true, - "excludeProtected": true, - "excludeInternal": true, - "readme": "README.md", - "cleanOutputDir": true -} diff --git a/vitest.config.ts b/vitest.config.ts deleted file mode 100644 index faa6d98..0000000 --- a/vitest.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - environment: "node", - include: ["tests/**/*.test.ts"], - }, -}); From 979bfe4fde8cbe58ae1e0145cdbb53fc44f60baa Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Fri, 30 Oct 2026 23:50:33 -0700 Subject: [PATCH 6/8] Squashed '.claude/skills/seclai-changelog/' changes from aea19cd..0f1b9d6 0f1b9d6 Updated skills and guards git-subtree-dir: .claude/skills/seclai-changelog git-subtree-split: 0f1b9d67b07b47b69cab19d9ade3fe62687b53a2 --- SKILL.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SKILL.md b/SKILL.md index 358f4b5..3365c87 100644 --- a/SKILL.md +++ b/SKILL.md @@ -160,8 +160,10 @@ export type AddEmailDomainInput = Pick See `AddEmailDomainInput` and `CreateExperimentInput` in `src/types.ts`. -**Compile the doc examples.** `npm run typecheck` covers `src/` and `tests/`, not -README or changelog snippets. Paste any example you write into a scratch `.ts` +**Compile the doc examples.** `npm run typecheck` covers `src/` only — its +`tsconfig.json` includes `src/**/*.ts`, and vitest strips types without checking +them, so `tests/` is not type-checked either — let alone README or changelog +snippets. Paste any example you write into a scratch `.ts` that imports from `../src/index` and compile it — that is how the `delegated`-is-required bug above was found, after the snippet had already shipped in a PR. From f9c8767d45971f38392fd9e70d7f21b73792483e Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Fri, 30 Oct 2026 23:50:35 -0700 Subject: [PATCH 7/8] Squashed '.claude/skills/seclai-sdk-sync/' changes from 5b4e063..f6aa6eb f6aa6eb Updated skills and guards git-subtree-dir: .claude/skills/seclai-sdk-sync git-subtree-split: f6aa6ebc8a8457cb4b2535e41ee0d1258647d422 --- SKILL.md | 36 +++- sdksync.py | 503 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 525 insertions(+), 14 deletions(-) diff --git a/SKILL.md b/SKILL.md index 0f00507..2f72dd5 100644 --- a/SKILL.md +++ b/SKILL.md @@ -74,7 +74,20 @@ and swallowed the helpers below it), and `Search` was reported as never sending required `q` (the extractor read `q["k"] =` but not the map literal that sets it). Four of six Go findings were artefacts. Since both were fixed, all four SDKs report the *same* three findings — independently-written clients agreeing is the signal -that the check is reading them correctly. +that the check is reading them correctly. Twice more since: JavaScript's shorthand +`query: { download }` was read as sending nothing, and Go's `sortableListQuery` +was unknown to the extractor, so four endpoints were reported as never sending +page/limit/sort/order. + +How keys are read, so a finding can be checked against it: + +- **JavaScript** query literals are read member by member: `a: x`, `"a": x` and + the shorthand `a` are keys. A `...spread` or `[computed]` key makes the site + UNPARSED, never clean. +- **Go** package-level functions returning `map[string]string` (`listQuery`, + `sortableListQuery`) are query builders. Their keys are read from their own + bodies, including builders they call, so `listQuery` is credited with + page/limit only. A builder whose body cannot be read makes its callers UNPARSED. ## `returns` — the axis that catches a changed response @@ -154,9 +167,24 @@ diff called 21 JavaScript changes breaking when none were: (`x?: T` -> `x?: T | undefined`; source compatible), a TypeScript parameter type wrapped in `Omit` (usually source compatible: an object literal that sets an omitted key no longer compiles) or `Partial` (source - compatible) — in each case with every other parameter unchanged, or a - Python return annotation (not enforced — but confirm the runtime value did not - change too). + compatible), a TypeScript options parameter retyped to another **named** type + whose members, resolved from the declarations under `src/` at the tag and in + the working tree (interfaces, `extends`, aliases, `&`, `Omit`, `Pick`, + `Partial`), keep every old member with the same optionality and type and add + only optional ones — a member whose type names a local type counts as + unchanged only if that type's declaration is identical at both revisions, and + a type that does not resolve (generic, import, indexed access, union) stays + breaking — a required Python or TypeScript parameter made optional in place + (`id: str` -> `id: str | None = None`, `id: string` -> `id?: string`; same + name and position, positional stays positional, type unchanged or only widened + by `None`/`undefined`; not graded this way for C#), or a Python return + annotation (not enforced — but confirm the runtime value did not change too). + The parameter-level kinds combine: each old parameter must be unchanged or + changed in one of these ways, and any added parameter must be optional and at + the end. + +Only exported Go methods are surface. A lowercase method is unreachable outside +the package, so a change to one breaks no caller. An optional parameter inserted *mid-list* is graded breaking, not a warning: in C# a positional `M(id, token)` then tries to bind `token` to the new parameter. diff --git a/sdksync.py b/sdksync.py index b3299db..428f6a7 100755 --- a/sdksync.py +++ b/sdksync.py @@ -105,6 +105,12 @@ "return_re": r"\s*:\s*([^{\n]+?)\s*\{", "dict_at": [r"query:\s*"], "dict_key_re": r'["\']?([a-zA-Z_][a-zA-Z0-9_]*)["\']?\s*:', + # Read a query literal member by member rather than with dict_key_re: + # `{ download }` and `{ offset, limit: opts.limit }` send keys the regex + # cannot see (both were reported UNEXPOSED), and a `...spread` or + # `[computed]` member sends keys nobody can read here — UNPARSED, never + # clean. See `object_literal_keys`. + "dict_members": True, # `private`/`protected`/`#name` members only. An unmodified `_name(` is # matched by method_re and already audited as a block of its own. "helper_re": _JS_HELPER_RE, @@ -115,7 +121,10 @@ "skip": {"request", "requestRaw", "uploadFile", "paginate"}, }, "go": { - "sig_re": r"func \(c \*Client\) (\w+)\(", + # Exported only: a lowercase method is unreachable outside the package, + # so a change to one breaks no caller. `alertConfigsBody` and + # `modelAlertsBody` were graded BREAKING for that reason alone. + "sig_re": r"func \(c \*Client\) ([A-Z]\w*)\(", "sig_tail_re": r" \(([^)]*)\)", "sig_groups": ("name", "params", "ret"), "detect": "client.go", @@ -135,7 +144,12 @@ # false positive twin of the bug this check exists to find. "dict_at": [r"map\[string\]string"], "dict_key_re": r'"([a-zA-Z_][a-zA-Z0-9_]*)"\s*:', - "helpers": {"listQuery(": ["page", "limit"]}, + # Package-level functions that build and return a query map, such as + # `listQuery(page, limit)` and `sortableListQuery(opts)`. Their keys are + # read from their own bodies (see `query_builders`) rather than listed + # here: a hard-coded list missed `sortableListQuery`, so every method + # using it was reported as never sending page/limit/sort/order. + "builder_re": r"^func ([a-z][A-Za-z0-9]*)\([^)]*\)\s*map\[string\]string\s*\{", "helper_re": r"^func \(c \*Client\) ([a-z][A-Za-z0-9]*)\(", "helper_call": r"(? str: return "".join(out) -def split_args(sig: str, seps: str = ",") -> list[str]: +def split_args(sig: str, seps: str = ",", keep_star: bool = False) -> list[str]: """Split a comma-separated argument or parameter list at depth 0. A naive `split(",")` turns `Dictionary q` into two entries, @@ -350,7 +364,7 @@ def split_args(sig: str, seps: str = ",") -> list[str]: j += 1 if "".join(cur).strip(): out.append("".join(cur).strip()) - return [p for p in out if p and p != "*"] + return [p for p in out if p and (keep_star or p != "*")] def spec_query_index(spec: dict) -> dict[tuple[str, str], tuple[str, set[str], set[str]]]: @@ -499,12 +513,82 @@ def via_helper_line(n: int) -> str: f" holding the request (one hop)") -def block_query_keys(body: str, cfg: dict) -> tuple[set[str], bool]: +def object_literal_keys(lit: str) -> tuple[set[str], bool]: + """Keys of a JavaScript object literal's body, read member by member. + + `a: x`, `"a": x` and the shorthand `a` each name a key. A `...spread`, a + `[computed]` key or anything else unreadable makes the literal unparsed: + it can send keys nobody can see, so it must never read as clean. Nested + literals are a member's value and contribute no keys of their own. + """ + keys: set[str] = set() + ok = True + for member in split_args(strip_comments(lit)): + m = re.match(r"""(?:"([^"]+)"|'([^']+)'|([A-Za-z_$][\w$]*))\s*:""", member) + if m: + keys.add(next(g for g in m.groups() if g)) + elif re.fullmatch(r"[A-Za-z_$][\w$]*", member): + keys.add(member) + else: + ok = False + return keys, ok + + +def query_builders(texts: list[str], cfg: dict) -> dict[str, tuple[set[str], bool]]: + """Package-level query builder name -> (keys it can set, parsed_ok). + + Keys come from the builder's own body, including any builder it calls, so + `sortableListQuery` inherits `listQuery`'s page/limit and adds sort/order — + and a method calling only `listQuery` is never credited with sort/order. + A builder whose body cannot be read, or that recurses, is not ok: every + method using it is then UNPARSED rather than credited with nothing. + """ + if "builder_re" not in cfg: + return {} + bodies: dict[str, str] = {} + for text in texts: + for m in re.finditer(cfg["builder_re"], text, re.M): + body = balanced_slice(text, m.end() - 1) + bodies.setdefault(m.group(1), body if body is not None else "") + out: dict[str, tuple[set[str], bool]] = {} + + def resolve(name: str, stack: tuple[str, ...]) -> tuple[set[str], bool]: + if name in out: + return out[name] + if name in stack or not bodies[name]: + return set(), False + nested = {n: resolve(n, stack + (name,)) for n in bodies + if n != name and _calls(bodies[name], n)} + res = block_query_keys(bodies[name], cfg, nested) + if any(_calls(bodies[name], n) for n in stack + (name,)): + res = (res[0], False) + out[name] = res + return res + + for name in bodies: + resolve(name, ()) + return out + + +def _calls(body: str, name: str) -> bool: + """A call to the free function `name(` — not `x.name(`, not `othername(`.""" + return re.search(rf"(? tuple[set[str], bool]: """(keys, parsed_ok). parsed_ok is False when a construction site was found - but could not be read — reported as an error, never as "sends nothing".""" + but could not be read — reported as an error, never as "sends nothing". + `builders` is `query_builders(...)`: calls to them add their keys.""" keys: set[str] = set() ok = True + for name, (bkeys, bok) in (builders or {}).items(): + if _calls(body, name): + keys |= bkeys + ok = ok and bok + for anchor, ordered in (cfg.get("helpers") or {}).items(): for m in re.finditer(re.escape(anchor), body): args = balanced_slice(body, m.end() - 1, "(", ")") @@ -531,7 +615,12 @@ def block_query_keys(body: str, cfg: dict) -> tuple[set[str], bool]: if lit is None: ok = False continue - keys |= set(re.findall(cfg["dict_key_re"], lit)) + if cfg.get("dict_members"): + lkeys, lok = object_literal_keys(lit) + keys |= lkeys + ok = ok and lok + else: + keys |= set(re.findall(cfg["dict_key_re"], lit)) if indirect and not keys: ok = False @@ -560,9 +649,10 @@ def cmd_params(args) -> int: via_helper = 0 texts = [f.read_text(errors="replace") for f in files] + builders = query_builders(texts, cfg) for mname, _body, call, request_body, helper in request_blocks(texts, cfg): via_helper += helper is not None - keys, ok = block_query_keys(request_body, cfg) + keys, ok = block_query_keys(request_body, cfg, builders) if not ok: unparsed.add((mname, f"{call[0]} {call[1]}")) if call not in index: @@ -1251,6 +1341,8 @@ def _ts_wrapped_type(o: str, n: str) -> str | None: _TS_COMPATIBLE_LABELS = { + "default": "required parameter made optional in place — source compatible", + "added": "optional parameters added — source compatible", "props": ("optional property added to an options object — usually source compatible, " "but breaks a caller passing a non-literal object whose same-named property " "has another type"), @@ -1284,7 +1376,359 @@ def _ts_compatible_change(old: list[str], new: list[str]) -> str | None: return "; ".join(_TS_COMPATIBLE_LABELS[k] for k in _TS_COMPATIBLE_LABELS if k in kinds) -def classify_change(lang: str, old: tuple[str, str], new: tuple[str, str]) -> tuple[str, str]: +# ── Parameters that gained a default ───────────────────────────────────────── +# `f(id: str)` -> `f(id: str | None = None)` and `f(id: string)` -> `f(id?: string)` +# keep every old call working, but a textual diff called both BREAKING. They +# are accepted only parameter by parameter: same name, same position, same +# kind, the type unchanged or only widened to admit None/undefined, and every +# other parameter unchanged or added as optional at the end. Anything else — +# a default lost, a rename, a reorder, a narrowed type, a positional parameter +# made keyword-only — stays BREAKING. C# is deliberately not included: the +# default lands in metadata the caller compiled against, and it has no case +# that needs it. + +def _top_level_index(s: str, ch: str) -> int: + """Index of the first `ch` at bracket depth 0 outside string literals, or -1. + For `=`, the `=` of `=>`, `==`, `!=`, `<=` and `>=` does not count.""" + depth, j, prev = 0, 0, "" + while j < len(s): + c = s[j] + if c in "\"'`": + end = _quoted_end(s, j) + if end is not None: + j, prev = end, "" + continue + if c in "<([{": + depth += 1 + elif c in ")]}" or (c == ">" and prev != "="): + depth -= 1 + elif c == ch and depth == 0: + nxt = s[j + 1] if j + 1 < len(s) else "" + if ch != "=" or (nxt not in "=>" and prev not in "=!<>"): + return j + prev = c + j += 1 + return -1 + + +def _union_members(t: str) -> set[str]: + m = re.fullmatch(r"\s*Optional\[(.*)\]\s*", t, re.S) + if m: + return {" ".join(x.split()) for x in split_args(m.group(1), "|")} | {"None"} + return {" ".join(x.split()) for x in split_args(t, "|")} + + +def _py_param(p: str) -> tuple[str, str, str | None] | None: + """(name, type, default) of one Python parameter, or None if not plain.""" + eq = _top_level_index(p, "=") + head, default = (p, None) if eq < 0 else (p[:eq], p[eq + 1:].strip()) + m = re.fullmatch(r"\s*([A-Za-z_]\w*)\s*(?::\s*(.+?))?\s*", head, re.S) + if not m: + return None + return m.group(1), " ".join((m.group(2) or "").split()), default + + +def _ts_param(p: str) -> tuple[str, bool, str, str | None] | None: + """(name, optional `?`, type, default) of one TypeScript parameter, or None.""" + eq = _top_level_index(p, "=") + head, default = (p, None) if eq < 0 else (p[:eq], " ".join(p[eq + 1:].split())) + m = re.fullmatch(r"\s*([A-Za-z_$][\w$]*)\s*(\?)?\s*(?::\s*(.+?))?\s*", head, re.S) + if not m: + return None + return m.group(1), bool(m.group(2)), " ".join((m.group(3) or "").split()), default + + +def _gained_default(lang: str, o: str, n: str) -> bool: + """`o` was required and `n` is the same parameter made optional, its type + unchanged or only widened by None (Python) / undefined (TypeScript).""" + if lang == "python": + po, pn = _py_param(o), _py_param(n) + if not po or not pn or po[0] != pn[0] or po[2] is not None or pn[2] is None: + return False + nullable = "None" + else: + po, pn = _ts_param(o), _ts_param(n) + if (not po or not pn or po[0] != pn[0] or po[1] or po[3] is not None + or not (pn[1] or pn[3] is not None)): + return False + nullable = "undefined" + type_at = 2 if lang == "javascript" else 1 + old_t, new_t = po[type_at], pn[type_at] + if not old_t: + return not new_t + return new_t == old_t or _union_members(new_t) == _union_members(old_t) | {nullable} + + +def _is_optional(lang: str, p: str) -> bool: + if lang == "python": + q = _py_param(p) + return q is not None and q[2] is not None + q = _ts_param(p) + return q is not None and (q[1] or q[3] is not None) + + +def _py_kinds(raw: str) -> list[tuple[str, str]] | None: + """[(param, "pos"|"kw")] with the bare `*` consumed, or None when the list + has `/`, `*args` or `**kwargs` — shapes this rule does not reason about.""" + out, kind = [], "pos" + for p in split_args(raw, keep_star=True): + if p == "*": + kind = "kw" + elif p == "/" or p.startswith("*"): + return None + else: + out.append((p, kind)) + return out + + +def _gained_default_change(lang: str, old_par: str, new_par: str, + param_change=None) -> set[str] | None: + """Kinds of compatible change, when every old parameter is unchanged, made + optional in place, or (via `param_change`) changed in another provably + compatible way, and every added parameter is optional. None otherwise.""" + if lang == "python": + ok, nk = _py_kinds(old_par), _py_kinds(new_par) + if ok is None or nk is None: + return None + o_pos = [p for p, k in ok if k == "pos"] + n_pos = [p for p, k in nk if k == "pos"] + o_kw = {(_py_param(p) or ("",))[0]: p for p, k in ok if k == "kw"} + n_kw = {(_py_param(p) or ("",))[0]: p for p, k in nk if k == "kw"} + if len(n_pos) < len(o_pos) or "" in o_kw or "" in n_kw: + return None + pairs = list(zip(o_pos, n_pos)) + for name, o in o_kw.items(): + if name not in n_kw: + return None + pairs.append((o, n_kw[name])) + added = n_pos[len(o_pos):] + [p for name, p in n_kw.items() if name not in o_kw] + else: + op, np_ = split_args(old_par), split_args(new_par) + if len(np_) < len(op): + return None + pairs, added = list(zip(op, np_)), np_[len(op):] + kinds: set[str] = set() + for o, n in pairs: + if o == n: + continue + if _gained_default(lang, o, n): + kinds.add("default") + continue + k = param_change(o, n) if param_change else None + if k is None: + return None + kinds |= k + if not all(_is_optional(lang, a) for a in added): + return None + if added: + kinds.add("added") + return kinds or None + + +# ── TypeScript named types ─────────────────────────────────────────────────── +# An options parameter retyped from one named type to another (`ListOptions` -> +# `ListSolutionsOptions`) was graded BREAKING on its text. It is compatible only +# when both types resolve, from source at their own revision, to members where +# every old member survives unchanged and every added one is optional. A type +# that does not resolve — a generic, an import, an indexed access, a top-level +# union — keeps the change BREAKING. + +_TS_BUILTIN = {"string", "number", "boolean", "undefined", "null", "unknown", "any", + "never", "object", "void", "bigint", "symbol", "true", "false", + "Record", "Array", "ReadonlyArray", "Promise", "Date", "Readonly", + "Partial", "Required", "Pick", "Omit", "Map", "Set", "readonly", + "keyof", "typeof"} + + +def _ts_expr_end(text: str, i: int) -> int: + """End of a type-alias expression starting at `i`: the first `;` at depth 0, + or a blank line / new top-level declaration when the `;` is omitted.""" + depth, j, prev = 0, i, "" + while j < len(text): + c = text[j] + if c in "\"'`": + end = _quoted_end(text, j) + if end is not None: + j, prev = end, "" + continue + if c in "<([{": + depth += 1 + elif c in ")]}" or (c == ">" and prev != "="): + depth -= 1 + elif depth == 0 and (c == ";" or (c == "\n" and re.match( + r"\n\s*(?:\n|(?:export\s+)?(?:interface|type|const|function|class|import)\b)", + text[j:]))): + return j + prev = c + j += 1 + return len(text) + + +def ts_declarations(texts: list[str]) -> dict[str, tuple | None]: + """Type name -> ("interface", [extends...], body, text) | ("alias", expr, text), + or None when it cannot be resolved (generic, or declared twice differently).""" + out: dict[str, tuple | None] = {} + + def put(name: str, decl: tuple | None) -> None: + if name in out and out[name] != decl: + out[name] = None + else: + out[name] = decl + + for raw in texts: + text = strip_comments(raw) + for m in re.finditer(r"(?m)^[ \t]*(?:export\s+)?(?:declare\s+)?interface\s+([\w$]+)\s*(<)?", + text): + brace = text.find("{", m.end()) + body = balanced_slice(text, m.end()) if brace >= 0 else None + if m.group(2) or body is None: + put(m.group(1), None) + continue + ext = text[m.end():brace].strip() + bases = split_args(ext[len("extends"):]) if ext.startswith("extends") else [] + if ext and not bases: + put(m.group(1), None) + continue + whole = " ".join(text[m.start():brace + len(body) + 2].split()) + put(m.group(1), ("interface", bases, body, whole)) + for m in re.finditer(r"(?m)^[ \t]*(?:export\s+)?(?:declare\s+)?type\s+([\w$]+)\s*(<)?", text): + if m.group(2): + put(m.group(1), None) + continue + eq = re.match(r"\s*=", text[m.end():]) + if not eq: + continue + start = m.end() + eq.end() + end = _ts_expr_end(text, start) + expr = " ".join(text[start:end].split()) + put(m.group(1), ("alias", expr, " ".join(text[m.start():end].split()))) + return out + + +def _ts_typed_members(body: str) -> dict[str, tuple[bool, str]] | None: + """member -> (optional, type) for an object type body; None if any member + is not a plain `name?: type` property (methods, index signatures, ...).""" + out: dict[str, tuple[bool, str]] = {} + for raw in split_args(strip_comments(body), ";,"): + text = " ".join(raw.split()) + if not text: + continue + m = _TS_MEMBER_RE.match(text) + if not m or m.group(1) in out: + return None + out[m.group(1).strip("\"'")] = (bool(m.group(2)), " ".join(m.group(3).split())) + return out + + +def _ts_string_keys(k: str) -> set[str] | None: + keys = split_args(k, "|") + if not keys or not all(re.fullmatch(r"\"[^\"]*\"|'[^']*'", x) for x in keys): + return None + return {x[1:-1] for x in keys} + + +def ts_resolve(expr: str, decls: dict, seen: tuple[str, ...] = () + ) -> dict[str, tuple[bool, str]] | None: + """Members of a TypeScript object type expression, or None if unresolvable.""" + e = " ".join(expr.split()) + while e.startswith("(") and balanced_slice(e, 0, "(", ")") == e[1:-1]: + e = e[1:-1].strip() + if not e: + return None + if e.startswith("{") and balanced_slice(e, 0) == e[1:-1]: + return _ts_typed_members(e[1:-1]) + if len(split_args(e, "|")) > 1: + return None + parts = split_args(e, "&") + if len(parts) > 1: + merged: dict[str, tuple[bool, str]] = {} + for part in parts: + r = ts_resolve(part, decls, seen) + if r is None: + return None + for k, v in r.items(): + if k in merged and merged[k] != v: + return None + merged[k] = v + return merged + m = re.fullmatch(r"(Omit|Pick|Partial)\s*<(.*)>", e, re.S) + if m: + args = split_args(m.group(2)) + base = ts_resolve(args[0], decls, seen) if args else None + if base is None: + return None + if m.group(1) == "Partial": + return {k: (True, t) for k, (_, t) in base.items()} if len(args) == 1 else None + keys = _ts_string_keys(args[1]) if len(args) == 2 else None + if keys is None: + return None + if m.group(1) == "Omit": + return {k: v for k, v in base.items() if k not in keys} + return {k: v for k, v in base.items() if k in keys} if keys <= set(base) else None + if not re.fullmatch(r"[A-Za-z_$][\w$]*", e) or e in seen: + return None + d = decls.get(e) + if d is None: + return None + if d[0] == "alias": + return ts_resolve(d[1], decls, seen + (e,)) + merged = {} + for b in d[1]: + r = ts_resolve(b, decls, seen + (e,)) + if r is None: + return None + merged.update(r) + own = _ts_typed_members(d[2]) + if own is None: + return None + merged.update(own) + return merged + + +def _ts_type_refs_unchanged(t: str, old_decls: dict, new_decls: dict) -> bool: + """Every identifier a property type names is a builtin, or a local type whose + declaration is textually identical at both revisions. Same text naming a + type that changed underneath is not the same type.""" + bare = re.sub(r"\"[^\"]*\"|'[^']*'|`[^`]*`", "", t) + for ident in set(re.findall(r"[A-Za-z_$][\w$]*", bare)): + if ident in _TS_BUILTIN: + continue + o, n = old_decls.get(ident), new_decls.get(ident) + if o is None or n is None or o[-1] != n[-1]: + return False + return True + + +def ts_named_options_change(o: str, n: str, old_decls: dict, new_decls: dict) -> set[str] | None: + """Kinds of compatible change between two options parameters whose types are + resolved from declarations; None unless provably compatible.""" + po, pn = _ts_param(o), _ts_param(n) + if not po or not pn or (po[0], po[1], po[3]) != (pn[0], pn[1], pn[3]) or not po[2] or not pn[2]: + return None + mo, mn = ts_resolve(po[2], old_decls), ts_resolve(pn[2], new_decls) + if mo is None or mn is None or (not mo and mn): + return None + kinds: set[str] = set() + for k, (opt, typ) in mo.items(): + if k not in mn or mn[k][0] != opt: + return None + if not _ts_type_refs_unchanged(typ, old_decls, new_decls): + return None + if mn[k][1] == typ: + continue + if not _ts_widened_to_undefined(f"{k}?: {typ}", f"{k}?: {mn[k][1]}"): + return None + kinds.add("undefined") + added = [v for k, v in mn.items() if k not in mo] + if not all(opt for opt, _ in added): + return None + if added: + kinds.add("props") + return kinds or {"same"} + + +def classify_change(lang: str, old: tuple[str, str], new: tuple[str, str], + ts_decls: tuple[dict, dict] | None = None) -> tuple[str, str]: """(severity, label) for one signature change. severity is 'break' or 'warn'. Not every signature change breaks a caller, and a check that says it does is @@ -1302,6 +1746,22 @@ def classify_change(lang: str, old: tuple[str, str], new: tuple[str, str]) -> tu label = _ts_compatible_change(op, np_) if label: return "warn", label + if lang in ("python", "javascript") and old_ret == new_ret: + def ts_param_change(o: str, n: str) -> set[str] | None: + k = _ts_options_change(o, n) + if k is None: + w = _ts_wrapped_type(o, n) + k = {w} if w else None + if k is None and ts_decls is not None: + k = ts_named_options_change(o, n, *ts_decls) + return k + kinds = _gained_default_change( + lang, old_par, new_par, ts_param_change if lang == "javascript" else None) + if kinds: + if len(kinds) > 1: + kinds.discard("same") + return "warn", "; ".join(_TS_COMPATIBLE_LABELS[k] + for k in _TS_COMPATIBLE_LABELS if k in kinds) # `len(np_) > len(op)` matters: `split_args` drops Python's bare `*`, so # `f(self, a, b)` -> `f(self, a, *, b)` yields two IDENTICAL lists, the # empty tail passes `all()` vacuously, and making a parameter @@ -1324,6 +1784,25 @@ def classify_change(lang: str, old: tuple[str, str], new: tuple[str, str]) -> tu return "warn", "signature reordered" +def _texts_at(repo: Path, rev: str | None, sub: str, suffix: str) -> list[str]: + """Every `*suffix` file under `sub`, at `rev` or in the working tree. A file + that cannot be read is skipped: its types then do not resolve, which keeps + any change that needs them BREAKING.""" + if rev is None: + return [f.read_text(encoding="utf-8", errors="replace") + for f in sorted((repo / sub).rglob(f"*{suffix}"))] + ls = subprocess.run(["git", "-C", str(repo), "ls-tree", "-r", "--name-only", rev, "--", sub], + capture_output=True, text=True) + out = [] + for name in ls.stdout.split(): + if name.endswith(suffix): + p = subprocess.run(["git", "-C", str(repo), "show", f"{rev}:{name}"], + capture_output=True, text=True) + if p.returncode == 0: + out.append(p.stdout) + return out + + def cmd_surface(args) -> int: """Diff the public API surface against a released tag. @@ -1369,6 +1848,10 @@ def cmd_surface(args) -> int: new_text = "\n".join(f.read_text(encoding="utf-8", errors="replace") for f in files) old, new = public_surface(old_text, cfg), public_surface(new_text, cfg) + ts_decls = None + if lang == "javascript": + ts_decls = (ts_declarations(_texts_at(repo, args.rev, "src", ".ts")), + ts_declarations(_texts_at(repo, None, "src", ".ts"))) removed = sorted(set(old) - set(new)) added = sorted(set(new) - set(old)) changed = [k for k in sorted(set(old) & set(new)) if old[k] - new[k]] @@ -1385,7 +1868,7 @@ def cmd_surface(args) -> int: now = sorted(new[k] - old[k]) sev, label = ("break", "signature removed") if len(gone) == 1 and len(now) == 1: - sev, label = classify_change(lang, gone[0], now[0]) + sev, label = classify_change(lang, gone[0], now[0], ts_decls) (breaks if sev == "break" else warns).append((k, label, gone, now)) def show(rows: list) -> None: From bf3ce9921335534384367138b3c87fcf0c954b3e Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Fri, 30 Oct 2026 23:59:36 -0700 Subject: [PATCH 8/8] Ignore __pycache__ --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c68891c..fb167d7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ build .DS_Store .version-backup.json .README.md.bak +__pycache__