From 1753dcacca2fc010966982b5ce73e695701cd004 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 12:13:44 -0800 Subject: [PATCH 01/20] Squashed '.claude/skills/seclai-changelog/' changes from f6aa6eb..65188e7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 65188e7 Addressed review findings 0f1b9d6 Updated skills and guards aea19cd Updated skills 3558844 Add the surface check; report API version changes; record the changelog rule 9ac3bdb Add provenance banner to the vendored skills 4abc72a Tweak Go handling 22d0637 Updated version link instructions for Go ae892f0 Updated skill to clarify type handling fad3662 Added shared skill to update SDK change logs REVERT: f6aa6eb Updated skills and guards REVERT: 5b4e063 Updated skills REVERT: 14a086e Addressed review comments REVERT: 4a9410f Addressed review comments REVERT: 683ba85 Addressed review comments REVERT: f16043e Addressed review comments REVERT: 9f5a04b More audit tool fixes REVERT: 20f845d Addressed review comments REVERT: 77cecda Updated the audit-tool REVERT: b62c912 Updated tools REVERT: 177d423 Internal review fixes REVERT: a2aa7ef Add the surface check; report API version changes; record the changelog rule REVERT: e89d300 Note that a typed façade is invisible to the returns check REVERT: 4f4113d Note that dated versioning gives one operation two legal response shapes REVERT: 5ab0384 Add returns and models audits; fix spec-diff and extractor defects REVERT: 07d1323 Fixed gaps REVERT: b6e5468 Addressed review comments REVERT: 6189884 Tweaks REVERT: ea07ba9 Add provenance banner to the vendored skills REVERT: 58ff6ce Do not check in python cache files REVERT: 9b18406 Added scripts and skill to help update SDKs git-subtree-dir: .claude/skills/seclai-changelog git-subtree-split: 65188e7f93892656b46f6cfadd24d0ab999d8b7a --- .claude/skills/seclai-sdk-sync/SKILL.md | 356 - .claude/skills/seclai-sdk-sync/docexamples.py | 230 - .claude/skills/seclai-sdk-sync/sdksync.py | 2120 -- .gitattributes | 22 - .github/copilot-instructions.md | 41 - .github/workflows/main-build.yaml | 166 - .github/workflows/pr-build.yaml | 42 - .gitignore | 10 - CHANGELOG.md | 295 - CLAUDE.md | 6 - LICENSE | 21 - README.md | 1085 - .../seclai-changelog/SKILL.md => SKILL.md | 4 +- openapi/seclai.openapi.json | 28904 ---------------- 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 | 3878 --- src/errors.ts | 92 - src/index.ts | 367 - src/openapi.ts | 20056 ----------- src/types.ts | 1132 - src/versions.ts | 45 - tests/client.test.ts | 4065 --- tsconfig.json | 19 - tsup.config.ts | 9 - typedoc.json | 15 - .../validate.py => validate.py | 0 vitest.config.ts | 8 - 31 files changed, 2 insertions(+), 66674 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 CLAUDE.md delete mode 100644 LICENSE delete mode 100644 README.md rename .claude/skills/seclai-changelog/SKILL.md => SKILL.md (92%) 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 2f72dd5..0000000 --- a/.claude/skills/seclai-sdk-sync/SKILL.md +++ /dev/null @@ -1,356 +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. 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 - -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. - -**`params` and `returns` follow one hop into a non-public helper, and no further.** -A public method with no request of its own that calls a non-public method of the -same client holding the verb and path literal (Go `c.thingsBody(`, C# `internal -…ResponseAsync`, Python `self._x(`, JS `private`/`#x`) is audited as that request, -with its own declared return type; both summaries then print how many methods -were resolved that way, so a drop in that number is a narrower audit, not a -cleaner SDK. A second hop, a helper that takes its verb or path as an argument, -and a call from another class (the façade's `_client.X(`) are still not followed. - -**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), 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), 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. -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 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/.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 428f6a7..0000000 --- a/.claude/skills/seclai-sdk-sync/sdksync.py +++ /dev/null @@ -1,2120 +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. -# 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*)\(", - "sig_tail_re": r"\s*->\s*([^:]+):", - "line_comment": "#", - "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*:', - "helper_re": r"^[ \t]+(?:async )?def (_[a-z0-9][a-z0-9_]*)\(", - "helper_call": r"\bself\.{name}\(", - "skip": {"request", "request_raw", "stream", "paginate"}, - }, - "javascript": { - "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"], - # 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*:', - # 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, - # 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": { - # 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", - "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*:', - # 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"(?,?\[\]. ]+?) ([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"]}, - "helper_re": (r"^ (?:(?:private|internal|protected|static|async) )+" - r"[\w<>,?\[\]. ]+ ([A-Z][A-Za-z0-9]*)\s*\("), - "helper_call": r"(? 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 _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 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 `}`. 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): - 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 ch == closer: - depth -= 1 - if depth == 0: - return text[i + 1: j] - j += 1 - return None - - -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 = ",", 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, - which over-counts arity for the query helpers and reports a phantom - 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, 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 ")]}" or (ch == ">" and prev != "="): - depth -= 1 - prev = ch - if ch in seps and depth == 0: - out.append("".join(cur).strip()) - cur = [] - else: - cur.append(ch) - j += 1 - if "".join(cur).strip(): - out.append("".join(cur).strip()) - 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]]]: - """(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 strip_docs(text: str) -> str: - """Drop docstrings, block comments and whole-line comments. - - Helper detection reads through this: a docstring's `"GET"` and `"/sources"` - example made seclai-python's `_raise_for_openapi_response` look like the - request behind twenty methods that never issue one. - """ - text = re.sub(r'"""[\s\S]*?"""|\'\'\'[\s\S]*?\'\'\'|/\*[\s\S]*?\*/', "", text) - return re.sub(r"(?m)^[ \t]*(?://|#).*$", "", text) - - -def endpoint_helpers(text: str, cfg: dict) -> dict[str, str]: - """Non-public client method name -> body, for those that DEFINE a request. - - Defining one means holding a verb and a path literal. Transport plumbing - (`doBytes`, `SendRawResponseAsync`) takes both as arguments and holds neither, - which is what keeps it out of this index. - """ - if "helper_re" not in cfg: - return {} - ends = sorted({m.start() - for pat in (cfg["helper_re"], cfg["method_re"], cfg.get("boundary_re")) if pat - for m in re.finditer(pat, text, re.M)}) - out: dict[str, str] = {} - for m in re.finditer(cfg["helper_re"], text, re.M): - name = m.group(1) - if name in cfg.get("skip", ()) or name in out: - continue - end = next((e for e in ends if e > m.start()), len(text)) - body = strip_docs(text[m.start():end]) - if block_call(body, cfg["verb_re"]): - out[name] = body - return out - - -def helper_called(body: str, cfg: dict, helpers: dict[str, str]) -> str | None: - """Name of the first endpoint helper a method body calls, if any.""" - code = strip_docs(body) # a comment naming a helper is not a call to it - first: tuple[int, str] | None = None - for name in helpers: - m = re.search(cfg["helper_call"].replace("{name}", re.escape(name)), code) - if m and (first is None or m.start() < first[0]): - first = (m.start(), name) - return first[1] if first else None - - -def request_blocks(texts: list[str], cfg: dict): - """Yield (name, body, call, request_body, helper) per public method with a request. - - A method with no request call of its own that calls a non-public method - defining one is read through that helper — ONE hop. `body` stays the public - method's, so its declared return type is what `returns` compares; - `request_body` is where query keys are read. `helper` is None for own requests. - """ - shared: dict[str, str] = {} - if cfg.get("helper_scope") == "package": - for text in texts: - for k, v in endpoint_helpers(text, cfg).items(): - shared.setdefault(k, v) - for text in texts: - helpers = shared or endpoint_helpers(text, cfg) - 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 call: - yield mname, body, call, body, None - continue - helper = helper_called(body, cfg, helpers) - if helper: - hbody = helpers[helper] - yield mname, body, block_call(hbody, cfg["verb_re"]), body + "\n" + hbody, helper - - -def via_helper_line(n: int) -> str: - return (f" {n} of the methods read were resolved through a non-public helper" - f" holding the request (one hop)") - - -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". - `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, "(", ")") - 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 - 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 - 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() - - 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, builders) - 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 via_helper: - print(via_helper_line(via_helper)) - - 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, via_helper = [], [], [], 0, 0 - texts = [path.read_text(encoding="utf-8", errors="replace") for path in files] - for mname, body, call, _request_body, helper in request_blocks(texts, cfg): - if call not in want: - continue - declared = block_return(body, cfg) - if declared is None: - continue - n += 1 - via_helper += helper is not None - 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 via_helper: - print(via_helper_line(via_helper)) - - 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()) - - 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): - 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 - - - -# Kept as an alias: the tests and the older call sites name it `_params`. -_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 = { - "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"), - "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) - - -# ── 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 - 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) - if lang == "javascript" and old_ret == new_ret: - 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 - # 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 _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. - - 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) - 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]] - - 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], ts_decls) - (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 fb167d7..0000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -node_modules -npm-debug.log* -yarn-debug.log* -yarn-error.log* -dist -build -.DS_Store -.version-backup.json -.README.md.bak -__pycache__ diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 4476bc1..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,295 +0,0 @@ -# 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`, 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()` (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`, `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 - -### 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.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 -[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/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 4d144a0..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# 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/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 66ed44f..0000000 --- a/README.md +++ /dev/null @@ -1,1085 +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_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. -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. -- `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 | -| --- | --- | -| `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 | -| `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 -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, 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. - -## 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"); - -// 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 -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 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 }); -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: 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 -``` - -### 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. - -### 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 -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", { 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, 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" }); -``` - -### 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({ 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", { startDate: "2026-10-01", endDate: "2026-10-31" }); -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({ limit: 5 }); -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"); -``` - -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: - - -```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({ search: "billing" }); -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({ limit: 10 }); -await client.acceptGovernanceAiPlan("conversation_id"); -await client.declineGovernanceAiPlan("conversation_id"); -``` - -### Alerts - -```ts -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" }); - -// Subscriptions -await client.subscribeToAlert("alert_id"); -await client.unsubscribeFromAlert("alert_id"); - -// Alert configs -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({ includeDefaults: true }); -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({ unreadOnly: true }); -await client.markModelAlertRead("alert_id"); -await client.markAllModelAlertsRead(); -const unread = await client.getUnreadModelAlertCount(); -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: "..." }); -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 92% rename from .claude/skills/seclai-changelog/SKILL.md rename to SKILL.md index 3365c87..b00eaf5 100644 --- a/.claude/skills/seclai-changelog/SKILL.md +++ b/SKILL.md @@ -64,13 +64,13 @@ forward. ## 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**: +Do not guess the next version. These repos only squash-merge. The squash commit's subject is the PR title on a multi-commit PR, or that commit's headline on a single-commit PR, and its body is every branch commit message. Releases are cut by `seclai/github-tag-action` in `.github/workflows/main-build.yaml`, which reads that **squash commit** on `main`: - contains `#major` → major bump - contains `#minor` → minor bump - otherwise → `DEFAULT_BUMP: patch` -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. +The convention is to put `#minor` / `#major` in a branch commit message. It reaches `main` through the squash body, so do not trim the body in the merge dialog. The PR title also counts on a multi-commit PR. A change that adds endpoints needs `#minor` in one of those places, or it ships as a patch and 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 neither a branch commit message nor the PR title 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 4220dcc..0000000 --- a/openapi/seclai.openapi.json +++ /dev/null @@ -1,28904 +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" - }, - "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, 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" - }, - "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" - }, - "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": [ - { - "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`. 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": { - "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" - }, - "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": [ - { - "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_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", - "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" - }, - "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": [ - { - "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, 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" - }, - "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``, ``email_received`` and ``slack_command`` 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" - }, - "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", - "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" - }, - "SlackReplyVisibility": { - "enum": [ - "channel", - "private" - ], - "title": "SlackReplyVisibility", - "type": "string" - }, - "SlackTriggerActivation": { - "enum": [ - "everywhere", - "channel_opt_in" - ], - "title": "SlackTriggerActivation", - "type": "string" - }, - "SlackTriggerConfigApiResponse": { - "properties": { - "activation": { - "title": "Activation", - "type": "string" - }, - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" - }, - "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" - }, - "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; left unresolved, 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" - }, - "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": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID to pass to `GET /contents/{id}`. `null` while the item has no retrievable content.", - "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." - }, - "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": { - "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" - }, - "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).", - "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" - }, - "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": { - "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" - }, - "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": [ - { - "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" - }, - "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", - "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": "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": [ - { - "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" - }, - "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": { - "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": [ - "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" - }, - "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": [ - { - "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_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": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "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": [ - { - "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_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).", - "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- `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": [ - { - "$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/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.", - "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, 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": [ - { - "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}/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.", - "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, 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": [ - { - "$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.\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": [ - { - "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", - "2026-10-28" - ], - "latest": "2026-10-28" - } -} 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 51cb2d2..0000000 --- a/src/client.ts +++ /dev/null @@ -1,3878 +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, - AgentExampleListResponse, - ListAgentExamplesOptions, - SetSlackTriggerConfigRequest, - SlackTriggerConfigResponse, - ListSolutionsOptions, - ListMemoryBanksOptions, - ListEvaluationResultsOptions, - ListAgentEvaluationResultsOptions, - ListEvaluationRunsOptions, - ListCompatibleRunsOptions, - DateRangeOptions, - OffsetPageOptions, - ListAlertsOptions, - ListAlertConfigsOptions, - ListOrganizationAlertPreferencesOptions, - ListModelAlertsOptions, - ModelRecommendationsOptions, -} 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; - } - - /** - * 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. - * - * @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, status, flag and time-range filters. - */ - 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, - status: opts.status, - flagged_only: opts.flaggedOnly, - time_from: opts.timeFrom, - time_to: opts.timeTo, - }, - }), - "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 and a `startedAfter` filter. - */ - 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, started_after: opts.startedAfter }, - }), - "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, status, step, flag and time-range filters. - */ - async listAgentEvaluationResults( - agentId: string, - opts: ListAgentEvaluationResultsOptions = {}, - ): Promise { - return keyedList( - await this.request("GET", `/agents/${agentId}/evaluation-results`, { - 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, - ); - } - - /** - * List evaluation run summaries for an agent. - * - * @param agentId - Agent identifier. - * @param opts - Pagination, status, step and time-range filters. - */ - async listEvaluationRuns(agentId: string, opts: ListEvaluationRunsOptions = {}): Promise { - return keyedList( - await this.request("GET", `/agents/${agentId}/evaluation-runs`, { - query: { - page: opts.page, - limit: opts.limit, - status: opts.status, - step: opts.step, - time_from: opts.timeFrom, - time_to: opts.timeTo, - }, - }), - "data", - PAGE_COUNTERS, - ); - } - - /** - * Get a summary of non-manual evaluations, for one agent or the whole account. - * - * @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, - opts: DateRangeOptions = {}, - ): Promise { - return (await this.request("GET", "/agents/evaluation-results/non-manual-summary", { - query: { agent_id: agentId, days: opts.days, start_date: opts.startDate, end_date: opts.endDate }, - })) 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 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. - * - * 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: OffsetPageOptions = {}, - ): 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, sorting and a `type` filter. - * @returns Paginated list of memory banks. - */ - 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, type: opts.type }, - }), - "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. - * @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`, { - query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate }, - }); - } - - /** - * 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. - * - * @param opts - Turns to return (server default 5) and most-recent turns to skip (default 0). - */ - 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; - } - - /** - * 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, sorting and a name `search`. - * @returns Paginated list of solutions. - */ - async listSolutions(opts: ListSolutionsOptions = {}): Promise { - return (await this.request("GET", "/solutions", { - query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order, search: opts.search }, - })) 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. - * - * @param opts - `limit`: how many conversations (the server defaults to 20). - */ - async listGovernanceAiConversations(opts: { limit?: number } = {}): Promise { - return listItems( - await this.request("GET", "/governance/ai-assistant/conversations", { query: { limit: opts.limit } }), - ); - } - - /** - * 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: 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, - agent_id: opts.agentId, - source_connection_id: opts.sourceConnectionId, - time_from: opts.timeFrom, - time_to: opts.timeTo, - }, - })) 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: ListAlertConfigsOptions = {}): Promise { - return keyedList( - 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"], - ); - } - - /** - * 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. - * - * @param opts - Organization filter, and whether to include default subscriptions. - */ - async listOrganizationAlertPreferences( - opts: ListOrganizationAlertPreferencesOptions = {}, - ): Promise { - return keyedList( - await this.request("GET", "/alerts/organization-preferences/list", { - query: { organization_id: opts.organizationId, include_defaults: opts.includeDefaults }, - }), - "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, an agent filter and `unreadOnly`. - */ - 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, agent_id: opts.agentId, unread_only: opts.unreadOnly }, - }), - "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. - * @param opts - Capabilities and limits a recommended model must have. - */ - 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; - } - - /** - * 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 - 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: 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 }, - }), - "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. - * - * @param opts - Turns to return (server default 5) and most-recent turns to skip (default 0). - */ - 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; - } - - /** - * 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 5d0a673..0000000 --- a/src/index.ts +++ /dev/null @@ -1,367 +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, - ListAgentExamplesOptions, - ListSolutionsOptions, - ListMemoryBanksOptions, - ListEvaluationResultsOptions, - ListAgentEvaluationResultsOptions, - ListEvaluationRunsOptions, - ListCompatibleRunsOptions, - DateRangeOptions, - OffsetPageOptions, - ListAlertsOptions, - ListAlertConfigsOptions, - ListOrganizationAlertPreferencesOptions, - ListModelAlertsOptions, - ModelRecommendationsOptions, - - // Identity - MeResponse, - OrganizationInfoResponse, - - // Agents - AgentListResponse, - AgentExampleListResponse, - AgentExample, - AgentExampleResource, - AgentDefinitionResponse, - AgentExportResponse, - AgentSummaryResponse, - CreateAgentRequest, - UpdateAgentRequest, - UpdateAgentDefinitionRequest, - AgentImportPreviewRequest, - AgentImportPreviewResponse, - AgentDefinitionImportErrorResponse, - ImportFieldErrorModel, - ImportSkipResponse, - GovernancePolicyRefResponse, - AgentCallerApiResponse, - - // Agent Email Triggers - SetEmailTriggerConfigRequest, - EmailTriggerConfigResponse, - - // Agent Slack Triggers - SetSlackTriggerConfigRequest, - SlackTriggerConfigResponse, - SlackTriggerActivation, - SlackTriggerScope, - SlackReplyVisibility, - - // 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, - SpendCapAction, - SpendCapDeleteOrder, - 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 4e4835e..0000000 --- a/src/openapi.ts +++ /dev/null @@ -1,20056 +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 - * - `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. - * - * 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. - * - 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/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; - 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, 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`). - * - * 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}/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; - 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, source_spend_limit_reached (needs source_connection_id). - * - * 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. - * - * 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"]; - /** - * 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"; - /** AgentExampleListResponse */ - AgentExampleListResponse: { - /** Data */ - data: unknown[]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * 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, 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; - }; - /** - * 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; - /** - * 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. - */ - 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`. 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; - /** - * 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; - /** - * 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. - */ - 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 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. - */ - 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; - /** - * 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`. - */ - 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, 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; - /** - * 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``, ``email_received`` and ``slack_command`` 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; - }; - /** - * 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} - */ - 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; - }; - /** - * 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: { - /** - * 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; left unresolved, 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; - /** - * 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` while the item has no retrievable content. - */ - 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; - /** - * 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. - */ - 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; - /** - * @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). - * @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; - }; - /** - * 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. - * - * 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; - /** - * 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. - */ - 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; - /** @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: { - /** - * 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 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. - */ - 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; - /** - * 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 Defaults to dynamic_input, or to the template's own trigger type for an `agent_template` without `agent_definition`. - */ - trigger_type?: string | null; - }; - /** - * 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; - /** - * 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'. - */ - 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 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. - */ - 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 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). - * @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_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?: { - /** @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"]; - }; - }; - }; - }; - 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; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned 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 c520e8c..0000000 --- a/src/types.ts +++ /dev/null @@ -1,1132 +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"; - -/** - * `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. */ -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"]; - -/** - * 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 = 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"]; - -/** 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< - WithServerDefaults, - "accepted_attachments" -> & { - accepted_attachments?: AcceptedAttachmentSlotInput[] | null; -}; - -/** - * 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.). - * - * `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 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). */ -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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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"]; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** - * 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** Compaction test response. */ -export type CompactionTestResponse = components["schemas"]["CompactionTestResponseModel"]; - -/** Standalone compaction test request. */ -export type StandaloneTestCompactionRequest = WithServerDefaults; - -/** 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"]; - -/** 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"]; - -/** Request body for uploading inline text to a source. */ -export type InlineTextUploadRequest = WithServerDefaults; - -/** Request body for replacing content with inline text. */ -export type InlineTextReplaceRequest = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** - * 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 = WithServerDefaults; - -/** - * 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"; -} - -/** 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. */ - type?: "conversation" | "general" | (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}: those of {@link ListAgentEvaluationResultsOptions} except `flaggedOnly`. */ -export type ListEvaluationRunsOptions = Omit; - -/** 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}, - * {@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. */ - days?: number; - /** First day, `YYYY-MM-DD`. */ - startDate?: string; - /** Last day, `YYYY-MM-DD`. */ - endDate?: string; -} - -/** Offset paging. Each method documents its server defaults and bounds. */ -export interface OffsetPageOptions { - /** Most items to return. */ - limit?: number; - /** Items to skip. */ - 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?: "source" | (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 deleted file mode 100644 index bbde5d8..0000000 --- a/src/versions.ts +++ /dev/null @@ -1,45 +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", - 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-28", -} 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 28c84ba..0000000 --- a/tests/client.test.ts +++ /dev/null @@ -1,4065 +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"); - }); - - 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" }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// 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" }] }, - ]); - }); -}); - -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 -// ───────────────────────────────────────────────────────────────────────────── - -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-28"); - 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']"); - }); -}); - - -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); - }); -}); - -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([]); - }); -}); 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 9b579e693374cec47922e3a96a0db493b06bedab Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 12:13:45 -0800 Subject: [PATCH 02/20] Squashed '.claude/skills/seclai-sdk-sync/' changes from f6aa6eb..c04694e c04694e Addressed review findings 99b3f5a Addressed review comments and added skills c71fbe5 Addressed review findings 79a0130 Addressed review findings 35319db Addressed review findings 6b7ba9e Addressed review findings 1cb3d57 Addressed review findings git-subtree-dir: .claude/skills/seclai-sdk-sync git-subtree-split: c04694ef8ba895d064dc194790d5363a15f1b09e --- .claude/skills/seclai-changelog/SKILL.md | 190 - .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 | 10 - CHANGELOG.md | 295 - CLAUDE.md | 6 - LICENSE | 21 - README.md | 1085 - .../seclai-sdk-sync/SKILL.md => SKILL.md | 96 +- .../docexamples.py => docexamples.py | 0 openapi/seclai.openapi.json | 28904 ---------------- 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 | 701 +- src/auth.ts | 602 - src/client.ts | 3878 --- src/errors.ts | 92 - src/index.ts | 367 - src/openapi.ts | 20056 ----------- src/types.ts | 1132 - src/versions.ts | 45 - tests/client.test.ts | 4065 --- tsconfig.json | 19 - tsup.config.ts | 9 - typedoc.json | 15 - vitest.config.ts | 8 - 31 files changed, 649 insertions(+), 64438 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 CLAUDE.md delete mode 100644 LICENSE delete mode 100644 README.md rename .claude/skills/seclai-sdk-sync/SKILL.md => SKILL.md (80%) 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 (76%) 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 3365c87..0000000 --- a/.claude/skills/seclai-changelog/SKILL.md +++ /dev/null @@ -1,190 +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 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. - -## 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/` 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. - -## 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 fb167d7..0000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -node_modules -npm-debug.log* -yarn-debug.log* -yarn-error.log* -dist -build -.DS_Store -.version-backup.json -.README.md.bak -__pycache__ diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 4476bc1..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,295 +0,0 @@ -# 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`, 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()` (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`, `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 - -### 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.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 -[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/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 4d144a0..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,6 +0,0 @@ -# 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/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 66ed44f..0000000 --- a/README.md +++ /dev/null @@ -1,1085 +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_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. -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. -- `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 | -| --- | --- | -| `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 | -| `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 -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, 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. - -## 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"); - -// 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 -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 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 }); -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: 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 -``` - -### 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. - -### 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 -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", { 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, 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" }); -``` - -### 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({ 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", { startDate: "2026-10-01", endDate: "2026-10-31" }); -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({ limit: 5 }); -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"); -``` - -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: - - -```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({ search: "billing" }); -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({ limit: 10 }); -await client.acceptGovernanceAiPlan("conversation_id"); -await client.declineGovernanceAiPlan("conversation_id"); -``` - -### Alerts - -```ts -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" }); - -// Subscriptions -await client.subscribeToAlert("alert_id"); -await client.unsubscribeFromAlert("alert_id"); - -// Alert configs -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({ includeDefaults: true }); -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({ unreadOnly: true }); -await client.markModelAlertRead("alert_id"); -await client.markAllModelAlertsRead(); -const unread = await client.getUnreadModelAlertCount(); -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: "..." }); -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 80% rename from .claude/skills/seclai-sdk-sync/SKILL.md rename to SKILL.md index 2f72dd5..9c36b96 100644 --- a/.claude/skills/seclai-sdk-sync/SKILL.md +++ b/SKILL.md @@ -153,36 +153,73 @@ 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), 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), 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). +- **WARN** — compatible but worth checking. One line per kind: + - **Trailing optional parameter**: source compatible, but flagged as binary + breaking for C#. + - **`unknown` narrowed** to a concrete TypeScript return type, keeping its + wrapper: `unknown` to any type, `unknown[]` to `X[]` or `Array`, + `Promise` to `Promise`, `Promise` to + `Promise`. Changing the wrapper (`unknown[]` to `Promise`) breaks + callers that `.map` or `await`, so it stays BREAKING, as does an + `unknown` anywhere else (a callback parameter, a type-parameter + constraint, `Record`). + - **Options-object member added**: an optional member added to an inline + TypeScript options object such as `opts: { signal?: AbortSignal } = {}`, with + every other member, the parameter's name and its default unchanged. Usually + source compatible, but a caller passing a non-literal object that already + has a same-named property of another type (`const o = { signal: "abc" }`) no + longer compiles, since excess-property checks only cover literals. Never + graded this way for an empty `{}`, which accepts values the new type rejects. + - **Widened to `undefined`**: an optional options-object member `x?: T` -> + `x?: T | undefined`. Source compatible. A callback whose *return* type gained + `| undefined` is not this, and stays breaking. + - **`Omit`**: a TypeScript parameter type wrapped in it. Usually source + compatible; an object literal that sets an omitted key no longer compiles. + - **`Partial`**: a TypeScript parameter type wrapped in it. Source compatible. + - **Retyped to another named type**: a TypeScript options parameter whose new + type, resolved from the declarations under `src/` at the tag and in the + working tree (interfaces, `extends`, aliases, `&`, `Omit`, `Pick`, `Partial`), + keeps every old member with the same optionality and type and adds only + optional ones. A member whose type names a local type counts as unchanged + only if that declaration is identical at both revisions. A type that does + not resolve (generic, import, indexed access, union) stays breaking. + - **Required parameter made optional in place**: Python `id: str` -> + `id: str | None = None`, TypeScript `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#. + - **Python return annotation changed**: 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. +A reformat is not a change: parameter lists are compared as their split, +whitespace-normalised members, so a trailing comma added when prettier or black +wraps a signature is invisible. Python's bare `*` is kept, since making a +parameter keyword-only does break callers. + +The return type is read up to the `{` that opens the body, at bracket depth 0, +so a lone Go `error`, a TypeScript constructor with no annotation, +`Promise<{ id: string }>`, a generic prettier wraps onto its own lines, and a +conditional type (`T extends U ? { a: 1 } : never`) are all read whole. An async +generator (`async *runStreamingAgent(`) is a method like any other, and a +generic method's type parameters (`paginate(`, wrapped or +holding a `() => void`) are recorded with its return type: changing one, or +its constraint, is BREAKING ("type parameters changed"). Until +2026-10-31 a regex read it instead, and 27 seclai-go methods returning a lone +value, plus the TypeScript constructor, were invisible: removing one reported +"no breaking change". + +A head the scan matches but cannot read — type parameters or a return type it +never closes, a parameter list that does not balance — is reported as +**UNREADABLE** and fails the run, at either revision, even when nothing changed. +Before, such a method was silently left out of the surface and its removal +reported "no breaking change"; every scanner bug found in the 2026-10 reviews +was that. Now an unfamiliar shape costs a look instead of a missed break: fix +the scanner and add a test, then rerun. A statement the pattern also matches +(`setup(x);` at class-member indent) is not a method and is not listed. + Only exported Go methods are surface. A lowercase method is unreachable outside the package, so a change to one breaks no caller. @@ -350,7 +387,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 a commit -message (not the PR title), or it ships as a patch and the changelog heading -will not match the tag. +A sync that adds endpoints needs a `#minor` bump; where the keyword goes and how +the squash commit carries it is in the `seclai-changelog` skill, "Determine the +version". 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 4220dcc..0000000 --- a/openapi/seclai.openapi.json +++ /dev/null @@ -1,28904 +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" - }, - "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, 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" - }, - "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" - }, - "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": [ - { - "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`. 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": { - "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" - }, - "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": [ - { - "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_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", - "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" - }, - "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": [ - { - "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, 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" - }, - "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``, ``email_received`` and ``slack_command`` 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" - }, - "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", - "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" - }, - "SlackReplyVisibility": { - "enum": [ - "channel", - "private" - ], - "title": "SlackReplyVisibility", - "type": "string" - }, - "SlackTriggerActivation": { - "enum": [ - "everywhere", - "channel_opt_in" - ], - "title": "SlackTriggerActivation", - "type": "string" - }, - "SlackTriggerConfigApiResponse": { - "properties": { - "activation": { - "title": "Activation", - "type": "string" - }, - "agent_id": { - "format": "uuid", - "title": "Agent Id", - "type": "string" - }, - "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" - }, - "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; left unresolved, 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" - }, - "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": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "ID to pass to `GET /contents/{id}`. `null` while the item has no retrievable content.", - "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." - }, - "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": { - "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" - }, - "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).", - "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" - }, - "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": { - "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" - }, - "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": [ - { - "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" - }, - "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", - "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": "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": [ - { - "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" - }, - "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": { - "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": [ - "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" - }, - "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": [ - { - "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_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": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "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": [ - { - "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_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).", - "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- `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": [ - { - "$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/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.", - "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, 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": [ - { - "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}/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.", - "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, 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": [ - { - "$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.\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": [ - { - "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", - "2026-10-28" - ], - "latest": "2026-10-28" - } -} 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 76% rename from .claude/skills/seclai-sdk-sync/sdksync.py rename to sdksync.py index 428f6a7..8d22491 100755 --- a/.claude/skills/seclai-sdk-sync/sdksync.py +++ b/sdksync.py @@ -53,8 +53,12 @@ # `[^)]*` 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. +# The return type after the closing `)` is read by `_read_return_tail`, not a +# regex: `Promise<{ id: string }>` and Go's single, untupled `error` both +# defeated one. +# sig_groups — head groups, then "params", then "ret" when it comes after. +# type_params — a `<...>` type-parameter list may sit between the name and +# `(`; it is read and recorded with the return type. # 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`): @@ -68,7 +72,6 @@ LANGS = { "python": { "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", @@ -79,7 +82,7 @@ # 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]+):", + "return_after_params": True, "dict_at": [r"params\s*=\s*(?:_strip_none\()?\s*"], "dict_key_re": r'"([a-zA-Z_][a-zA-Z0-9_]*)"\s*:', "helper_re": r"^[ \t]+(?:async )?def (_[a-z0-9][a-z0-9_]*)\(", @@ -87,8 +90,14 @@ "skip": {"request", "request_raw", "stream", "paginate"}, }, "javascript": { - "sig_re": r"\n (?:async )?(\w+)\(", - "sig_tail_re": r"\s*:\s*([^{\n]+?)\s*\{", + # `async *name(` (an async generator, e.g. `runStreamingAgent`) and + # `name(` too: either one missing from the pattern left the method out + # of the surface, so removing it went unreported. The match stops before + # the `<` or `(`; `public_surface` reads a type-parameter list with + # `balanced_slice`, so parens and prettier's line wrapping inside it are + # fine, and records it with the return type (see `_split_type_params`). + "sig_re": r"\n (?:async )?\*?(\w+)(?=[<(])", + "type_params": True, "sig_groups": ("name", "params", "ret"), "detect": "src/client.ts", "sources": ["src/client.ts"], @@ -102,7 +111,7 @@ 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*\{", + "return_after_params": True, "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: @@ -125,7 +134,6 @@ # 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", "sources": ["*.go"], @@ -135,8 +143,8 @@ # 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*\{", + # Go returns `(*T, error)`; `block_return` takes the tuple's first element. + "return_after_params": True, "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 @@ -178,6 +186,10 @@ }, } +# The scanner each language's source needs (see `strip_comments`). +for _name, _cfg in LANGS.items(): + _cfg["lexer"] = _name + NOT_APPLICABLE = { "seclai-cli": "wraps @seclai/sdk; coverage is SDK-method-to-command, not spec-path", "seclai-mcp": "ships no client source", @@ -272,16 +284,79 @@ def _quoted_end(text: str, i: int) -> int | None: return None +def _norm(x: str | None) -> str: + """Whitespace-normalised text: every run of whitespace becomes one space.""" + return " ".join((x or "").split()) + + +def _norm_ts(x: str | None) -> str: + """`_norm` for a piece of TypeScript signature, with prettier's wrapped angle + brackets joined first: `Record<\n string,\n unknown,\n>` becomes + `Record`, as it is written on one line. + + Plain `_norm` turned the wrapped closer's line break into a space on each + side of the `>`, which `_bracket` then read as a comparison, so a later scan + of the normalised text lost its depth. It assumes a `<` ending a line and a + `>` starting one are brackets. That is wrong for a comparison broken across + lines in a parameter default (`a <\n b`): the join then miscounts depth, which + can only produce a false BREAKING, never a missed one. No SDK file has it.""" + x = re.sub(r"<[ \t]*\n\s*", "<", x or "") + x = re.sub(r",?\s*\n[ \t]*>", ">", x) + return _norm(x) + + +def _bracket(s: str, j: int) -> int: + """+1 if `s[j]` opens a bracket, -1 if it closes one, 0 otherwise. + + The one place that decides whether `<` and `>` are brackets, shared by every + depth-counting scanner here. They are, as generics (`Map>`), except: + `=>` and `->` (an arrow), `<=` and `>=`, `<-` (Go's `<-chan`, `chan<-`), a + shift `<<`, and a `<` or `>` with a space on both sides (`a > b` in a default + value). Counting those drove the depth negative or left it open, so the + commas after them stopped splitting and arity came out wrong. + + A `>` that starts its line is a closer even with a space on both sides: + prettier wraps a long generic as `Promise<\n A | B\n > {`, and reading + that `>` as a comparison left the return type open, so the method fell out + of the surface and removing it reported nothing. A comparison does not start + a line: prettier breaks a binary expression after its operator. + """ + c = s[j] + if c in "([{": + return 1 + if c in ")]}": + return -1 + if c not in "<>": + return 0 + prev = s[j - 1] if j else "" + nxt = s[j + 1] if j + 1 < len(s) else "" + if prev == " " and nxt == " " and not (c == ">" and _starts_line(s, j)): + return 0 + if c == "<": + return 0 if (nxt in "-=<" or prev == "<") else 1 + return 0 if (prev in "=-" or nxt == "=") else -1 + + +def _starts_line(s: str, j: int) -> bool: + """True when only spaces or tabs precede `s[j]` on its line.""" + k = j - 1 + while k >= 0 and s[k] in " \t": + k -= 1 + return k < 0 or s[k] == "\n" + + def balanced_slice(text: str, at: int, opener: str = "{", closer: str = "}") -> str | None: """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 `}`. Brackets inside a string - literal (`fmt?: "{id}"`, `sep = ")"`) are text, not structure. + literal (`fmt?: "{id}"`, `sep = ")"`) are text, not structure. For `<`/`>`, + which of them count is `_bracket`'s call: the `>` of `=>` does not. """ i = text.find(opener, at) if i == -1: return None + angle = opener == "<" depth, j = 0, i while j < len(text): ch = text[j] @@ -290,9 +365,9 @@ def balanced_slice(text: str, at: int, opener: str = "{", closer: str = "}") -> if end is not None: j = end continue - if ch == opener: + if ch == opener and (not angle or _bracket(text, j) == 1): depth += 1 - elif ch == closer: + elif ch == closer and (not angle or _bracket(text, j) == -1): depth -= 1 if depth == 0: return text[i + 1: j] @@ -300,22 +375,133 @@ def balanced_slice(text: str, at: int, opener: str = "{", closer: str = "}") -> return None -def strip_comments(text: str, line: str = "//") -> str: +def _triple_end(text: str, i: int) -> int | None: + """Index just past the Python triple-quoted string opening at `text[i]`.""" + q = text[i:i + 3] + j = i + 3 + while j < len(text): + if text[j] == "\\": + j += 2 + continue + if text.startswith(q, j): + return j + 3 + j += 1 + return None + + +def _template_end(text: str, i: int) -> int | None: + """Index just past the JavaScript template literal opening at `text[i]`. + It may span lines, and a `${...}` inside may hold strings and templates.""" + j, n = i + 1, len(text) + while j < n: + ch = text[j] + if ch == "\\": + j += 2 + continue + if ch == "`": + return j + 1 + if text.startswith("${", j): + depth, j = 1, j + 2 + while j < n and depth: + c = text[j] + if c == "`": + end = _template_end(text, j) + if end is None: + return None + j = end + continue + if c in "\"'": + end = _quoted_end(text, j) + j = end if end is not None else j + 1 + continue + depth += 1 if c == "{" else -1 if c == "}" else 0 + j += 1 + continue + j += 1 + return None + + +# After one of these characters or words a `/` starts a regex literal, not a division. +_REGEX_AFTER_CHARS = set("(,=:[!&|?{};+-*%<>~^") +_REGEX_AFTER_WORDS = {"return", "typeof", "case", "do", "else", "in", "of", "new", + "delete", "void", "throw", "yield", "await", "instanceof"} + + +def _regex_end(text: str, i: int, before: str) -> int | None: + """Index just past the JavaScript regex literal opening at `text[i]`, or None + when the `/` is a division. `before` is the code preceding it. + + Which one a `/` is depends on the grammar; this is the usual previous-token + heuristic. It is still a limit: a regex directly after `)` (`if (x) /re/.test(s)`) + or `]` is read as a division, and its body as code. A literal must close on + its own line, as the grammar requires. + """ + if text.startswith(("//", "/*"), i): + return None + tail = before.rstrip() + word = re.search(r"[A-Za-z_$][\w$]*$", tail) + if tail and tail[-1] not in _REGEX_AFTER_CHARS and not (word and word.group() in _REGEX_AFTER_WORDS): + return None + j, in_class = i + 1, False + while j < len(text): + c = text[j] + if c == "\\": + j += 2 + continue + if c == "\n": + return None + if in_class: + in_class = c != "]" + elif c == "[": + in_class = True + elif c == "/": + j += 1 + while j < len(text) and (text[j].isalnum() or text[j] in "_$"): + j += 1 + return j + j += 1 + return None + + +def strip_comments(text: str, line: str = "//", lexer: str | None = None, + drop_triple: bool = False) -> 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 `//`. + + `lexer` (a `LANGS` key) adds the literals that span lines or hold comment + markers, so a `/*` in one cannot swallow method heads up to the next `*/`: + Python triple-quoted strings (replaced by `""` with `drop_triple`, which is + how docstrings are kept out of request scanning), JavaScript template and + regex literals, Go raw strings. Without it, a literal must close on its own + line. C# verbatim strings are a known limit. """ out, j, n = [], 0, len(text) + recent = "" # the last code emitted, for the regex-literal heuristic while j < n: ch = text[j] - if ch in "\"'`": - end = _quoted_end(text, j) + end = None + if lexer == "python" and text.startswith(('"""', "'''"), j): + end = _triple_end(text, j) if end is not None: - out.append(text[j:end]) - j = end + out.append('""' if drop_triple else text[j:end]) + recent, j = '""', end continue + if ch == "`" and lexer == "javascript": + end = _template_end(text, j) + elif ch == "`" and lexer == "go": + close = text.find("`", j + 1) + end = None if close == -1 else close + 1 + elif ch in "\"'`": + end = _quoted_end(text, j) + elif ch == "/" and lexer == "javascript": + end = _regex_end(text, j, recent) + if end is not None: + out.append(text[j:end]) + recent, j = text[j:end], end + continue if line == "//" and text.startswith("/*", j): end = text.find("*/", j + 2) j = n if end == -1 else end + 2 @@ -327,6 +513,7 @@ def strip_comments(text: str, line: str = "//") -> str: out.append(" ") continue out.append(ch) + recent = (recent + ch)[-24:] j += 1 return "".join(out) @@ -336,12 +523,12 @@ def split_args(sig: str, seps: str = ",", keep_star: bool = False) -> list[str]: 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`. 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. + signature change for `surface`. Which `<`/`>` are brackets is `_bracket`'s + call: the `>` of `cb: (a: A, b: B) => void`, Go's `<-chan` and the `>=` of a + default value are not. `seps` lets an object-literal type body split on `;` + too. Separators and brackets inside string literals are text. """ - out, depth, cur, prev = [], 0, [], "" + out, depth, cur = [], 0, [] j, n = 0, len(sig) while j < n: ch = sig[j] @@ -351,11 +538,7 @@ def split_args(sig: str, seps: str = ",", keep_star: bool = False) -> list[str]: cur.append(sig[j:end]) j = end continue - if ch in "<([{": - depth += 1 - elif ch in ")]}" or (ch == ">" and prev != "="): - depth -= 1 - prev = ch + depth += _bracket(sig, j) if ch in seps and depth == 0: out.append("".join(cur).strip()) cur = [] @@ -434,15 +617,22 @@ def block_call(body: str, verb_re: str) -> tuple[str, str] | None: return v.group(1).upper(), path -def strip_docs(text: str) -> str: - """Drop docstrings, block comments and whole-line comments. - - Helper detection reads through this: a docstring's `"GET"` and `"/sources"` - example made seclai-python's `_raise_for_openapi_response` look like the - request behind twenty methods that never issue one. +def code_only(text: str, cfg: dict) -> str: + """`text` without comments or Python docstrings, for request scanning. + + Every scan strips comments with `strip_comments` and the language's lexer: + `surface` and the TypeScript declaration readers (`ts_declarations`, + `_ts_object_members`, `_ts_typed_members`) and the JavaScript query-literal + reader `object_literal_keys` do too, so a multi-line template + literal holding `/*` is read the same way everywhere. A + docstring's `"GET"` and `"/sources"` example made seclai-python's + `_raise_for_openapi_response` look like the request behind twenty methods + that never issue one, and a trailing `// (default: 2000)` held a `)` that + ended a parameter list early. Triple-quoted strings are dropped (as `""`) + rather than kept, which is right for docstrings and harmless elsewhere: + no request path or query key is written in one. """ - text = re.sub(r'"""[\s\S]*?"""|\'\'\'[\s\S]*?\'\'\'|/\*[\s\S]*?\*/', "", text) - return re.sub(r"(?m)^[ \t]*(?://|#).*$", "", text) + return strip_comments(text, cfg.get("line_comment", "//"), cfg.get("lexer"), drop_triple=True) def endpoint_helpers(text: str, cfg: dict) -> dict[str, str]: @@ -454,16 +644,16 @@ def endpoint_helpers(text: str, cfg: dict) -> dict[str, str]: """ if "helper_re" not in cfg: return {} - ends = sorted({m.start() - for pat in (cfg["helper_re"], cfg["method_re"], cfg.get("boundary_re")) if pat - for m in re.finditer(pat, text, re.M)}) + # dict.fromkeys: the JavaScript boundary_re IS helper_re; scan it once. + patterns = dict.fromkeys(p for p in (cfg["helper_re"], cfg["method_re"], cfg.get("boundary_re")) if p) + ends = sorted({m.start() for pat in patterns for m in re.finditer(pat, text, re.M)}) out: dict[str, str] = {} for m in re.finditer(cfg["helper_re"], text, re.M): name = m.group(1) if name in cfg.get("skip", ()) or name in out: continue end = next((e for e in ends if e > m.start()), len(text)) - body = strip_docs(text[m.start():end]) + body = code_only(text[m.start():end], cfg) if block_call(body, cfg["verb_re"]): out[name] = body return out @@ -471,7 +661,7 @@ def endpoint_helpers(text: str, cfg: dict) -> dict[str, str]: def helper_called(body: str, cfg: dict, helpers: dict[str, str]) -> str | None: """Name of the first endpoint helper a method body calls, if any.""" - code = strip_docs(body) # a comment naming a helper is not a call to it + code = code_only(body, cfg) # a comment naming a helper is not a call to it first: tuple[int, str] | None = None for name in helpers: m = re.search(cfg["helper_call"].replace("{name}", re.escape(name)), code) @@ -487,7 +677,10 @@ def request_blocks(texts: list[str], cfg: dict): defining one is read through that helper — ONE hop. `body` stays the public method's, so its declared return type is what `returns` compares; `request_body` is where query keys are read. `helper` is None for own requests. + Every text is read without comments or docstrings (see `code_only`), so a + commented-out request is not a request and a `)` in a comment is not code. """ + texts = [code_only(t, cfg) for t in texts] shared: dict[str, str] = {} if cfg.get("helper_scope") == "package": for text in texts: @@ -523,7 +716,7 @@ def object_literal_keys(lit: str) -> tuple[set[str], bool]: """ keys: set[str] = set() ok = True - for member in split_args(strip_comments(lit)): + for member in split_args(strip_comments(lit, "//", "javascript")): # JS only (`dict_members`) m = re.match(r"""(?:"([^"]+)"|'([^']+)'|([A-Za-z_$][\w$]*))\s*:""", member) if m: keys.add(next(g for g in m.groups() if g)) @@ -571,8 +764,9 @@ def resolve(name: str, stack: tuple[str, ...]) -> tuple[set[str], bool]: def _calls(body: str, name: str) -> bool: - """A call to the free function `name(` — not `x.name(`, not `othername(`.""" - return re.search(rf"(? str: def block_return(body: str, cfg: dict) -> str | None: - """The declared return type of the method a block starts with. + """The declared return type of the method a block starts with; None when it + declares none or cannot be read (`read_block_return` tells them apart).""" + return read_block_return(body, cfg)[0] + + +def read_block_return(body: str, cfg: dict) -> tuple[str | None, bool]: + """(declared return type, unreadable) of the method a block starts with. + The block is known to be a method that makes a request, so anything short of + reading its return — or finding it has no annotation — is unreadable, and + `returns` must not count it as "nothing to check". 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 @@ -1075,22 +1278,23 @@ def block_return(body: str, cfg: dict) -> str | None: """ 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 + return (m.group(1).strip(), False) if m else (None, True) # 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 + return None, True + sliced = _after_params(body, body.find("(", anchor.end() - 1)) + if sliced is None: + return None, True + ret, _ = _read_return_tail(body, sliced[1], cfg["lexer"]) + if ret is None: + return None, True + if cfg["lexer"] == "go": + parts = split_args(ret) # `*T, error` -> `*T` + return (parts[0] if parts else ""), False + return (ret or None), False # no annotation declares nothing to check def cmd_returns(args) -> int: @@ -1102,7 +1306,7 @@ def cmd_returns(args) -> int: 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: + if "return_after_params" 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) @@ -1124,12 +1328,15 @@ def cmd_returns(args) -> int: _schema_label(_json_schema(op, "response", code))) break - mismatched, renamed, untyped, n, via_helper = [], [], [], 0, 0 + mismatched, renamed, untyped, unreadable, n, via_helper = [], [], [], [], 0, 0 texts = [path.read_text(encoding="utf-8", errors="replace") for path in files] for mname, body, call, _request_body, helper in request_blocks(texts, cfg): if call not in want: continue - declared = block_return(body, cfg) + declared, unread = read_block_return(body, cfg) + if unread: + unreadable.append((mname, call)) + continue if declared is None: continue n += 1 @@ -1178,39 +1385,170 @@ def cmd_returns(args) -> int: for name, (verb, p), expect, declared in untyped: print(f" {name} ({verb} {p}): {declared}, spec declares {expect}") + if unreadable: + print(f"\nUNREADABLE ({len(unreadable)}) — request methods whose return type this " + "scan could not read; a shape mismatch there would go unreported:") + for name, (verb, p) in unreadable: + print(f" {name} ({verb} {p})") if mismatched: print(f"\n{len(mismatched)} return type(s) disagree with the spec in SHAPE.") return 1 + if unreadable: + print(f"\n{len(unreadable)} unreadable return type(s) — the result above is incomplete.") + return 1 print("\nno return type disagrees with the spec in shape") return 0 # ── surface ────────────────────────────────────────────────────────────────── +def _after_params(text: str, open_paren: int) -> tuple[str, int] | None: + """(parameter list, index just past its closing `)`) for the `(` at + `open_paren`, sliced by paren matching. Shared by `surface` and `returns`, so + the offset past the `)` is written once.""" + if open_paren < 0: + return None + params = balanced_slice(text, open_paren, "(", ")") + if params is None: + return None + return params, open_paren + len(params) + 2 + + +def _read_return_tail(text: str, i: int, lexer: str) -> tuple[str | None, bool]: + """(return type, unreadable). The type is None with unreadable False when + what follows is a statement, not a method; with unreadable True when the + scan never reached the body — the case `surface` must not stay quiet about. + + A scan, not a regex. The type ends at the `{` that opens the body, at depth + 0 — so `Promise<{ id: string }>` (its `{` is inside `<>`), an object type + literal right after `:` or a `|`, and Go's `interface{}` are read whole. The + regexes this replaced stopped at the first `{` and recorded `Promise<`, so a + change inside that type was invisible, and Go's matched only a `(...)` tuple, + so every method returning a lone `error` was missing from the surface. + """ + if lexer == "csharp": + return "", False # read from the head; see sig_groups + if lexer == "python": + m = re.compile(r"\s*(?:->\s*([^:]+?))?\s*:").match(text, i) + # Every match of Python's pattern is a `def`, so a miss is a misread. + return (_norm(m.group(1)), False) if m else (None, True) + j, n = i, len(text) + if lexer == "javascript": + m = re.compile(r"\s*:").match(text, j) + if m is None: + m = re.compile(r"\s*\{").match(text, j) + return ("", False) if m else (None, False) # `foo(x);` is a call + j = m.end() + start, depth = j, 0 + while j < n: + c = text[j] + if c in "\"'`": + end = _quoted_end(text, j) + if end is not None: + j = end + continue + if c in ";=" and depth == 0 and not text.startswith("=>", j): + return None, False # a statement or a field initialiser, not a method + if c == "{" and depth == 0: + so_far = text[start:j].rstrip() + # A TypeScript `{` opens a type literal, not the body, wherever a type + # can start: after `|`, `&`, `=>`, `:`, `,`, and in a conditional type + # after `?` or `extends` (`T extends { a: 1 } ? { b: 2 } : never`). + literal = (lexer == "go" and re.search(r"\b(?:interface|struct)$", so_far)) or ( + lexer == "javascript" and ( + not so_far or so_far.endswith(("|", "&", "=>", ":", ",", "?")) + or re.search(r"\bextends$", so_far))) + if not literal: + ret = (_norm_ts if lexer == "javascript" else _norm)(text[start:j]) + # A Go result tuple is recorded without its parens, `*Run, error`. + if lexer == "go" and ret.startswith("(") and balanced_slice(ret, 0, "(", ")") == ret[1:-1]: + ret = _norm(ret[1:-1]) + return ret, False + body = balanced_slice(text, j) + if body is None: + return None, True + j += len(body) + 2 + continue + depth += _bracket(text, j) + j += 1 + return None, True # ran off the end: the body was never found + + 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"] + both allow overloads/variants under one name. - def norm(x: str | None) -> str: - return " ".join((x or "").split()) + The parameter list is stored as its split, normalised members joined by + ", ", so a reformat — prettier or black wrapping a signature and adding a + trailing comma — is not a change. Python's bare `*` is kept: making a + parameter keyword-only is one. + """ + return scan_surface(text, cfg)[0] - tail_re = re.compile(cfg.get("sig_tail_re", ""), re.S) + +def scan_surface(text: str, cfg: dict) -> tuple[dict[str, set[tuple[str, str]]], list[str]]: + """(`public_surface`, `unreadable_heads`) from one pass over `text`.""" + out: dict[str, set[tuple[str, str]]] = {} + unreadable: set[str] = set() # 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", "//")) + text = strip_comments(text, cfg.get("line_comment", "//"), cfg["lexer"]) for m in re.finditer(cfg["sig_re"], text, re.S): - 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 + status, name, entry = _read_head(text, m, cfg) + if status == "ok": + out.setdefault(name, set()).add(entry) + elif status == "unreadable": + unreadable.add(name) + return out, sorted(unreadable) + + +def unreadable_heads(text: str, cfg: dict) -> list[str]: + """Names of public method heads `public_surface` matched but could not read. + + Such a method is missing from the surface at that revision, so its removal + or change would report nothing. `surface` lists these and fails, which turns + any shape the scanner does not understand into a visible error rather than a + silent miss. A statement the pattern also matches (`foo(x);`) is not listed. + """ + return scan_surface(text, cfg)[1] + + +def _read_head(text: str, m: re.Match, cfg: dict) -> tuple[str, str, tuple[str, str] | None]: + """("ok", name, (return type, parameters)), ("skip", name, None) for a match + that is not a method, or ("unreadable", name, None).""" + order = cfg["sig_groups"] + name = _norm(dict(zip(order, m.groups()))["name"]) + # Most patterns end on the `(`; JavaScript's stops before it, so a + # type-parameter list can come first. + at = m.end() - 1 if text[m.end() - 1] == "(" else m.end() + tparams = None + if cfg.get("type_params") and text.startswith("<", at): + tp = balanced_slice(text, at, "<", ">") + if tp is None: + return "unreadable", name, None + # Split and rejoined like the parameters, so prettier's trailing comma + # on a wrapped list is not a change. + tparams = ", ".join(_norm_ts(x) for x in split_args(tp)) + at += len(tp) + 2 + while at < len(text) and text[at] in " \t\n": + at += 1 + if not text.startswith("(", at): + return ("unreadable" if tparams is not None else "skip"), name, None + sliced = _after_params(text, at) + if sliced is None: + return "unreadable", name, None + params, after = sliced + ret, unreadable = _read_return_tail(text, after, cfg["lexer"]) + if ret is None: + return ("unreadable" if unreadable else "skip"), name, None + if tparams is not None: + ret = _join_type_params(tparams, ret) + parts = dict(zip(order, m.groups() + (params,))) + if "ret" not in parts: + parts["ret"] = ret + norm = _norm_ts if cfg["lexer"] == "javascript" else _norm + canon = ", ".join(norm(p) for p in split_args(params, keep_star=True)) + return "ok", _norm(parts["name"]), (_norm(parts["ret"]), canon) @@ -1218,6 +1556,15 @@ def norm(x: str | None) -> str: _params = split_args +# A TypeScript parameter's head, `name?: `, and an object member's name and `?`. +_TS_PARAM_HEAD_RE = re.compile(r"\s*([\w$]+\s*\??\s*:\s*)") +_TS_MEMBER_NAME = r"(?:readonly\s+)?([\w$]+|\"[^\"]*\"|'[^']*')\s*(\?)?\s*" +# A property member, `name?: type`, with the type captured. +_TS_MEMBER_RE = re.compile(_TS_MEMBER_NAME + r":\s*(.*)$", re.S) +# Any named member: a property, or a method `name(...)`. +_TS_NAMED_MEMBER_RE = re.compile(_TS_MEMBER_NAME + r"[:(]") + + 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", "= {}"). @@ -1225,44 +1572,68 @@ def _ts_inline_object(param: str) -> tuple[str, str, str] | None: 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: + m = _TS_PARAM_HEAD_RE.match(param) + if not m or not param.startswith("{", m.end()): return None - start = m.end() - 1 + start = m.end() 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())) + return (_norm(param[:start]), body, _norm(param[end + 1:])) 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: + then refuses to call the change compatible. Comments are dropped here even + though `public_surface` already stripped them: `classify_change` is also + called directly with raw signature text, and the bodies are a few lines, so + the second pass costs nothing worth a precondition. 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), ";,") + parts = split_args(strip_comments(body, "//", "javascript"), ";,") out: dict[str, tuple[bool, str]] = {} for raw in parts: - text = " ".join(raw.split()) + text = _norm(raw) if not text: continue - m = re.match(r"(?:readonly\s+)?([\w$]+|\"[^\"]*\"|'[^']*')\s*(\?)?\s*[:(]", text) + m = _TS_NAMED_MEMBER_RE.match(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 _arrow_at_top(t: str) -> bool: + """`t` is a function type: it has an `=>` at bracket depth 0.""" + depth, j = 0, 0 + while j < len(t): + if t[j] in "\"'`": + end = _quoted_end(t, j) + if end is not None: + j = end + continue + if depth == 0 and t.startswith("=>", j): + return True + depth += _bracket(t, j) + j += 1 + return False 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, "|")) + """Top-level `|` members of a type, whitespace-normalised and sorted. + + A function type is one member: in `(e: E) => T | undefined` the `|` belongs + to the return type, so splitting it there called a callback whose return + type changed "optional property widened to accept undefined". + """ + if _arrow_at_top(t): + return [_norm(t)] + return sorted(_norm(x) for x in split_args(t, "|")) def _ts_widened_to_undefined(old: str, new: str) -> bool: @@ -1314,9 +1685,8 @@ def _ts_wrapped_type(o: str, n: str) -> str | None: 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()): + ho, hn = _TS_PARAM_HEAD_RE.match(o), _TS_PARAM_HEAD_RE.match(n) + if not ho or not hn or _norm(ho.group(1)) != _norm(hn.group(1)): return None rest_o, rest_n = o[ho.end():], n[hn.end():] w = re.match(r"(Omit|Partial)\s*<", rest_n) @@ -1336,8 +1706,7 @@ def _ts_wrapped_type(o: str, n: str) -> str | None: 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 + return kind if _norm(rest_o) == _norm(args[0] + after) else None _TS_COMPATIBLE_LABELS = { @@ -1398,10 +1767,9 @@ def _top_level_index(s: str, ch: str) -> int: if end is not None: j, prev = end, "" continue - if c in "<([{": - depth += 1 - elif c in ")]}" or (c == ">" and prev != "="): - depth -= 1 + b = _bracket(s, j) + if b: + depth += b 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 "=!<>"): @@ -1414,8 +1782,8 @@ def _top_level_index(s: str, ch: str) -> int: 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, "|")} + return {_norm(x) for x in split_args(m.group(1), "|")} | {"None"} + return {_norm(x) for x in split_args(t, "|")} def _py_param(p: str) -> tuple[str, str, str | None] | None: @@ -1425,17 +1793,17 @@ def _py_param(p: str) -> tuple[str, str, str | None] | None: 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 + return m.group(1), _norm(m.group(2)), 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())) + head, default = (p, None) if eq < 0 else (p[:eq], _norm(p[eq + 1:])) 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 + return m.group(1), bool(m.group(2)), _norm(m.group(3)), default def _gained_default(lang: str, o: str, n: str) -> bool: @@ -1543,23 +1911,21 @@ def _gained_default_change(lang: str, old_par: str, new_par: str, 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, "" + depth, j = 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, "" + j = end continue - if c in "<([{": - depth += 1 - elif c in ")]}" or (c == ">" and prev != "="): - depth -= 1 + b = _bracket(text, j) + if b: + depth += b 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) @@ -1576,7 +1942,7 @@ def put(name: str, decl: tuple | None) -> None: out[name] = decl for raw in texts: - text = strip_comments(raw) + text = strip_comments(raw, "//", "javascript") for m in re.finditer(r"(?m)^[ \t]*(?:export\s+)?(?:declare\s+)?interface\s+([\w$]+)\s*(<)?", text): brace = text.find("{", m.end()) @@ -1589,7 +1955,7 @@ def put(name: str, decl: tuple | None) -> None: if ext and not bases: put(m.group(1), None) continue - whole = " ".join(text[m.start():brace + len(body) + 2].split()) + whole = _norm(text[m.start():brace + len(body) + 2]) 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): @@ -1600,8 +1966,8 @@ def put(name: str, decl: tuple | None) -> None: 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()))) + expr = _norm(text[start:end]) + put(m.group(1), ("alias", expr, _norm(text[m.start():end]))) return out @@ -1609,14 +1975,14 @@ 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()) + for raw in split_args(strip_comments(body, "//", "javascript"), ";,"): + text = _norm(raw) 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())) + out[m.group(1).strip("\"'")] = (bool(m.group(2)), _norm(m.group(3))) return out @@ -1630,7 +1996,7 @@ def _ts_string_keys(k: str) -> set[str] | None: 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()) + e = _norm(expr) while e.startswith("(") and balanced_slice(e, 0, "(", ")") == e[1:-1]: e = e[1:-1].strip() if not e: @@ -1727,6 +2093,82 @@ def ts_named_options_change(o: str, n: str, old_decls: dict, new_decls: dict) -> return kinds or {"same"} +def _join_type_params(tparams: str, ret: str) -> str: + """A generic method's recorded return: `: Promise`. + + Kept with the return type rather than the parameters so that the optional- + parameter rules, which compare parameters by position, are unaffected. No + TypeScript type starts with `<...>:` (a generic function type is `(`), so + `_split_type_params` can always take it apart again.""" + return f"<{tparams}>: {ret}".rstrip() + + +def _unwrap(t: str, wrapper: str) -> str | None: + """`X` when `t` is exactly `wrapper` (`Promise`, `Array`), else None.""" + if not t.startswith(wrapper + "<"): + return None + inner = balanced_slice(t, len(wrapper), "<", ">") + if inner is None or len(wrapper) + len(inner) + 2 != len(t): + return None + return inner.strip() + + +def _array_element(t: str) -> str | None: + """`X` when `t` is an array of `X`: `X[]` for a name or a parenthesised + type, or `Array`. A union like `A | B[]` is not an array, so the element + must be a single name (with type arguments) or wrapped in parens.""" + inner = _unwrap(t, "Array") + if inner is not None: + return inner + if not t.endswith("[]"): + return None + el = t[:-2].strip() + if el.startswith("(") and balanced_slice(el, 0, "(", ")") == el[1:-1]: + return el[1:-1].strip() + m = re.fullmatch(r"[\w$.]+", el) or re.fullmatch(r"[\w$.]+(<.*>)", el) + if m and (m.lastindex is None or _unwrap(el, el[:el.index("<")]) is not None): + return el + return None + + +def _narrowed_from_unknown(old: str, new: str) -> bool: + """True when `new` only replaces the `unknown` in `old` with a concrete type, + keeping everything around it — the one return change a caller cannot + notice except as better types. + + `unknown` is the value the caller reads only when it is the whole return, + its array, or either inside `Promise<>`. The wrapper must survive: callers of + `unknown[]` call `.map`, and callers of `Promise` `await` or + `.then`, so `unknown[]` -> `Promise` breaks them. An `unknown` + anywhere else (a callback parameter, a constraint, `Record`) + stays BREAKING. + """ + if "unknown" in new: + return False + def concrete(x: str | None) -> bool: + return bool(x) and "unknown" not in x + if old == "unknown": + return True + if old == "unknown[]": + return concrete(_array_element(new)) + if old == "Promise": + return concrete(_unwrap(new, "Promise")) + if old == "Promise": + inner = _unwrap(new, "Promise") + return inner is not None and concrete(_array_element(inner)) + return False + + +def _split_type_params(ret: str) -> tuple[str | None, str]: + """(type parameters, return type) of a recorded return; None when the method + is not generic.""" + if ret.startswith("<"): + inner = balanced_slice(ret, 0, "<", ">") + if inner is not None and ret.startswith(":", len(inner) + 2): + return inner, ret[len(inner) + 3:].strip() + return None, ret + + 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'. @@ -1740,6 +2182,13 @@ def classify_change(lang: str, old: tuple[str, str], new: tuple[str, str], """ old_ret, old_par = old new_ret, new_par = new + if lang == "javascript": + # A type parameter or its constraint changing cannot be proven safe from + # text: `` -> `` can reject every old call. + old_tp, old_ret = _split_type_params(old_ret) + new_tp, new_ret = _split_type_params(new_ret) + if old_tp != new_tp: + return "break", "type parameters changed" if old_par != new_par: op, np_ = split_args(old_par), split_args(new_par) if lang == "javascript" and old_ret == new_ret: @@ -1776,7 +2225,13 @@ def ts_param_change(o: str, n: str) -> set[str] | None: 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: + # Only where `unknown` is the value the caller reads: the whole return, + # its array, or either inside `Promise<>`. Anywhere else it may be a + # parameter of a callback (`(x: unknown) => void`) or a constraint + # (``), where narrowing rejects calls that worked, so + # it stays BREAKING; a covariant case like `() => unknown` is a false + # alarm this accepts. + if lang == "javascript" and _narrowed_from_unknown(old_ret, 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" @@ -1847,7 +2302,8 @@ def cmd_surface(args) -> int: 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) + (old, old_unread), (new, new_unread) = scan_surface(old_text, cfg), scan_surface(new_text, cfg) + unreadable = [(args.rev, n) for n in old_unread] + [("now", n) for n in new_unread] ts_decls = None if lang == "javascript": ts_decls = (ts_declarations(_texts_at(repo, args.rev, "src", ".ts")), @@ -1858,6 +2314,12 @@ def cmd_surface(args) -> int: print(f"{repo.name} [{lang}] — {len(old)} public method(s) at {args.rev}, {len(new)} now") + if unreadable: + print(f"\nUNREADABLE ({len(unreadable)}) — public method heads this scan could not " + "read; they are missing from the surface, so a change to them would go " + "unreported. Fix the scanner (and add a test) before trusting this result:") + for rev, n in unreadable: + print(f" {n} (at {rev})") if removed: print(f"\nREMOVED ({len(removed)}) — every caller breaks:") for k in removed: @@ -1893,6 +2355,9 @@ def show(rows: list) -> None: print(f"\n{len(removed) + len(breaks)} breaking change(s). Keep the old form and add " "alongside it, or bump the major.") return 1 + if unreadable: + print(f"\n{len(unreadable)} unreadable method head(s) — the result above is incomplete.") + return 1 print("\nno breaking change — every released signature still works") return 0 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 51cb2d2..0000000 --- a/src/client.ts +++ /dev/null @@ -1,3878 +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, - AgentExampleListResponse, - ListAgentExamplesOptions, - SetSlackTriggerConfigRequest, - SlackTriggerConfigResponse, - ListSolutionsOptions, - ListMemoryBanksOptions, - ListEvaluationResultsOptions, - ListAgentEvaluationResultsOptions, - ListEvaluationRunsOptions, - ListCompatibleRunsOptions, - DateRangeOptions, - OffsetPageOptions, - ListAlertsOptions, - ListAlertConfigsOptions, - ListOrganizationAlertPreferencesOptions, - ListModelAlertsOptions, - ModelRecommendationsOptions, -} 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; - } - - /** - * 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. - * - * @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, status, flag and time-range filters. - */ - 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, - status: opts.status, - flagged_only: opts.flaggedOnly, - time_from: opts.timeFrom, - time_to: opts.timeTo, - }, - }), - "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 and a `startedAfter` filter. - */ - 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, started_after: opts.startedAfter }, - }), - "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, status, step, flag and time-range filters. - */ - async listAgentEvaluationResults( - agentId: string, - opts: ListAgentEvaluationResultsOptions = {}, - ): Promise { - return keyedList( - await this.request("GET", `/agents/${agentId}/evaluation-results`, { - 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, - ); - } - - /** - * List evaluation run summaries for an agent. - * - * @param agentId - Agent identifier. - * @param opts - Pagination, status, step and time-range filters. - */ - async listEvaluationRuns(agentId: string, opts: ListEvaluationRunsOptions = {}): Promise { - return keyedList( - await this.request("GET", `/agents/${agentId}/evaluation-runs`, { - query: { - page: opts.page, - limit: opts.limit, - status: opts.status, - step: opts.step, - time_from: opts.timeFrom, - time_to: opts.timeTo, - }, - }), - "data", - PAGE_COUNTERS, - ); - } - - /** - * Get a summary of non-manual evaluations, for one agent or the whole account. - * - * @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, - opts: DateRangeOptions = {}, - ): Promise { - return (await this.request("GET", "/agents/evaluation-results/non-manual-summary", { - query: { agent_id: agentId, days: opts.days, start_date: opts.startDate, end_date: opts.endDate }, - })) 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 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. - * - * 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: OffsetPageOptions = {}, - ): 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, sorting and a `type` filter. - * @returns Paginated list of memory banks. - */ - 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, type: opts.type }, - }), - "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. - * @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`, { - query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate }, - }); - } - - /** - * 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. - * - * @param opts - Turns to return (server default 5) and most-recent turns to skip (default 0). - */ - 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; - } - - /** - * 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, sorting and a name `search`. - * @returns Paginated list of solutions. - */ - async listSolutions(opts: ListSolutionsOptions = {}): Promise { - return (await this.request("GET", "/solutions", { - query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order, search: opts.search }, - })) 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. - * - * @param opts - `limit`: how many conversations (the server defaults to 20). - */ - async listGovernanceAiConversations(opts: { limit?: number } = {}): Promise { - return listItems( - await this.request("GET", "/governance/ai-assistant/conversations", { query: { limit: opts.limit } }), - ); - } - - /** - * 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: 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, - agent_id: opts.agentId, - source_connection_id: opts.sourceConnectionId, - time_from: opts.timeFrom, - time_to: opts.timeTo, - }, - })) 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: ListAlertConfigsOptions = {}): Promise { - return keyedList( - 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"], - ); - } - - /** - * 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. - * - * @param opts - Organization filter, and whether to include default subscriptions. - */ - async listOrganizationAlertPreferences( - opts: ListOrganizationAlertPreferencesOptions = {}, - ): Promise { - return keyedList( - await this.request("GET", "/alerts/organization-preferences/list", { - query: { organization_id: opts.organizationId, include_defaults: opts.includeDefaults }, - }), - "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, an agent filter and `unreadOnly`. - */ - 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, agent_id: opts.agentId, unread_only: opts.unreadOnly }, - }), - "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. - * @param opts - Capabilities and limits a recommended model must have. - */ - 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; - } - - /** - * 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 - 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: 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 }, - }), - "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. - * - * @param opts - Turns to return (server default 5) and most-recent turns to skip (default 0). - */ - 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; - } - - /** - * 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 5d0a673..0000000 --- a/src/index.ts +++ /dev/null @@ -1,367 +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, - ListAgentExamplesOptions, - ListSolutionsOptions, - ListMemoryBanksOptions, - ListEvaluationResultsOptions, - ListAgentEvaluationResultsOptions, - ListEvaluationRunsOptions, - ListCompatibleRunsOptions, - DateRangeOptions, - OffsetPageOptions, - ListAlertsOptions, - ListAlertConfigsOptions, - ListOrganizationAlertPreferencesOptions, - ListModelAlertsOptions, - ModelRecommendationsOptions, - - // Identity - MeResponse, - OrganizationInfoResponse, - - // Agents - AgentListResponse, - AgentExampleListResponse, - AgentExample, - AgentExampleResource, - AgentDefinitionResponse, - AgentExportResponse, - AgentSummaryResponse, - CreateAgentRequest, - UpdateAgentRequest, - UpdateAgentDefinitionRequest, - AgentImportPreviewRequest, - AgentImportPreviewResponse, - AgentDefinitionImportErrorResponse, - ImportFieldErrorModel, - ImportSkipResponse, - GovernancePolicyRefResponse, - AgentCallerApiResponse, - - // Agent Email Triggers - SetEmailTriggerConfigRequest, - EmailTriggerConfigResponse, - - // Agent Slack Triggers - SetSlackTriggerConfigRequest, - SlackTriggerConfigResponse, - SlackTriggerActivation, - SlackTriggerScope, - SlackReplyVisibility, - - // 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, - SpendCapAction, - SpendCapDeleteOrder, - 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 4e4835e..0000000 --- a/src/openapi.ts +++ /dev/null @@ -1,20056 +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 - * - `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. - * - * 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. - * - 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/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; - 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, 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`). - * - * 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}/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; - 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, source_spend_limit_reached (needs source_connection_id). - * - * 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. - * - * 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"]; - /** - * 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"; - /** AgentExampleListResponse */ - AgentExampleListResponse: { - /** Data */ - data: unknown[]; - pagination: components["schemas"]["PaginationResponse"]; - }; - /** - * 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, 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; - }; - /** - * 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; - /** - * 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. - */ - 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`. 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; - /** - * 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; - /** - * 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. - */ - 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 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. - */ - 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; - /** - * 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`. - */ - 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, 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; - /** - * 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``, ``email_received`` and ``slack_command`` 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; - }; - /** - * 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} - */ - 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; - }; - /** - * 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: { - /** - * 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; left unresolved, 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; - /** - * 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` while the item has no retrievable content. - */ - 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; - /** - * 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. - */ - 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; - /** - * @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). - * @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; - }; - /** - * 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. - * - * 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; - /** - * 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. - */ - 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; - /** @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: { - /** - * 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 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. - */ - 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; - /** - * 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 Defaults to dynamic_input, or to the template's own trigger type for an `agent_template` without `agent_definition`. - */ - trigger_type?: string | null; - }; - /** - * 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; - /** - * 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'. - */ - 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 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. - */ - 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 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). - * @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_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?: { - /** @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"]; - }; - }; - }; - }; - 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; - header?: { - /** @description Target a different organization account (OAuth only). When omitted, the user's default account is used. Ignored for API key authentication — the key's account is always used. */ - "X-Account-Id"?: components["parameters"]["X-Account-Id"]; - /** @description Opt into dated, backward-incompatible API changes (format YYYY-MM-DD). When omitted, the account's pinned baseline version is used and responses keep their legacy shapes. Send a date on or after a change's release to adopt it — e.g. `2026-07-27` enables rejection of undeclared query parameters (422) and the canonical `{data, pagination}` envelope (pagination = `{page, limit, total, pages, has_next, has_prev}`) on every list endpoint that previously returned 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 c520e8c..0000000 --- a/src/types.ts +++ /dev/null @@ -1,1132 +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"; - -/** - * `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. */ -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"]; - -/** - * 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 = 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"]; - -/** 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< - WithServerDefaults, - "accepted_attachments" -> & { - accepted_attachments?: AcceptedAttachmentSlotInput[] | null; -}; - -/** - * 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.). - * - * `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 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). */ -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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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"]; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** - * 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** Compaction test response. */ -export type CompactionTestResponse = components["schemas"]["CompactionTestResponseModel"]; - -/** Standalone compaction test request. */ -export type StandaloneTestCompactionRequest = WithServerDefaults; - -/** 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"]; - -/** 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"]; - -/** Request body for uploading inline text to a source. */ -export type InlineTextUploadRequest = WithServerDefaults; - -/** Request body for replacing content with inline text. */ -export type InlineTextReplaceRequest = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** 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 = WithServerDefaults; - -/** - * 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 = WithServerDefaults; - -/** - * 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"; -} - -/** 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. */ - type?: "conversation" | "general" | (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}: those of {@link ListAgentEvaluationResultsOptions} except `flaggedOnly`. */ -export type ListEvaluationRunsOptions = Omit; - -/** 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}, - * {@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. */ - days?: number; - /** First day, `YYYY-MM-DD`. */ - startDate?: string; - /** Last day, `YYYY-MM-DD`. */ - endDate?: string; -} - -/** Offset paging. Each method documents its server defaults and bounds. */ -export interface OffsetPageOptions { - /** Most items to return. */ - limit?: number; - /** Items to skip. */ - 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?: "source" | (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 deleted file mode 100644 index bbde5d8..0000000 --- a/src/versions.ts +++ /dev/null @@ -1,45 +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", - 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-28", -} 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 28c84ba..0000000 --- a/tests/client.test.ts +++ /dev/null @@ -1,4065 +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"); - }); - - 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" }); - }); -}); - -// ───────────────────────────────────────────────────────────────────────────── -// 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" }] }, - ]); - }); -}); - -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 -// ───────────────────────────────────────────────────────────────────────────── - -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-28"); - 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']"); - }); -}); - - -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); - }); -}); - -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([]); - }); -}); 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 20e41d643feab307ed3c0c000681efeab15c8a98 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 12:13:46 -0800 Subject: [PATCH 03/20] Squashed '.claude/skills/seclai-sdk-review-triage/' content from commit e45417d git-subtree-dir: .claude/skills/seclai-sdk-review-triage git-subtree-split: e45417d9df908012689529c5cc06f670ac8ee22a --- SKILL.md | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 SKILL.md diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..2a0a993 --- /dev/null +++ b/SKILL.md @@ -0,0 +1,155 @@ +--- +name: seclai-sdk-review-triage +description: Triage PR review comments in a Seclai SDK repo (seclai-python, seclai-javascript, seclai-go, seclai-csharp, seclai-cli, seclai-mcp) or in sdk-tools, by evidence class, by how many SDKs share the site, and by whether it touches published surface, into fix here / fix in every SDK / ask / nothing / upstream / push back. Use when addressing review comments or unresolved PR threads, when a /code-review result is pasted in, before replying to or resolving threads, before reporting a review round, and when review rounds keep finding new problems. +--- + +# Triaging SDK review comments + +> **Vendored file — do not edit in place.** The canonical copy lives in the +> `seclai/sdk-tools` repository at `skills/seclai-sdk-review-triage/`, 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. + +Adapted from the `seclai` repo's `pr-review-triage` for SDK work, where the stakes +are published surface and wire behaviour, and one finding usually exists in four +SDKs at once. + +**Fetch the PR's own threads first.** A pasted `/code-review` result is a second +input, not a substitute: + +``` +gh api graphql -f query='{ repository(owner:"seclai",name:"") { + pullRequest(number:) { reviewThreads(first:100) { nodes { + id isResolved comments(first:1){ nodes { path line databaseId body } } } } } }' +``` + +**State what the PR is for before reading a finding**, a sentence each: its goal +(sync to which spec, plus any backlog the user agreed to), the design it chose, and +what it ruled out. Weigh every finding against that. A finding that re-opens a +decision already made in this PR or an earlier round is answered by citing the +decision, not by changing the code back. + +## 1. Classify each finding + +| Class | Test | Disposition | +|---|---|---| +| **Proven** | You can write a failing test today from input that occurs | Fix (§3) | +| **Contract** | A published statement is false: README, CHANGELOG, docstring, SKILL.md, a comment | Make it true once, by the smallest change; deleting the claim counts | +| **Latent** | Provably wrong when reached; you can name the absent condition | **Nothing**, unless it would ship a break or a wrong request to consumers (§4) | +| **Speculative** | Hypothesised from code shape | Nothing | +| **Opinion** | Naming, reuse, dedupe, where a rule lives, a narrower type | Internals: **nothing**. New public surface: **ask** (§2) | +| **Consequence** | A true statement about an effect elsewhere | Record it in the reply | + +The class is yours to assign; a label arriving with the finding is an input. + +**Check that the finding is right before acting.** Name the command whose output +would prove your answer wrong, and run it: build the consumer, run the audit, read +the backend handler. Confident it is wrong: push back and change nothing. Unsure: +say which part you doubt, then act. Right diagnosis with a wrong suggested fix: take +the diagnosis, replace the repair, say both. + +## 2. What it touches decides the process + +| It touches | Then | +|---|---| +| **Published surface**: a public name or signature, what goes on the wire (query keys, null vs omitted, body shape), what a response deserializes into, version constants, a CHANGELOG heading or **Breaking:** label | **Decide, don't patch.** Check `surface` against the last tag; ask the user when the fix trades one consumer outcome for another | +| **Internal code** in this PR | Fix if proven or contract; otherwise nothing | +| **Trivial**: an internal comment, a test name, helper dedupe, a log line | One pass (delete, or the smallest true change) or nothing. Never a second pass | + +**Unreleased public surface can still change freely; released surface cannot.** +An opinion on a public name added in this PR is a decision to make now, with the +user, because a rename after release is breaking. The same opinion on a released +name is a major-version question. + +**A finding on generated code** (`seclai/_generated/`, `src/openapi.ts`, +`generated/seclai.gen.go`) is fixed in the generator's flags or upstream in the +spec, never in the output. + +**A spec defect goes upstream.** An undocumented null, a response schema that inlines +a string instead of `$ref`-ing the enum, untyped list items: reply on the thread, +and suggest the spec fix in `seclai`. Don't work around it in four SDKs unless the +user asks. + +## 3. One SDK, or all of them? + +**Count the sites across the sibling SDKs before fixing.** Most findings are about a +behaviour the four SDKs share: an optional `agent_id`, how `days` and the dates +combine, how a null clears a field. Fixing it in one SDK leaves three wrong and +invites the next round to find them. Check the siblings, fix them all the same way +in this round, or say the count in the reply ("one of four SDKs"). + +Two or more sites, or a fix that needed another fix where both changed behaviour, +means a design question first: give the options and a recommendation, and let the +user choose before any code. + +## 4. Latent findings and the audit tool + +A latent finding gets **nothing** unless learning it the breaking way would ship a +break or a wrong request to consumers, and nothing else would catch it first. Say +the assessment on the thread, so the reviewer knows it was weighed, not missed. + +For `sdksync.py` in sdk-tools, sdk-tools' CLAUDE.md governs. In short: `surface` and +`returns` report what they cannot read as UNREADABLE, so a parsing limit there is a +false alarm, never a silent miss. A latent parsing finding is not reportable unless +it gets past that guard. The stop condition is **no finding that changes an audit +result on a real SDK file**. Check it by running the audits on all four checkouts +before and after. + +## 5. Measure the round before fixing it + +Signals that the rounds are churning instead of converging: + +- the finding count stays flat or rises across three rounds; +- a fix needed another fix, and both changed behaviour; +- the response diff approaches the size of the change under review; +- more than half the findings land on the previous round's fixes (on a full-diff + review; a delta review lands there by construction). + +**Two firing, or the fix-needs-a-fix one alone: stop fixing finding by finding.** +Name the signal, name the requirement or design that is unclear, propose the way +out (often: make the failure mode loud, so latent cases become visible false +alarms; or split the adjacent work), and let the user decide. + +After the first round, review only the delta since the last reviewed commit, not +`HEAD~1..HEAD` counted by hand. + +## 6. Your own fixes + +**Delete, or add a guard. Do not add a named concept** (a new function, type, +option, or config key) to the code under review to answer a finding. Each new name is +surface for the next round. If a fix seems to need one, stop and say so. + +**Do not widen scope to make a test easy.** Supporting a shape no SDK has, because a +test needed it, is new work with its own review rounds. + +**A test added for a finding must fail without the fix.** Undo the fix, watch the +test fail, restore it. Say that you did. + +## 7. Replies and threads + +- One reply per thread, posted after the gates pass. The user commits and pushes, + so say the change is in the working tree. +- **Resolve only after the user reports the push** and + `gh pr view --json headRefOid` shows the new head, and only threads you changed. + A pushback, a doubt, or a question for the user stays open unless the user says to + resolve it. +- **Lead with the disagreement** when there is one. Dispute the claim, not the + reviewer. +- A review written against unpushed commits has no threads. Reply with one PR + comment once the commits are pushed. + +## 8. Reporting the round + +Lead with the class counts and how many findings changed behaviour. For example: +"9 findings: 2 proven, 4 latent, 1 contract, 2 opinion; 2 changed behaviour". When +none changed behaviour, say so in the first line: that is the stop condition. Then +list the pushbacks and doubts before the fixes. Report the classes you assigned, +not the ones the review claimed. End with: + +``` +Findings that change behaviour: N +Sibling SDKs checked: N of 4 — fixed in N +Pushed back / asked: N +Below the bar: N — said on the thread +Fixes verified by undoing them: N of N +``` From 4fe48c5858edb58c82a2324461e96591aac07e7d Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 12:47:33 -0800 Subject: [PATCH 04/20] 2026-11-05 API sync #minor --- CHANGELOG.md | 17 + README.md | 57 +++- openapi/seclai.openapi.json | 611 +++++++++++++++++++++++++++++++++--- src/client.ts | 64 +++- src/index.ts | 12 + src/openapi.ts | 475 +++++++++++++++++++++++++--- src/types.ts | 56 +++- src/versions.ts | 4 +- tests/client.test.ts | 107 ++++++- 9 files changed, 1296 insertions(+), 107 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4476bc1..00557c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [1.9.0] - 2026-11-05 + +### Changed + +- Sync the bundled OpenAPI spec and regenerate the types. Existing responses gain properties: `result_reported_at` on `AgentRunResponse`, set once the run's answer is in `output`, and `alias` on `SlackTriggerConfigResponse` +- Move `SeclaiApiVersion.Latest` to `2026-11-04`. Nothing is sent unless `apiVersion` is set, so a client that passes `SeclaiApiVersion.Latest` now opts into `2026-11-04`. From `2026-11-02`, `updateAgentDefinition()`, and `updateAgent()` when it sets `sampling_config`, refuse a definition or sampling rule that references a metadata key no trigger declares (with a 400 and a 422 respectively), where older versions declare the key as optional; from `2026-11-04`, `createEvaluationResult()` rejects `retry_triggered: true`, `updateAgent()` rejects `evaluation_mode` `eval_and_retry`, and `createEvaluationCriteria()` and `updateEvaluationCriteria()` reject a `step_id` that does not name a `display_result` or `streaming_result` step, each with a 400 +- Mark `input` on `SetSlackTriggerConfigRequest` deprecated. The API ignores it: a Slack run's input is the text after `/seclai `, or the message the shortcut was used on. It stays on the type so existing calls still compile + +### Added + +- Add `getMetadataKeys()` and `setMetadataKeys()` to read and replace the run metadata keys an agent trigger declares, which steps reference as `{{metadata.}}`. A key's `required` defaults to `false` and can be omitted +- Add `getKnowledgeBaseMetadataKeyStats()` to see which item-metadata keys a knowledge base's content carries, with item counts and top values for all time and the last 30 and 7 days +- Accept `alias` on `setSlackTriggerConfig()`, the name people type after `/seclai` to run the agent +- Add the `SeclaiApiVersion.V2026_11_02` and `SeclaiApiVersion.V2026_11_04` constants, so those versions are accepted as `apiVersion` +- Add the type exports `MetadataOrigin`, `MetadataKeyDeclaration`, `MetadataKeyDeclarationInput`, `SetMetadataKeysRequest`, `DeclarableMetadataKey`, `MetadataKeysResponse`, `KnowledgeBaseMetadataKeyStatsResponse`, `MetadataKeyWindowResponse`, `MetadataKeyCountResponse` and `MetadataValueCountResponse` + ## [1.8.0] - 2026-10-31 ### Changed @@ -270,6 +286,7 @@ _Stable release. No functional changes since 0.0.1._ _Initial release._ +[1.9.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.9.0 [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 diff --git a/README.md b/README.md index 66ed44f..d9c599b 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_28`, +Known versions are on `SeclaiApiVersion` (`V2026_07_01` through `V2026_11_04`, 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. @@ -190,6 +190,9 @@ a request that used to succeed, or (from `2026-10-21`) which fields can be 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. +- `2026-11-02` refuses an agent write that references a metadata key no trigger + declares, where older versions declare the key for you. +- `2026-11-04` rejects with a 400 evaluation settings that were accepted before. | Version | What it changes | | --- | --- | @@ -205,6 +208,8 @@ a request that used to succeed, or (from `2026-10-21`) which fields can be | `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 | +| `2026-11-02` | `updateAgentDefinition()`, and `updateAgent()` when it sets `sampling_config`, refuse a definition or sampling rule that references a metadata key no trigger declares, with a 400 and a 422 respectively. Declare the key first with `setMetadataKeys()`. An `agent_definition` import through `createAgent()` or `updateAgent()` is not refused and still declares the keys it reads. Below it each such key is declared on the trigger as optional | +| `2026-11-04` | `createEvaluationResult()` rejects `retry_triggered: true` and `updateAgent()` rejects `evaluation_mode` `eval_and_retry` with a 400: evaluations never retry a step. `createEvaluationCriteria()`, and `updateEvaluationCriteria()` when it changes `step_id`, reject a `step_id` that does not name a `display_result` or `streaming_result` step with a 400. Below it `eval_and_retry` is stored as `sample_and_flag` | **`Latest` moves with the SDK.** `SeclaiApiVersion.Latest` is the newest version the installed release knows, so upgrading the package can opt a client that @@ -212,8 +217,10 @@ 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, and `1.8.0` moves it to `2026-10-28`, -across the `if_else` / `switch` step-output change. Pass a +`2026-10-21` evaluation change, `1.8.0` moves it to `2026-10-28`, +across the `if_else` / `switch` step-output change, and `1.9.0` moves it to +`2026-11-04`, across the `2026-11-02` undeclared-metadata-key refusal and the +`2026-11-04` evaluation-setting rejections. Pass a dated constant such as `SeclaiApiVersion.V2026_07_27` to keep behaviour fixed across upgrades. @@ -404,6 +411,9 @@ const result = await client.runAgentAndPoll( ); ``` +A run's answer can be ready before its last step finishes: once +`result_reported_at` is set on `getAgentRun()`, `output` holds the answer. + ### Agent input uploads @@ -465,11 +475,15 @@ are listed in the run's `email_attachment_issues` metadata. By default the run f ### 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. +`/seclai ` or the message shortcut. Omitted fields are left unchanged. +`alias` is generated from the agent's name when not set; the text after the alias, +or the message the shortcut was used on, is the run's input. `input` is +deprecated and ignored by the API. ```ts const slack = await client.setSlackTriggerConfig("agent_id", "trigger_id", { + alias: "support", // people run `/seclai support` scope: "selected_channels", // or "bot_channels" channel_ids: ["C0123456789"], activation: "everywhere", // or "channel_opt_in" @@ -505,6 +519,30 @@ const { accepted_attachments } = await client.setAcceptedAttachments("agent_id", console.log(accepted_attachments.map((slot) => `${slot.name}: ${slot.min}..${slot.max ?? "any"}`)); ``` +### Trigger metadata keys + +Declare the run metadata keys a trigger provides, which steps reference as +`{{metadata.}}`. `system` and `source` keys are written by the platform; +`custom` keys are sent by the caller or set on the trigger, and only a `custom` +key can be `required` (default `false`): a caller-started run without it is +refused. The call replaces the whole declaration, and is refused with a 400 when +the agent references a key no trigger of its branch declares. + + +```ts +const agent = await client.getAgent("agent_id"); +const current = await client.getMetadataKeys("agent_id", agent.trigger_id!); +console.log(current.declarable_keys.map((k) => `${k.key} (${k.origin})`)); + +const updated = await client.setMetadataKeys("agent_id", agent.trigger_id!, { + metadata_keys: [ + { key: "customer_id", origin: "custom", required: true }, + { key: "region", origin: "custom" }, + ], +}); +console.log(updated.warnings); // agents whose `call_agent` mapping no longer fits +``` + ### Agent email governance ```ts @@ -585,6 +623,17 @@ await client.updateKnowledgeBase("kb_id", { name: "Renamed KB" }); await client.deleteKnowledgeBase("kb_id"); ``` +See which item-metadata keys a knowledge base's content carries, for all time +and the last 30 and 7 days: + + +```ts +const stats = await client.getKnowledgeBaseMetadataKeyStats("kb_id"); +for (const w of stats.windows) { + console.log(w.window, w.total_items, w.keys.map((k) => `${k.key}: ${k.items}`)); +} +``` + ### Memory banks ```ts diff --git a/openapi/seclai.openapi.json b/openapi/seclai.openapi.json index 4220dcc..bee860b 100644 --- a/openapi/seclai.openapi.json +++ b/openapi/seclai.openapi.json @@ -277,7 +277,7 @@ }, "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.", + "description": "The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, regex_replace, 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" }, @@ -492,7 +492,7 @@ "title": "Evaluation Criteria" }, "export_version": { - "description": "Schema version of the export format (currently \"5\").", + "description": "Schema version of the export format (currently \"6\").", "title": "Export Version", "type": "string" }, @@ -720,7 +720,7 @@ "type": "null" } ], - "description": "Metadata to make available for string substitution expressions in agent tasks.", + "description": "Metadata for string substitution in agent tasks. Each key must be one the agent's trigger declares (or sets); a run that sends another custom key, or lacks a required one, is refused with HTTP 400.", "title": "Metadata" }, "priority": { @@ -806,7 +806,7 @@ "type": "null" } ], - "description": "Result of the governance input evaluation: safe, blocked, skipped, or timed_out.", + "description": "Result of the governance input evaluation: pending, safe, blocked, skipped, timed_out, or error.", "title": "Governance Input Status" }, "governance_input_wait_ms": { @@ -830,7 +830,7 @@ "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.", + "description": "Sum over the run's human_in_the_loop steps of each one's wait for a decision, in milliseconds. Waits that overlap are each counted in full, so the sum can exceed the run's duration.", "title": "Hitl Wait Ms" }, "input": { @@ -886,6 +886,19 @@ "title": "Priority", "type": "boolean" }, + "result_reported_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "When the run reported success: for an agent whose `report_success` is `on_result`, once its result step published, or once its run started if it has no result step; else when the run completed. From then on `output` is the run's answer and never changes; stop polling here if you only need the answer. `status` still follows every step, so a run can report success and later fail. Null until the run reports, for a run that failed before reporting, and for runs that ended before this field existed.", + "title": "Result Reported At" + }, "run_id": { "description": "Unique identifier for the agent run.", "title": "Run Id", @@ -944,7 +957,7 @@ "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.", + "description": "Sum over the run's standard-mode wait steps of each one's wait, in milliseconds. Waits that overlap are each counted in full. Priority waits block inline and are not counted here.", "title": "Wait Ms" } }, @@ -1175,7 +1188,7 @@ "type": "null" } ], - "description": "Metadata to make available for string substitution expressions in agent tasks.", + "description": "Metadata for string substitution in agent tasks. Each key must be one the agent's trigger declares (or sets); a run that sends another custom key, or lacks a required one, is refused with HTTP 400.", "title": "Metadata" }, "replay_of_run_id": { @@ -1389,8 +1402,8 @@ "title": "Disabled Reason" }, "evaluation_mode": { - "default": "eval_and_retry", - "description": "Evaluation mode: output_expectation, eval_and_retry, or sample_and_flag.", + "default": "sample_and_flag", + "description": "Evaluation mode: output_expectation or sample_and_flag.", "title": "Evaluation Mode", "type": "string" }, @@ -1440,7 +1453,7 @@ }, "max_retries": { "default": 3, - "description": "Max retries for eval_and_retry mode.", + "description": "Deprecated: has no effect.", "title": "Max Retries", "type": "integer" }, @@ -1503,7 +1516,7 @@ "type": "null" } ], - "description": "Failure signals that trigger rollback. Defaults to agent_eval_fail, governance_block, agent_run_failed when null.", + "description": "Failure signals that trigger rollback. Defaults to governance_block, agent_run_failed when null.", "title": "Prompt Model Auto Rollback Triggers" }, "prompt_model_auto_upgrade_strategy": { @@ -1514,7 +1527,7 @@ }, "retry_on_failure": { "default": true, - "description": "Whether to retry on evaluation failure.", + "description": "Deprecated: has no effect.", "title": "Retry On Failure", "type": "boolean" }, @@ -3412,7 +3425,7 @@ "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.", + "description": "Request body for creating an evaluation criteria.\n\nstep_id names the display_result or streaming_result step to score. The\nevaluation mode and sample frequency are set at the\nagent level, not per-criteria.", "properties": { "description": { "anyOf": [ @@ -3522,12 +3535,14 @@ }, "retry_count": { "default": 0, + "description": "Deprecated: has no effect on any count.", "minimum": 0.0, "title": "Retry Count", "type": "integer" }, "retry_triggered": { "default": false, + "description": "Retired; true returns 400 from Seclai-Version 2026-11-04.", "title": "Retry Triggered", "type": "boolean" }, @@ -4127,6 +4142,29 @@ "title": "CreateSourceBody", "type": "object" }, + "DeclarableMetadataKey": { + "properties": { + "always_present": { + "description": "Whether every run carries this key.", + "title": "Always Present", + "type": "boolean" + }, + "key": { + "title": "Key", + "type": "string" + }, + "origin": { + "$ref": "#/components/schemas/MetadataOrigin" + } + }, + "required": [ + "key", + "origin", + "always_present" + ], + "title": "DeclarableMetadataKey", + "type": "object" + }, "DmarcFailingSourceResponse": { "properties": { "failed_count": { @@ -5062,7 +5100,7 @@ "type": "boolean" }, "evaluation_mode": { - "description": "Runtime behavior mode. output_expectation (manual validation), eval_and_retry (every run + retry), sample_and_flag (sampled monitoring).", + "description": "Runtime behavior mode. output_expectation (manual validation), sample_and_flag (sampled monitoring).", "title": "Evaluation Mode", "type": "string" }, @@ -5106,6 +5144,7 @@ "type": "string" }, "max_retries": { + "description": "Deprecated: has no effect.", "title": "Max Retries", "type": "integer" }, @@ -5124,6 +5163,7 @@ "type": "object" }, "retry_on_failure": { + "description": "Deprecated: has no effect.", "title": "Retry On Failure", "type": "boolean" }, @@ -5253,10 +5293,12 @@ "type": "string" }, "retry_count": { + "description": "Deprecated.", "title": "Retry Count", "type": "integer" }, "retry_triggered": { + "description": "Deprecated.", "title": "Retry Triggered", "type": "boolean" }, @@ -5439,10 +5481,12 @@ "type": "string" }, "retry_count": { + "description": "Deprecated.", "title": "Retry Count", "type": "integer" }, "retry_triggered": { + "description": "Deprecated.", "title": "Retry Triggered", "type": "boolean" }, @@ -6118,7 +6162,7 @@ "title": "Step Id" }, "step_type": { - "description": "The step type to generate config for (e.g. 'regex_replace', 'gate', 'text', 'prompt_call', 'retrieval').", + "description": "The step type to generate config for (e.g. 'regex_replace', 'if_else', 'text', 'prompt_call', 'retrieval').", "title": "Step Type", "type": "string" }, @@ -6726,6 +6770,27 @@ "title": "KnowledgeBaseListResponseModel", "type": "object" }, + "KnowledgeBaseMetadataKeyStatsResponse": { + "properties": { + "knowledge_base_id": { + "title": "Knowledge Base Id", + "type": "string" + }, + "windows": { + "items": { + "$ref": "#/components/schemas/MetadataKeyWindowResponse" + }, + "title": "Windows", + "type": "array" + } + }, + "required": [ + "knowledge_base_id", + "windows" + ], + "title": "KnowledgeBaseMetadataKeyStats", + "type": "object" + }, "KnowledgeBaseResponseModel": { "description": "Response model for a single knowledge base.", "properties": { @@ -7278,6 +7343,198 @@ "title": "MemoryBank", "type": "object" }, + "MetadataKeyCountResponse": { + "properties": { + "distinct_values": { + "description": "How many different values it takes.", + "title": "Distinct Values", + "type": "integer" + }, + "items": { + "description": "Items in the window carrying the key.", + "title": "Items", + "type": "integer" + }, + "key": { + "description": "The item-metadata key.", + "title": "Key", + "type": "string" + }, + "top_values": { + "description": "Its 5 most frequent values, most frequent first.", + "items": { + "$ref": "#/components/schemas/MetadataValueCountResponse" + }, + "title": "Top Values", + "type": "array" + } + }, + "required": [ + "key", + "items", + "distinct_values", + "top_values" + ], + "title": "MetadataKeyCountResponse", + "type": "object" + }, + "MetadataKeyDeclaration": { + "additionalProperties": false, + "properties": { + "key": { + "description": "Steps reference the key as ``{{metadata.}}``.", + "maxLength": 255, + "minLength": 1, + "title": "Key", + "type": "string" + }, + "origin": { + "$ref": "#/components/schemas/MetadataOrigin", + "description": "``system`` and ``source`` keys are written by the platform; ``custom`` keys are sent by the caller or set on the trigger." + }, + "required": { + "default": false, + "description": "A caller-started run without this key is refused. Only a ``custom`` key can be required.", + "title": "Required", + "type": "boolean" + } + }, + "required": [ + "key", + "origin" + ], + "title": "MetadataKeyDeclaration", + "type": "object" + }, + "MetadataKeyWindowResponse": { + "properties": { + "keys": { + "description": "Keys seen in the window, most frequent first.", + "items": { + "$ref": "#/components/schemas/MetadataKeyCountResponse" + }, + "title": "Keys", + "type": "array" + }, + "since": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The window's start; null for all time.", + "title": "Since" + }, + "total_items": { + "description": "Items in the window.", + "title": "Total Items", + "type": "integer" + }, + "window": { + "enum": [ + "all_time", + "last_30_days", + "last_7_days" + ], + "title": "Window", + "type": "string" + } + }, + "required": [ + "window", + "since", + "total_items", + "keys" + ], + "title": "MetadataKeyWindowResponse", + "type": "object" + }, + "MetadataKeysResponse": { + "properties": { + "accepts_any_source_key": { + "description": "True for content triggers, which may declare any item-metadata key.", + "title": "Accepts Any Source Key", + "type": "boolean" + }, + "agent_id": { + "format": "uuid", + "title": "Agent Id", + "type": "string" + }, + "declarable_keys": { + "description": "The system and source keys this trigger's type can declare.", + "items": { + "$ref": "#/components/schemas/DeclarableMetadataKey" + }, + "title": "Declarable Keys", + "type": "array" + }, + "metadata_keys": { + "description": "The keys the agent's steps may reference. Static trigger metadata and Slack form fields are declared custom keys too, and are not repeated here.", + "items": { + "$ref": "#/components/schemas/MetadataKeyDeclaration" + }, + "title": "Metadata Keys", + "type": "array" + }, + "trigger_id": { + "format": "uuid", + "title": "Trigger Id", + "type": "string" + }, + "warnings": { + "description": "Set by a PUT that changes the declaration: agents whose `call_agent` mapping no longer fits it. Always empty on GET.", + "items": { + "type": "string" + }, + "title": "Warnings", + "type": "array" + } + }, + "required": [ + "trigger_id", + "agent_id", + "metadata_keys", + "declarable_keys", + "accepts_any_source_key" + ], + "title": "MetadataKeysResponse", + "type": "object" + }, + "MetadataOrigin": { + "description": "Who writes a run metadata key (docs/architecture/run-metadata.md, Q2).", + "enum": [ + "system", + "source", + "custom" + ], + "title": "MetadataOrigin", + "type": "string" + }, + "MetadataValueCountResponse": { + "properties": { + "items": { + "description": "Items carrying this value.", + "title": "Items", + "type": "integer" + }, + "value": { + "description": "The value as text, cut to 100 characters; an object is shown as {\u2026} and a list as [\u2026].", + "title": "Value", + "type": "string" + } + }, + "required": [ + "value", + "items" + ], + "title": "MetadataValueCountResponse", + "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": { @@ -7969,6 +8226,23 @@ "title": "SetAutoBlockModeRequest", "type": "object" }, + "SetMetadataKeysRequest": { + "properties": { + "metadata_keys": { + "description": "The whole declaration; replaces the trigger's current one.", + "items": { + "$ref": "#/components/schemas/MetadataKeyDeclaration" + }, + "title": "Metadata Keys", + "type": "array" + } + }, + "required": [ + "metadata_keys" + ], + "title": "SetMetadataKeysRequest", + "type": "object" + }, "SetSlackTriggerConfigApiRequest": { "description": "Omitted fields are left unchanged.", "properties": { @@ -7983,6 +8257,18 @@ ], "description": "`everywhere` in scope, or `channel_opt_in`." }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The name people type after `/seclai` to run this agent: lowercase letters, digits and hyphens, starting with a letter, unique in the Slack workspace. Generated from the agent's name when not set or empty.", + "title": "Alias" + }, "allow_dms": { "anyOf": [ { @@ -8022,7 +8308,7 @@ "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.}}`.", + "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.}}`, not in the run's input, which is the text after `/seclai ` or the message the shortcut was used on, and its files.", "title": "Form" }, "include_invoker_email": { @@ -8036,18 +8322,6 @@ ], "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": [ { @@ -8225,6 +8499,18 @@ "title": "Agent Id", "type": "string" }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The name people type after `/seclai` to run this agent.", + "title": "Alias" + }, "allow_dms": { "title": "Allow Dms", "type": "boolean" @@ -9817,7 +10103,7 @@ "type": "object" }, "UpdateEvaluationCriteriaRequest": { - "description": "Request body for updating an evaluation criteria.\n\nRetry settings and sample frequency are set at the agent level.", + "description": "Request body for updating an evaluation criteria.\n\nThe evaluation mode and sample frequency are set at the agent level.", "properties": { "description": { "anyOf": [ @@ -11115,7 +11401,7 @@ "type": "null" } ], - "description": "Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'.", + "description": "Evaluation mode: 'output_expectation' or 'sample_and_flag'. From Seclai-Version 2026-11-04 'eval_and_retry' returns 400; earlier versions store it as 'sample_and_flag'.", "title": "Evaluation Mode" }, "max_credits_per_period": { @@ -11153,7 +11439,7 @@ "type": "null" } ], - "description": "Max retries for eval_and_retry mode (1-10).", + "description": "Deprecated: accepted and has no effect.", "title": "Max Retries" }, "max_runs_per_day": { @@ -11231,7 +11517,7 @@ "type": "null" } ], - "description": "Failure signals that trigger rollback: agent_eval_fail, governance_flag, governance_block, agent_run_failed.", + "description": "Failure signals that trigger rollback: governance_flag, governance_block, agent_run_failed. agent_eval_fail is accepted and never fires; in the list, a run with a failed evaluation is never picked as the rollback target.", "title": "Prompt Model Auto Rollback Triggers" }, "prompt_model_auto_upgrade_strategy": { @@ -11254,7 +11540,7 @@ "type": "null" } ], - "description": "Whether to retry on evaluation failure.", + "description": "Deprecated: accepted and has no effect.", "title": "Retry On Failure" }, "sampling_config": { @@ -14955,7 +15241,7 @@ ] }, "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.", + "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, or rename the criteria. From Seclai-Version 2026-11-04 a\nchanged `step_id` must name a `display_result` or `streaming_result` step.", "operationId": "update_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__patch", "parameters": [ { @@ -15285,7 +15571,7 @@ ] }, "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.", + "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. From Seclai-Version 2026-11-04\n`retry_triggered: true` returns 400: evaluations never retry a step.", "operationId": "create_evaluation_result_api_agents_evaluation_criteria__criteria_id__results_post", "parameters": [ { @@ -15429,7 +15715,7 @@ }, "/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).", + "description": "Get an evaluation summary for API key clients.\n\nReturns aggregated pass/fail/flagged counts and pass rates for each automatic evaluation mode.\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": [ { @@ -16309,7 +16595,7 @@ ] }, "put": { - "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.", + "description": "Update an agent's name, description, evaluation settings, model lifecycle settings and run limits.\n\nEvaluation settings: `evaluation_mode` ('output_expectation', 'sample_and_flag'; see the field), `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `sampling_config`. `max_retries` and `retry_on_failure` are accepted and have no effect.\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 'governance_flag', 'governance_block', 'agent_run_failed'; 'agent_eval_fail' never fires, and in the list keeps a run with a failed evaluation from being a rollback target).\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": [ { @@ -16887,7 +17173,7 @@ }, "/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.", + "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- `repeat_until`: Run a body (`body[]`) again until its `conditions` match the iteration's verdict or `max_iterations` (1\u20131000, default 3) is reached. Fields: `conditions`, `match`, optional `verdict_template`, `output` (`last` or `all`), `fail_when_max_reached`\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). An agent has at most one `streaming_result` or `display_result`; saving refuses a second\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` 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": [ { @@ -16952,7 +17238,7 @@ ] }, "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.", + "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`, `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`, `repeat_until`, `if_else`, and `switch`. Non-composite step types (`display_result`, `join`, `streaming_result`) cannot contain child steps. A definition holding a `gate` or `retry` step is rejected: use `if_else`, or `repeat_until` to run steps again until a condition holds.\n\n**repeat_until** runs its `body[]`, then tests its `conditions` against the iteration's verdict (`verdict_template`, else the iteration's value); it repeats until they match or `max_iterations` is reached.\n\n**if_else** runs `then_steps` when its `conditions` 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": [ { @@ -17255,7 +17541,7 @@ ] }, "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.", + "description": "Create new step evaluation settings for an agent.\n\nFrom Seclai-Version 2026-11-04, `step_id` must name a `display_result` or\n`streaming_result` step, the run's published result; another step returns 400.\nThe evaluation mode and sample frequency are the agent's.", "operationId": "create_evaluation_criteria_api_agents__agent_id__evaluation_criteria_post", "parameters": [ { @@ -17727,7 +18013,7 @@ }, "/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.", + "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 `\"6\"`)\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": [ { @@ -17992,7 +18278,7 @@ ] }, "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.", + "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 for string substitution. Each key must be one the trigger declares (`GET /agents/{agent_id}/triggers/{trigger_id}/metadata-keys`); a run that sends another custom key, or lacks a required one, is refused with HTTP 400.\n\nAfter starting:\n- Poll `GET /agents/runs/{run_id}` until `result_reported_at` is set (the run's answer is in `output`) or `status` is `failed`; poll on until `status` is `completed` or `failed` if you need to know that every step finished.\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": [ { @@ -18079,7 +18365,7 @@ }, "/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.", + "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- A `result` event contains the snapshot once the run has reported its result (`result_reported_at` is set and `output` is the answer).\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: render them live, but take the answer from the `result` event. `done.status` says whether the whole run succeeded, which can still fail after its result.\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": [ { @@ -18121,7 +18407,7 @@ } } }, - "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}`." + "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: result` \u2014 `data` is an `AgentRunResponse` snapshot once the run reported success (see `result_reported_at`): its `output` is the run's answer. Sent before `done`; for an agent whose `report_success` is `on_result` it can arrive while later steps still run.\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": { @@ -18443,6 +18729,170 @@ ] } }, + "/agents/{agent_id}/triggers/{trigger_id}/metadata-keys": { + "get": { + "description": "A trigger declares the run metadata keys its agent's steps may reference, each `required` or optional. `system` and `source` keys are written by the platform and are never required; `custom` keys are sent by the caller. A run you start is refused with HTTP 400 when it lacks a required key or sends a custom key the trigger does not declare. `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": "get_metadata_keys_api_api_agents__agent_id__triggers__trigger_id__metadata_keys_get", + "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" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataKeysResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it 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 metadata keys a trigger declares", + "tags": [ + "agents" + ] + }, + "put": { + "description": "A trigger declares the run metadata keys its agent's steps may reference, each `required` or optional. `system` and `source` keys are written by the platform and are never required; `custom` keys are sent by the caller. A run you start is refused with HTTP 400 when it lacks a required key or sends a custom key the trigger does not declare. `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.\n\nRejected with HTTP 400 when the agent references a key no trigger of its branch then declares.", + "operationId": "set_metadata_keys_api_api_agents__agent_id__triggers__trigger_id__metadata_keys_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/SetMetadataKeysRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataKeysResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it 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 metadata keys a trigger accepts", + "tags": [ + "agents" + ] + } + }, "/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.", @@ -22982,6 +23432,73 @@ ] } }, + "/knowledge_bases/{knowledge_base_id}/metadata-key-stats": { + "get": { + "description": "How often each item-metadata key appears on the knowledge base's content items, for declaring a content trigger's metadata keys. An item is counted once, at its latest version; the total includes items with no metadata. Only keys a content run carries are listed: a null value counts as absent, and reserved keys and the keys the platform sets after the item's own are left out. Each window counts the items whose latest version was created or linked in it.\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_metadata_key_stats_api_knowledge_bases__knowledge_base_id__metadata_key_stats_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/KnowledgeBaseMetadataKeyStatsResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + }, + "description": "A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it 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 Metadata Key Stats", + "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.", @@ -28897,8 +29414,10 @@ "2026-10-18", "2026-10-19", "2026-10-21", - "2026-10-28" + "2026-10-28", + "2026-11-02", + "2026-11-04" ], - "latest": "2026-10-28" + "latest": "2026-11-04" } } diff --git a/src/client.ts b/src/client.ts index 51cb2d2..e57ab67 100644 --- a/src/client.ts +++ b/src/client.ts @@ -182,6 +182,9 @@ import type { ListAgentExamplesOptions, SetSlackTriggerConfigRequest, SlackTriggerConfigResponse, + SetMetadataKeysRequest, + MetadataKeysResponse, + KnowledgeBaseMetadataKeyStatsResponse, ListSolutionsOptions, ListMemoryBanksOptions, ListEvaluationResultsOptions, @@ -1929,8 +1932,9 @@ export class Seclai { * 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. + * Sets the Slack connection, `alias` (the name people type after `/seclai`), + * form, channels, reply visibility and conversation settings. Omitted fields + * are left unchanged. `input` is deprecated and ignored by the API. * * @param agentId - Agent identifier. * @param triggerId - Trigger identifier. @@ -1970,6 +1974,46 @@ export class Seclai { })) as AcceptedAttachmentsResponse; } + /** + * Get the run metadata keys a trigger declares. + * + * Steps may reference a declared key as `{{metadata.}}`. The response + * also lists the system and source keys the trigger's type can declare. + * + * @param agentId - Agent identifier. + * @param triggerId - Trigger identifier, as `getAgent()` returns it. + * @returns The trigger's declared and declarable metadata keys. + */ + async getMetadataKeys(agentId: string, triggerId: string): Promise { + return (await this.request( + "GET", + `/agents/${agentId}/triggers/${triggerId}/metadata-keys`, + )) as MetadataKeysResponse; + } + + /** + * Replace the run metadata keys a trigger declares. + * + * The body is the whole declaration and replaces the current one. The API + * answers 400 when the agent references a key that no trigger of its branch + * declares. + * + * @param agentId - Agent identifier. + * @param triggerId - Trigger identifier, as `getAgent()` returns it. + * @param body - The full declaration; each key's `required` defaults to `false`. + * @returns The trigger's metadata keys, with `warnings` naming agents whose + * `call_agent` mapping no longer fits. + */ + async setMetadataKeys( + agentId: string, + triggerId: string, + body: SetMetadataKeysRequest, + ): Promise { + return (await this.request("PUT", `/agents/${agentId}/triggers/${triggerId}/metadata-keys`, { + json: body, + })) as MetadataKeysResponse; + } + // ═══════════════════════════════════════════════════════════════════════════ // Agent Email Governance // ═══════════════════════════════════════════════════════════════════════════ @@ -2157,6 +2201,22 @@ export class Seclai { return (await this.request("GET", `/knowledge_bases/${knowledgeBaseId}`)) as KnowledgeBaseResponse; } + /** + * Get the item-metadata keys seen in a knowledge base's content. + * + * Reports, for all time and the last 30 and 7 days, each key's item count, + * number of distinct values and five most frequent values. + * + * @param knowledgeBaseId - Knowledge base identifier. + * @returns The key statistics per window. + */ + async getKnowledgeBaseMetadataKeyStats(knowledgeBaseId: string): Promise { + return (await this.request( + "GET", + `/knowledge_bases/${knowledgeBaseId}/metadata-key-stats`, + )) as KnowledgeBaseMetadataKeyStatsResponse; + } + /** * Update a knowledge base. * diff --git a/src/index.ts b/src/index.ts index 5d0a673..fc1863c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -121,6 +121,14 @@ export type { SlackTriggerScope, SlackReplyVisibility, + // Agent Trigger Metadata Keys + MetadataOrigin, + MetadataKeyDeclaration, + MetadataKeyDeclarationInput, + SetMetadataKeysRequest, + DeclarableMetadataKey, + MetadataKeysResponse, + // Agent Email Governance AgentEmailOptOutResponse, AgentEmailOptOutListResponse, @@ -217,6 +225,10 @@ export type { KnowledgeBaseResponse, CreateKnowledgeBaseBody, UpdateKnowledgeBaseBody, + KnowledgeBaseMetadataKeyStatsResponse, + MetadataKeyWindowResponse, + MetadataKeyCountResponse, + MetadataValueCountResponse, // Memory Banks MemoryBankListResponse, diff --git a/src/openapi.ts b/src/openapi.ts index 4e4835e..ae1b367 100644 --- a/src/openapi.ts +++ b/src/openapi.ts @@ -196,7 +196,8 @@ export interface paths { * * 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. + * evaluation prompt, or rename the criteria. From Seclai-Version 2026-11-04 a + * changed `step_id` must name a `display_result` or `streaming_result` step. */ patch: operations["update_evaluation_criteria_api_agents_evaluation_criteria__criteria_id__patch"]; trace?: never; @@ -247,7 +248,8 @@ export interface paths { * * 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. + * agent run and optionally a specific step run. From Seclai-Version 2026-11-04 + * `retry_triggered: true` returns 400: evaluations never retry a step. */ post: operations["create_evaluation_result_api_agents_evaluation_criteria__criteria_id__results_post"]; delete?: never; @@ -292,7 +294,7 @@ export interface paths { * 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). + * Returns aggregated pass/fail/flagged counts and pass rates for each automatic evaluation mode. * * 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 @@ -530,9 +532,9 @@ export interface paths { * Update agent metadata * @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`. + * Evaluation settings: `evaluation_mode` ('output_expectation', 'sample_and_flag'; see the field), `default_evaluation_tier` ('fast', 'balanced', 'thorough'), `sampling_config`. `max_retries` and `retry_on_failure` are accepted and have no effect. * - * 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'). + * 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 'governance_flag', 'governance_block', 'agent_run_failed'; 'agent_eval_fail' never fires, and in the list keeps a run with a failed evaluation from being a rollback target). * * 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. * @@ -722,8 +724,7 @@ export interface paths { * - `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)) + * - `repeat_until`: Run a body (`body[]`) again until its `conditions` match the iteration's verdict or `max_iterations` (1–1000, default 3) is reached. Fields: `conditions`, `match`, optional `verdict_template`, `output` (`last` or `all`), `fail_when_max_reached` * - `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) @@ -737,13 +738,13 @@ export interface paths { * - `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 + * - `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). An agent has at most one `streaming_result` or `display_result`; saving refuses a second * - `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`. + * - `if_else`: Conditional dispatch. Evaluates `conditions` 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: @@ -756,11 +757,11 @@ export interface paths { * * 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. + * The definition contains the agent's step workflow. Step types include `prompt_call`, `retrieval`, `regex_replace`, `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`, `repeat_until`, `if_else`, and `switch`. Non-composite step types (`display_result`, `join`, `streaming_result`) cannot contain child steps. A definition holding a `gate` or `retry` step is rejected: use `if_else`, or `repeat_until` to run steps again until a condition holds. * - * **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. + * **repeat_until** runs its `body[]`, then tests its `conditions` against the iteration's verdict (`verdict_template`, else the iteration's value); it repeats until they match or `max_iterations` is reached. * - * **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). + * **if_else** runs `then_steps` when its `conditions` 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`. * @@ -850,8 +851,9 @@ export interface paths { * 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. + * From Seclai-Version 2026-11-04, `step_id` must name a `display_result` or + * `streaming_result` step, the run's published result; another step returns 400. + * The evaluation mode and sample frequency are the agent's. */ post: operations["create_evaluation_criteria_api_agents__agent_id__evaluation_criteria_post"]; delete?: never; @@ -947,7 +949,7 @@ export interface paths { * 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"`) + * - `export_version`: schema version (currently `"6"`) * - `exported_at`: ISO-8601 timestamp * - `agent`: name, description, schema_version, definition, timestamps * - `trigger`: trigger type, input template, schedules @@ -1033,10 +1035,10 @@ export interface paths { * - `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. + * - `metadata`: a JSON object for string substitution. Each key must be one the trigger declares (`GET /agents/{agent_id}/triggers/{trigger_id}/metadata-keys`); a run that sends another custom key, or lacks a required one, is refused with HTTP 400. * * After starting: - * - Poll `GET /agents/runs/{run_id}` until `status` is `completed` or `failed`. + * - Poll `GET /agents/runs/{run_id}` until `result_reported_at` is set (the run's answer is in `output`) or `status` is `failed`; poll on until `status` is `completed` or `failed` if you need to know that every step finished. * - Use `include_step_outputs=true` to include per-step outputs, timing, and credits. * * Auth & scoping: @@ -1069,6 +1071,7 @@ export interface paths { * - 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`. + * - A `result` event contains the snapshot once the run has reported its result (`result_reported_at` is set and `output` is the answer). * - The final `done` event contains the terminal snapshot (including `output` and `credits` when available). * * Input options (for `dynamic_input` triggers): @@ -1078,7 +1081,7 @@ export interface paths { * 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`. + * - `stream_token` events carry the model's raw output: render them live, but take the answer from the `result` event. `done.status` says whether the whole run succeeded, which can still fail after its result. * * Auth & scoping: * - Requires `X-API-Key` header or OAuth Bearer token. All resources are scoped to the caller's account. @@ -1165,6 +1168,36 @@ export interface paths { patch?: never; trace?: never; }; + "/agents/{agent_id}/triggers/{trigger_id}/metadata-keys": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get the metadata keys a trigger declares + * @description A trigger declares the run metadata keys its agent's steps may reference, each `required` or optional. `system` and `source` keys are written by the platform and are never required; `custom` keys are sent by the caller. A run you start is refused with HTTP 400 when it lacks a required key or sends a custom key the trigger does not declare. `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. + */ + get: operations["get_metadata_keys_api_api_agents__agent_id__triggers__trigger_id__metadata_keys_get"]; + /** + * Declare the metadata keys a trigger accepts + * @description A trigger declares the run metadata keys its agent's steps may reference, each `required` or optional. `system` and `source` keys are written by the platform and are never required; `custom` keys are sent by the caller. A run you start is refused with HTTP 400 when it lacks a required key or sends a custom key the trigger does not declare. `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. + * + * Rejected with HTTP 400 when the agent references a key no trigger of its branch then declares. + */ + put: operations["set_metadata_keys_api_api_agents__agent_id__triggers__trigger_id__metadata_keys_put"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/agents/{agent_id}/triggers/{trigger_id}/slack-config": { parameters: { query?: never; @@ -2467,6 +2500,29 @@ export interface paths { patch?: never; trace?: never; }; + "/knowledge_bases/{knowledge_base_id}/metadata-key-stats": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get Knowledge Base Metadata Key Stats + * @description How often each item-metadata key appears on the knowledge base's content items, for declaring a content trigger's metadata keys. An item is counted once, at its latest version; the total includes items with no metadata. Only keys a content run carries are listed: a null value counts as absent, and reserved keys and the keys the platform sets after the item's own are left out. Each window counts the items whose latest version was created or linked in it. + * + * 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_metadata_key_stats_api_knowledge_bases__knowledge_base_id__metadata_key_stats_get"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/me": { parameters: { query?: never; @@ -4144,7 +4200,7 @@ export interface components { 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. + * @description The agent definition containing name, description, tags, and step workflow tree. Step types include prompt_call, retrieval, regex_replace, 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; @@ -4247,7 +4303,7 @@ export interface components { }[] | null; /** * Export Version - * @description Schema version of the export format (currently "5"). + * @description Schema version of the export format (currently "6"). */ export_version: string; /** @@ -4355,7 +4411,7 @@ export interface components { input_upload_ids?: string[] | null; /** * Metadata - * @description Metadata to make available for string substitution expressions in agent tasks. + * @description Metadata for string substitution in agent tasks. Each key must be one the agent's trigger declares (or sets); a run that sends another custom key, or lacks a required one, is refused with HTTP 400. */ metadata?: { [key: string]: components["schemas"]["JsonValue"]; @@ -4406,7 +4462,7 @@ export interface components { flagged_policies?: components["schemas"]["routers__api__agents__GovernancePolicyRefResponse"][]; /** * Governance Input Status - * @description Result of the governance input evaluation: safe, blocked, skipped, or timed_out. + * @description Result of the governance input evaluation: pending, safe, blocked, skipped, timed_out, or error. */ governance_input_status?: string | null; /** @@ -4416,7 +4472,7 @@ export interface components { 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. + * @description Sum over the run's human_in_the_loop steps of each one's wait for a decision, in milliseconds. Waits that overlap are each counted in full, so the sum can exceed the run's duration. */ hitl_wait_ms?: number | null; /** @@ -4444,6 +4500,11 @@ export interface components { * @description Indicates if the run was treated as a priority execution. */ priority: boolean; + /** + * Result Reported At + * @description When the run reported success: for an agent whose `report_success` is `on_result`, once its result step published, or once its run started if it has no result step; else when the run completed. From then on `output` is the run's answer and never changes; stop polling here if you only need the answer. `status` still follows every step, so a run can report success and later fail. Null until the run reports, for a run that failed before reporting, and for runs that ended before this field existed. + */ + result_reported_at?: string | null; /** * Run Id * @description Unique identifier for the agent run. @@ -4468,7 +4529,7 @@ export interface components { 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. + * @description Sum over the run's standard-mode wait steps of each one's wait, in milliseconds. Waits that overlap are each counted in full. Priority waits block inline and are not counted here. */ wait_ms?: number | null; }; @@ -4567,7 +4628,7 @@ export interface components { input_upload_ids?: string[] | null; /** * Metadata - * @description Metadata to make available for string substitution expressions in agent tasks. + * @description Metadata for string substitution in agent tasks. Each key must be one the agent's trigger declares (or sets); a run that sends another custom key, or lacks a required one, is refused with HTTP 400. */ metadata?: { [key: string]: components["schemas"]["JsonValue"]; @@ -4690,8 +4751,8 @@ export interface components { disabled_reason?: string | null; /** * Evaluation Mode - * @description Evaluation mode: output_expectation, eval_and_retry, or sample_and_flag. - * @default eval_and_retry + * @description Evaluation mode: output_expectation or sample_and_flag. + * @default sample_and_flag */ evaluation_mode: string; /** @@ -4716,7 +4777,7 @@ export interface components { max_credits_per_run?: number | null; /** * Max Retries - * @description Max retries for eval_and_retry mode. + * @description Deprecated: has no effect. * @default 3 */ max_retries: number; @@ -4748,7 +4809,7 @@ export interface components { 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. + * @description Failure signals that trigger rollback. Defaults to governance_block, agent_run_failed when null. */ prompt_model_auto_rollback_triggers?: string[] | null; /** @@ -4759,7 +4820,7 @@ export interface components { prompt_model_auto_upgrade_strategy: string; /** * Retry On Failure - * @description Whether to retry on evaluation failure. + * @description Deprecated: has no effect. * @default true */ retry_on_failure: boolean; @@ -5709,7 +5770,8 @@ export interface components { * CreateEvaluationCriteriaRequest * @description Request body for creating an evaluation criteria. * - * The evaluation mode, retry settings, and sample frequency are set at the + * step_id names the display_result or streaming_result step to score. The + * evaluation mode and sample frequency are set at the * agent level, not per-criteria. */ CreateEvaluationCriteriaRequest: { @@ -5758,11 +5820,13 @@ export interface components { flagged: boolean; /** * Retry Count + * @description Deprecated: has no effect on any count. * @default 0 */ retry_count: number; /** * Retry Triggered + * @description Retired; true returns 400 from Seclai-Version 2026-11-04. * @default false */ retry_triggered: boolean; @@ -6027,6 +6091,17 @@ export interface components { */ url_id?: string | null; }; + /** DeclarableMetadataKey */ + DeclarableMetadataKey: { + /** + * Always Present + * @description Whether every run carries this key. + */ + always_present: boolean; + /** Key */ + key: string; + origin: components["schemas"]["MetadataOrigin"]; + }; /** DmarcFailingSourceResponse */ DmarcFailingSourceResponse: { /** Failed Count */ @@ -6501,7 +6576,7 @@ export interface components { enabled: boolean; /** * Evaluation Mode - * @description Runtime behavior mode. output_expectation (manual validation), eval_and_retry (every run + retry), sample_and_flag (sampled monitoring). + * @description Runtime behavior mode. output_expectation (manual validation), sample_and_flag (sampled monitoring). */ evaluation_mode: string; /** Evaluation Prompt */ @@ -6517,7 +6592,10 @@ export interface components { * Format: uuid */ id: string; - /** Max Retries */ + /** + * Max Retries + * @description Deprecated: has no effect. + */ max_retries: number; /** * Pass Threshold @@ -6528,7 +6606,10 @@ export interface components { result_summary: { [key: string]: number; }; - /** Retry On Failure */ + /** + * Retry On Failure + * @description Deprecated: has no effect. + */ retry_on_failure: boolean; /** Step Id */ step_id: string | null; @@ -6587,9 +6668,15 @@ export interface components { * Format: uuid */ id: string; - /** Retry Count */ + /** + * Retry Count + * @description Deprecated. + */ retry_count: number; - /** Retry Triggered */ + /** + * Retry Triggered + * @description Deprecated. + */ retry_triggered: boolean; /** * Score @@ -6677,9 +6764,15 @@ export interface components { * Format: uuid */ id: string; - /** Retry Count */ + /** + * Retry Count + * @description Deprecated. + */ retry_count: number; - /** Retry Triggered */ + /** + * Retry Triggered + * @description Deprecated. + */ retry_triggered: boolean; /** * Score @@ -6977,7 +7070,7 @@ export interface components { step_id?: string | null; /** * Step Type - * @description The step type to generate config for (e.g. 'regex_replace', 'gate', 'text', 'prompt_call', 'retrieval'). + * @description The step type to generate config for (e.g. 'regex_replace', 'if_else', 'text', 'prompt_call', 'retrieval'). */ step_type: string; /** @@ -7322,6 +7415,13 @@ export interface components { */ total: number; }; + /** KnowledgeBaseMetadataKeyStats */ + KnowledgeBaseMetadataKeyStatsResponse: { + /** Knowledge Base Id */ + knowledge_base_id: string; + /** Windows */ + windows: components["schemas"]["MetadataKeyWindowResponse"][]; + }; /** * KnowledgeBase * @description Response model for a single knowledge base. @@ -7626,6 +7726,120 @@ export interface components { */ updated_at: string; }; + /** MetadataKeyCountResponse */ + MetadataKeyCountResponse: { + /** + * Distinct Values + * @description How many different values it takes. + */ + distinct_values: number; + /** + * Items + * @description Items in the window carrying the key. + */ + items: number; + /** + * Key + * @description The item-metadata key. + */ + key: string; + /** + * Top Values + * @description Its 5 most frequent values, most frequent first. + */ + top_values: components["schemas"]["MetadataValueCountResponse"][]; + }; + /** MetadataKeyDeclaration */ + MetadataKeyDeclaration: { + /** + * Key + * @description Steps reference the key as ``{{metadata.}}``. + */ + key: string; + /** @description ``system`` and ``source`` keys are written by the platform; ``custom`` keys are sent by the caller or set on the trigger. */ + origin: components["schemas"]["MetadataOrigin"]; + /** + * Required + * @description A caller-started run without this key is refused. Only a ``custom`` key can be required. + * @default false + */ + required: boolean; + }; + /** MetadataKeyWindowResponse */ + MetadataKeyWindowResponse: { + /** + * Keys + * @description Keys seen in the window, most frequent first. + */ + keys: components["schemas"]["MetadataKeyCountResponse"][]; + /** + * Since + * @description The window's start; null for all time. + */ + since: string | null; + /** + * Total Items + * @description Items in the window. + */ + total_items: number; + /** + * Window + * @enum {string} + */ + window: "all_time" | "last_30_days" | "last_7_days"; + }; + /** MetadataKeysResponse */ + MetadataKeysResponse: { + /** + * Accepts Any Source Key + * @description True for content triggers, which may declare any item-metadata key. + */ + accepts_any_source_key: boolean; + /** + * Agent Id + * Format: uuid + */ + agent_id: string; + /** + * Declarable Keys + * @description The system and source keys this trigger's type can declare. + */ + declarable_keys: components["schemas"]["DeclarableMetadataKey"][]; + /** + * Metadata Keys + * @description The keys the agent's steps may reference. Static trigger metadata and Slack form fields are declared custom keys too, and are not repeated here. + */ + metadata_keys: components["schemas"]["MetadataKeyDeclaration"][]; + /** + * Trigger Id + * Format: uuid + */ + trigger_id: string; + /** + * Warnings + * @description Set by a PUT that changes the declaration: agents whose `call_agent` mapping no longer fits it. Always empty on GET. + */ + warnings?: string[]; + }; + /** + * MetadataOrigin + * @description Who writes a run metadata key (docs/architecture/run-metadata.md, Q2). + * @enum {string} + */ + MetadataOrigin: "system" | "source" | "custom"; + /** MetadataValueCountResponse */ + MetadataValueCountResponse: { + /** + * Items + * @description Items carrying this value. + */ + items: number; + /** + * Value + * @description The value as text, cut to 100 characters; an object is shown as {…} and a list as […]. + */ + value: string; + }; /** * ModalityRateResponse * @description Per-modality rate for an LLM that prices image/audio/video output @@ -7979,6 +8193,14 @@ export interface components { /** Mode */ mode: string; }; + /** SetMetadataKeysRequest */ + SetMetadataKeysRequest: { + /** + * Metadata Keys + * @description The whole declaration; replaces the trigger's current one. + */ + metadata_keys: components["schemas"]["MetadataKeyDeclaration"][]; + }; /** * SetSlackTriggerConfigApiRequest * @description Omitted fields are left unchanged. @@ -7986,6 +8208,11 @@ export interface components { SetSlackTriggerConfigApiRequest: { /** @description `everywhere` in scope, or `channel_opt_in`. */ activation?: components["schemas"]["SlackTriggerActivation"] | null; + /** + * Alias + * @description The name people type after `/seclai` to run this agent: lowercase letters, digits and hyphens, starting with a letter, unique in the Slack workspace. Generated from the agent's name when not set or empty. + */ + alias?: string | null; /** * Allow Dms * @description Runnable in the app's own DMs. @@ -7995,18 +8222,13 @@ export interface components { 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.}}`. + * @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.}}`, not in the run's input, which is the text after `/seclai ` or the message the shortcut was used on, and its files. */ 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; /** @@ -8074,6 +8296,11 @@ export interface components { * Format: uuid */ agent_id: string; + /** + * Alias + * @description The name people type after `/seclai` to run this agent. + */ + alias?: string | null; /** Allow Dms */ allow_dms: boolean; /** Channel Ids */ @@ -8870,7 +9097,7 @@ export interface components { * UpdateEvaluationCriteriaRequest * @description Request body for updating an evaluation criteria. * - * Retry settings and sample frequency are set at the agent level. + * The evaluation mode and sample frequency are set at the agent level. */ UpdateEvaluationCriteriaRequest: { /** Description */ @@ -9451,7 +9678,7 @@ export interface components { } | null; /** * Evaluation Mode - * @description Evaluation mode: 'output_expectation', 'eval_and_retry', or 'sample_and_flag'. + * @description Evaluation mode: 'output_expectation' or 'sample_and_flag'. From Seclai-Version 2026-11-04 'eval_and_retry' returns 400; earlier versions store it as 'sample_and_flag'. */ evaluation_mode?: string | null; /** @@ -9466,7 +9693,7 @@ export interface components { max_credits_per_run?: number | null; /** * Max Retries - * @description Max retries for eval_and_retry mode (1-10). + * @description Deprecated: accepted and has no effect. */ max_retries?: number | null; /** @@ -9496,14 +9723,14 @@ export interface components { 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. + * @description Failure signals that trigger rollback: governance_flag, governance_block, agent_run_failed. agent_eval_fail is accepted and never fires; in the list, a run with a failed evaluation is never picked as the rollback target. */ 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. + * @description Deprecated: accepted and has no effect. */ retry_on_failure?: boolean | null; /** @@ -13235,6 +13462,7 @@ export interface operations { * * SSE events: * - `event: init` — `data` is an `AgentRunResponse` snapshot (includes `run_id`). + * - `event: result` — `data` is an `AgentRunResponse` snapshot once the run reported success (see `result_reported_at`): its `output` is the run's answer. Sent before `done`; for an agent whose `report_success` is `on_result` it can arrive while later steps still run. * - `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}`. @@ -13443,6 +13671,106 @@ export interface operations { }; }; }; + get_metadata_keys_api_api_agents__agent_id__triggers__trigger_id__metadata_keys_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; + trigger_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MetadataKeysResponse"]; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ + 503: { + 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_metadata_keys_api_api_agents__agent_id__triggers__trigger_id__metadata_keys_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"]["SetMetadataKeysRequest"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MetadataKeysResponse"]; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ + 503: { + 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_slack_trigger_config_api_api_agents__agent_id__triggers__trigger_id__slack_config_put: { parameters: { query?: never; @@ -16398,6 +16726,53 @@ export interface operations { }; }; }; + get_knowledge_base_metadata_key_stats_api_knowledge_bases__knowledge_base_id__metadata_key_stats_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"]["KnowledgeBaseMetadataKeyStatsResponse"]; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + /** @description A dependency is unavailable. `database_unavailable` is temporary (for example routine maintenance) and carries a `Retry-After` header, after which the request can be retried unchanged. `vector_store_unavailable` means the vector store backing an embeddings operation is not configured; it carries no `Retry-After` because it does not clear without an operator. */ + 503: { + 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; diff --git a/src/types.ts b/src/types.ts index c520e8c..b6f8008 100644 --- a/src/types.ts +++ b/src/types.ts @@ -241,13 +241,53 @@ export type EmailTriggerConfigResponse = components["schemas"]["EmailTriggerConf /** * Request body for configuring a `SLACK_COMMAND` trigger. * - * Every field is optional, and an omitted field is left unchanged. + * Every field is optional, and an omitted field is left unchanged. `alias` is + * the name people type after `/seclai` to run the agent. */ -export type SetSlackTriggerConfigRequest = components["schemas"]["SetSlackTriggerConfigApiRequest"]; +export type SetSlackTriggerConfigRequest = components["schemas"]["SetSlackTriggerConfigApiRequest"] & { + /** + * @deprecated The API no longer accepts `input` and ignores it. A run's input + * is the text after `/seclai `, or the message the shortcut was used on. + * Set `alias` to choose the name. + */ + input?: string | null; +}; /** A `SLACK_COMMAND` trigger's Slack connection, form, channels and conversation settings. */ export type SlackTriggerConfigResponse = components["schemas"]["SlackTriggerConfigApiResponse"]; +// ─── Agent Trigger Metadata Keys ───────────────────────────────────────────── + +/** Who writes a run metadata key: `system`, `source` (both written by the platform) or `custom`. */ +export type MetadataOrigin = components["schemas"]["MetadataOrigin"]; + +/** + * One run metadata key a trigger declares, which steps reference as + * `{{metadata.}}`. + */ +export type MetadataKeyDeclaration = components["schemas"]["MetadataKeyDeclaration"]; + +/** + * A {@link MetadataKeyDeclaration} as sent to {@link Seclai.setMetadataKeys}: + * `required` defaults to `false` and can be omitted — the generated type marks + * it required only because the schema declares a default. + */ +export type MetadataKeyDeclarationInput = WithServerDefaults; + +/** + * Request body for {@link Seclai.setMetadataKeys}: the whole declaration, which + * replaces the trigger's current one. + */ +export type SetMetadataKeysRequest = Omit & { + metadata_keys: MetadataKeyDeclarationInput[]; +}; + +/** A system or source metadata key a trigger's type can declare. */ +export type DeclarableMetadataKey = components["schemas"]["DeclarableMetadataKey"]; + +/** The run metadata keys a trigger declares, and the ones its type could declare. */ +export type MetadataKeysResponse = components["schemas"]["MetadataKeysResponse"]; + /** Where a Slack trigger runs within its scope: `everywhere` or `channel_opt_in`. */ export type SlackTriggerActivation = components["schemas"]["SlackTriggerActivation"]; @@ -571,6 +611,18 @@ export type CreateKnowledgeBaseBody = components["schemas"]["CreateKnowledgeBase /** Request body for updating a knowledge base. */ export type UpdateKnowledgeBaseBody = components["schemas"]["UpdateKnowledgeBaseBody"]; +/** Item-metadata keys seen in a knowledge base's content, per time window. */ +export type KnowledgeBaseMetadataKeyStatsResponse = components["schemas"]["KnowledgeBaseMetadataKeyStatsResponse"]; + +/** The item-metadata keys seen in one window (`all_time`, `last_30_days` or `last_7_days`). */ +export type MetadataKeyWindowResponse = components["schemas"]["MetadataKeyWindowResponse"]; + +/** One item-metadata key: how many items carry it, how many values it takes, and its top values. */ +export type MetadataKeyCountResponse = components["schemas"]["MetadataKeyCountResponse"]; + +/** One value of an item-metadata key and how many items carry it. */ +export type MetadataValueCountResponse = components["schemas"]["MetadataValueCountResponse"]; + // ─── Memory Banks ──────────────────────────────────────────────────────────── /** Paginated list of memory banks. */ diff --git a/src/versions.ts b/src/versions.ts index bbde5d8..efebbf4 100644 --- a/src/versions.ts +++ b/src/versions.ts @@ -23,10 +23,12 @@ export const SeclaiApiVersion = { V2026_10_19: "2026-10-19", V2026_10_21: "2026-10-21", V2026_10_28: "2026-10-28", + V2026_11_02: "2026-11-02", + V2026_11_04: "2026-11-04", /** 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-28", + Latest: "2026-11-04", } as const; /** diff --git a/tests/client.test.ts b/tests/client.test.ts index 28c84ba..9f7aa20 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -10,7 +10,7 @@ import { SeclaiStreamingError, SeclaiApiVersion, } from "../src/index"; -import type { SetAcceptedAttachmentsRequest } from "../src/index"; +import type { SetAcceptedAttachmentsRequest, SetMetadataKeysRequest, SetSlackTriggerConfigRequest } from "../src/index"; import { parseIni, isTokenValid } from "../src/auth"; type RecordedRequest = { @@ -540,6 +540,29 @@ describe("Knowledge Bases", () => { await client.getKnowledgeBase("kb_1"); }); + test("getKnowledgeBaseMetadataKeyStats sends GET /knowledge_bases/:id/metadata-key-stats", async () => { + const client = makeClient((req) => { + const u = new URL(req.url); + expect(req.method).toBe("GET"); + expect(u.pathname).toBe("/knowledge_bases/kb_1/metadata-key-stats"); + expect(u.search).toBe(""); + expect(req.bodyText).toBeUndefined(); + return jsonResponse({ + knowledge_base_id: "kb_1", + windows: [ + { + window: "all_time", + since: null, + total_items: 3, + keys: [{ key: "author", items: 2, distinct_values: 1, top_values: [{ value: "Ada", items: 2 }] }], + }, + ], + }); + }); + const stats = await client.getKnowledgeBaseMetadataKeyStats("kb_1"); + expect(stats.windows[0]!.keys[0]!.top_values[0]!.value).toBe("Ada"); + }); + test("updateKnowledgeBase sends PUT /knowledge_bases/:id", async () => { const client = makeClient((req) => { expect(req.method).toBe("PUT"); @@ -2471,6 +2494,67 @@ describe("Agent Email Triggers", () => { }); }); +describe("Agent Trigger Metadata Keys", () => { + const keysResponse = { + agent_id: "ag_1", + trigger_id: "tr_1", + accepts_any_source_key: false, + declarable_keys: [{ key: "email_from", origin: "system", always_present: true }], + metadata_keys: [{ key: "customer_id", origin: "custom", required: true }], + warnings: [], + }; + + test("getMetadataKeys sends GET /agents/:id/triggers/:tid/metadata-keys", async () => { + const client = makeClient((req) => { + const u = new URL(req.url); + expect(req.method).toBe("GET"); + expect(u.pathname).toBe("/agents/ag_1/triggers/tr_1/metadata-keys"); + expect(u.search).toBe(""); + expect(req.bodyText).toBeUndefined(); + return jsonResponse(keysResponse); + }); + const res = await client.getMetadataKeys("ag_1", "tr_1"); + expect(res.declarable_keys[0]!.origin).toBe("system"); + expect(res.metadata_keys[0]!.key).toBe("customer_id"); + }); + + test("setMetadataKeys sends PUT /agents/:id/triggers/:tid/metadata-keys with the declaration", 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/metadata-keys"); + expect(u.search).toBe(""); + expect(JSON.parse(req.bodyText!)).toEqual({ + metadata_keys: [ + { key: "customer_id", origin: "custom", required: true }, + { key: "region", origin: "custom" }, + ], + }); + return jsonResponse({ ...keysResponse, warnings: ["Caller agent no longer fits"] }); + }); + // `required` is server-defaulted, so a key without it must typecheck. + const res = await client.setMetadataKeys("ag_1", "tr_1", { + metadata_keys: [ + { key: "customer_id", origin: "custom", required: true }, + { key: "region", origin: "custom" }, + ], + }); + expect(res.warnings).toEqual(["Caller agent no longer fits"]); + }); + + test("SetMetadataKeysRequest accepts a key without required, and an empty declaration", async () => { + const bodies: unknown[] = []; + const client = makeClient((req) => { + bodies.push(JSON.parse(req.bodyText!)); + return jsonResponse({ ...keysResponse, metadata_keys: [] }); + }); + const body: SetMetadataKeysRequest = { metadata_keys: [{ key: "source_url", origin: "source" }] }; + await client.setMetadataKeys("ag_1", "tr_1", body); + await client.setMetadataKeys("ag_1", "tr_1", { metadata_keys: [] }); + expect(bodies).toEqual([{ metadata_keys: [{ key: "source_url", origin: "source" }] }, { metadata_keys: [] }]); + }); +}); + describe("Agent Slack Triggers", () => { test("setSlackTriggerConfig sends PUT /agents/:id/triggers/:tid/slack-config", async () => { const client = makeClient((req) => { @@ -2523,6 +2607,25 @@ describe("Agent Slack Triggers", () => { }); await client.setSlackTriggerConfig("ag_1", "tr_1", { allow_dms: true }); }); + + test("setSlackTriggerConfig sends alias and returns it", async () => { + const client = makeClient((req) => { + expect(JSON.parse(req.bodyText!)).toEqual({ alias: "support" }); + return jsonResponse({ trigger_id: "tr_1", alias: "support" }); + }); + const config = await client.setSlackTriggerConfig("ag_1", "tr_1", { alias: "support" }); + expect(config.alias).toBe("support"); + }); + + test("SetSlackTriggerConfigRequest still accepts the deprecated input", async () => { + // Released in 1.8.0; the API now ignores it, but callers passing it must keep compiling. + const body: SetSlackTriggerConfigRequest = { input: "{{slack.text}}", alias: "support" }; + const client = makeClient((req) => { + expect(JSON.parse(req.bodyText!)).toEqual({ input: "{{slack.text}}", alias: "support" }); + return jsonResponse({ trigger_id: "tr_1", alias: "support" }); + }); + await client.setSlackTriggerConfig("ag_1", "tr_1", body); + }); }); describe("Agent Examples", () => { @@ -3159,7 +3262,7 @@ describe("API version constants", () => { test("a constant reaches the wire", async () => { const client = makeClient( (req) => { - expect(req.headers["seclai-version"]).toBe("2026-10-28"); + expect(req.headers["seclai-version"]).toBe("2026-11-04"); return jsonResponse({ data: [] }); }, { apiVersion: SeclaiApiVersion.Latest }, From 43dfff6efb54da129d98250a6b36e4ff25557fe1 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 13:42:52 -0800 Subject: [PATCH 05/20] Squashed '.claude/skills/seclai-sdk-sync/' changes from c04694e..7b225d4 7b225d4 Addressed review comments 44177a2 Addressed review comments 7d62432 Addressed review comments c4072df Addressed review comments a05fa4d Sync tool fixes git-subtree-dir: .claude/skills/seclai-sdk-sync git-subtree-split: 7b225d4c0c87d6089fd50eb94ae14d49452dd3f1 --- SKILL.md | 58 ++++++-- sdksync.py | 388 ++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 401 insertions(+), 45 deletions(-) diff --git a/SKILL.md b/SKILL.md index 9c36b96..4b536d9 100644 --- a/SKILL.md +++ b/SKILL.md @@ -97,8 +97,8 @@ 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 +- **NAME DIFFERS** (warning) — same shape, different type name. The SDKs' own + type names often drop the spec's `Model` and `Api` affixes, 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 @@ -223,6 +223,30 @@ the scanner and add a test, then rerun. A statement the pattern also matches Only exported Go methods are surface. A lowercase method is unreachable outside the package, so a change to one breaks no caller. +**Go struct fields are surface too.** seclai-go's request/response types are +aliases (`type SetSlackTriggerConfigRequest = +generated.SetSlackTriggerConfigApiRequest`) of oapi-codegen structs, and +`generated` is a public package, so a field dropped by regeneration breaks +callers while every method signature is unchanged. `surface` diffs the exported +fields of exported structs in package `seclai` (read through the alias) and in +`generated/`, and the names of their other exported types, constants and +variables (an enum value the spec drops removes a generated constant): a removed +field, type, constant or variable is REMOVED; a changed field type, or a changed +declared type of a constant or variable, is BREAKING; an added one is ADDED. For +a non-struct type only the first line of its definition is compared (`string`, +an alias's target, `interface {`), so a change after the first line (a method of +a multi-line interface) is not seen. An alias to an exported struct in `seclai` +or `generated/` is compared by its fields, so re-pointing it at a struct with +the same fields is not seen either; if the old target is removed, its REMOVED +line still catches that. An alias to a struct in another package (`type File = +openapi_types.File`) is compared by its target's name only. Tags and comments +are ignored, in nested structs too. A struct it cannot read, or one embedding an +unexported struct, is UNREADABLE, as for a method head. Methods on generated +types (union accessors such as `AsValidationErrorLoc0`) are not read. It found +one shipped break: v1.8.0 renamed `generated.InsufficientCreditsDetail.Error` +and `generated.InsufficientCreditsResponse.Detail`. C# has the same blind spot +for model properties, and it is not covered. + 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. @@ -244,12 +268,22 @@ both revisions. 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. +that rev. Without it you get every long-standing coverage gap, which is how a +gate gets muted. + +A class is matched to its schema by name with the module prefix and the `Api` / +`Model` affixes dropped (`SlackTriggerConfigApiResponse` is +`SlackTriggerConfigResponse`), and by the +client's own methods: the class a method returns, or takes as its body, models +that operation's schema. That links `ContentFileUploadResponse` and picks which +`FileUploadResponse` a class is. Until 2026-11 an affixed class was never +matched, so `--since` did not report the Slack `alias` addition. A name that +still matches several schemas is listed as AMBIGUOUS and checked only for the +properties they all declare. + +It cannot see models with no named schema (an inline body, an SSE event, a +client-side options class); it names them as unchecked. Two of the six models +left stale in 2026-07 were in that blind spot, so read the list. ## `docexamples` — compile the README @@ -275,7 +309,7 @@ cover README snippets, and two shipped PRs contained examples that could not com | --- | --- | --- | --- | | 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-go | types generated, methods hand-written | yes | `make generate`; `types.go` aliases the `generated/` structs | | 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 | | @@ -308,7 +342,11 @@ For repos without a bundled spec, point at one: 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. + - go: `make generate` (`go generate ./...`, directives in `generated/gen.go`): + `cmd/specfix` converts the 3.1 spec to 3.0, then oapi-codegen v2.4.1 writes + `generated/seclai.gen.go`. To keep a field the spec removed, compiling and + marked deprecated, add it to `retainedRequestFields` in `cmd/specfix`. + - csharp: nothing to regenerate; hand-written models are what `models` checks. 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. diff --git a/sdksync.py b/sdksync.py index 8d22491..689edef 100755 --- a/sdksync.py +++ b/sdksync.py @@ -2258,6 +2258,189 @@ def _texts_at(repo: Path, rev: str | None, sub: str, suffix: str) -> list[str]: return out +def _go_package_texts(repo: Path, rev: str | None, sub: str) -> list[str]: + """The non-test `.go` files directly in `sub` (one Go package), at `rev` or + in the working tree. Listed at the rev itself, so a file deleted since the + tag still contributes its types to the baseline.""" + if rev is None: + d = repo / sub + return [f.read_text(encoding="utf-8", errors="replace") + for f in sorted(d.glob("*.go")) if not f.name.endswith("_test.go")] + prefix = "" if sub in ("", ".") else sub.rstrip("/") + "/" + ls = subprocess.run(["git", "-C", str(repo), "ls-tree", "--name-only", rev, "--", prefix or "."], + capture_output=True, text=True) + out = [] + for name in ls.stdout.split(): + if name.endswith(".go") and not name.endswith("_test.go") and "/" not in name[len(prefix):]: + 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 + + +_GO_TYPE_RE = re.compile(r"^type[ \t]+([A-Za-z_]\w*)(?:\[[^\]\n]*\])?[ \t]+", re.M) +_GO_FIELD_RE = re.compile(r"^([A-Za-z_]\w*(?:\s*,\s*[A-Za-z_]\w*)*)\s+(\S.*)$", re.S) +_GO_EMBED_RE = re.compile(r"^\*?([A-Za-z_]\w*\.)?([A-Za-z_]\w*)(?:\[.*\])?$", re.S) + + +def _go_struct_members(body: str) -> list[str] | None: + """A struct body split into its field declarations, at depth 0: a nested + `struct { ... }` or `map[K]V` stays one member. None when it does not balance.""" + out, cur, depth, j = [], [], 0, 0 + while j < len(body): + ch = body[j] + if ch in "\"'`": + end = (body.find("`", j + 1) + 1 or None) if ch == "`" else _quoted_end(body, j) + if end is None: + return None + cur.append(body[j:end]) + j = end + continue + if ch in "([{": + depth += 1 + elif ch in ")]}": + depth -= 1 + if depth < 0: + return None + if ch in "\n;" and depth == 0: + out.append("".join(cur).strip()) + cur = [] + else: + cur.append(ch) + j += 1 + out.append("".join(cur).strip()) + return None if depth else [m for m in out if m] + + +def go_struct_fields(text: str) -> tuple[dict[str, dict[str, str] | str], list[str]]: + """(declarations, unreadable) for one Go package's source. + + A declaration maps an EXPORTED name to {exported field: type} for a struct, + to the alias target string (`generated.X`) for `type A = B`, to "type T" + for any other type (`type Scope string` -> "type string"), and to + "const T" / "var T" for a package constant or variable, T its declared type + if any. A struct tag is dropped, nested ones too: retagging + changes the wire, not what compiles. An embedded field is named by its type, + as Go names it. A struct whose body does not balance, holds a member read as + neither a field nor an embedding, or embeds an unexported struct (whose + promoted fields this scan cannot list) is unreadable. + """ + text = strip_comments(text, "//", "go") + decls: dict[str, dict[str, str] | str] = {} + # A grouped `type ( ... )` block is not read; say so rather than drop it. + unreadable: list[str] = ["type ( ... ) block" + for _ in re.finditer(r"^type[ \t]*\(", text, re.M)] + for m in re.finditer(r"^(const|var)\b[ \t]*(\()?", text, re.M): + kind = m.group(1) + if m.group(2): + body = balanced_slice(text, m.end() - 1, "(", ")") + members = _go_struct_members(body[1:-1]) if body is not None else None + if members is None: + unreadable.append(f"{kind} ( ... ) block") + continue + else: + members = [text[m.end():].split("\n", 1)[0]] + last = "" + for mem in members: + left, eq, _ = mem.partition("=") + names, typ = re.match(r"\s*([\w\s,]*?\w)(?:\s+([^,\s].*?))?\s*$", left).groups() + if kind == "const" and not eq and not typ: + typ = last # Go repeats the previous spec's type and value + last = typ or "" + for n in re.split(r"\s*,\s*", names): + if n[0].isupper(): + decls[n] = _norm(f"{kind} {typ or ''}") + for m in _GO_TYPE_RE.finditer(text): + name, rest = m.group(1), text[m.end():] + if not name[0].isupper(): + continue + if rest.startswith("="): + decls[name] = _norm(rest[1:].split("\n", 1)[0]) + continue + if not re.match(r"struct\s*\{", rest): + # `type Scope string`, interfaces, func types: the first line of the + # underlying type, so `string` -> `int` is a change. + decls[name] = _norm("type " + rest.split("\n", 1)[0]) + continue + body = balanced_slice(text, m.end()) + members = _go_struct_members(body) if body is not None else None + if members is None: + unreadable.append(f"type {name} struct") + continue + fields: dict[str, str] = {} + ok = True + for mem in members: + mem = re.sub(r"\s*`[^`]*`\s*$|\s*\"(?:[^\"\\]|\\.)*\"\s*$", "", mem) + e = _GO_EMBED_RE.match(mem) + f = _GO_FIELD_RE.match(mem) + if e and not f: + if not e.group(1) and e.group(2)[0].islower(): + ok = False + break + fields[e.group(2)] = "embedded " + _norm(mem) + elif f: + for fname in re.split(r"\s*,\s*", f.group(1)): + fields[fname] = _norm(re.sub(r"\s*`[^`]*`", "", f.group(2))) + else: + ok = False + break + if not ok: + unreadable.append(f"type {name} struct") + continue + decls[name] = {k: v for k, v in fields.items() if k[0].isupper()} + return decls, unreadable + + +def _go_kind(entry: str) -> str: + """What a `go_field_surface` entry declares: "type", "const", "var" or "field". + A field's type text cannot start with these keywords; "struct" alone is a type.""" + word = entry.split(" ", 1)[0] + return "type" if entry == "struct" or word == "type" else word if word in ("const", "var") else "field" + + +def go_field_surface(seclai_texts: list[str], generated_texts: list[str] + ) -> tuple[dict[str, str], list[str]]: + """(surface, unreadable) for package seclai (as `X`) and `generated/` (as + `generated.X`): `Type` -> "struct" and `Type.Field` -> field type for every + exported struct, `Name` -> its `go_struct_fields` value for every other + exported declaration, and "type = target" for any other alias. An alias to + an exported struct in either package (`type Req = generated.ReqApi`) is + listed with the fields it resolves to, since that is what its callers set. + """ + pk: dict[str, dict] = {} + unreadable: list[str] = [] + for prefix, texts in (("", seclai_texts), ("generated.", generated_texts)): + decls = {} + for t in texts: + d, u = go_struct_fields(t) + decls.update(d) + unreadable += [f"{n} in package {prefix.rstrip('.') or 'seclai'}" for n in u] + pk[prefix] = decls + + def resolve(prefix: str, name: str, seen: tuple = ()) -> dict | None: + d = pk[prefix].get(name) + if isinstance(d, dict) or d is None or name in seen: + return d if isinstance(d, dict) else None + if d.startswith("generated."): + return resolve("generated.", d[len("generated."):], seen + (name,)) + if "." in d or not re.fullmatch(r"\w+", d): + return None # another package, or not a plain name: not ours to read + return resolve(prefix, d, seen + (name,)) + + out: dict[str, str] = {} + for prefix, decls in pk.items(): + for name, d in decls.items(): + fields = resolve(prefix, name) + if fields is None: + out[prefix + name] = d if _go_kind(d) != "field" else f"type = {d}" + continue + out[prefix + name] = "struct" + for f, t in fields.items(): + out[f"{prefix}{name}.{f}"] = t + return out, unreadable + + def cmd_surface(args) -> int: """Diff the public API surface against a released tag. @@ -2312,11 +2495,31 @@ def cmd_surface(args) -> int: 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") + # Go: exported struct fields too. The request/response types are aliases of + # oapi-codegen structs in the public `generated` package, so removing or + # retyping a field breaks callers while every method signature is unchanged. + old_f, new_f = {}, {} + if lang == "go": + old_f, old_fu = go_field_surface(_go_package_texts(repo, args.rev, "."), + _go_package_texts(repo, args.rev, "generated")) + new_f, new_fu = go_field_surface(_go_package_texts(repo, None, "."), + _go_package_texts(repo, None, "generated")) + unreadable += [(args.rev, n) for n in old_fu] + [("now", n) for n in new_fu] + gone_types = {k for k in old_f if old_f[k] == "struct" and k not in new_f} + for k in sorted(set(old_f) - set(new_f)): + if k in gone_types or k.rsplit(".", 1)[0] not in gone_types: + removed.append(f"{k} ({_go_kind(old_f[k])})") + added += [f"{k} ({_go_kind(new_f[k])})" for k in sorted(set(new_f) - set(old_f)) + if _go_kind(new_f[k]) != "field" or k.rsplit(".", 1)[0] in old_f] + + fields_note = (f"; {sum(v == 'struct' for v in old_f.values())} exported struct type(s) " + f"at {args.rev}, {sum(v == 'struct' for v in new_f.values())} now") if lang == "go" else "" + print(f"{repo.name} [{lang}] — {len(old)} public method(s) at {args.rev}, {len(new)} now{fields_note}") if unreadable: - print(f"\nUNREADABLE ({len(unreadable)}) — public method heads this scan could not " - "read; they are missing from the surface, so a change to them would go " + print(f"\nUNREADABLE ({len(unreadable)}) — public method heads, or Go declarations, " + "this scan could not read; they are missing from the surface, so a change " + "to them would go " "unreported. Fix the scanner (and add a test) before trusting this result:") for rev, n in unreadable: print(f" {n} (at {rev})") @@ -2332,14 +2535,19 @@ def cmd_surface(args) -> int: if len(gone) == 1 and len(now) == 1: sev, label = classify_change(lang, gone[0], now[0], ts_decls) (breaks if sev == "break" else warns).append((k, label, gone, now)) + for k in sorted(set(old_f) & set(new_f)): + if old_f[k] != new_f[k]: + what = ("field type changed" if _go_kind(old_f[k]) == _go_kind(new_f[k]) == "field" + else "declaration changed") + breaks.append((k, what, [(old_f[k], None)], [(new_f[k], None)])) 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]})") + print(f" was: {ret}" + ("" if params is None else f" ({params[:100]})")) for ret, params in now: - print(f" now: {ret} ({params[:100]})") + print(f" now: {ret}" + ("" if params is None else f" ({params[:100]})")) if breaks: print(f"\nBREAKING ({len(breaks)}) — a released signature no longer works:") @@ -2356,7 +2564,7 @@ def show(rows: list) -> None: "alongside it, or bump the major.") return 1 if unreadable: - print(f"\n{len(unreadable)} unreadable method head(s) — the result above is incomplete.") + print(f"\n{len(unreadable)} unreadable declaration(s) — the result above is incomplete.") return 1 print("\nno breaking change — every released signature still works") return 0 @@ -2405,6 +2613,21 @@ def git_location(spec: Path, fallback: Path) -> tuple[Path, str]: die(f"{full} resolves outside its own work tree {root}; --since cannot read it") +def affix_free(name: str) -> str: + """A schema name with its module qualification and `Api`/`Model` affixes + dropped, as seclai-csharp names its hand-written models: + `routers__api__agents__UpdateAgentRequest` -> `UpdateAgentRequest`, + `SlackTriggerConfigApiResponse` -> `SlackTriggerConfigResponse`, + `CloudDriveResponseModel` -> `CloudDriveResponse`. Only a trailing `Model` + and an `Api` before the last word go, so `EmbeddingModelListResponse`, + `ApiVersionResponse` and `UpdateApiVersionRequest` keep theirs. `models` + matches classes by it. + """ + name = short_label(name) + name = re.sub(r"(?<=[a-z0-9])Model$", "", name) + return re.sub(r"(?<=[a-z0-9])Api(?=[A-Z][a-z0-9]*$)", "", name) + + def spec_schema_index(spec: dict) -> dict[str, list[tuple[str, set[str]]]]: """Short schema name -> [(full name, property names)]. @@ -2414,11 +2637,91 @@ def spec_schema_index(spec: dict) -> dict[str, list[tuple[str, set[str]]]]: """ 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 {}))) + index.setdefault(short_label(full), []).append((full, set(sch.get("properties") or {}))) return index +def _element(label: str) -> tuple[bool, str]: + m = re.match(r"^array<(.+)>$", label) + return (True, m.group(1)) if m else (False, label) + + +def operation_models(repo: Path, lang: str, spec: dict, classes: set[str]) -> dict[str, dict[str, set[str]]]: + """Model class -> {full schema name -> client methods} from the client itself. + + A method that returns class X for an operation whose response is schema S, + or takes X as a parameter where the operation's request body is S, says X + models S. That is the client's own declaration, so it settles which of two + same-named schemas (`routers__api__sources__FileUploadResponse` and + `routers__api__contents__FileUploadResponse`) a class is, and links a class + named nothing like its schema (`ContentFileUploadResponse`). A list on one + side and an object on the other links nothing: that is a `returns` finding. + """ + cfg = LANGS.get(lang) + if not cfg or "return_head_re" not in cfg: + return {} + ops = {} + for raw, item in spec.get("paths", {}).items(): + for verb, op in item.items(): + if verb in ("get", "post", "put", "patch", "delete"): + ops[(verb.upper(), normalise(raw))] = op + links: dict[str, dict[str, set[str]]] = {} + + def link(cls: str, label: str, mname: str) -> None: + if cls in classes and "<" not in label and label not in ("object", "none", "unknown"): + links.setdefault(cls, {}).setdefault(label, set()).add(mname) + + texts = [f.read_text(encoding="utf-8", errors="replace") for f in source_files(repo, cfg)] + for mname, body, call, _request_body, _helper in request_blocks(texts, cfg): + op = ops.get(call) + if op is None: + continue + declared, unread = read_block_return(body, cfg) + if declared and not unread: + got_arr, got = _element(normalise_type(declared, lang)) + for code in ("200", "201", "202"): + if code in op.get("responses", {}): + want_arr, want = _element(_schema_label(_json_schema(op, "response", code))) + if got_arr == want_arr: + link(got, want, mname) + break + req = _schema_label(_json_schema(op, "request")) + anchor = re.search(cfg["method_re"], body) + sliced = _after_params(body, body.find("(", anchor.end() - 1)) if anchor else None + if sliced and req not in ("none", "object"): + types = {a.split()[0] for a in split_args(sliced[0]) if a.split()} + for t in types & classes: + link(t, req, mname) + return links + + +def match_models(classes: set[str], spec: dict, + links: dict[str, dict[str, set[str]]]) -> dict[str, list[str]]: + """Model class -> the full schema names it may model ([] when none). + + By name first: the exact short name, else the `affix_free` spelling, + ignoring case (`HttpValidationError` is `HTTPValidationError`). A + class the client links to operations (`operation_models`) is narrowed to + the named candidates it is used for; when it is used for none of them, its + links replace them. More than one result is ambiguous and is reported so; + picking one would check a model against a schema it may not be. + """ + fulls = list((spec.get("components", {}).get("schemas") or {})) + exact: dict[str, list[str]] = {} + loose: dict[str, list[str]] = {} + for full in fulls: + exact.setdefault(short_label(full), []).append(full) + loose.setdefault(affix_free(full).lower(), []).append(full) + out = {} + for cls in classes: + named = exact.get(cls) or loose.get(affix_free(cls).lower()) or [] + used = set(links.get(cls, {})) + if used: + named = sorted(used & set(named)) or sorted(used) + out[cls] = named + return out + + def cmd_models(args) -> int: repo = Path(args.repo).resolve() if repo.name in NOT_APPLICABLE: @@ -2435,7 +2738,8 @@ def cmd_models(args) -> int: return 0 spec = load_spec(args.rev, args.spec, repo) - index = spec_schema_index(spec) + props = {full: set(sch.get("properties") or {}) + for full, sch in (spec.get("components", {}).get("schemas") or {}).items()} # `--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 @@ -2445,63 +2749,77 @@ def cmd_models(args) -> int: 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)) + old = load_spec(args.since, rel, spec_repo) + was_full = {f: set(s.get("properties") or {}) + for f, s in (old.get("components", {}).get("schemas") or {}).items()} + was_short = spec_schema_index(old) 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() + for full, now in props.items(): + # A schema that only gained or lost its module qualification since + # the rev is the same schema: compare it with its old short name. + was = was_full.get(full) + if was is None: + was = set().union(*(p for _, p in was_short.get(short_label(full), []))) if now - was: - gained[short] = now - was + gained[full] = 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}") + print(f"{repo.name} [{lang}] — {len(files)} model file(s), {len(props)} spec schemas{scope}") - missing, extra, unmatched = [], [], [] + models: dict[str, set[str]] = {} 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 m: + models[m.group(1)] = set(re.findall(cfg["prop_re"], text)) + matches = match_models(set(models), spec, operation_models(repo, lang, spec, set(models))) + + missing, extra, unmatched, ambiguous = [], [], [], [] + for cls in sorted(models): + have, cands = models[cls], matches[cls] if not cands: unmatched.append(cls) continue + if len(cands) > 1: + ambiguous.append((cls, cands)) # 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)) + want = set.intersection(*(props[c] for c in cands)) if gained is not None: - want &= gained.get(cls, set()) + want &= set().union(*(gained.get(c, set()) for c in cands)) gone = want - have if gone: - missing.append((cls, sorted(gone), [n for n, _ in cands])) + missing.append((cls, sorted(gone), cands)) if len(cands) == 1 and gained is None: - surplus = have - cands[0][1] + surplus = have - props[cands[0]] 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: + for cls, gone, full in missing: where = f" [{', '.join(full)}]" if full != [cls] else "" - print(f" {cls}{where}\n {', '.join(props)}") + print(f" {cls}{where}\n {', '.join(gone)}") 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))) + for cls, surplus in extra: + print(f" {cls}: {', '.join(surplus)}") + if ambiguous: + print(f"\nWARN — AMBIGUOUS ({len(ambiguous)}) — the class matches several schemas and " + "nothing narrows it to one; only properties all of them declare are checked:") + for cls, cands in ambiguous: + print(f" {cls}: {', '.join(cands)}") 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. + # against. Say so, and name them, 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).") + f"and are unchecked (inline request bodies land here)" + + ("." if args.quiet_unmatched else ":\n " + ", ".join(unmatched))) if missing: print(f"\n{len(missing)} model(s) behind the spec.") @@ -2560,7 +2878,7 @@ def main() -> int: 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") + help="count the model classes with no schema without naming them") p.set_defaults(func=cmd_models) p = sub.add_parser("spec-diff", help="paths/schemas added, removed or changed between revisions") From bed316711624e14a097116183029a852dbb7c348 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 16:36:07 -0800 Subject: [PATCH 06/20] Addressed review comments --- CHANGELOG.md | 5 ++ README.md | 27 +++++++++-- src/client.ts | 40 +++++++++++++-- src/types.ts | 29 +++++++++-- tests/client.test.ts | 113 ++++++++++++++++++++++++++++++++++++------- 5 files changed, 182 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00557c1..af5b8f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,13 +6,18 @@ - Sync the bundled OpenAPI spec and regenerate the types. Existing responses gain properties: `result_reported_at` on `AgentRunResponse`, set once the run's answer is in `output`, and `alias` on `SlackTriggerConfigResponse` - Move `SeclaiApiVersion.Latest` to `2026-11-04`. Nothing is sent unless `apiVersion` is set, so a client that passes `SeclaiApiVersion.Latest` now opts into `2026-11-04`. From `2026-11-02`, `updateAgentDefinition()`, and `updateAgent()` when it sets `sampling_config`, refuse a definition or sampling rule that references a metadata key no trigger declares (with a 400 and a 422 respectively), where older versions declare the key as optional; from `2026-11-04`, `createEvaluationResult()` rejects `retry_triggered: true`, `updateAgent()` rejects `evaluation_mode` `eval_and_retry`, and `createEvaluationCriteria()` and `updateEvaluationCriteria()` reject a `step_id` that does not name a `display_result` or `streaming_result` step, each with a 400 +- Note API changes that apply on every API version, whatever `apiVersion` is set: a run started with `runAgent()`, `runStreamingAgent()` or the helpers built on them is refused with a 400 when its `metadata` sends a custom key the trigger does not declare, or lacks a required one, so declare custom keys with `setMetadataKeys()` before sending them; `updateAgentDefinition()` rejects a definition holding a `gate` or `retry` step (use `if_else`, or `repeat_until` to run steps again until a condition holds); the `agent_eval_fail` rollback trigger is accepted and never fires, and the default rollback triggers no longer include it; `max_retries` and `retry_on_failure` on `updateAgent()` are accepted and have no effect; and `evaluation_mode` on `AgentSummaryResponse` defaults to `sample_and_flag` instead of `eval_and_retry` +- Return the `result` event's snapshot from `runStreamingAgentAndWait()` when the stream ends, or `timeoutMs` elapses, after a `result` event but before `done`, instead of throwing. Its `output` is the run's answer; `done` is still returned when it arrives +- Return the last polled run from `runAgentAndPoll()` when `timeoutMs` elapses and that run has `result_reported_at` set, instead of throwing `SeclaiStreamingError` - Mark `input` on `SetSlackTriggerConfigRequest` deprecated. The API ignores it: a Slack run's input is the text after `/seclai `, or the message the shortcut was used on. It stays on the type so existing calls still compile +- Mark `max_retries` and `retry_on_failure` on `UpdateAgentRequest`, and `retry_count` and `retry_triggered` on `CreateEvaluationResultRequest`, deprecated. They have no effect, and from `2026-11-04` `retry_triggered: true` returns a 400. They stay on the types so existing calls still compile ### Added - Add `getMetadataKeys()` and `setMetadataKeys()` to read and replace the run metadata keys an agent trigger declares, which steps reference as `{{metadata.}}`. A key's `required` defaults to `false` and can be omitted - Add `getKnowledgeBaseMetadataKeyStats()` to see which item-metadata keys a knowledge base's content carries, with item counts and top values for all time and the last 30 and 7 days - Accept `alias` on `setSlackTriggerConfig()`, the name people type after `/seclai` to run the agent +- Add the `returnOnResult` option to `runAgentAndPoll()`, to return as soon as a polled run has `result_reported_at` set, without waiting for later steps - Add the `SeclaiApiVersion.V2026_11_02` and `SeclaiApiVersion.V2026_11_04` constants, so those versions are accepted as `apiVersion` - Add the type exports `MetadataOrigin`, `MetadataKeyDeclaration`, `MetadataKeyDeclarationInput`, `SetMetadataKeysRequest`, `DeclarableMetadataKey`, `MetadataKeysResponse`, `KnowledgeBaseMetadataKeyStatsResponse`, `MetadataKeyWindowResponse`, `MetadataKeyCountResponse` and `MetadataValueCountResponse` diff --git a/README.md b/README.md index d9c599b..17583e1 100644 --- a/README.md +++ b/README.md @@ -361,7 +361,10 @@ await client.deleteAgentRun("run_id"); The SDK provides two streaming patterns over the SSE `/runs/stream` endpoint: -**Block until done** — returns the final `done` payload or throws on timeout: +**Block until done** — returns the final `done` payload. If the stream ends or +`timeoutMs` elapses after a `result` event but before `done`, it returns the +`result` snapshot, whose `output` is the run's answer; with neither, it throws +`SeclaiStreamingError`: ```ts const result = await client.runStreamingAgentAndWait( @@ -384,6 +387,10 @@ for await (const event of client.runStreamingAgent( } ``` +A `result` event carries the run's answer in `output` once `result_reported_at` +is set. It comes before `done`, and for an agent that reports its result early it +can arrive while later steps still run. + 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 @@ -412,7 +419,16 @@ const result = await client.runAgentAndPoll( ``` A run's answer can be ready before its last step finishes: once -`result_reported_at` is set on `getAgentRun()`, `output` holds the answer. +`result_reported_at` is set on `getAgentRun()`, `output` holds the answer. Pass +`returnOnResult: true` to return as soon as a polled run has it set. On timeout, +a last polled run that has it set is returned instead of throwing +`SeclaiStreamingError`. + + +```ts +const run = await client.runAgentAndPoll("agent_id", { input: "Hello" }, { returnOnResult: true }); +if (run.result_reported_at) console.log(run.output); +``` ### Agent input uploads @@ -525,8 +541,11 @@ Declare the run metadata keys a trigger provides, which steps reference as `{{metadata.}}`. `system` and `source` keys are written by the platform; `custom` keys are sent by the caller or set on the trigger, and only a `custom` key can be `required` (default `false`): a caller-started run without it is -refused. The call replaces the whole declaration, and is refused with a 400 when -the agent references a key no trigger of its branch declares. +refused. A run is also refused with a 400 when its `metadata` sends a custom key +the trigger does not declare, on every API version, so declare custom keys with +`setMetadataKeys()` before sending them in a run's `metadata`. The call replaces +the whole declaration, and is refused with a 400 when the agent references a key +no trigger of its branch declares. ```ts diff --git a/src/client.ts b/src/client.ts index e57ab67..29ebbf8 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1198,11 +1198,18 @@ export class Seclai { * takes no `include_reasoning`, and one passed anyway is not sent: this method * returns no `stream_reasoning` events. * + * A `result` event carries the run's answer in `output` once + * `result_reported_at` is set, and can arrive while later steps still run. If + * the stream ends or `timeoutMs` elapses after a `result` event but before + * `done`, that `result` snapshot is returned instead of throwing. + * * @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. + * @returns Final agent run payload from the `done` event, or the `result` + * snapshot when `done` does not arrive. + * @throws {@link SeclaiStreamingError} If the stream ends, or `timeoutMs` + * elapses, before a `done` or `result` event. */ async runStreamingAgentAndWait( agentId: string, @@ -1231,6 +1238,7 @@ export class Seclai { const signal = anySignal([opts?.signal, timeoutController.signal]); let lastSeen: AgentRunResponse | undefined; + let reported: AgentRunResponse | undefined; try { const init: RequestInit = { method: "POST", headers, body: JSON.stringify(runBody) }; @@ -1282,10 +1290,11 @@ export class Seclai { const parser = createSseParser((msg) => { if (!msg.data) return; - if (msg.event === "init" || msg.event === "done") { + if (msg.event === "init" || msg.event === "result" || msg.event === "done") { try { const parsed = JSON.parse(msg.data) as AgentRunResponse; lastSeen = parsed; + if (msg.event === "result") reported = parsed; if (msg.event === "done") final = parsed; } catch { /* ignore malformed JSON */ } } @@ -1307,6 +1316,7 @@ export class Seclai { throw new SeclaiStreamingError("Stream ended before receiving a 'done' event.", lastSeen?.run_id); } catch (err) { if (timedOut) { + if (reported) return reported; throw new SeclaiStreamingError( `Timed out after ${timeoutMs}ms waiting for streaming agent run to complete.`, lastSeen?.run_id, @@ -1332,6 +1342,10 @@ export class Seclai { * @example * ```ts * for await (const event of client.runStreamingAgent("agent-id", { input: "Hello!" })) { + * // `result` carries the answer in `output`, possibly before later steps finish. + * if (event.event === "result") { + * console.log("Answer:", (event.data as AgentRunResponse).output); + * } * if (event.event === "done") { * console.log("Final:", event.data); * } @@ -1459,11 +1473,18 @@ export class Seclai { * * This is useful in environments where SSE streaming is unavailable. * + * A run's answer can be ready before its last step finishes: once + * `result_reported_at` is set, `output` holds the answer. Pass + * `returnOnResult: true` to return as soon as a polled run has it set. When + * `timeoutMs` elapses and the last polled run has it set, that run is returned + * instead of throwing. + * * @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. + * @returns The terminal agent run, or one with `result_reported_at` set (see above). + * @throws {@link SeclaiStreamingError} On timeout, unless the last polled run + * has `result_reported_at` set. */ async runAgentAndPoll( agentId: string, @@ -1475,6 +1496,11 @@ export class Seclai { timeoutMs?: number; /** Include per-step outputs in the final result. */ includeStepOutputs?: boolean; + /** + * Return as soon as a polled run has `result_reported_at` set (its answer is + * in `output`), without waiting for later steps to finish (default: false). + */ + returnOnResult?: boolean; signal?: AbortSignal; }, ): Promise { @@ -1486,9 +1512,11 @@ export class Seclai { const runId = (run as any).id ?? (run as any).run_id; if (!runId) throw new SeclaiError("Agent run response did not contain an id."); + let last: AgentRunResponse | undefined; while (true) { if (opts?.signal?.aborted) throw new SeclaiError("Polling aborted."); if (Date.now() - startTime > timeout) { + if (last?.result_reported_at) return last; throw new SeclaiStreamingError(`Polling timed out after ${timeout}ms.`, runId); } @@ -1497,10 +1525,12 @@ export class Seclai { const current = await this.getAgentRun(runId, opts?.includeStepOutputs ? { includeStepOutputs: true } : undefined, ); + last = current; const status = (current as any).status; if (status === "completed" || status === "failed" || status === "cancelled") { return current; } + if (opts?.returnOnResult && current.result_reported_at) return current; } } diff --git a/src/types.ts b/src/types.ts index b6f8008..1986f35 100644 --- a/src/types.ts +++ b/src/types.ts @@ -155,7 +155,15 @@ export type CreateAgentRequest = Omit< * default to `false` on the server; the generated schema marks them required * only because they declare a default. */ -export type UpdateAgentRequest = Partial; +export type UpdateAgentRequest = Omit< + Partial, + "max_retries" | "retry_on_failure" +> & { + /** @deprecated Has no effect: the API accepts it and ignores it. Evaluations never retry a step. */ + max_retries?: number | null; + /** @deprecated Has no effect: the API accepts it and ignores it. Evaluations never retry a step. */ + retry_on_failure?: boolean | null; +}; /** * Request body for updating an agent definition (steps, model, etc.). @@ -246,9 +254,9 @@ export type EmailTriggerConfigResponse = components["schemas"]["EmailTriggerConf */ export type SetSlackTriggerConfigRequest = components["schemas"]["SetSlackTriggerConfigApiRequest"] & { /** - * @deprecated The API no longer accepts `input` and ignores it. A run's input - * is the text after `/seclai `, or the message the shortcut was used on. - * Set `alias` to choose the name. + * @deprecated The API ignores `input`; use `alias` to choose the name people + * type after `/seclai`. A run's input is the text after `/seclai `, or + * the message the shortcut was used on. */ input?: string | null; }; @@ -527,7 +535,18 @@ export type EvaluationResultResponse = components["schemas"]["EvaluationResultRe export type EvaluationResultListResponse = VersionedList; /** Request body for creating a manual evaluation result. */ -export type CreateEvaluationResultRequest = WithServerDefaults; +export type CreateEvaluationResultRequest = Omit< + WithServerDefaults, + "retry_count" | "retry_triggered" +> & { + /** @deprecated Has no effect on any count. */ + retry_count?: number; + /** + * @deprecated Retired: evaluations never retry a step. `true` returns HTTP 400 + * from `Seclai-Version` `2026-11-04`. + */ + retry_triggered?: boolean; +}; /** Summary of evaluation results for a criteria. */ export type EvaluationResultSummaryResponse = components["schemas"]["EvaluationResultSummaryResponse"]; diff --git a/tests/client.test.ts b/tests/client.test.ts index 9f7aa20..ceda413 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -10,7 +10,7 @@ import { SeclaiStreamingError, SeclaiApiVersion, } from "../src/index"; -import type { SetAcceptedAttachmentsRequest, SetMetadataKeysRequest, SetSlackTriggerConfigRequest } from "../src/index"; +import type { SetAcceptedAttachmentsRequest, SetSlackTriggerConfigRequest } from "../src/index"; import { parseIni, isTokenValid } from "../src/auth"; type RecordedRequest = { @@ -480,6 +480,53 @@ describe("Streaming", () => { await client.runStreamingAgentAndWait("ag_1", body); expect(bodies).toEqual([{ input: "hi" }]); }); + + const reportedRun = { run_id: "run_1", status: "running", output: "answer", result_reported_at: "2026-11-05T00:00:00Z" }; + + test("runStreamingAgentAndWait returns the result snapshot when the stream ends before done", async () => { + const client = makeClient((req) => + makeSseResponse( + [ + `event: init\ndata: ${JSON.stringify({ run_id: "run_1", status: "pending" })}\n\n`, + `event: result\ndata: ${JSON.stringify(reportedRun)}\n\n`, + ], + { signal: req.signal }, + ), + ); + const result = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 5_000 }); + expect(result).toEqual(reportedRun); + }); + + test("runStreamingAgentAndWait returns the result snapshot on timeout before done", async () => { + const encoder = new TextEncoder(); + const client = makeClient((req) => { + // Sends init and result, then stays open until the timeout aborts it. + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(`event: init\ndata: ${JSON.stringify({ run_id: "run_1", status: "pending" })}\n\n`)); + controller.enqueue(encoder.encode(`event: result\ndata: ${JSON.stringify(reportedRun)}\n\n`)); + req.signal?.addEventListener("abort", () => controller.error(new Error("aborted")), { once: true }); + }, + }); + return new Response(stream as any, { status: 200, headers: { "content-type": "text/event-stream" } }); + }); + const result = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 20 }); + expect(result).toEqual(reportedRun); + }); + + test("runStreamingAgentAndWait returns done over an earlier result", async () => { + const done = { run_id: "run_1", status: "completed", output: "answer", credits: 1 }; + const client = makeClient((req) => + makeSseResponse( + [ + `event: result\ndata: ${JSON.stringify(reportedRun)}\n\n`, + `event: done\ndata: ${JSON.stringify(done)}\n\n`, + ], + { signal: req.signal }, + ), + ); + expect(await client.runStreamingAgentAndWait("ag_1", { input: "hi" })).toEqual(done); + }); }); // ───────────────────────────────────────────────────────────────────────────── @@ -508,6 +555,41 @@ describe("Polling", () => { }); expect((result as any).status).toBe("completed"); }); + + const reportedRun = { id: "run_1", status: "running", output: "answer", result_reported_at: "2026-11-05T00:00:00Z" }; + + test("runAgentAndPoll returns a run with result_reported_at on timeout", async () => { + const client = makeClient((req) => + req.method === "POST" ? jsonResponse({ id: "run_1", status: "pending" }) : jsonResponse(reportedRun), + ); + const result = await client.runAgentAndPoll("ag_1", { input: "hi" }, { pollIntervalMs: 5, timeoutMs: 30 }); + expect(result).toEqual(reportedRun); + }); + + test("runAgentAndPoll still throws on timeout without result_reported_at", async () => { + const client = makeClient((req) => + jsonResponse({ id: "run_1", status: req.method === "POST" ? "pending" : "running", result_reported_at: null }), + ); + await expect( + client.runAgentAndPoll("ag_1", { input: "hi" }, { pollIntervalMs: 5, timeoutMs: 30 }), + ).rejects.toBeInstanceOf(SeclaiStreamingError); + }); + + test("runAgentAndPoll with returnOnResult returns once result_reported_at is set", async () => { + let gets = 0; + const client = makeClient((req) => { + if (req.method === "POST") return jsonResponse({ id: "run_1", status: "pending" }); + gets++; + return jsonResponse(gets === 1 ? reportedRun : { ...reportedRun, status: "completed" }); + }); + const result = await client.runAgentAndPoll("ag_1", { input: "hi" }, { + pollIntervalMs: 5, + timeoutMs: 5_000, + returnOnResult: true, + }); + expect(result).toEqual(reportedRun); + expect(gets).toBe(1); + }); }); // ───────────────────────────────────────────────────────────────────────────── @@ -2519,17 +2601,13 @@ describe("Agent Trigger Metadata Keys", () => { }); test("setMetadataKeys sends PUT /agents/:id/triggers/:tid/metadata-keys with the declaration", async () => { + const bodies: unknown[] = []; 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/metadata-keys"); expect(u.search).toBe(""); - expect(JSON.parse(req.bodyText!)).toEqual({ - metadata_keys: [ - { key: "customer_id", origin: "custom", required: true }, - { key: "region", origin: "custom" }, - ], - }); + bodies.push(JSON.parse(req.bodyText!)); return jsonResponse({ ...keysResponse, warnings: ["Caller agent no longer fits"] }); }); // `required` is server-defaulted, so a key without it must typecheck. @@ -2540,18 +2618,17 @@ describe("Agent Trigger Metadata Keys", () => { ], }); expect(res.warnings).toEqual(["Caller agent no longer fits"]); - }); - - test("SetMetadataKeysRequest accepts a key without required, and an empty declaration", async () => { - const bodies: unknown[] = []; - const client = makeClient((req) => { - bodies.push(JSON.parse(req.bodyText!)); - return jsonResponse({ ...keysResponse, metadata_keys: [] }); - }); - const body: SetMetadataKeysRequest = { metadata_keys: [{ key: "source_url", origin: "source" }] }; - await client.setMetadataKeys("ag_1", "tr_1", body); + // An empty declaration is sent as-is. await client.setMetadataKeys("ag_1", "tr_1", { metadata_keys: [] }); - expect(bodies).toEqual([{ metadata_keys: [{ key: "source_url", origin: "source" }] }, { metadata_keys: [] }]); + expect(bodies).toEqual([ + { + metadata_keys: [ + { key: "customer_id", origin: "custom", required: true }, + { key: "region", origin: "custom" }, + ], + }, + { metadata_keys: [] }, + ]); }); }); From 27a5d5460722d542d5dc36028fdd07d90428dd47 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 16:36:24 -0800 Subject: [PATCH 07/20] Squashed '.claude/skills/seclai-sdk-sync/' changes from 7b225d4..37a397d 37a397d Addressed review comments a08b53f Addressed review comments 2ee73d8 Addressed review comments 39b0862 Fixed C# sync findings git-subtree-dir: .claude/skills/seclai-sdk-sync git-subtree-split: 37a397db1b640e7674aff2359cb1c04a0c898fda --- SKILL.md | 13 +++++++------ sdksync.py | 34 +++++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/SKILL.md b/SKILL.md index 4b536d9..ef619c2 100644 --- a/SKILL.md +++ b/SKILL.md @@ -240,12 +240,13 @@ or `generated/` is compared by its fields, so re-pointing it at a struct with the same fields is not seen either; if the old target is removed, its REMOVED line still catches that. An alias to a struct in another package (`type File = openapi_types.File`) is compared by its target's name only. Tags and comments -are ignored, in nested structs too. A struct it cannot read, or one embedding an -unexported struct, is UNREADABLE, as for a method head. Methods on generated -types (union accessors such as `AsValidationErrorLoc0`) are not read. It found -one shipped break: v1.8.0 renamed `generated.InsufficientCreditsDetail.Error` -and `generated.InsufficientCreditsResponse.Detail`. C# has the same blind spot -for model properties, and it is not covered. +are ignored; in a nested struct only backtick tags are, the form oapi-codegen +writes. A struct it cannot read, or one embedding an unexported struct, is +UNREADABLE, as for a method head. Methods on generated types (union accessors +such as `AsValidationErrorLoc0`) are not read. It found one shipped break: +v1.8.0 renamed `generated.InsufficientCreditsDetail.Error` and +`generated.InsufficientCreditsResponse.Detail`. C# has the same blind spot for +model properties, and it is not covered. 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 689edef..02b6529 100755 --- a/sdksync.py +++ b/sdksync.py @@ -2285,8 +2285,11 @@ def _go_package_texts(repo: Path, rev: str | None, sub: str) -> list[str]: def _go_struct_members(body: str) -> list[str] | None: - """A struct body split into its field declarations, at depth 0: a nested - `struct { ... }` or `map[K]V` stays one member. None when it does not balance.""" + """A struct body (or `const`/`var` block) split into its declarations at + depth 0: a nested `struct { ... }` or `map[K]V` stays one member. A line + break splits only where Go would end the statement (after an identifier, + literal, `)`, `]` or `}`), so `"a" +` continues onto the next line. None + when it does not balance.""" out, cur, depth, j = [], [], 0, 0 while j < len(body): ch = body[j] @@ -2303,11 +2306,16 @@ def _go_struct_members(body: str) -> list[str] | None: depth -= 1 if depth < 0: return None - if ch in "\n;" and depth == 0: - out.append("".join(cur).strip()) - cur = [] - else: - cur.append(ch) + if depth == 0 and ch in "\n;": + member = "".join(cur) + tail = member.rstrip() + if (ch == ";" or not tail or tail[-1].isalnum() or tail[-1] in "_\"'`)]}" + or tail.endswith(("++", "--")) or re.search(r"(? tuple[dict[str, dict[str, str] | str], list[s to the alias target string (`generated.X`) for `type A = B`, to "type T" for any other type (`type Scope string` -> "type string"), and to "const T" / "var T" for a package constant or variable, T its declared type - if any. A struct tag is dropped, nested ones too: retagging - changes the wire, not what compiles. An embedded field is named by its type, + if any. A struct tag is dropped, and a nested struct's backtick tags too: + retagging changes the wire, not what compiles. An embedded field is named by its type, as Go names it. A struct whose body does not balance, holds a member read as neither a field nor an embedding, or embeds an unexported struct (whose promoted fields this scan cannot list) is unreadable. @@ -2335,7 +2343,7 @@ def go_struct_fields(text: str) -> tuple[dict[str, dict[str, str] | str], list[s kind = m.group(1) if m.group(2): body = balanced_slice(text, m.end() - 1, "(", ")") - members = _go_struct_members(body[1:-1]) if body is not None else None + members = _go_struct_members(body) if body is not None else None if members is None: unreadable.append(f"{kind} ( ... ) block") continue @@ -2344,7 +2352,11 @@ def go_struct_fields(text: str) -> tuple[dict[str, dict[str, str] | str], list[s last = "" for mem in members: left, eq, _ = mem.partition("=") - names, typ = re.match(r"\s*([\w\s,]*?\w)(?:\s+([^,\s].*?))?\s*$", left).groups() + head = re.match(r"\s*([\w\s,]*?\w)(?:\s+([^,\s].*?))?\s*$", left) + if head is None: # no name before the type or `=` + unreadable.append(f"{kind} ( ... ) block" if m.group(2) else f"{kind} {left.strip()}") + break + names, typ = head.groups() if kind == "const" and not eq and not typ: typ = last # Go repeats the previous spec's type and value last = typ or "" From 9aa86e677602362eaa640d4a80e93fa7de8d6586 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 18:56:52 -0800 Subject: [PATCH 08/20] Addressed review comments --- CHANGELOG.md | 6 +- README.md | 60 +++++++++++-- src/client.ts | 140 ++++++++++++++++++++++-------- src/errors.ts | 17 +++- src/types.ts | 2 +- tests/client.test.ts | 197 ++++++++++++++++++++++++++++++++++++++++--- 6 files changed, 360 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af5b8f8..669e397 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,6 @@ - Sync the bundled OpenAPI spec and regenerate the types. Existing responses gain properties: `result_reported_at` on `AgentRunResponse`, set once the run's answer is in `output`, and `alias` on `SlackTriggerConfigResponse` - Move `SeclaiApiVersion.Latest` to `2026-11-04`. Nothing is sent unless `apiVersion` is set, so a client that passes `SeclaiApiVersion.Latest` now opts into `2026-11-04`. From `2026-11-02`, `updateAgentDefinition()`, and `updateAgent()` when it sets `sampling_config`, refuse a definition or sampling rule that references a metadata key no trigger declares (with a 400 and a 422 respectively), where older versions declare the key as optional; from `2026-11-04`, `createEvaluationResult()` rejects `retry_triggered: true`, `updateAgent()` rejects `evaluation_mode` `eval_and_retry`, and `createEvaluationCriteria()` and `updateEvaluationCriteria()` reject a `step_id` that does not name a `display_result` or `streaming_result` step, each with a 400 - Note API changes that apply on every API version, whatever `apiVersion` is set: a run started with `runAgent()`, `runStreamingAgent()` or the helpers built on them is refused with a 400 when its `metadata` sends a custom key the trigger does not declare, or lacks a required one, so declare custom keys with `setMetadataKeys()` before sending them; `updateAgentDefinition()` rejects a definition holding a `gate` or `retry` step (use `if_else`, or `repeat_until` to run steps again until a condition holds); the `agent_eval_fail` rollback trigger is accepted and never fires, and the default rollback triggers no longer include it; `max_retries` and `retry_on_failure` on `updateAgent()` are accepted and have no effect; and `evaluation_mode` on `AgentSummaryResponse` defaults to `sample_and_flag` instead of `eval_and_retry` -- Return the `result` event's snapshot from `runStreamingAgentAndWait()` when the stream ends, or `timeoutMs` elapses, after a `result` event but before `done`, instead of throwing. Its `output` is the run's answer; `done` is still returned when it arrives -- Return the last polled run from `runAgentAndPoll()` when `timeoutMs` elapses and that run has `result_reported_at` set, instead of throwing `SeclaiStreamingError` - Mark `input` on `SetSlackTriggerConfigRequest` deprecated. The API ignores it: a Slack run's input is the text after `/seclai `, or the message the shortcut was used on. It stays on the type so existing calls still compile - Mark `max_retries` and `retry_on_failure` on `UpdateAgentRequest`, and `retry_count` and `retry_triggered` on `CreateEvaluationResultRequest`, deprecated. They have no effect, and from `2026-11-04` `retry_triggered: true` returns a 400. They stay on the types so existing calls still compile @@ -17,7 +15,9 @@ - Add `getMetadataKeys()` and `setMetadataKeys()` to read and replace the run metadata keys an agent trigger declares, which steps reference as `{{metadata.}}`. A key's `required` defaults to `false` and can be omitted - Add `getKnowledgeBaseMetadataKeyStats()` to see which item-metadata keys a knowledge base's content carries, with item counts and top values for all time and the last 30 and 7 days - Accept `alias` on `setSlackTriggerConfig()`, the name people type after `/seclai` to run the agent -- Add the `returnOnResult` option to `runAgentAndPoll()`, to return as soon as a polled run has `result_reported_at` set, without waiting for later steps +- Add the `returnOnResult` option to `runAgentAndPoll()` and `runStreamingAgentAndWait()`, to return as soon as a run has `result_reported_at` set (from `runAgent()` or a poll), or a `result` event arrives, without waiting for later steps. The run may still be in progress and can still fail +- Add the `throwOnIncomplete` option to `runStreamingAgentAndWait()`, to throw `SeclaiStreamingError`, with the latest snapshot in `run`, when the stream ends or breaks before `done`, instead of returning a run that has not finished or throwing the fetch error. It will become the default in the next major version +- Add `run` to `SeclaiStreamingError`: the latest snapshot of the unfinished run when `runStreamingAgentAndWait()` or `runAgentAndPoll()` gives up, so a reported answer in `output` is not lost - Add the `SeclaiApiVersion.V2026_11_02` and `SeclaiApiVersion.V2026_11_04` constants, so those versions are accepted as `apiVersion` - Add the type exports `MetadataOrigin`, `MetadataKeyDeclaration`, `MetadataKeyDeclarationInput`, `SetMetadataKeysRequest`, `DeclarableMetadataKey`, `MetadataKeysResponse`, `KnowledgeBaseMetadataKeyStatsResponse`, `MetadataKeyWindowResponse`, `MetadataKeyCountResponse` and `MetadataValueCountResponse` diff --git a/README.md b/README.md index 17583e1..d50714d 100644 --- a/README.md +++ b/README.md @@ -361,16 +361,24 @@ await client.deleteAgentRun("run_id"); The SDK provides two streaming patterns over the SSE `/runs/stream` endpoint: -**Block until done** — returns the final `done` payload. If the stream ends or -`timeoutMs` elapses after a `result` event but before `done`, it returns the -`result` snapshot, whose `output` is the run's answer; with neither, it throws -`SeclaiStreamingError`: +**Block until done** — returns the run from the `done` event. If `timeoutMs` +elapses first, it throws `SeclaiStreamingError`, whose `run` holds the latest +snapshot: the `result` snapshot if one arrived, else the `init` snapshot. An +abort through `signal` rethrows the abort error. + +By default, a stream that ends before `done` returns the latest snapshot when +its status is not `pending`, so the run returned may not have finished: check +`status` and `result_reported_at`. A stream that breaks throws the fetch error. +Pass `throwOnIncomplete: true` to throw `SeclaiStreamingError`, with the snapshot +in `run`, in both cases instead. It is recommended, and becomes the default in +the next major version: + ```ts const result = await client.runStreamingAgentAndWait( "agent_id", { input: "Hello", metadata: {} }, - { timeoutMs: 60_000 }, + { timeoutMs: 60_000, throwOnIncomplete: true }, ); ``` @@ -387,9 +395,39 @@ for await (const event of client.runStreamingAgent( } ``` +When the server answers with plain JSON instead of an SSE stream, +`runStreamingAgent` yields only a `done` event, so read the answer from it. + A `result` event carries the run's answer in `output` once `result_reported_at` is set. It comes before `done`, and for an agent that reports its result early it -can arrive while later steps still run. +can arrive while later steps still run. Pass `returnOnResult: true` to +`runStreamingAgentAndWait` to return that `result` snapshot without waiting for +`done`. Such a run may still be in progress: its `status` is not terminal and the +run can still fail, so check `result_reported_at`, not `status`: + + +```ts +const run = await client.runStreamingAgentAndWait("agent_id", { input: "Hello" }, { returnOnResult: true }); +if (run.result_reported_at) console.log(run.output); +``` + +On a timeout, or with `throwOnIncomplete` on a cut stream, read the answer, if +one was reported, from the error's `run`: + +```ts +import { SeclaiStreamingError } from "@seclai/sdk"; + +try { + const run = await client.runStreamingAgentAndWait("agent_id", { input: "Hello" }, { throwOnIncomplete: true }); + console.log(run.output); +} catch (err) { + if (err instanceof SeclaiStreamingError && err.run?.result_reported_at) { + console.log("Answer, run not finished:", err.run.output); + } else { + throw err; + } +} +``` Pass `include_reasoning: true` to also receive `stream_reasoning` events carrying the model's reasoning while it thinks. They are sent only for a @@ -420,9 +458,13 @@ const result = await client.runAgentAndPoll( A run's answer can be ready before its last step finishes: once `result_reported_at` is set on `getAgentRun()`, `output` holds the answer. Pass -`returnOnResult: true` to return as soon as a polled run has it set. On timeout, -a last polled run that has it set is returned instead of throwing -`SeclaiStreamingError`. +`returnOnResult: true` to return as soon as a run has it set, the one +`runAgent()` returns included. With `includeStepOutputs`, that first check uses a +`getAgentRun()` fetched at once instead, because the `runAgent()` response +carries no step outputs. Such a run may still be in progress: its `status` +is not terminal and the run can still fail, so check `result_reported_at`, not +`status`. If `timeoutMs` elapses first, it throws `SeclaiStreamingError` with the +last polled run in `run`. ```ts diff --git a/src/client.ts b/src/client.ts index 29ebbf8..f52b65e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1199,22 +1199,65 @@ export class Seclai { * returns no `stream_reasoning` events. * * A `result` event carries the run's answer in `output` once - * `result_reported_at` is set, and can arrive while later steps still run. If - * the stream ends or `timeoutMs` elapses after a `result` event but before - * `done`, that `result` snapshot is returned instead of throwing. + * `result_reported_at` is set, and can arrive while later steps still run. + * Pass `returnOnResult: true` to return that `result` snapshot as soon as it + * arrives, without waiting for `done`. Such a run may still be in progress: + * its `status` is not terminal and the run can still fail, so check + * `result_reported_at`, not `status`. + * + * If `timeoutMs` elapses, this throws {@link SeclaiStreamingError} with the + * latest snapshot in `run`: the `result` snapshot if one arrived, else the + * `init` snapshot. An abort from `signal` rethrows the abort error. + * + * By default, a stream that ends before `done` returns the latest snapshot + * when its status is not `pending`, so the run returned may not have + * finished: check `status` and `result_reported_at`. A stream that breaks + * throws the fetch error. Pass `throwOnIncomplete: true` to throw + * {@link SeclaiStreamingError} with the snapshot in `run` in both cases + * instead; it is recommended, and becomes the default in the next major + * version. * * @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, or the `result` - * snapshot when `done` does not arrive. - * @throws {@link SeclaiStreamingError} If the stream ends, or `timeoutMs` - * elapses, before a `done` or `result` event. + * @param opts - Timeout, abort signal and `returnOnResult` options. + * @returns The run from the `done` event; with `returnOnResult`, the + * `result` snapshot; without `throwOnIncomplete`, possibly an unfinished + * snapshot (see above). + * @throws {@link SeclaiStreamingError} If `timeoutMs` elapses, or, with + * `throwOnIncomplete`, the stream ends or breaks, before the run finished. + * Its `run` holds the latest snapshot. + * + * @example + * ```ts + * try { + * const run = await client.runStreamingAgentAndWait("agent-id", { input: "Hello" }, { throwOnIncomplete: true }); + * console.log(run.output); + * } catch (err) { + * if (err instanceof SeclaiStreamingError && err.run?.result_reported_at) { + * console.log("Answer (run not finished):", err.run.output); + * } else throw err; + * } + * ``` */ async runStreamingAgentAndWait( agentId: string, body: Omit, - opts?: { timeoutMs?: number; signal?: AbortSignal }, + opts?: { + timeoutMs?: number; + signal?: AbortSignal; + /** + * Return the `result` snapshot as soon as a `result` event arrives (its + * answer is in `output`), without waiting for `done` (default: false). + */ + returnOnResult?: boolean; + /** + * Throw {@link SeclaiStreamingError}, with the latest snapshot in `run`, + * whenever the stream ends or breaks before `done`, instead of returning + * an unfinished run or throwing the fetch error (default: false). This + * becomes the default in the next major version. + */ + throwOnIncomplete?: boolean; + }, ): Promise { // Not sent even from untyped callers: the reasoning events are discarded here. const { include_reasoning: _ignored, ...runBody } = body as AgentRunStreamRequest; @@ -1300,26 +1343,48 @@ export class Seclai { } }); - while (!final) { - const { value, done } = await reader.read(); - if (done) break; - if (value) parser.feed(decoder.decode(value, { stream: true })); + let readFailure: string | undefined; + try { + while (!final && !(opts?.returnOnResult && reported)) { + const { value, done } = await reader.read(); + if (done) break; + if (value) parser.feed(decoder.decode(value, { stream: true })); + } + } catch (err) { + // The caller asked to stop: keep the abort error. Without + // throwOnIncomplete, a broken read throws the fetch error, as released. + if (opts?.signal?.aborted || (!opts?.throwOnIncomplete && !timedOut)) throw err; + readFailure = err instanceof Error ? err.message : String(err); } + // Dispatch an event whose terminating blank line has not arrived. + parser.feed(decoder.decode()); parser.end(); if (final) return final; - if (lastSeen && (lastSeen as any).status && (lastSeen as any).status !== "pending") { + if (opts?.returnOnResult && reported) { + reader.cancel().catch(() => {}); + return reported; + } + // Released behaviour without throwOnIncomplete: the stream ended early. + if (!opts?.throwOnIncomplete && !timedOut && lastSeen?.status && lastSeen.status !== "pending") { return lastSeen; } - throw new SeclaiStreamingError("Stream ended before receiving a 'done' event.", lastSeen?.run_id); + const run = reported ?? lastSeen; + const state = reported ? "A result had been reported; see `run`." : "No result had been reported."; + const reason = timedOut + ? `Timed out after ${timeoutMs}ms before the streaming agent run finished.` + : readFailure !== undefined + ? `Stream failed before the run finished: ${readFailure}.` + : "Stream ended before receiving a 'done' event."; + throw new SeclaiStreamingError(`${reason} ${state}`, run?.run_id, run); } catch (err) { - if (timedOut) { - if (reported) return reported; + if (timedOut && !opts?.signal?.aborted && !(err instanceof SeclaiStreamingError)) { throw new SeclaiStreamingError( `Timed out after ${timeoutMs}ms waiting for streaming agent run to complete.`, lastSeen?.run_id, + reported ?? lastSeen, ); } throw err; @@ -1475,16 +1540,23 @@ export class Seclai { * * A run's answer can be ready before its last step finishes: once * `result_reported_at` is set, `output` holds the answer. Pass - * `returnOnResult: true` to return as soon as a polled run has it set. When - * `timeoutMs` elapses and the last polled run has it set, that run is returned - * instead of throwing. + * `returnOnResult: true` to return as soon as a run has it set, the run + * `runAgent()` returns included (with `includeStepOutputs`, the first + * `getAgentRun()` instead, fetched without waiting). Such a run may still be in progress: its + * `status` is not terminal and the run can still fail, so check + * `result_reported_at`, not `status`. + * + * When `timeoutMs` elapses first, this throws {@link SeclaiStreamingError} + * with the last polled run in `run`. If that run has `result_reported_at` + * set, its `output` is the answer. * * @param agentId - Agent identifier. * @param body - Run request payload. * @param opts - Polling configuration and abort signal. - * @returns The terminal agent run, or one with `result_reported_at` set (see above). - * @throws {@link SeclaiStreamingError} On timeout, unless the last polled run - * has `result_reported_at` set. + * @returns The terminal agent run, or, with `returnOnResult`, the first run + * with `result_reported_at` set. + * @throws {@link SeclaiStreamingError} If `timeoutMs` elapses before the run + * finished. Its `run` holds the last polled run. */ async runAgentAndPoll( agentId: string, @@ -1512,25 +1584,27 @@ export class Seclai { const runId = (run as any).id ?? (run as any).run_id; if (!runId) throw new SeclaiError("Agent run response did not contain an id."); - let last: AgentRunResponse | undefined; + // The initial response is checked too: a fast run can already be done. It + // carries no step outputs, so when they are asked for, fetch the run first. + let current = opts?.includeStepOutputs ? await this.getAgentRun(runId, { includeStepOutputs: true }) : run; while (true) { + const status = (current as any).status; + if (status === "completed" || status === "failed" || status === "cancelled") { + return current; + } + if (opts?.returnOnResult && current.result_reported_at) return current; + if (opts?.signal?.aborted) throw new SeclaiError("Polling aborted."); if (Date.now() - startTime > timeout) { - if (last?.result_reported_at) return last; - throw new SeclaiStreamingError(`Polling timed out after ${timeout}ms.`, runId); + const state = current.result_reported_at ? "A result had been reported; see `run`." : "No result had been reported."; + throw new SeclaiStreamingError(`Polling timed out after ${timeout}ms. ${state}`, runId, current); } await new Promise((r) => setTimeout(r, pollInterval)); - const current = await this.getAgentRun(runId, + current = await this.getAgentRun(runId, opts?.includeStepOutputs ? { includeStepOutputs: true } : undefined, ); - last = current; - const status = (current as any).status; - if (status === "completed" || status === "failed" || status === "cancelled") { - return current; - } - if (opts?.returnOnResult && current.result_reported_at) return current; } } diff --git a/src/errors.ts b/src/errors.ts index 36c1fb2..7364d30 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -7,6 +7,8 @@ * handles every SDK error. Narrow to more specific subclasses for finer handling. */ +import type { AgentRunResponse } from "./types"; + /** Base error class for the Seclai SDK. */ export class SeclaiError extends Error { constructor(message: string) { @@ -79,14 +81,25 @@ export class SeclaiAPIValidationError extends SeclaiAPIStatusError { } } -/** Thrown when a streaming operation fails (e.g. stream ends unexpectedly). */ +/** + * Thrown when a streaming operation fails (e.g. stream ends unexpectedly), or + * when a run helper stops waiting before the run finished. + */ export class SeclaiStreamingError extends SeclaiError { /** The run ID associated with the failed stream, when available. */ public readonly runId: string | undefined; + /** + * The latest snapshot of the unfinished run, when one was received: the + * `result` snapshot if one arrived (its `output` is the run's answer), else + * the `init` snapshot, or the last polled run. The run may still be in + * progress, and can still fail. + */ + public readonly run: AgentRunResponse | undefined; - constructor(message: string, runId?: string) { + constructor(message: string, runId?: string, run?: AgentRunResponse) { super(message); this.name = "SeclaiStreamingError"; this.runId = runId; + this.run = run; } } diff --git a/src/types.ts b/src/types.ts index 1986f35..15b8b93 100644 --- a/src/types.ts +++ b/src/types.ts @@ -536,7 +536,7 @@ export type EvaluationResultListResponse = VersionedList, + WithServerDefaults, "retry_count" | "retry_triggered" > & { /** @deprecated Has no effect on any count. */ diff --git a/tests/client.test.ts b/tests/client.test.ts index ceda413..625b119 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -10,7 +10,7 @@ import { SeclaiStreamingError, SeclaiApiVersion, } from "../src/index"; -import type { SetAcceptedAttachmentsRequest, SetSlackTriggerConfigRequest } from "../src/index"; +import type { SetAcceptedAttachmentsRequest, SetMetadataKeysRequest, SetSlackTriggerConfigRequest } from "../src/index"; import { parseIni, isTokenValid } from "../src/auth"; type RecordedRequest = { @@ -483,7 +483,19 @@ describe("Streaming", () => { const reportedRun = { run_id: "run_1", status: "running", output: "answer", result_reported_at: "2026-11-05T00:00:00Z" }; - test("runStreamingAgentAndWait returns the result snapshot when the stream ends before done", async () => { + const initRun = { run_id: "run_1", status: "running" }; + + test("runStreamingAgentAndWait with throwOnIncomplete throws with the init snapshot when the stream ends after init only", async () => { + const client = makeClient((req) => + makeSseResponse([`event: init\ndata: ${JSON.stringify(initRun)}\n\n`], { signal: req.signal }), + ); + const err = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 5_000, throwOnIncomplete: true }).catch((e) => e); + expect(err).toBeInstanceOf(SeclaiStreamingError); + expect(err.run).toEqual(initRun); + expect(err.message).toContain("No result had been reported"); + }); + + test("runStreamingAgentAndWait with throwOnIncomplete throws with the result snapshot when the stream ends before done", async () => { const client = makeClient((req) => makeSseResponse( [ @@ -493,25 +505,129 @@ describe("Streaming", () => { { signal: req.signal }, ), ); - const result = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 5_000 }); - expect(result).toEqual(reportedRun); + const err = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 5_000, throwOnIncomplete: true }).catch((e) => e); + expect(err).toBeInstanceOf(SeclaiStreamingError); + expect(err.run).toEqual(reportedRun); + expect(err.runId).toBe("run_1"); + expect(err.message).toContain("A result had been reported"); }); - test("runStreamingAgentAndWait returns the result snapshot on timeout before done", async () => { + test("runStreamingAgentAndWait with throwOnIncomplete throws with the result snapshot on timeout, dispatching a buffered event", async () => { const encoder = new TextEncoder(); const client = makeClient((req) => { - // Sends init and result, then stays open until the timeout aborts it. + // Sends init and a result missing its blank line, then stays open until the timeout aborts it. const stream = new ReadableStream({ start(controller) { - controller.enqueue(encoder.encode(`event: init\ndata: ${JSON.stringify({ run_id: "run_1", status: "pending" })}\n\n`)); - controller.enqueue(encoder.encode(`event: result\ndata: ${JSON.stringify(reportedRun)}\n\n`)); + controller.enqueue(encoder.encode(`event: init\ndata: ${JSON.stringify(initRun)}\n\n`)); + controller.enqueue(encoder.encode(`event: result\ndata: ${JSON.stringify(reportedRun)}\n`)); req.signal?.addEventListener("abort", () => controller.error(new Error("aborted")), { once: true }); }, }); return new Response(stream as any, { status: 200, headers: { "content-type": "text/event-stream" } }); }); - const result = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 20 }); + const err = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 20, throwOnIncomplete: true }).catch((e) => e); + expect(err).toBeInstanceOf(SeclaiStreamingError); + expect(err.message).toContain("Timed out after 20ms"); + expect(err.run).toEqual(reportedRun); + }); + + test("runStreamingAgentAndWait with throwOnIncomplete throws with the init snapshot when the stream breaks", async () => { + const encoder = new TextEncoder(); + const client = makeClient(() => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(`event: init\ndata: ${JSON.stringify(initRun)}\n\n`)); + setTimeout(() => controller.error(new TypeError("connection reset")), 5); + }, + }); + return new Response(stream as any, { status: 200, headers: { "content-type": "text/event-stream" } }); + }); + const err = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 5_000, throwOnIncomplete: true }).catch((e) => e); + expect(err).toBeInstanceOf(SeclaiStreamingError); + expect(err.message).toContain("connection reset"); + expect(err.run).toEqual(initRun); + }); + + // Without throwOnIncomplete, each ending keeps its 1.8.0 behaviour. + test("runStreamingAgentAndWait by default returns a non-pending snapshot when the stream ends before done", async () => { + const client = makeClient((req) => + makeSseResponse([`event: init\ndata: ${JSON.stringify(initRun)}\n\n`], { signal: req.signal }), + ); + expect(await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 5_000 })).toEqual(initRun); + }); + + test("runStreamingAgentAndWait by default throws the fetch error when the stream breaks", async () => { + const encoder = new TextEncoder(); + const reset = new TypeError("connection reset"); + const client = makeClient(() => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(`event: init\ndata: ${JSON.stringify(initRun)}\n\n`)); + setTimeout(() => controller.error(reset), 5); + }, + }); + return new Response(stream as any, { status: 200, headers: { "content-type": "text/event-stream" } }); + }); + const err = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 5_000 }).catch((e) => e); + expect(err).toBe(reset); + }); + + test("runStreamingAgentAndWait by default throws SeclaiStreamingError with the snapshot on timeout", async () => { + const encoder = new TextEncoder(); + const client = makeClient((req) => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(`event: init\ndata: ${JSON.stringify(initRun)}\n\n`)); + req.signal?.addEventListener("abort", () => controller.error(new Error("aborted")), { once: true }); + }, + }); + return new Response(stream as any, { status: 200, headers: { "content-type": "text/event-stream" } }); + }); + const err = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 20 }).catch((e) => e); + expect(err).toBeInstanceOf(SeclaiStreamingError); + expect(err.runId).toBe("run_1"); + expect(err.run).toEqual(initRun); + }); + + test("runStreamingAgentAndWait rethrows a caller abort after a result", async () => { + const encoder = new TextEncoder(); + const caller = new AbortController(); + const client = makeClient((req) => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(`event: result\ndata: ${JSON.stringify(reportedRun)}\n\n`)); + req.signal?.addEventListener("abort", () => controller.error(new DOMException("aborted", "AbortError")), { once: true }); + setTimeout(() => caller.abort(), 5); + }, + }); + return new Response(stream as any, { status: 200, headers: { "content-type": "text/event-stream" } }); + }); + const err = await client + .runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 5_000, signal: caller.signal }) + .catch((e) => e); + expect(err).not.toBeInstanceOf(SeclaiStreamingError); + expect(err.name).toBe("AbortError"); + }); + + test("runStreamingAgentAndWait with returnOnResult returns the result snapshot without waiting for done", async () => { + const encoder = new TextEncoder(); + let cancelled = false; + const client = makeClient(() => { + // Never sends done and never closes. + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(`event: init\ndata: ${JSON.stringify(initRun)}\n\n`)); + controller.enqueue(encoder.encode(`event: result\ndata: ${JSON.stringify(reportedRun)}\n\n`)); + }, + cancel() { + cancelled = true; + }, + }); + return new Response(stream as any, { status: 200, headers: { "content-type": "text/event-stream" } }); + }); + const result = await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { timeoutMs: 5_000, returnOnResult: true }); expect(result).toEqual(reportedRun); + expect(cancelled).toBe(true); }); test("runStreamingAgentAndWait returns done over an earlier result", async () => { @@ -558,12 +674,52 @@ describe("Polling", () => { const reportedRun = { id: "run_1", status: "running", output: "answer", result_reported_at: "2026-11-05T00:00:00Z" }; - test("runAgentAndPoll returns a run with result_reported_at on timeout", async () => { + test("runAgentAndPoll throws with the last polled run on timeout, even when it has result_reported_at", async () => { const client = makeClient((req) => req.method === "POST" ? jsonResponse({ id: "run_1", status: "pending" }) : jsonResponse(reportedRun), ); - const result = await client.runAgentAndPoll("ag_1", { input: "hi" }, { pollIntervalMs: 5, timeoutMs: 30 }); - expect(result).toEqual(reportedRun); + const err = await client + .runAgentAndPoll("ag_1", { input: "hi" }, { pollIntervalMs: 5, timeoutMs: 30 }) + .catch((e) => e); + expect(err).toBeInstanceOf(SeclaiStreamingError); + expect(err.run).toEqual(reportedRun); + expect(err.message).toContain("A result had been reported"); + }); + + test("runAgentAndPoll returns the initial runAgent() response without polling when it is already finished", async () => { + const completed = { ...reportedRun, status: "completed" }; + for (const [initial, opts] of [ + [reportedRun, { returnOnResult: true }], + [completed, {}], + ] as const) { + let gets = 0; + const client = makeClient((req) => { + if (req.method === "POST") return jsonResponse(initial); + gets++; + return jsonResponse(completed); + }); + const result = await client.runAgentAndPoll("ag_1", { input: "hi" }, { pollIntervalMs: 5, timeoutMs: 5_000, ...opts }); + expect(result).toEqual(initial); + expect(gets).toBe(0); + } + }); + + test("runAgentAndPoll with includeStepOutputs fetches the run before returning a finished initial response", async () => { + const completed = { ...reportedRun, status: "completed" }; + const withSteps = { ...completed, steps: [{ output: "step output" }] }; + const gets: string[] = []; + const client = makeClient((req) => { + if (req.method === "POST") return jsonResponse(completed); + gets.push(new URL(req.url).search); + return jsonResponse(withSteps); + }); + const result = await client.runAgentAndPoll("ag_1", { input: "hi" }, { + pollIntervalMs: 5_000, + timeoutMs: 1_000, + includeStepOutputs: true, + }); + expect(result).toEqual(withSteps); + expect(gets).toEqual(["?include_step_outputs=true"]); }); test("runAgentAndPoll still throws on timeout without result_reported_at", async () => { @@ -2630,6 +2786,17 @@ describe("Agent Trigger Metadata Keys", () => { { metadata_keys: [] }, ]); }); + + test("setMetadataKeys takes a SetMetadataKeysRequest body with a non-custom origin", async () => { + const bodies: unknown[] = []; + const client = makeClient((req) => { + bodies.push(JSON.parse(req.bodyText!)); + return jsonResponse(keysResponse); + }); + const body: SetMetadataKeysRequest = { metadata_keys: [{ key: "source_url", origin: "source" }] }; + await client.setMetadataKeys("ag_1", "tr_1", body); + expect(bodies).toEqual([{ metadata_keys: [{ key: "source_url", origin: "source" }] }]); + }); }); describe("Agent Slack Triggers", () => { @@ -4233,11 +4400,13 @@ describe("Request types", () => { const ref = `components["schemas"]["${name}"]`; if (!types.includes(ref)) continue; // not exported as a request type if (types.includes(`Partial<${ref}>`)) continue; + // Keys an outer Omit, "key" | …> drops are declared + // again by hand, as optional. const wrapped = types.match( - new RegExp(`WithServerDefaults<${ref.replace(/[[\]"]/g, "\\$&")},\\s*([^>]+)>`), + new RegExp(`WithServerDefaults<${ref.replace(/[[\]"]/g, "\\$&")},\\s*([^>]+)>(?:,\\s*([^>]+)>)?`), ); for (const key of defaulted) { - if (!wrapped || !wrapped[1].includes(`"${key}"`)) missing.push(`${name}.${key}`); + if (!wrapped || !`${wrapped[1]} ${wrapped[2] ?? ""}`.includes(`"${key}"`)) missing.push(`${name}.${key}`); } } expect(missing).toEqual([]); From 6ddb442f483685313f258236ba6987b3c282f4eb Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 20:22:35 -0800 Subject: [PATCH 09/20] Addressed review comments --- CHANGELOG.md | 2 +- README.md | 9 +++++---- src/client.ts | 35 ++++++++++++++++++++++++++++------- tests/client.test.ts | 44 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 669e397..3e0b483 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ - Add `getKnowledgeBaseMetadataKeyStats()` to see which item-metadata keys a knowledge base's content carries, with item counts and top values for all time and the last 30 and 7 days - Accept `alias` on `setSlackTriggerConfig()`, the name people type after `/seclai` to run the agent - Add the `returnOnResult` option to `runAgentAndPoll()` and `runStreamingAgentAndWait()`, to return as soon as a run has `result_reported_at` set (from `runAgent()` or a poll), or a `result` event arrives, without waiting for later steps. The run may still be in progress and can still fail -- Add the `throwOnIncomplete` option to `runStreamingAgentAndWait()`, to throw `SeclaiStreamingError`, with the latest snapshot in `run`, when the stream ends or breaks before `done`, instead of returning a run that has not finished or throwing the fetch error. It will become the default in the next major version +- Add the `throwOnIncomplete` option to `runStreamingAgentAndWait()`, to throw `SeclaiStreamingError`, with the latest snapshot in `run`, when the stream ends or breaks before `done`, or the server answers with plain JSON for a run that has not finished, instead of returning a run that has not finished or throwing the fetch error. It will become the default in the next major version - Add `run` to `SeclaiStreamingError`: the latest snapshot of the unfinished run when `runStreamingAgentAndWait()` or `runAgentAndPoll()` gives up, so a reported answer in `output` is not lost - Add the `SeclaiApiVersion.V2026_11_02` and `SeclaiApiVersion.V2026_11_04` constants, so those versions are accepted as `apiVersion` - Add the type exports `MetadataOrigin`, `MetadataKeyDeclaration`, `MetadataKeyDeclarationInput`, `SetMetadataKeysRequest`, `DeclarableMetadataKey`, `MetadataKeysResponse`, `KnowledgeBaseMetadataKeyStatsResponse`, `MetadataKeyWindowResponse`, `MetadataKeyCountResponse` and `MetadataValueCountResponse` diff --git a/README.md b/README.md index d50714d..a85c67b 100644 --- a/README.md +++ b/README.md @@ -370,7 +370,8 @@ By default, a stream that ends before `done` returns the latest snapshot when its status is not `pending`, so the run returned may not have finished: check `status` and `result_reported_at`. A stream that breaks throws the fetch error. Pass `throwOnIncomplete: true` to throw `SeclaiStreamingError`, with the snapshot -in `run`, in both cases instead. It is recommended, and becomes the default in +in `run`, in both cases instead, and also when the server answers with plain +JSON for a run that has not finished. It is recommended, and becomes the default in the next major version: @@ -459,9 +460,9 @@ const result = await client.runAgentAndPoll( A run's answer can be ready before its last step finishes: once `result_reported_at` is set on `getAgentRun()`, `output` holds the answer. Pass `returnOnResult: true` to return as soon as a run has it set, the one -`runAgent()` returns included. With `includeStepOutputs`, that first check uses a -`getAgentRun()` fetched at once instead, because the `runAgent()` response -carries no step outputs. Such a run may still be in progress: its `status` +`runAgent()` returns included. With `includeStepOutputs`, when that run would end +the poll, it is fetched again at once, because the `runAgent()` response carries +no step outputs. Such a run may still be in progress: its `status` is not terminal and the run can still fail, so check `result_reported_at`, not `status`. If `timeoutMs` elapses first, it throws `SeclaiStreamingError` with the last polled run in `run`. diff --git a/src/client.ts b/src/client.ts index f52b65e..95fe4b4 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1252,7 +1252,8 @@ export class Seclai { returnOnResult?: boolean; /** * Throw {@link SeclaiStreamingError}, with the latest snapshot in `run`, - * whenever the stream ends or breaks before `done`, instead of returning + * whenever the stream ends or breaks before `done`, or the server answers + * with plain JSON for a run that has not finished, instead of returning * an unfinished run or throwing the fetch error (default: false). This * becomes the default in the next major version. */ @@ -1317,7 +1318,16 @@ export class Seclai { // If server returned JSON instead of SSE if (isJson) { - return (await response.json()) as AgentRunResponse; + const run = (await response.json()) as AgentRunResponse; + const status = (run as any).status; + const finished = + status === "completed" || status === "failed" || status === "cancelled" || + Boolean(opts?.returnOnResult && run.result_reported_at); + if (opts?.throwOnIncomplete && !finished) { + const state = run.result_reported_at ? "A result had been reported; see `run`." : "No result had been reported."; + throw new SeclaiStreamingError(`The server answered with JSON for a run that has not finished. ${state}`, run.run_id, run); + } + return run; } if (!response.body) { @@ -1357,7 +1367,9 @@ export class Seclai { readFailure = err instanceof Error ? err.message : String(err); } - // Dispatch an event whose terminating blank line has not arrived. + // Flush the decoder, and dispatch an event whose complete lines were read + // but whose terminating blank line has not arrived. Text after the last + // newline is not parsed. parser.feed(decoder.decode()); parser.end(); @@ -1541,8 +1553,8 @@ export class Seclai { * A run's answer can be ready before its last step finishes: once * `result_reported_at` is set, `output` holds the answer. Pass * `returnOnResult: true` to return as soon as a run has it set, the run - * `runAgent()` returns included (with `includeStepOutputs`, the first - * `getAgentRun()` instead, fetched without waiting). Such a run may still be in progress: its + * `runAgent()` returns included (with `includeStepOutputs`, when that run + * would end the poll, it is fetched again at once for its step outputs). Such a run may still be in progress: its * `status` is not terminal and the run can still fail, so check * `result_reported_at`, not `status`. * @@ -1585,8 +1597,17 @@ export class Seclai { if (!runId) throw new SeclaiError("Agent run response did not contain an id."); // The initial response is checked too: a fast run can already be done. It - // carries no step outputs, so when they are asked for, fetch the run first. - let current = opts?.includeStepOutputs ? await this.getAgentRun(runId, { includeStepOutputs: true }) : run; + // carries no step outputs, so when they are asked for and it would end the + // poll, fetch the run first. + let current = run; + if (opts?.includeStepOutputs) { + const status = (run as any).status; + if (status === "completed" || status === "failed" || status === "cancelled" || + (opts.returnOnResult && run.result_reported_at)) { + if (opts.signal?.aborted) throw new SeclaiError("Polling aborted."); + current = await this.getAgentRun(runId, { includeStepOutputs: true }); + } + } while (true) { const status = (current as any).status; if (status === "completed" || status === "failed" || status === "cancelled") { diff --git a/tests/client.test.ts b/tests/client.test.ts index 625b119..61b0e26 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -548,6 +548,20 @@ describe("Streaming", () => { expect(err.run).toEqual(initRun); }); + test("runStreamingAgentAndWait with throwOnIncomplete throws for a JSON reply whose run has not finished", async () => { + const client = makeClient(() => jsonResponse(reportedRun)); + const err = await client + .runStreamingAgentAndWait("ag_1", { input: "hi" }, { throwOnIncomplete: true }) + .catch((e) => e); + expect(err).toBeInstanceOf(SeclaiStreamingError); + expect(err.run).toEqual(reportedRun); + // returnOnResult accepts it, and without either option it is returned as released. + expect( + await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { throwOnIncomplete: true, returnOnResult: true }), + ).toEqual(reportedRun); + expect(await client.runStreamingAgentAndWait("ag_1", { input: "hi" })).toEqual(reportedRun); + }); + // Without throwOnIncomplete, each ending keeps its 1.8.0 behaviour. test("runStreamingAgentAndWait by default returns a non-pending snapshot when the stream ends before done", async () => { const client = makeClient((req) => @@ -722,6 +736,36 @@ describe("Polling", () => { expect(gets).toEqual(["?include_step_outputs=true"]); }); + test("runAgentAndPoll with includeStepOutputs sends no extra GET for a pending initial response", async () => { + let gets = 0; + const client = makeClient((req) => { + if (req.method === "POST") return jsonResponse({ id: "run_1", status: "pending" }); + gets++; + return jsonResponse({ id: "run_1", status: "running" }); + }); + await expect( + client.runAgentAndPoll("ag_1", { input: "hi" }, { pollIntervalMs: 50, timeoutMs: 20, includeStepOutputs: true }), + ).rejects.toBeInstanceOf(SeclaiStreamingError); + expect(gets).toBe(1); + }); + + test("runAgentAndPoll with includeStepOutputs does not fetch after an abort", async () => { + const caller = new AbortController(); + let gets = 0; + const client = makeClient((req) => { + if (req.method === "POST") { + caller.abort(); // while runAgent() is in flight + return jsonResponse({ id: "run_1", status: "completed" }); + } + gets++; + return jsonResponse({ id: "run_1", status: "completed" }); + }); + await expect( + client.runAgentAndPoll("ag_1", { input: "hi" }, { includeStepOutputs: true, signal: caller.signal }), + ).rejects.toThrow("Polling aborted."); + expect(gets).toBe(0); + }); + test("runAgentAndPoll still throws on timeout without result_reported_at", async () => { const client = makeClient((req) => jsonResponse({ id: "run_1", status: req.method === "POST" ? "pending" : "running", result_reported_at: null }), From 8e6c87347be668e02c0db823fc62abb73cc4ed52 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 20:44:27 -0800 Subject: [PATCH 10/20] Addressed review comments --- src/client.ts | 4 ++-- tests/client.test.ts | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/client.ts b/src/client.ts index 95fe4b4..e3cbabc 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1604,8 +1604,8 @@ export class Seclai { const status = (run as any).status; if (status === "completed" || status === "failed" || status === "cancelled" || (opts.returnOnResult && run.result_reported_at)) { - if (opts.signal?.aborted) throw new SeclaiError("Polling aborted."); - current = await this.getAgentRun(runId, { includeStepOutputs: true }); + // After an abort, skip the fetch: the loop returns the start response. + if (!opts.signal?.aborted) current = await this.getAgentRun(runId, { includeStepOutputs: true }); } } while (true) { diff --git a/tests/client.test.ts b/tests/client.test.ts index 61b0e26..5622bda 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -562,6 +562,14 @@ describe("Streaming", () => { expect(await client.runStreamingAgentAndWait("ag_1", { input: "hi" })).toEqual(reportedRun); }); + test("runStreamingAgentAndWait with throwOnIncomplete returns a JSON reply whose run is completed or failed", async () => { + for (const status of ["completed", "failed"]) { + const run = { ...reportedRun, status }; + const client = makeClient(() => jsonResponse(run)); + expect(await client.runStreamingAgentAndWait("ag_1", { input: "hi" }, { throwOnIncomplete: true })).toEqual(run); + } + }); + // Without throwOnIncomplete, each ending keeps its 1.8.0 behaviour. test("runStreamingAgentAndWait by default returns a non-pending snapshot when the stream ends before done", async () => { const client = makeClient((req) => @@ -749,7 +757,7 @@ describe("Polling", () => { expect(gets).toBe(1); }); - test("runAgentAndPoll with includeStepOutputs does not fetch after an abort", async () => { + test("runAgentAndPoll with includeStepOutputs returns a finished start run without fetching after an abort", async () => { const caller = new AbortController(); let gets = 0; const client = makeClient((req) => { @@ -760,9 +768,8 @@ describe("Polling", () => { gets++; return jsonResponse({ id: "run_1", status: "completed" }); }); - await expect( - client.runAgentAndPoll("ag_1", { input: "hi" }, { includeStepOutputs: true, signal: caller.signal }), - ).rejects.toThrow("Polling aborted."); + const result = await client.runAgentAndPoll("ag_1", { input: "hi" }, { includeStepOutputs: true, signal: caller.signal }); + expect(result).toEqual({ id: "run_1", status: "completed" }); expect(gets).toBe(0); }); From 67bec432412b201955f4154d75800ef3690ef162 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 20:50:42 -0800 Subject: [PATCH 11/20] Addressed review comments --- src/client.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client.ts b/src/client.ts index e3cbabc..6d19702 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1562,6 +1562,10 @@ export class Seclai { * with the last polled run in `run`. If that run has `result_reported_at` * set, its `output` is the answer. * + * `signal` is checked between polls. After an abort, a start run that has + * already finished is still returned, without step outputs even when + * `includeStepOutputs` is set; otherwise this throws. + * * @param agentId - Agent identifier. * @param body - Run request payload. * @param opts - Polling configuration and abort signal. @@ -1569,6 +1573,8 @@ export class Seclai { * with `result_reported_at` set. * @throws {@link SeclaiStreamingError} If `timeoutMs` elapses before the run * finished. Its `run` holds the last polled run. + * @throws {@link SeclaiError} `"Polling aborted."` If `signal` is aborted + * before the run finished. */ async runAgentAndPoll( agentId: string, From 8a07c08d2daba681af490ac61224ed6600d0361d Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 21:33:37 -0800 Subject: [PATCH 12/20] Addressed review comments --- CLAUDE.md | 8 ++++++++ src/client.ts | 14 +++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 4d144a0..94a52bd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,5 +1,13 @@ # seclai-javascript +## Changing and reviewing code + +The rules for writing a change (Gate 3, a cold review of your own diff before you +report) and for producing review findings are shared by every SDK repo. They are +vendored from `sdk-tools` with the review-triage skill: + +@.claude/skills/seclai-sdk-review-triage/rules.md + ## 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. diff --git a/src/client.ts b/src/client.ts index 6d19702..826b9bb 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1562,9 +1562,12 @@ export class Seclai { * with the last polled run in `run`. If that run has `result_reported_at` * set, its `output` is the answer. * - * `signal` is checked between polls. After an abort, a start run that has - * already finished is still returned, without step outputs even when - * `includeStepOutputs` is set; otherwise this throws. + * `signal` is checked at the top of each poll, after the check for a run + * that ends the poll. A run that has ended the poll by then, whether the + * start run or a polled one, is returned even after an abort; the start run + * then comes back without step outputs, even when `includeStepOutputs` is + * set. Otherwise an abort throws `SeclaiError("Polling aborted.")`, which is + * not an `AbortError` and does not carry `signal.reason`. * * @param agentId - Agent identifier. * @param body - Run request payload. @@ -1573,8 +1576,9 @@ export class Seclai { * with `result_reported_at` set. * @throws {@link SeclaiStreamingError} If `timeoutMs` elapses before the run * finished. Its `run` holds the last polled run. - * @throws {@link SeclaiError} `"Polling aborted."` If `signal` is aborted - * before the run finished. + * @throws {@link SeclaiError} `"Polling aborted."` If `signal` is aborted and, + * at the next poll's check, the run has not ended the poll. It is not an + * `AbortError` and does not carry `signal.reason`. */ async runAgentAndPoll( agentId: string, From fc4bfa89904b6aa531cf6b6f6ad25b993b8cd51f Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 21:35:17 -0800 Subject: [PATCH 13/20] Updated rules --- CLAUDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 94a52bd..af13c02 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,7 +2,7 @@ ## Changing and reviewing code -The rules for writing a change (Gate 3, a cold review of your own diff before you +The rules for writing a change (the cold-review gate on your own diff before you report) and for producing review findings are shared by every SDK repo. They are vendored from `sdk-tools` with the review-triage skill: From 19af5c030a5ce0c1c3c75016c9f163af61586e7d Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 21:35:46 -0800 Subject: [PATCH 14/20] Squashed '.claude/skills/seclai-changelog/' changes from 65188e7..9c53cbd 9c53cbd Fix where semver messages go git-subtree-dir: .claude/skills/seclai-changelog git-subtree-split: 9c53cbd8681392f472f09d710bcfd37af094b10c --- SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SKILL.md b/SKILL.md index b00eaf5..0b1ad69 100644 --- a/SKILL.md +++ b/SKILL.md @@ -64,13 +64,13 @@ forward. ## Determine the version -Do not guess the next version. These repos only squash-merge. The squash commit's subject is the PR title on a multi-commit PR, or that commit's headline on a single-commit PR, and its body is every branch commit message. Releases are cut by `seclai/github-tag-action` in `.github/workflows/main-build.yaml`, which reads that **squash commit** on `main`: +Do not guess the next version. Releases are cut by `seclai/github-tag-action` in `.github/workflows/main-build.yaml`, which scans the **commit messages** for a bump keyword. The PR title is not scanned: - contains `#major` → major bump - contains `#minor` → minor bump - otherwise → `DEFAULT_BUMP: patch` -The convention is to put `#minor` / `#major` in a branch commit message. It reaches `main` through the squash body, so do not trim the body in the merge dialog. The PR title also counts on a multi-commit PR. A change that adds endpoints needs `#minor` in one of those places, or it ships as a patch and 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 neither a branch commit message nor the PR title carries the keyword. +Put `#minor` / `#major` in a branch commit message; never tell the user that the PR title will do. A change that adds endpoints needs `#minor` in a commit message, or it ships as a patch and 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 no branch commit message carries the keyword. Check `git tag --sort=-v:refname | head -1` for the current latest, then apply the bump. From d9abc261d2043452f74695df208da454e2c081d6 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 21:35:49 -0800 Subject: [PATCH 15/20] Squashed '.claude/skills/seclai-sdk-review-triage/' changes from e45417d..7a14236 7a14236 Updated rules and skills to reduce review churn 70dfef1 Updated rules and skills to reduce review churn git-subtree-dir: .claude/skills/seclai-sdk-review-triage git-subtree-split: 7a14236fd95b8e296bdf10b8263bf7c663066358 --- SKILL.md | 34 ++++++++++++++++++++++--- rules.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 rules.md diff --git a/SKILL.md b/SKILL.md index 2a0a993..9ea8150 100644 --- a/SKILL.md +++ b/SKILL.md @@ -29,6 +29,15 @@ what it ruled out. Weigh every finding against that. A finding that re-opens a decision already made in this PR or an earlier round is answered by citing the decision, not by changing the code back. +**A spec-sync PR changes only what the spec diff changed**, plus backlog the user +agreed to before the review. A Proven finding about behaviour that is already in the +last release goes to an issue, however cheap the fix looks, and the thread links it; +other classes keep their §1 disposition. A Contract finding on prose this PR wrote is +still fixed here. + +**Read `rules.md` next to this file** (each SDK `CLAUDE.md` imports it). Its +cold-review gate runs on your response diff before you reply (§7). + ## 1. Classify each finding | Class | Test | Disposition | @@ -110,6 +119,12 @@ Name the signal, name the requirement or design that is unclear, propose the way out (often: make the failure mode loud, so latent cases become visible false alarms; or split the adjacent work), and let the user decide. +**The default way out is to freeze the mechanism.** When a fix to a mechanism (a +helper's timeout, fallback, retry or error rules) needs a fix, and both changed +behaviour, propose that this PR stop changing it: later findings on it go to one +issue listing every affected repo, and a fix that created a regression is reverted +rather than fixed forward. + After the first round, review only the delta since the last reviewed commit, not `HEAD~1..HEAD` counted by hand. @@ -122,13 +137,22 @@ surface for the next round. If a fix seems to need one, stop and say so. **Do not widen scope to make a test easy.** Supporting a shape no SDK has, because a test needed it, is new work with its own review rounds. +**A fix that adds or changes a mechanism is a new change, not a repair**: a new +option, timeout, fallback, retry, client or error type. Do not write it in answer to +a finding. Write down what it must do for each case (each way a stream or poll ends, +and its outcome, per SDK), agree it with the user, then implement it in every SDK +at once, in its own PR unless the user puts it in this one. Without that, each review round re-derives the design and finds the next +edge case. + **A test added for a finding must fail without the fix.** Undo the fix, watch the -test fail, restore it. Say that you did. +test fail, restore it. Say that you did. That proves the fix does what it says, not +that it is right; when the cold-review gate runs, its Break prompt checks the second. ## 7. Replies and threads -- One reply per thread, posted after the gates pass. The user commits and pushes, - so say the change is in the working tree. +- One reply per thread, posted after lint, tests and the cold-review gate on the + response diff (`rules.md`) pass. The user commits and pushes, so say the change is in + the working tree. - **Resolve only after the user reports the push** and `gh pr view --json headRefOid` shows the new head, and only threads you changed. A pushback, a doubt, or a question for the user stays open unless the user says to @@ -144,7 +168,8 @@ Lead with the class counts and how many findings changed behaviour. For example: "9 findings: 2 proven, 4 latent, 1 contract, 2 opinion; 2 changed behaviour". When none changed behaviour, say so in the first line: that is the stop condition. Then list the pushbacks and doubts before the fixes. Report the classes you assigned, -not the ones the review claimed. End with: +not the ones the review claimed. Say what the cold-review gate found on the +response diff. End with: ``` Findings that change behaviour: N @@ -152,4 +177,5 @@ Sibling SDKs checked: N of 4 — fixed in N Pushed back / asked: N Below the bar: N — said on the thread Fixes verified by undoing them: N of N +Cold-review gate on the response diff: N findings, N changed behaviour | skipped (<10 lines) ``` diff --git a/rules.md b/rules.md new file mode 100644 index 0000000..05e84e6 --- /dev/null +++ b/rules.md @@ -0,0 +1,77 @@ +# Rules for changing and reviewing an SDK repo + +> **Vendored file — do not edit in place.** The canonical copy lives in +> `seclai/sdk-tools` at `skills/seclai-sdk-review-triage/rules.md`. Each SDK +> repo's `CLAUDE.md` imports its own vendored copy. + +Adapted from the `seclai` repo's `CLAUDE.md`. These rules apply to every task in an +SDK repo, whether you are writing the change or reviewing one. In sdk-tools they +arrive through the triage skill, and its own `CLAUDE.md` rules for audit findings +take precedence. The gates before this one are each repo's lint and test targets. + +## The cold-review gate: review your own diff before you report + +**Run it before you report a change as done, and before you draft replies to a +review round.** A reply is a published claim, and the next cold review finds what +this gate skips. Skip it for a diff under ~10 changed lines, and say so. Skip it when +you are a subagent: the agent that reports to the user runs it on the whole diff it +reports, including what subagents wrote. Do not report completion while a subagent +you started is still running. + +Delegate it, scoped to the diff being reported. Subagents get this file but not your +reasoning, and not inheriting your belief is the point. Run four prompts in parallel: + +- **Falsify** each claim your report, replies, CHANGELOG and docs are about to + make. Hand over the claim and the artifact that settles it: the code, the spec, + the last release tag. Never hand over your reasoning. +- **Break** each function you added or changed: "produce an input where these tests + pass and the code is wrong." Point the prompt at what has bitten SDK changes: + - a caller-supplied or replaced `HTTPClient`/transport; + - cancellation versus timeout; + - a cut or partial stream; + - an error from a 4xx (auth) versus a 5xx; + - the released behaviour at the last tag; + - the sync/async twin. +- **Read** the prose and test names you added: "which assert a fact, and is each + one true? Which prevent no wrong action a reader would otherwise take? Those are + deleted. For each that ranges over a set (every, each, never, a count), list the + set from the code and name a member it misses." +- **Trace** what the change does to code it does not touch: "list each caller of + every changed function, and each variant it runs under (overloads, the async + twin, the same helper in the sibling SDKs). Name one whose behaviour, comment, + test or doc sentence the change makes wrong." + +**Passing is reporting what came back, including nothing.** Triage its findings with +`seclai-sdk-review-triage`, the same as a reviewer's. A fix arising here runs the +gate again on that fix. + +**Never predict what the next review round will find.** Report what this gate +found on the diff: "the cold-review gate found no finding that changes behaviour", +or the list it did find. That is a claim about this diff, not about the next round. + +## Producing review findings + +For the agent writing findings, not the author triaging them. + +- **State the evidence each finding carries.** + - *Proven*: you can write a failing test today from input that occurs. + - *Contract*: a published statement is false (README, CHANGELOG, docstring, + comment). + - *Latent*: provably wrong when reached, and you can name the absent condition. + - *Speculative*: hypothesised from code shape. + - *Consequence*: a true statement about an effect elsewhere. +- **Say whether the behaviour is already in the last release.** Check the last tag. + A defect the PR did not introduce is reported as pre-existing; in a spec-sync PR + the author files it as an issue rather than fixing it there. +- **Do not report speculative hardening**, such as "a server could send X", "a + caller could reuse Y", unbounded inputs, races or timing margins. Report a latent + finding only when it would ship a break or a wrong request to consumers. +- **Every finding names a concrete failure**: the input or state, and the wrong + result. If it cannot be stated that way, it is an opinion; say so. +- **Contract means false, not incomplete.** A sentence that leaves something out is + an opinion, unless the omission makes what it says false. +- **Read the PR description and the earlier threads before reporting on code they + cover.** Do not report a finding that reverses a decision recorded there; quote + the decision and argue it, if you must. +- **Terminate on severity, not emptiness.** "No finding that changes behaviour or + the published surface" is decidable, and it is the stopping point. From 41dfe4acff2b9a5f0f04008ba45c133455078b01 Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 22:56:25 -0800 Subject: [PATCH 16/20] Addressed review comments --- CHANGELOG.md | 1 + README.md | 5 +++-- src/client.ts | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e0b483..9f2e1e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Sync the bundled OpenAPI spec and regenerate the types. Existing responses gain properties: `result_reported_at` on `AgentRunResponse`, set once the run's answer is in `output`, and `alias` on `SlackTriggerConfigResponse` - Move `SeclaiApiVersion.Latest` to `2026-11-04`. Nothing is sent unless `apiVersion` is set, so a client that passes `SeclaiApiVersion.Latest` now opts into `2026-11-04`. From `2026-11-02`, `updateAgentDefinition()`, and `updateAgent()` when it sets `sampling_config`, refuse a definition or sampling rule that references a metadata key no trigger declares (with a 400 and a 422 respectively), where older versions declare the key as optional; from `2026-11-04`, `createEvaluationResult()` rejects `retry_triggered: true`, `updateAgent()` rejects `evaluation_mode` `eval_and_retry`, and `createEvaluationCriteria()` and `updateEvaluationCriteria()` reject a `step_id` that does not name a `display_result` or `streaming_result` step, each with a 400 - Note API changes that apply on every API version, whatever `apiVersion` is set: a run started with `runAgent()`, `runStreamingAgent()` or the helpers built on them is refused with a 400 when its `metadata` sends a custom key the trigger does not declare, or lacks a required one, so declare custom keys with `setMetadataKeys()` before sending them; `updateAgentDefinition()` rejects a definition holding a `gate` or `retry` step (use `if_else`, or `repeat_until` to run steps again until a condition holds); the `agent_eval_fail` rollback trigger is accepted and never fires, and the default rollback triggers no longer include it; `max_retries` and `retry_on_failure` on `updateAgent()` are accepted and have no effect; and `evaluation_mode` on `AgentSummaryResponse` defaults to `sample_and_flag` instead of `eval_and_retry` +- Check the `runAgent()` response in `runAgentAndPoll()` before polling, so a run that ended at once is returned without waiting one `pollIntervalMs`. After an abort through `signal` during the start request, that finished run is now returned instead of throwing `Polling aborted.`, and with `includeStepOutputs` it comes back without step outputs. When `timeoutMs` elapses during the start request, that finished run is also returned, where `SeclaiStreamingError` was thrown - Mark `input` on `SetSlackTriggerConfigRequest` deprecated. The API ignores it: a Slack run's input is the text after `/seclai `, or the message the shortcut was used on. It stays on the type so existing calls still compile - Mark `max_retries` and `retry_on_failure` on `UpdateAgentRequest`, and `retry_count` and `retry_triggered` on `CreateEvaluationResultRequest`, deprecated. They have no effect, and from `2026-11-04` `retry_triggered: true` returns a 400. They stay on the types so existing calls still compile diff --git a/README.md b/README.md index a85c67b..e80f8e0 100644 --- a/README.md +++ b/README.md @@ -461,8 +461,9 @@ A run's answer can be ready before its last step finishes: once `result_reported_at` is set on `getAgentRun()`, `output` holds the answer. Pass `returnOnResult: true` to return as soon as a run has it set, the one `runAgent()` returns included. With `includeStepOutputs`, when that run would end -the poll, it is fetched again at once, because the `runAgent()` response carries -no step outputs. Such a run may still be in progress: its `status` +the poll and `signal` is not aborted, it is fetched again at once, because the +`runAgent()` response carries no step outputs; after an abort it comes back +without step outputs. Such a run may still be in progress: its `status` is not terminal and the run can still fail, so check `result_reported_at`, not `status`. If `timeoutMs` elapses first, it throws `SeclaiStreamingError` with the last polled run in `run`. diff --git a/src/client.ts b/src/client.ts index 826b9bb..ea6f2dc 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1553,10 +1553,10 @@ export class Seclai { * A run's answer can be ready before its last step finishes: once * `result_reported_at` is set, `output` holds the answer. Pass * `returnOnResult: true` to return as soon as a run has it set, the run - * `runAgent()` returns included (with `includeStepOutputs`, when that run - * would end the poll, it is fetched again at once for its step outputs). Such a run may still be in progress: its - * `status` is not terminal and the run can still fail, so check - * `result_reported_at`, not `status`. + * `runAgent()` returns included. With `includeStepOutputs`, when that run + * would end the poll, it is fetched again at once for its step outputs. + * Such a run may still be in progress: its `status` is not terminal and the + * run can still fail, so check `result_reported_at`, not `status`. * * When `timeoutMs` elapses first, this throws {@link SeclaiStreamingError} * with the last polled run in `run`. If that run has `result_reported_at` From 028eab3e855a41cb2f72920a4650b34f4169663e Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 23:29:50 -0800 Subject: [PATCH 17/20] Addressed review comments --- CHANGELOG.md | 2 +- README.md | 2 +- src/client.ts | 9 ++++++--- tests/client.test.ts | 12 ++++++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f2e1e1..62c2828 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ - Sync the bundled OpenAPI spec and regenerate the types. Existing responses gain properties: `result_reported_at` on `AgentRunResponse`, set once the run's answer is in `output`, and `alias` on `SlackTriggerConfigResponse` - Move `SeclaiApiVersion.Latest` to `2026-11-04`. Nothing is sent unless `apiVersion` is set, so a client that passes `SeclaiApiVersion.Latest` now opts into `2026-11-04`. From `2026-11-02`, `updateAgentDefinition()`, and `updateAgent()` when it sets `sampling_config`, refuse a definition or sampling rule that references a metadata key no trigger declares (with a 400 and a 422 respectively), where older versions declare the key as optional; from `2026-11-04`, `createEvaluationResult()` rejects `retry_triggered: true`, `updateAgent()` rejects `evaluation_mode` `eval_and_retry`, and `createEvaluationCriteria()` and `updateEvaluationCriteria()` reject a `step_id` that does not name a `display_result` or `streaming_result` step, each with a 400 - Note API changes that apply on every API version, whatever `apiVersion` is set: a run started with `runAgent()`, `runStreamingAgent()` or the helpers built on them is refused with a 400 when its `metadata` sends a custom key the trigger does not declare, or lacks a required one, so declare custom keys with `setMetadataKeys()` before sending them; `updateAgentDefinition()` rejects a definition holding a `gate` or `retry` step (use `if_else`, or `repeat_until` to run steps again until a condition holds); the `agent_eval_fail` rollback trigger is accepted and never fires, and the default rollback triggers no longer include it; `max_retries` and `retry_on_failure` on `updateAgent()` are accepted and have no effect; and `evaluation_mode` on `AgentSummaryResponse` defaults to `sample_and_flag` instead of `eval_and_retry` -- Check the `runAgent()` response in `runAgentAndPoll()` before polling, so a run that ended at once is returned without waiting one `pollIntervalMs`. After an abort through `signal` during the start request, that finished run is now returned instead of throwing `Polling aborted.`, and with `includeStepOutputs` it comes back without step outputs. When `timeoutMs` elapses during the start request, that finished run is also returned, where `SeclaiStreamingError` was thrown +- Check the `runAgent()` response in `runAgentAndPoll()` before polling, so a run that ended at once is returned without waiting one `pollIntervalMs`. After an abort through `signal` during the start request, that run is now returned instead of throwing `Polling aborted.`, and with `includeStepOutputs` it comes back without step outputs. When `timeoutMs` elapses during the start request, that run is also returned, where `SeclaiStreamingError` was thrown - Mark `input` on `SetSlackTriggerConfigRequest` deprecated. The API ignores it: a Slack run's input is the text after `/seclai `, or the message the shortcut was used on. It stays on the type so existing calls still compile - Mark `max_retries` and `retry_on_failure` on `UpdateAgentRequest`, and `retry_count` and `retry_triggered` on `CreateEvaluationResultRequest`, deprecated. They have no effect, and from `2026-11-04` `retry_triggered: true` returns a 400. They stay on the types so existing calls still compile diff --git a/README.md b/README.md index e80f8e0..6230a25 100644 --- a/README.md +++ b/README.md @@ -466,7 +466,7 @@ the poll and `signal` is not aborted, it is fetched again at once, because the without step outputs. Such a run may still be in progress: its `status` is not terminal and the run can still fail, so check `result_reported_at`, not `status`. If `timeoutMs` elapses first, it throws `SeclaiStreamingError` with the -last polled run in `run`. +latest run it has (the `runAgent()` response if no poll ran) in `run`. ```ts diff --git a/src/client.ts b/src/client.ts index ea6f2dc..02d39fb 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1554,12 +1554,14 @@ export class Seclai { * `result_reported_at` is set, `output` holds the answer. Pass * `returnOnResult: true` to return as soon as a run has it set, the run * `runAgent()` returns included. With `includeStepOutputs`, when that run - * would end the poll, it is fetched again at once for its step outputs. + * would end the poll and `signal` is not aborted, it is fetched again at + * once for its step outputs. * Such a run may still be in progress: its `status` is not terminal and the * run can still fail, so check `result_reported_at`, not `status`. * * When `timeoutMs` elapses first, this throws {@link SeclaiStreamingError} - * with the last polled run in `run`. If that run has `result_reported_at` + * with the latest run it has (the `runAgent()` response if no poll ran) in + * `run`. If that run has `result_reported_at` * set, its `output` is the answer. * * `signal` is checked at the top of each poll, after the check for a run @@ -1575,7 +1577,8 @@ export class Seclai { * @returns The terminal agent run, or, with `returnOnResult`, the first run * with `result_reported_at` set. * @throws {@link SeclaiStreamingError} If `timeoutMs` elapses before the run - * finished. Its `run` holds the last polled run. + * finished. Its `run` holds the latest run it has (the `runAgent()` + * response if no poll ran). * @throws {@link SeclaiError} `"Polling aborted."` If `signal` is aborted and, * at the next poll's check, the run has not ended the poll. It is not an * `AbortError` and does not carry `signal.reason`. diff --git a/tests/client.test.ts b/tests/client.test.ts index 5622bda..94591fd 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -773,6 +773,18 @@ describe("Polling", () => { expect(gets).toBe(0); }); + test("runAgentAndPoll returns a finished start run when timeoutMs elapses during the start request", async () => { + const client = makeClient(async (req) => { + if (req.method === "POST") { + await new Promise((r) => setTimeout(r, 40)); + return jsonResponse({ id: "run_1", status: "completed" }); + } + throw new Error("unexpected GET"); + }); + const result = await client.runAgentAndPoll("ag_1", { input: "hi" }, { pollIntervalMs: 5, timeoutMs: 10 }); + expect(result).toEqual({ id: "run_1", status: "completed" }); + }); + test("runAgentAndPoll still throws on timeout without result_reported_at", async () => { const client = makeClient((req) => jsonResponse({ id: "run_1", status: req.method === "POST" ? "pending" : "running", result_reported_at: null }), From 798918e0a4cd61b24d2893c25eec3a7b5d269caa Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 23:44:43 -0800 Subject: [PATCH 18/20] Addressed review comments --- src/client.ts | 2 +- src/errors.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.ts b/src/client.ts index 02d39fb..05cc5ef 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1594,7 +1594,7 @@ export class Seclai { /** Include per-step outputs in the final result. */ includeStepOutputs?: boolean; /** - * Return as soon as a polled run has `result_reported_at` set (its answer is + * Return as soon as a run, the `runAgent()` response included, has `result_reported_at` set (its answer is * in `output`), without waiting for later steps to finish (default: false). */ returnOnResult?: boolean; diff --git a/src/errors.ts b/src/errors.ts index 7364d30..7f5eeb1 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -91,7 +91,7 @@ export class SeclaiStreamingError extends SeclaiError { /** * The latest snapshot of the unfinished run, when one was received: the * `result` snapshot if one arrived (its `output` is the run's answer), else - * the `init` snapshot, or the last polled run. The run may still be in + * the `init` snapshot, or the latest run the poll helper has. The run may still be in * progress, and can still fail. */ public readonly run: AgentRunResponse | undefined; From a2c471ebfd62332a0516930d83c92966339cc5dc Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Thu, 5 Nov 2026 23:56:44 -0800 Subject: [PATCH 19/20] Addressed review comments --- src/client.ts | 5 +++-- src/errors.ts | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client.ts b/src/client.ts index 05cc5ef..bfadb8a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1594,8 +1594,9 @@ export class Seclai { /** Include per-step outputs in the final result. */ includeStepOutputs?: boolean; /** - * Return as soon as a run, the `runAgent()` response included, has `result_reported_at` set (its answer is - * in `output`), without waiting for later steps to finish (default: false). + * Return as soon as a run, the `runAgent()` response included, has + * `result_reported_at` set (its answer is in `output`), without waiting + * for later steps to finish (default: false). */ returnOnResult?: boolean; signal?: AbortSignal; diff --git a/src/errors.ts b/src/errors.ts index 7f5eeb1..5d901f1 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -89,10 +89,9 @@ export class SeclaiStreamingError extends SeclaiError { /** The run ID associated with the failed stream, when available. */ public readonly runId: string | undefined; /** - * The latest snapshot of the unfinished run, when one was received: the - * `result` snapshot if one arrived (its `output` is the run's answer), else - * the `init` snapshot, or the latest run the poll helper has. The run may still be in - * progress, and can still fail. + * Set by `runStreamingAgentAndWait()` and `runAgentAndPoll()` to the latest + * run they had, if any (when it has `result_reported_at` set, its `output` + * is the answer). The run may still be in progress, and can still fail. */ public readonly run: AgentRunResponse | undefined; From b6a975b530a077dc49f009a83523d70566f7fd6a Mon Sep 17 00:00:00 2001 From: Kim Burgaard Date: Fri, 6 Nov 2026 00:50:52 -0800 Subject: [PATCH 20/20] Squashed '.claude/skills/seclai-changelog/' changes from 9c53cbd..acc2e36 acc2e36 Updated skill git-subtree-dir: .claude/skills/seclai-changelog git-subtree-split: acc2e3659aa88562c9dcf8b8cc2e45e113bfcfed --- SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SKILL.md b/SKILL.md index 0b1ad69..638d022 100644 --- a/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` -Put `#minor` / `#major` in a branch commit message; never tell the user that the PR title will do. A change that adds endpoints needs `#minor` in a commit message, or it ships as a patch and 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 no branch commit message carries the keyword. +Put `#minor` / `#major` in a branch commit message; never tell the user that the PR title will do. The keyword reaches `main` in the squash commit's message, so keep it when editing the message in the merge dialog. A change that adds endpoints needs `#minor` in a commit message, or it ships as a patch and 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 no branch commit message carries the keyword. Check `git tag --sort=-v:refname | head -1` for the current latest, then apply the bump.