diff --git a/.claude/rules/wire-ops.md b/.claude/rules/wire-ops.md index e9c8fe78a99..1d36c726d8e 100644 --- a/.claude/rules/wire-ops.md +++ b/.claude/rules/wire-ops.md @@ -13,7 +13,7 @@ paths: - `server/operations/base.py` defines `Operation`, `Role` and `grant_rank`; `server/transport/mcp_primer.py` renders the primer and answers `prompts/*` / `resources/*`; `server/observability/budgets.py::effective_budget_ms` resolves each op's latency budget (runtime and per-consumer overrides). - Nothing below `server/transport/` imports it (`tests/unit/test_transport_layering.py`), and `package_contract_allowlist.txt` only shrinks: fix the import, never add an exception. - Models in `server//api/models_.py` import no handler; the `Operation` and its `OPERATIONS` entry live in `ops_.py`. `server/operations/registry.py` imports each list, and the handler in `server//app/` imports its models at module top. Transports discover ops from the registry; a change that edits transport code to add an op is in the wrong place. -- After any op or field change: `python -m scripts.codegen.` for `sdk_py_gen`, `sdk_py_client_gen`, `sdk_ts_gen`, `sdk_rb_gen`, `sdk_rust_gen`, `sdk_rust_gen --fixtures`, `docs_reference`, `op_reach_census`. Generated SDK files are never edited by hand. +- After any op or field change: `python -m scripts.codegen.` for `sdk_py_gen`, `sdk_py_client_gen`, `sdk_ts_gen`, `sdk_rb_gen`, `sdk_rust_gen`, `sdk_rust_gen --fixtures`, `sdk_go_gen`, `docs_reference`, `op_reach_census`. Generated SDK files are never edited by hand. - Whether an agent calls `memory.set` or `memory.pin` is the model's judgement from the tool description (`server/transport/mcp_descriptions.py`), not a pattern match: change the wording, not a regex. - A field description is what a model reads when it calls the tool: one sentence on what the value does, its unit and its default. - The default MCP `tools/list` has a token ceiling (`test_mcp_listing_budget.py`); a new tool joins the default listing only when an agent needs it without asking. diff --git a/.claude/skills/loom-change/SKILL.md b/.claude/skills/loom-change/SKILL.md index a2a221e2e40..7cbbe3cdd61 100644 --- a/.claude/skills/loom-change/SKILL.md +++ b/.claude/skills/loom-change/SKILL.md @@ -11,7 +11,7 @@ Find the row for the change, read its guide before the first edit, and finish it | Change | Guide | Also in the same PR | | --- | --- | --- | -| Wire op (new, renamed, removed field) | [adding-an-operation](../../../docs/development/adding-an-operation.md) | `python -m scripts.codegen.sdk_py_gen`, `.sdk_py_client_gen`, `.sdk_ts_gen`, `.sdk_rb_gen`, `.sdk_rust_gen`, `.sdk_rust_gen --fixtures`, `.docs_reference`, `.op_reach_census`; unit test + integration test for a read or write path; MCP listing budget if it is listed by default; its dashboard control, or a `NOT_IN_DASHBOARD` reason in `server/operations/dashboard.py` | +| Wire op (new, renamed, removed field) | [adding-an-operation](../../../docs/development/adding-an-operation.md) | `python -m scripts.codegen.sdk_py_gen`, `.sdk_py_client_gen`, `.sdk_ts_gen`, `.sdk_rb_gen`, `.sdk_rust_gen`, `.sdk_rust_gen --fixtures`, `.sdk_go_gen`, `.docs_reference`, `.op_reach_census`; unit test + integration test for a read or write path; MCP listing budget if it is listed by default; its dashboard control, or a `NOT_IN_DASHBOARD` reason in `server/operations/dashboard.py` | | Table or column | [adding-a-table](../../../docs/development/adding-a-table.md) | migration + `make schema-dump`; RMT row builders; `loom.memory_versions` + its view for a `loom.memory` column; erasure step + census row, or a `NO_MEMORY_CONTENT` / `STEP_ONLY_TABLES` entry with its reason; a new table's row in `docs/architecture/storage-layout.md`, its Today cell when the engine, sort key, partition key or TTL changes, its Erasure cell when its census classification changes, its row removed when the table is dropped (with the dump pending, the row test fails until it lands) | | Migration | [migrations](../../../docs/development/migrations.md) | next free number on current `origin/main`; additive only; `make schema-dump` on a private ClickHouse (with none at hand, leave `schemas/schema.sql` unchanged and report the dump as pending; never hand-edit it); written values N-1 tolerates ([rolling upgrades](../../../docs/architecture/rolling-upgrades.md)), `make test-mixed-version` | | Setting | [extending-loom](../../../docs/development/extending-loom.md#add-a-setting) | field in its area's section of `server/settings/catalog.py` (models in `Models`) with a comment on what it controls and its values; `python -m scripts.codegen.settings_reference`, `.settings_schema` and `.settings_example`; read as `settings.`; a rename or removal follows the [settings rule](../../rules/settings.md) | diff --git a/.devcontainer/source/Dockerfile b/.devcontainer/source/Dockerfile index 94aaa92265e..ea6e1680bf0 100644 --- a/.devcontainer/source/Dockerfile +++ b/.devcontainer/source/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0 COPY --from=ghcr.io/astral-sh/uv:0.12.2@sha256:069a51314a7bb6031777a9273205fe1b0b19e914ef418207d1338b268df641dd /uv /usr/local/bin/uv ARG CONTRIBUTOR_UID=1000 -RUN apt-get update && apt-get install -y --no-install-recommends build-essential ca-certificates git rustfmt \ +RUN apt-get update && apt-get install -y --no-install-recommends build-essential ca-certificates git golang-go rustfmt \ && useradd --create-home --uid "$CONTRIBUTOR_UID" developer \ && mkdir /venv && chown developer:developer /venv diff --git a/.devcontainer/source/README.md b/.devcontainer/source/README.md index 10dcb64f3b8..c994854989b 100644 --- a/.devcontainer/source/README.md +++ b/.devcontainer/source/README.md @@ -3,8 +3,8 @@ Use a task-specific checkout to investigate a small defect, write its regression and send a reviewable contribution. This configuration builds a Python source environment with pinned base and installer images, the repository's dependency lock and a private -virtualenv. It installs compiler dependencies and `rustfmt` for the Rust SDK generator -checks in `make lint`, and runs a focused unit check. It starts +virtualenv. It installs compiler dependencies, `gofmt` and `rustfmt` for the SDK +generator checks in `make lint`, and runs a focused unit check. It starts no Loom service, database or provider, and exposes no port. Select **Loom source contribution** when reopening the checkout in a development diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 972979edee4..4fbf8ef9c99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,6 +101,13 @@ jobs: run: | python scripts/codegen/sdk_rust_gen.py --check python scripts/codegen/sdk_rust_gen.py --fixtures --check + - name: Install Go formatter for generated contracts + uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 + with: + go-version: "1.27.4" + cache: false + - name: generated Go contracts are current + run: python scripts/codegen/sdk_go_gen.py --check - name: ruff format run: ruff format --check . # The Python SDK's op table, TypedDicts and per-op client are generated diff --git a/Makefile b/Makefile index 725e30312bc..5276ebb98cb 100644 --- a/Makefile +++ b/Makefile @@ -328,6 +328,7 @@ lint: $(PYTHON) scripts/codegen/sdk_rb_gen.py --check $(PYTHON) scripts/codegen/sdk_rust_gen.py --check $(PYTHON) scripts/codegen/sdk_rust_gen.py --fixtures --check + $(PYTHON) scripts/codegen/sdk_go_gen.py --check $(PYTHON) scripts/codegen/agent_plugin_sync.py --check $(PYTHON) scripts/codegen/settings_reference.py --check $(PYTHON) scripts/codegen/settings_schema.py --check diff --git a/docs/development/adding-an-operation.md b/docs/development/adding-an-operation.md index c2639c6bcc9..0bd9bc8cf67 100644 --- a/docs/development/adding-an-operation.md +++ b/docs/development/adding-an-operation.md @@ -166,6 +166,7 @@ python scripts/codegen/sdk_ts_gen.py # sdk/typescript/src/ python scripts/codegen/sdk_rb_gen.py # sdk/ruby/lib/clickhouse/loom/generated/*.rb python scripts/codegen/sdk_rust_gen.py # Rust wire models, methods and registry contracts python scripts/codegen/sdk_rust_gen.py --fixtures # Rust schema mapping contracts +python scripts/codegen/sdk_go_gen.py # Go wire models and grouped client methods python scripts/codegen/op_reach_census.py --write-manifest # server/operations/reach_manifest.py python scripts/codegen/docs_reference.py # generated regions of docs/reference/*.md make format diff --git a/docs/development/code-generation.md b/docs/development/code-generation.md index 4b229fd5736..268d2d73124 100644 --- a/docs/development/code-generation.md +++ b/docs/development/code-generation.md @@ -28,6 +28,7 @@ ruff formatting, an atomic write, and the write-or-check protocol). | `sdk_ts_gen.py` | `sdk/typescript/src/generated/ops.ts`: one interface per model, the `OPS` table, the `OpMap` type | `server.operations.registry.ALL_OPERATIONS` (the models' JSON Schemas) | yes | | `sdk_rb_gen.py` | `sdk/ruby/lib/clickhouse/loom/generated/`: `ops.rb` (the `OPS` table, one class per op group, one method per op) and `errors.rb` (one `Error` subclass per server code) | `server.operations.registry.ALL_OPERATIONS`; the error codes as `docs_reference.py` collects them | yes | | `sdk_rust_gen.py` | `sdk/rust/src/wire_models.rs`: serde contracts, constructors, setters, request `send` methods and replay declarations | the full registry, Pydantic schemas and collection defaults; names and numeric types are defined in the generator | yes | +| `sdk_go_gen.py` | `sdk/go/wire/models.gen.go`: Go request and response types; `sdk/go/client.gen.go`: grouped Go methods and root package aliases | the registry's Pydantic input and output models | yes | | `agent_plugin_sync.py` | the Codex plugin's copies of the hook scripts (`hooks/*.mjs`), the shared library (`lib/*.mjs`), the skills and the listing icon (`assets/`), byte-identical with the executable bit | `integrations/claude-code-plugin/` | yes | | `settings_reference.py` | the generated [configuration reference](../reference/configuration.md) | `server/settings/catalog.py`: each field's env var, type, default, and the comment above it | yes | | `settings_schema.py` | `schemas/loom-settings.schema.json`, the JSON Schema of the YAML settings file | the settings fields' types, bounds, defaults and comments, secrets left out | yes | @@ -66,6 +67,35 @@ segment, the method the rest with `.` joined, snake_case in Python `tests/unit/test_sdk_parity.py` fails when the two op tables, or the two method names of any op, differ. +### sdk_go_gen + +The `wire` package contains `Input` and `Output` types. +The root package exposes aliases for these types and groups the generated +methods by the first segment of the operation name. The methods share the +handwritten HTTP transport. Regeneration needs the server's Python +dependencies and `gofmt` on `PATH`. The check compares both generated files: + +```bash +python scripts/codegen/sdk_go_gen.py +python scripts/codegen/sdk_go_gen.py --check +``` + +Optional fields with a concrete non-nullable type use pointers. A nil pointer +omits the field; a pointer to `false`, `0` or an empty slice sends that value. +Optional nullable fields with a concrete type use +`wire.Optional[T]`: its zero value omits the field, `wire.Null[T]()` sends JSON +`null`, and `wire.Some(value)` sends a value. Decoding into a fresh struct +preserves all three states. `Get` reads a concrete value and `IsNull` tests +for explicit null. Open values and unions with different JSON types use +`json.RawMessage`. The server validates enum values and applies request +defaults. Top-level responses include the HTTP fields `ignored_args`, +`did_you_mean` and `mirrored` when the server sends them. Go skips other +unknown keys when decoding into a struct. + +The schema hash tracks literal defaults and static factory defaults. Factories +that compute defaults from other request fields run on the server; the +generator does not hash their behavior. + ### sdk_rust_gen The Rust SDK commits serde models and async and blocking methods for every diff --git a/docs/development/local-development.md b/docs/development/local-development.md index 7d5810fd325..13d33625aea 100644 --- a/docs/development/local-development.md +++ b/docs/development/local-development.md @@ -12,6 +12,7 @@ This page sets up a checkout for working on Loom's code. To evaluate Loom withou - **Docker** with Compose 2.34 or later (the dev compose file pulls ClickHouse daily), for ClickHouse and the stacks. - **Node 22** (the version CI uses) for the dashboard and the TypeScript SDK. +- **Go** with `gofmt` on `PATH` for the Go SDK generator check in `make lint`. - **rustfmt** on `PATH` for the Rust SDK generator checks in `make lint`. Install with `sudo apt-get install rustfmt` on Debian/Ubuntu. With rustup, use `rustup toolchain install 1.84.1 --profile minimal --component rustfmt` diff --git a/docs/reference/go-sdk.md b/docs/reference/go-sdk.md index dc239a6cf20..03057f7f705 100644 --- a/docs/reference/go-sdk.md +++ b/docs/reference/go-sdk.md @@ -80,6 +80,8 @@ The SDK returns a redirect as `*loom.Error` when the HTTP client has no custom ` ## Handle errors and deadlines -Pass a `context.Context` to each operation. The SDK leaves retries to the caller. For an HTTP error, use `errors.As` to read `*loom.Error` and match on `Code`. Use `Retryable` and `RetryAfter` when deciding whether to retry. When present, `RequestID` identifies the request in server logs. Check the [HTTP idempotency contract](http-api.md#idempotency) before resending writes whose outcome is unknown. +The SDK leaves retries to the caller. For an HTTP error, use `errors.As` to read `*loom.Error` and match on `Code`. Use `Retryable` and `RetryAfter` when deciding whether to retry. When present, `RequestID` identifies the request in server logs. + +A timeout does not tell you whether a write took effect. Check the [HTTP idempotency contract](http-api.md#idempotency) before resending writes whose outcome is unknown. Use the [HTTP API](http-api.md), [Python SDK](python-sdk.md), or [TypeScript SDK](typescript-sdk.md) for Loom operations beyond the Go client's memory methods. See the [Go source](https://github.com/ClickHouse/loom/tree/main/sdk/go) for the client and tests. diff --git a/scripts/codegen/sdk_go_gen.py b/scripts/codegen/sdk_go_gen.py new file mode 100644 index 00000000000..cbce3c1d323 --- /dev/null +++ b/scripts/codegen/sdk_go_gen.py @@ -0,0 +1,583 @@ +"""Generate Go wire types and client methods from the operation registry. + +python scripts/codegen/sdk_go_gen.py +python scripts/codegen/sdk_go_gen.py --check +""" + +from __future__ import annotations + +import argparse +import hashlib +import json +import re +import shutil +import subprocess +import sys +from pathlib import Path +from typing import Any + +from pydantic import BaseModel +from pydantic.json_schema import ( + GenerateJsonSchema, + JsonSchemaMode, + JsonSchemaValue, + models_json_schema, +) +from pydantic_core import core_schema + +ROOT = Path(__file__).resolve().parents[2] +if str(ROOT) not in sys.path: # run as a file + sys.path.insert(0, str(ROOT)) + +from scripts.codegen.common import GeneratedFile # noqa: E402 +from server.operations.read_projection import ProjectedRow # noqa: E402 + +COMMAND = "python scripts/codegen/sdk_go_gen.py" +TARGET = GeneratedFile(ROOT / "sdk/go/wire/models.gen.go", COMMAND) +CLIENT_TARGET = GeneratedFile(ROOT / "sdk/go/client.gen.go", COMMAND) + +_WORDS = re.compile(r"[A-Z]+(?=[A-Z][a-z])|[A-Za-z][a-z0-9]*|[0-9]+") +_PARAM_RESERVED = frozenset( + ( + "break case chan const continue default defer else fallthrough for func go goto if " + "import interface map package range return select struct switch type var " + "ctx in len nil opts s" + ).split() +) +_INITIALISMS = frozenset( + ( + "ACL AI API ASCII CPU CSV DAG DNS GPU HTML HTTP HTTPS ID IP JSON JWT LLM MCP " + "RPM RPC SDK SHA SHA1 SHA256 SLA SQL SSH TLS TTL UI URI URL UUID UTC UTF8 XML YAML" + ).split() +) +_SCALARS = {"string": "string", "integer": "int64", "number": "float64", "boolean": "bool"} +_GO_SCALARS = {*_SCALARS.values(), "uint64"} +_RAW = "json.RawMessage" +_REF_PREFIX = "#/$defs/" +_HTTP_SUFFIX = "-HTTPResponse" +_HTTP_FIELDS = { + "ignored_args": {"type": "array", "items": {"type": "string"}}, + "did_you_mean": {"type": "object", "additionalProperties": {"type": "string"}}, + "mirrored": {"type": "boolean"}, +} +_IDENTITY_FIELDS = {"org", "namespace", "agent"} +# These namespaces name the object being managed, not the caller's scope. +_EXPLICIT_NAMESPACE_OPS = { + "collection.delete", + "collection.move", + "namespace.cancel_request", + "namespace.delete", + "namespace.join", + "namespace.leave", + "namespace.mark_seen", + "namespace.register", +} +_POLICY_NAMESPACE_OPS = { + "extraction_policy.clear", + "extraction_policy.get", + "extraction_policy.set", +} +_NO_IDENTITY_DEFAULTS = { + **dict.fromkeys( + _EXPLICIT_NAMESPACE_OPS | _POLICY_NAMESPACE_OPS | {"collection.create"}, {"namespace"} + ), + "memory.clear": {"agent"}, # A clear selector must come from the caller. + "memory.update": {"agent"}, # Omission keeps the namespace-wide ambiguity check. +} +_SNAPSHOT_KEY = "NamespaceSnapshotOutput" +# conflicts.list reads and compares the memory row's ClickHouse UInt64 version. +_UINT64_FIELDS = { + "ConflictsListInput": "before_version", + "ConflictsListOutput": "next_before_version", + "_ConflictRow": "version", +} +# Keep the existing Client.Search method and SearchHit result type. +_GROUP_NAMES = {"search": "LoomSearch"} +_ROOT_NAMES = {"SearchHit": "WireSearchHit"} +# These fields have server defaults but are the usual reason to make the call. +# WithInput still allows callers to omit them (for example, pack by situation). +_POSITIONAL_DEFAULTS = {"context.pack": "query", "working_memory.set": "content"} +_OPTION_FIELDS = { + "context.pack": { + "token_budget": "WithPackTokenBudget", + "include_knowledge": "WithPackKnowledge", + }, + "knowledge.search": {"top_k": "WithKnowledgeSearchTopK"}, + "working_memory.get": {"block_key": "WithWorkingMemoryGetBlockKey"}, + "working_memory.set": {"block_key": "WithWorkingMemorySetBlockKey"}, +} +# These factories build constants or copy static collections. +_STATIC_FACTORIES = { + ("CodeBisectCandidatesInput", "wideners"), + ("CodeOutlineInput", "kinds"), + ("CostSummaryInput", "group_by"), + ("InboxRegisterInput", "accept_disclosure"), + ("InspectSettings", "extraction_instructions_refs"), + ("TrackerSimilarInput", "kinds"), + ("WebhookRegisterInput", "events"), +} + + +def _name(wire_name: str) -> str: + words = _WORDS.findall(wire_name) + name = "".join( + "ETag" if w.upper() == "ETAG" else w.upper() if w.upper() in _INITIALISMS else w.title() + for w in words + ) + return name if name[:1].isalpha() else f"Field{name}" + + +def _ref_key(ref: str) -> str: + if not ref.startswith(_REF_PREFIX) or "/" in ref[len(_REF_PREFIX) :]: + raise ValueError(f"unsupported Go schema reference: {ref}") + return ref[len(_REF_PREFIX) :].replace("~1", "/").replace("~0", "~") + + +def _parameter_name(field: str) -> str: + first, *rest = _WORDS.findall(field) or ["value"] + name = first.lower() + (_name("_".join(rest)) if rest else "") + return name if name.isidentifier() and name not in _PARAM_RESERVED else "value" + + +def _factory_defaults(model: type[BaseModel]) -> dict[str, Any]: + defaults: dict[str, Any] = {} + for name, field in model.model_fields.items(): + factory = field.default_factory + if factory is None or field.default_factory_takes_validated_data: + continue + if factory in (list, dict, set, tuple) or (model.__name__, name) in _STATIC_FACTORIES: + defaults[name] = field.get_default(call_default_factory=True) + elif not (isinstance(factory, type) and issubclass(factory, BaseModel)): + raise ValueError(f"{model.__name__}.{name}: classify the Go schema default factory") + # Nested models have their own schemas; do not run their constructors. + return defaults + + +class WireSchema(GenerateJsonSchema): + def generate_inner(self, schema: Any) -> JsonSchemaValue: + if self.mode == "serialization" and schema["type"] == "model": + serializer = schema.get("serialization", {}) + returns = serializer.get("return_schema", {}) + if ( + serializer.get("type") == "function-wrap" + and returns.get("type") == "dict" + and returns.get("keys_schema", {}).get("type") == "str" + and returns.get("values_schema", {}).get("type") == "any" + ): + # These wrappers filter the dumped fields. Their dict annotation + # would hide the types of every declared field from the SDK. + schema = {key: value for key, value in schema.items() if key != "serialization"} + return super().generate_inner(schema) + + def model_schema(self, schema: core_schema.ModelSchema) -> JsonSchemaValue: + model = schema["cls"] + by_alias = self.by_alias + if self.mode == "serialization": + # HTTP calls model_dump(mode="json") without an alias override. + self.by_alias = model.model_config.get("serialize_by_alias", False) + else: + self.by_alias = model.model_config.get("validate_by_alias", True) + try: + result = super().model_schema(schema) + finally: + self.by_alias = by_alias + if self.mode == "serialization" and issubclass(model, ProjectedRow): + result.pop("required", None) + if defaults := _factory_defaults(model): + result["x-loom-factory-defaults"] = self.encode_default(defaults) + if model.__module__ == "server.memory.api.models_conflicts": + if field := _UINT64_FIELDS.get(model.__name__): + result["properties"][field]["x-loom-go-uint64"] = True + return result + + +def _nested_refs(schema: Any) -> set[str]: + if isinstance(schema, dict): + if "$ref" in schema: + return {_ref_key(schema["$ref"])} + children = schema.values() + elif isinstance(schema, list): + children = schema + else: + return set() + return set().union(*map(_nested_refs, children)) + + +def _http_responses( + definitions: dict[str, Any], output_keys: set[str], input_keys: set[str] +) -> dict[str, str]: + """Add transport fields to top-level response objects only.""" + shared = input_keys | _nested_refs(definitions) + keys = {} + for key in sorted(output_keys): + schema = definitions[key] + props = schema.get("properties") + if props is None: + keys[key] = key # Open maps already retain the metadata. + continue + target = key + if key in shared: + target = key + _HTTP_SUFFIX + if target in definitions: + raise ValueError(f"duplicate Go response schema {target}") + if key == _SNAPSHOT_KEY: + if target == key or props.keys() & _HTTP_FIELDS.keys(): + raise ValueError("Go snapshot payload must be shared and exclude HTTP feedback") + definitions[target] = { + "type": "object", + "properties": _HTTP_FIELDS, + "x-loom-go-embedded-payload": key, + } + keys[key] = target + continue + definitions[target] = {**schema, "properties": {**_HTTP_FIELDS, **props}} + keys[key] = target + return keys + + +class Emitter: + """Render one shared set of Pydantic definitions and bind each op to its models.""" + + def __init__(self, defs: dict[str, Any], public: dict[str, str]) -> None: + self.names: dict[str, str] = {} + used = {*public, "Optional", "Null", "Some"} + for key in sorted(defs): + name = "NamespaceSnapshotPayload" if key == _SNAPSHOT_KEY else _name(key) + if key.endswith(_HTTP_SUFFIX): + op_name = _name(key.removesuffix(_HTTP_SUFFIX)) + if public.get(op_name) == key: + name = op_name + if public.get(name) == key: + self.names[key] = name + continue + if name in used: + name = f"Model{name}" + if name in used: + raise ValueError(f"duplicate Go model name {name} for {key}") + used.add(name) + self.names[key] = name + + def render(self, schema: dict[str, Any], *, unsigned: bool = False) -> str: + unsigned = unsigned or schema.get("x-loom-go-uint64", False) + if "$ref" in schema: + return self.names[_ref_key(schema["$ref"])] + if "anyOf" in schema: + branches = [item for item in schema["anyOf"] if item.get("type") != "null"] + if len(branches) == 1 and len(branches) < len(schema["anyOf"]): + inner = self.render(branches[0], unsigned=unsigned) + return inner if inner == _RAW else f"*{inner}" + return _RAW + if schema.get("type") == "object": + return self._object(schema) + if schema.get("type") == "array": + return self._array(schema) + if scalar := _SCALARS.get(schema.get("type")): + return "uint64" if unsigned and scalar == "int64" else scalar + if schema.get("type") == "null" or not schema.keys() - { + "default", + "description", + "examples", + "title", + }: + return _RAW + raise ValueError(f"unsupported Go wire schema: {schema}") + + def _array(self, schema: dict[str, Any]) -> str: + if "prefixItems" not in schema: + return f"[]{self.render(schema.get('items', {}))}" + items = schema["prefixItems"] + types = {self.render(item) for item in items} + if len(types) == 1 and len(items) == schema.get("minItems") == schema.get("maxItems"): + return f"[{len(items)}]{types.pop()}" + return _RAW + + def _object(self, schema: dict[str, Any]) -> str: + props = schema.get("properties", {}) + extra = schema.get("additionalProperties", True) + if "patternProperties" in schema or (props and isinstance(extra, dict)): + raise ValueError(f"unsupported Go object schema: {schema}") + if not props: + if extra is False or ("properties" in schema and "additionalProperties" not in schema): + return "struct{}" + return f"map[string]{self.render(extra if isinstance(extra, dict) else {})}" + + required = set(schema.get("required", ())) + fields = [] + if payload := schema.get("x-loom-go-embedded-payload"): + fields.append(self.names[payload]) + used = set() + for key, field in props.items(): + name = _name(key) + if name in used: + raise ValueError(f"duplicate Go field name {name} for {key}") + if not re.fullmatch(r"[A-Za-z0-9_.:-]+", key) or key == "-": + raise ValueError(f"unsupported Go JSON field name: {key!r}") + used.add(name) + go_type = self.render(field) + tag = key + if key not in required: + tag += ",omitempty" + if go_type.startswith("*"): + go_type = f"Optional[{go_type[1:]}]" + elif go_type != _RAW: + go_type = f"*{go_type}" + elif field.get("x-loom-go-omit-blank"): + tag += ",omitempty" + fields.append(f'{name} {go_type} `json:"{tag}"`') + return "struct {\n" + "\n".join(fields) + "\n}" + + def declaration(self, key: str, schema: dict[str, Any]) -> str: + name = self.names[key] + body = self.render(schema) + alias = "" if body.startswith("struct") else "= " + return f"type {name} {alias}{body}" + + +def _format(source: str) -> str: + gofmt = shutil.which("gofmt") + if not gofmt: + raise SystemExit("Go SDK generation needs gofmt on PATH (install Go)") + return subprocess.run( + [gofmt], input=source, text=True, stdout=subprocess.PIPE, check=True + ).stdout + + +def build_sources() -> tuple[str, str]: + from server.operations.registry import ALL_OPERATIONS + + bindings: list[tuple[str, str, type[BaseModel], JsonSchemaMode]] = [] + for op in sorted(ALL_OPERATIONS, key=lambda item: item.name): + bindings.extend( + ( + (op.name, "Input", op.input_model, "validation"), + (op.name, "Output", op.output_model, "serialization"), + ) + ) + models = sorted( + {(model, mode) for _, _, model, mode in bindings}, + key=lambda pair: (pair[0].__module__, pair[0].__name__, pair[1]), + ) + roots, schema = models_json_schema(models, schema_generator=WireSchema) + definitions = schema["$defs"] + input_keys = {_ref_key(roots[m, mode]["$ref"]) for m, mode in models if mode == "validation"} + responses = _http_responses( + definitions, + {_ref_key(roots[m, mode]["$ref"]) for m, mode in models if mode == "serialization"}, + input_keys, + ) + public = {} + op_types = [] + for op, suffix, model, mode in bindings: + name = f"{_name(op)}{suffix}" + key = _ref_key(roots[model, mode]["$ref"]) + if mode == "serialization": + key = responses[key] + elif op == "memory.history": + # Scoped history has no server agent default. Omit a blank agent so + # validation refuses the missing identity instead of reading empty-agent rows. + definition = definitions[key] + props = definition["properties"] + definitions[key] = { + **definition, + "properties": {**props, "agent": {**props["agent"], "x-loom-go-omit-blank": True}}, + } + if name in public: + raise ValueError(f"duplicate Go op type {name} for {op}") + public[name] = key + op_types.append((name, key, op, suffix)) + + emitter = Emitter(definitions, public) + descriptions = { + name: f"{name} is the {'request to' if suffix == 'Input' else 'response from'} {op}." + for name, _, op, suffix in op_types + } + decls = { + emitter.names[key]: emitter.declaration(key, value) for key, value in definitions.items() + } + for name, key, _, _ in op_types: + if name != emitter.names[key]: + decls[name] = f"type {name} = {emitter.names[key]}" + + # A bound, static default or enum can change without changing the Go field type. + digest = hashlib.sha256(json.dumps(schema, sort_keys=True).encode()).hexdigest() + parts = [ + "// Code generated by scripts/codegen/sdk_go_gen.py; DO NOT EDIT.\n" + f"// Registry model schema SHA-256: {digest}\n\n" + "// Package wire contains the Go requests and responses for Loom operations.\n" + "package wire" + ] + if any(_RAW in declaration for declaration in decls.values()): + parts.append('import "encoding/json"') + for name, declaration in sorted(decls.items()): + desc = descriptions.get(name, f"{name} is a model used by Loom operations.") + parts.append(f"// {desc}\n{declaration}") + client = _client_source( + emitter, + decls, + descriptions, + {op: definitions[key] for _, key, op, suffix in op_types if suffix == "Input"}, + ) + return "\n\n".join(parts) + "\n", client + + +def build_source() -> str: + return build_sources()[0] + + +def _client_source( + emitter: Emitter, + decls: dict[str, str], + descriptions: dict[str, str], + inputs: dict[str, dict[str, Any]], +) -> str: + parts = [ + "// Code generated by scripts/codegen/sdk_go_gen.py; DO NOT EDIT.\n\npackage loom", + 'import (\n"context"\n\n"github.com/ClickHouse/loom/sdk/go/wire"\n)', + ] + for name in sorted(decls): + alias = _ROOT_NAMES.get(name, name) + doc = descriptions.get(name, f"{alias} is a model used by Loom operations.") + parts.append(f"// {doc}\ntype {alias} = wire.{name}") + + def group_name(group: str) -> str: + return _GROUP_NAMES.get(group, _name(group)) + + groups = sorted({group_name(op.split(".", 1)[0]) for op in inputs}) + fields = "\n".join(f"{group} {group}Service" for group in groups) + parts.append( + "// Client calls Loom operations as one org, namespace and agent.\n" + "// Construct it with New. It is safe for concurrent use.\n" + f"type Client struct {{\n{fields}\n\nclientTransport\n}}" + ) + initializers = "\n".join( + f"c.{group} = {group}Service{{client: &c.clientTransport}}" for group in groups + ) + parts.append(f"func (c *Client) initServices() {{\n{initializers}\n}}") + for group in groups: + parts.append( + f"// {group}Service provides the operations on Client.{group}.\n" + f"type {group}Service struct {{ client *clientTransport }}" + ) + + methods = set() + for op, schema in inputs.items(): + group, rest = op.split(".", 1) + service, method = group_name(group), _name(rest) + if (service, method) in methods: + raise ValueError(f"duplicate Go method {service}.{method} for {op}") + methods.add((service, method)) + parts.extend(_client_methods(emitter, op, service, method, schema)) + return "\n\n".join(parts) + "\n" + + +def _client_methods( + emitter: Emitter, op: str, service: str, method: str, schema: dict[str, Any] +) -> list[str]: + input_type, output_type = f"{_name(op)}Input", f"{_name(op)}Output" + properties = schema.get("properties", {}) + required = set(schema.get("required", ())) + defaults = _IDENTITY_FIELDS - _NO_IDENTITY_DEFAULTS.get(op, set()) + business = required - defaults + positional = _POSITIONAL_DEFAULTS.get(op) + if positional is None and len(business) == 1: + (candidate,) = business + if emitter.render(properties[candidate]) in _GO_SCALARS: + positional = candidate + + def assign(field: str, value: str) -> str: + model = properties[field] + typ = emitter.render(model) + if typ not in _GO_SCALARS: + raise ValueError(f"{op}.{field} must be a non-nullable Go scalar") + return f"in.{_name(field)} = {'Ptr(' + value + ')' if field not in required else value}" + + methods = [] + body: list[str] = [] + doc = f"// {method} calls {op}." + if (positional is not None or not business) and properties: + option = "CodeReposOption" if op == "code.repos" else f"Option[{input_type}]" + params = f"opts ...{option}" + body.append("in := applyOptions(opts)") + doc += "\n// Use WithInput to supply additional request fields." + if positional is not None: + param = _parameter_name(positional) + params = f"{param} {emitter.render(properties[positional])}, {params}" + if op in _POSITIONAL_DEFAULTS: + # An empty argument leaves the option value or server default in place. + if emitter.render(properties[positional]) != "string": + raise ValueError(f"{op}.{positional} must be a string") + doc += f"\n// If {param} is empty, options or the server supply the value." + body.append(f'if {param} != "" {{ {assign(positional, param)} }}') + else: + body.append(assign(positional, param)) + elif not business and emitter.render(schema) == "struct{}": + params = "" + body.append(f"var in {input_type}") + else: + params = f"in {input_type}" + + if op in _EXPLICIT_NAMESPACE_OPS: + doc += "\n// The namespace must be named explicitly." + body.append( + f'if err := requireNamedNamespace("{op}", in.Namespace); err != nil {{\n' + "return nil, err\n}" + ) + elif op in _POLICY_NAMESPACE_OPS: + doc += '\n// Scope "namespace" requires the target namespace in the input.' + body.append( + f'if err := requirePolicyNamespace("{op}", in.Scope, in.Namespace); err != nil {{\n' + "return nil, err\n}" + ) + elif op == "namespace.rollback": + doc += "\n// Applying a rollback requires an explicit namespace." + body.append( + "if in.DryRun != nil && !*in.DryRun {\n" + f'if err := requireNamedNamespace("{op}", in.Namespace); err != nil {{\n' + "return nil, err\n}\n}" + ) + + for field in sorted(defaults & properties.keys()): + name = _name(field) + typ = emitter.render(properties[field]) + default = f"s.client.identity.{name}" + if typ == "string": + if field in required: + body.append(f'if in.{name} == "" {{ in.{name} = {default} }}') + else: + body.append( + f'if in.{name} == nil && {default} != "" {{ in.{name} = Ptr({default}) }}' + ) + elif typ == "*string" and field not in required: + body.append( + f'if len(in.{name}) == 0 && {default} != "" {{ in.{name} = Some({default}) }}' + ) + # Some operations use one of these keys for a non-identity value. + + body.append(f'return callOperation[{output_type}](s.client, ctx, "{op}", in)') + signature = f"func (s {service}Service) {method}(ctx context.Context" + signature += f", {params}" if params else "" + methods.append(f"{doc}\n{signature}) (*{output_type}, error) {{\n" + "\n".join(body) + "\n}") + for field, helper in _OPTION_FIELDS.get(op, {}).items(): + typ = emitter.render(properties[field]) + methods.append( + f"// {helper} sets {field} on {op}.\n" + f"func {helper}(value {typ}) Option[{input_type}] {{\n" + f"return func(in *{input_type}) {{ {assign(field, 'value')} }}\n}}" + ) + return methods + + +def main(argv: list[str] | None = None) -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--check", action="store_true", help="exit 1 when an artifact is stale") + parser.add_argument("--out", type=Path, help="write or check only the wire types at this path") + args = parser.parse_args(argv) + wire, client = build_sources() + if args.out is not None: + return GeneratedFile(args.out, COMMAND).sync(_format(wire), check=args.check) + artifacts = [(TARGET, _format(wire)), (CLIENT_TARGET, _format(client))] + return max(target.sync(text, check=args.check) for target, text in artifacts) + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/sdk/go/README.md b/sdk/go/README.md index df12b74337f..ad096d7b367 100644 --- a/sdk/go/README.md +++ b/sdk/go/README.md @@ -1,17 +1,14 @@ # Loom Go client -A minimal Go client for [ClickHouse Loom](https://loom.clickhouse.com/docs)'s memory -operations: `memory.set`, `memory.get`, `memory.search` and `memory.delete`. It depends -on the standard library only (`net/http`), and every call takes a `context.Context`. +The Go client for [ClickHouse Loom](https://loom.clickhouse.com/docs) uses only +the standard library. ```bash go get github.com/ClickHouse/loom/sdk/go ``` The [Go SDK guide](https://loom.clickhouse.com/docs/reference/go-sdk) covers -configuration, team access, and error handling. Every operation has a typed method in -the [Python](https://loom.clickhouse.com/docs/reference/python-sdk) and -[TypeScript](https://loom.clickhouse.com/docs/reference/typescript-sdk) SDKs. +configuration, team access, and error handling. ## Example @@ -44,10 +41,68 @@ func main() { } ``` +## List code repositories + +Run the [repository inventory example](examples/listrepos/main.go) from this +source checkout against a Loom server with code indexing configured. Set +`LOOM_BASE_URL` and `LOOM_API_KEY` for that server, and `LOOM_ORG` if you need to +select an organization explicitly. + +```bash +cd sdk/go +go run ./examples/listrepos +go run ./examples/listrepos -repo owner/name +``` + +The example prints the repository, branch, and namespace for each visible +entry. Call `client.Code.Repos(ctx)` to list all visible repositories, or +`client.Code.Repos(ctx, loom.WithRepo("owner/name"))` to filter by repository. + +## Grouped operations + +The client in this source checkout groups methods by the first segment of +the operation name: +`context.pack` is `client.Context.Pack`, and `knowledge.source.list` is +`client.Knowledge.SourceList`. `search.query` is `client.LoomSearch.Query`. +See the [generated client](client.gen.go) for method signatures and the +[generated models](wire/models.gen.go) for request and response fields. +The `loom` package exports both. + +| What the operation needs | Example | +| ---------------------------- | ---------------------------------------------------------------------------------- | +| No required operation fields | `client.Code.Repos(ctx)` | +| One value | `client.Context.Pack(ctx, "What should I check before deploying?")` | +| Several required fields | `client.Knowledge.Add(ctx, loom.KnowledgeAddInput{SourceURI: uri, Content: text})` | + +Set `Org`, `Namespace`, and `Agent` in `loom.Config` to supply caller identity. +Management methods such as `client.Collection.Delete(ctx, "col-runbooks")` +require an explicit target namespace. `client.Memory.Update` searches +across agents in the namespace unless you set `MemoryUpdateInput.Agent`. +`client.Memory.Clear` uses only the selectors in `MemoryClearInput`. +Pass `NamespaceRollbackInput.Namespace` explicitly when applying a rollback +with `DryRun: loom.Ptr(false)`. +For optional fields, pass a helper such as +`loom.WithPackTokenBudget(800)` or `loom.WithInput(loom.ContextPackInput{Mode: loom.Ptr("debug")})`. +`loom.Ptr(false)` sends `false`; an unset field lets the server apply its default. +For optional nullable fields, use `loom.Some(value)` or `loom.Null[T]()`. + +To restore a snapshot, use `snapshot.NamespaceSnapshotPayload` from +`client.Namespace.Snapshot` as `loom.NamespaceRestoreInput.Payload`. + +The [runbook example](examples/runbook/main.go) writes a knowledge document, +updates a working memory block, and builds a context pack. Set `LOOM_BASE_URL`, +`LOOM_API_KEY`, `LOOM_ORG`, and `LOOM_NAMESPACE` for a test namespace where the +token has the writer role, then run: + +```bash +cd sdk/go +go run ./examples/runbook +``` + ## Tests ```bash cd sdk/go && go test ./... ``` -The tests run against a local fake server and need no running Loom. +The tests do not need a running Loom server. diff --git a/sdk/go/client.gen.go b/sdk/go/client.gen.go new file mode 100644 index 00000000000..5611d209a66 --- /dev/null +++ b/sdk/go/client.gen.go @@ -0,0 +1,8755 @@ +// Code generated by scripts/codegen/sdk_go_gen.py; DO NOT EDIT. + +package loom + +import ( + "context" + + "github.com/ClickHouse/loom/sdk/go/wire" +) + +// AdminUsersInput is the request to admin.users. +type AdminUsersInput = wire.AdminUsersInput + +// AdminUsersOutput is the response from admin.users. +type AdminUsersOutput = wire.AdminUsersOutput + +// AgentsConnectedInput is the request to agents.connected. +type AgentsConnectedInput = wire.AgentsConnectedInput + +// AgentsConnectedOutput is the response from agents.connected. +type AgentsConnectedOutput = wire.AgentsConnectedOutput + +// AggregateRow is a model used by Loom operations. +type AggregateRow = wire.AggregateRow + +// AllowlistRow is a model used by Loom operations. +type AllowlistRow = wire.AllowlistRow + +// AnalysisColumn is a model used by Loom operations. +type AnalysisColumn = wire.AnalysisColumn + +// AppendBatchEntry is a model used by Loom operations. +type AppendBatchEntry = wire.AppendBatchEntry + +// ApplyDemote is a model used by Loom operations. +type ApplyDemote = wire.ApplyDemote + +// ApplyExpire is a model used by Loom operations. +type ApplyExpire = wire.ApplyExpire + +// ApplyFilter is a model used by Loom operations. +type ApplyFilter = wire.ApplyFilter + +// ApplyLabel is a model used by Loom operations. +type ApplyLabel = wire.ApplyLabel + +// ApplyLock is a model used by Loom operations. +type ApplyLock = wire.ApplyLock + +// ApplyRow is a model used by Loom operations. +type ApplyRow = wire.ApplyRow + +// ApplySearch is a model used by Loom operations. +type ApplySearch = wire.ApplySearch + +// ApplyTarget is a model used by Loom operations. +type ApplyTarget = wire.ApplyTarget + +// AssistantAskInput is the request to assistant.ask. +type AssistantAskInput = wire.AssistantAskInput + +// AssistantAskOutput is the response from assistant.ask. +type AssistantAskOutput = wire.AssistantAskOutput + +// AssistantCitation is a model used by Loom operations. +type AssistantCitation = wire.AssistantCitation + +// AssistantMessage is a model used by Loom operations. +type AssistantMessage = wire.AssistantMessage + +// AuditListInput is the request to audit.list. +type AuditListInput = wire.AuditListInput + +// AuditListOutput is the response from audit.list. +type AuditListOutput = wire.AuditListOutput + +// AuditListRow is a model used by Loom operations. +type AuditListRow = wire.AuditListRow + +// BacklinkDigest is a model used by Loom operations. +type BacklinkDigest = wire.BacklinkDigest + +// BacklinkEdge is a model used by Loom operations. +type BacklinkEdge = wire.BacklinkEdge + +// BacklinkRelated is a model used by Loom operations. +type BacklinkRelated = wire.BacklinkRelated + +// BacklinkVersion is a model used by Loom operations. +type BacklinkVersion = wire.BacklinkVersion + +// BlacklistAddInput is the request to blacklist.add. +type BlacklistAddInput = wire.BlacklistAddInput + +// BlacklistAddOutput is the response from blacklist.add. +type BlacklistAddOutput = wire.BlacklistAddOutput + +// BlacklistListInput is the request to blacklist.list. +type BlacklistListInput = wire.BlacklistListInput + +// BlacklistListOutput is the response from blacklist.list. +type BlacklistListOutput = wire.BlacklistListOutput + +// BlacklistRemoveInput is the request to blacklist.remove. +type BlacklistRemoveInput = wire.BlacklistRemoveInput + +// BlacklistRemoveOutput is the response from blacklist.remove. +type BlacklistRemoveOutput = wire.BlacklistRemoveOutput + +// BlacklistRow is a model used by Loom operations. +type BlacklistRow = wire.BlacklistRow + +// BlacklistSweepInput is the request to blacklist.sweep. +type BlacklistSweepInput = wire.BlacklistSweepInput + +// BlacklistSweepOutput is the response from blacklist.sweep. +type BlacklistSweepOutput = wire.BlacklistSweepOutput + +// BriefCheckout is a model used by Loom operations. +type BriefCheckout = wire.BriefCheckout + +// BriefDeadEnd is a model used by Loom operations. +type BriefDeadEnd = wire.BriefDeadEnd + +// BriefDecision is a model used by Loom operations. +type BriefDecision = wire.BriefDecision + +// BriefDone is a model used by Loom operations. +type BriefDone = wire.BriefDone + +// BriefEvent is a model used by Loom operations. +type BriefEvent = wire.BriefEvent + +// BriefEvidence is a model used by Loom operations. +type BriefEvidence = wire.BriefEvidence + +// BriefFile is a model used by Loom operations. +type BriefFile = wire.BriefFile + +// BriefSections is a model used by Loom operations. +type BriefSections = wire.BriefSections + +// BrowseEntry is a model used by Loom operations. +type BrowseEntry = wire.BrowseEntry + +// BudgetStatusInput is a model used by Loom operations. +type BudgetStatusInput = wire.BudgetStatusInput + +// BudgetStatusOutput is a model used by Loom operations. +type BudgetStatusOutput = wire.BudgetStatusOutput + +// BulkSetEntry is a model used by Loom operations. +type BulkSetEntry = wire.BulkSetEntry + +// BulkSetResult is a model used by Loom operations. +type BulkSetResult = wire.BulkSetResult + +// CalibrationGetInput is the request to calibration.get. +type CalibrationGetInput = wire.CalibrationGetInput + +// CalibrationGetOutput is the response from calibration.get. +type CalibrationGetOutput = wire.CalibrationGetOutput + +// CatalogColumn is a model used by Loom operations. +type CatalogColumn = wire.CatalogColumn + +// CatalogTable is a model used by Loom operations. +type CatalogTable = wire.CatalogTable + +// CategoryEntry is a model used by Loom operations. +type CategoryEntry = wire.CategoryEntry + +// CategoryHit is a model used by Loom operations. +type CategoryHit = wire.CategoryHit + +// ChainNodeRow is a model used by Loom operations. +type ChainNodeRow = wire.ChainNodeRow + +// ChangedFile is a model used by Loom operations. +type ChangedFile = wire.ChangedFile + +// ChunkModelCount is a model used by Loom operations. +type ChunkModelCount = wire.ChunkModelCount + +// ChunkStats is a model used by Loom operations. +type ChunkStats = wire.ChunkStats + +// ChunkTotals is a model used by Loom operations. +type ChunkTotals = wire.ChunkTotals + +// ChunkingPreview is a model used by Loom operations. +type ChunkingPreview = wire.ChunkingPreview + +// ChunkingSample is a model used by Loom operations. +type ChunkingSample = wire.ChunkingSample + +// CitedChunk is a model used by Loom operations. +type CitedChunk = wire.CitedChunk + +// CodeAskInput is the request to code.ask. +type CodeAskInput = wire.CodeAskInput + +// CodeAskOutput is the response from code.ask. +type CodeAskOutput = wire.CodeAskOutput + +// CodeBackportGapInput is the request to code.backport_gap. +type CodeBackportGapInput = wire.CodeBackportGapInput + +// CodeBackportGapOutput is the response from code.backport_gap. +type CodeBackportGapOutput = wire.CodeBackportGapOutput + +// CodeBackportGapsInput is the request to code.backport_gaps. +type CodeBackportGapsInput = wire.CodeBackportGapsInput + +// CodeBackportGapsOutput is the response from code.backport_gaps. +type CodeBackportGapsOutput = wire.CodeBackportGapsOutput + +// CodeBisectCandidatesInput is the request to code.bisect_candidates. +type CodeBisectCandidatesInput = wire.CodeBisectCandidatesInput + +// CodeBisectCandidatesOutput is the response from code.bisect_candidates. +type CodeBisectCandidatesOutput = wire.CodeBisectCandidatesOutput + +// CodeBlameRangeInput is the request to code.blame_range. +type CodeBlameRangeInput = wire.CodeBlameRangeInput + +// CodeBlameRangeOutput is the response from code.blame_range. +type CodeBlameRangeOutput = wire.CodeBlameRangeOutput + +// CodeCalibrateInput is the request to code.calibrate. +type CodeCalibrateInput = wire.CodeCalibrateInput + +// CodeCalibrateOutput is the response from code.calibrate. +type CodeCalibrateOutput = wire.CodeCalibrateOutput + +// CodeCalleesInput is the request to code.callees. +type CodeCalleesInput = wire.CodeCalleesInput + +// CodeCalleesOutput is the response from code.callees. +type CodeCalleesOutput = wire.CodeCalleesOutput + +// CodeCallersInput is the request to code.callers. +type CodeCallersInput = wire.CodeCallersInput + +// CodeCallersOutput is the response from code.callers. +type CodeCallersOutput = wire.CodeCallersOutput + +// CodeCandidateGroupWire is a model used by Loom operations. +type CodeCandidateGroupWire = wire.CodeCandidateGroupWire + +// CodeCandidateSiteWire is a model used by Loom operations. +type CodeCandidateSiteWire = wire.CodeCandidateSiteWire + +// CodeCandidateSitesWire is a model used by Loom operations. +type CodeCandidateSitesWire = wire.CodeCandidateSitesWire + +// CodeCommitCoverage is a model used by Loom operations. +type CodeCommitCoverage = wire.CodeCommitCoverage + +// CodeCommitTierCoverage is a model used by Loom operations. +type CodeCommitTierCoverage = wire.CodeCommitTierCoverage + +// CodeCompilerTier is a model used by Loom operations. +type CodeCompilerTier = wire.CodeCompilerTier + +// CodeContextPackInput is the request to code.context_pack. +type CodeContextPackInput = wire.CodeContextPackInput + +// CodeContextPackOutput is the response from code.context_pack. +type CodeContextPackOutput = wire.CodeContextPackOutput + +// CodeContextPackRow is a model used by Loom operations. +type CodeContextPackRow = wire.CodeContextPackRow + +// CodeContextPacksInput is the request to code.context_packs. +type CodeContextPacksInput = wire.CodeContextPacksInput + +// CodeContextPacksOutput is the response from code.context_packs. +type CodeContextPacksOutput = wire.CodeContextPacksOutput + +// CodeConventionsInput is the request to code.conventions. +type CodeConventionsInput = wire.CodeConventionsInput + +// CodeConventionsOutput is the response from code.conventions. +type CodeConventionsOutput = wire.CodeConventionsOutput + +// CodeCoverageClaimInput is the request to code.coverage_claim. +type CodeCoverageClaimInput = wire.CodeCoverageClaimInput + +// CodeCoverageClaimOutput is the response from code.coverage_claim. +type CodeCoverageClaimOutput = wire.CodeCoverageClaimOutput + +// CodeCoverageGaps is a model used by Loom operations. +type CodeCoverageGaps = wire.CodeCoverageGaps + +// CodeCoverageInput is the request to code.coverage. +type CodeCoverageInput = wire.CodeCoverageInput + +// CodeCoverageOutput is the response from code.coverage. +type CodeCoverageOutput = wire.CodeCoverageOutput + +// CodeCoverageUnwatchInput is the request to code.coverage.unwatch. +type CodeCoverageUnwatchInput = wire.CodeCoverageUnwatchInput + +// CodeCoverageUnwatchOutput is the response from code.coverage.unwatch. +type CodeCoverageUnwatchOutput = wire.CodeCoverageUnwatchOutput + +// CodeCoverageWatchInput is the request to code.coverage.watch. +type CodeCoverageWatchInput = wire.CodeCoverageWatchInput + +// CodeCoverageWatchOutput is the response from code.coverage.watch. +type CodeCoverageWatchOutput = wire.CodeCoverageWatchOutput + +// CodeEdgeWire is a model used by Loom operations. +type CodeEdgeWire = wire.CodeEdgeWire + +// CodeEditContextInput is the request to code.edit_context. +type CodeEditContextInput = wire.CodeEditContextInput + +// CodeEditContextOutput is the response from code.edit_context. +type CodeEditContextOutput = wire.CodeEditContextOutput + +// CodeEditContextTarget is a model used by Loom operations. +type CodeEditContextTarget = wire.CodeEditContextTarget + +// CodeEditReadSite is a model used by Loom operations. +type CodeEditReadSite = wire.CodeEditReadSite + +// CodeEditReadSource is a model used by Loom operations. +type CodeEditReadSource = wire.CodeEditReadSource + +// CodeEnclosingInput is the request to code.enclosing. +type CodeEnclosingInput = wire.CodeEnclosingInput + +// CodeEnclosingOutput is the response from code.enclosing. +type CodeEnclosingOutput = wire.CodeEnclosingOutput + +// CodeExamplesInput is the request to code.examples. +type CodeExamplesInput = wire.CodeExamplesInput + +// CodeExamplesOutput is the response from code.examples. +type CodeExamplesOutput = wire.CodeExamplesOutput + +// CodeFilesInput is the request to code.files. +type CodeFilesInput = wire.CodeFilesInput + +// CodeFilesOutput is the response from code.files. +type CodeFilesOutput = wire.CodeFilesOutput + +// CodeFirstBuildInput is the request to code.first_build. +type CodeFirstBuildInput = wire.CodeFirstBuildInput + +// CodeFirstBuildOutput is the response from code.first_build. +type CodeFirstBuildOutput = wire.CodeFirstBuildOutput + +// CodeGrepInput is the request to code.grep. +type CodeGrepInput = wire.CodeGrepInput + +// CodeGrepOutput is the response from code.grep. +type CodeGrepOutput = wire.CodeGrepOutput + +// CodeHistoryInput is the request to code.history. +type CodeHistoryInput = wire.CodeHistoryInput + +// CodeHistoryOutput is the response from code.history. +type CodeHistoryOutput = wire.CodeHistoryOutput + +// CodeImpactInput is the request to code.impact. +type CodeImpactInput = wire.CodeImpactInput + +// CodeImpactOutput is the response from code.impact. +type CodeImpactOutput = wire.CodeImpactOutput + +// CodeIndexErrorRow is a model used by Loom operations. +type CodeIndexErrorRow = wire.CodeIndexErrorRow + +// CodeIndexErrorsInput is the request to code.index_errors. +type CodeIndexErrorsInput = wire.CodeIndexErrorsInput + +// CodeIndexErrorsOutput is the response from code.index_errors. +type CodeIndexErrorsOutput = wire.CodeIndexErrorsOutput + +// CodeIndexStatusInput is the request to code.index_status. +type CodeIndexStatusInput = wire.CodeIndexStatusInput + +// CodeIndexStatusOutput is the response from code.index_status. +type CodeIndexStatusOutput = wire.CodeIndexStatusOutput + +// CodeLanguageCoverage is a model used by Loom operations. +type CodeLanguageCoverage = wire.CodeLanguageCoverage + +// CodeLink is a model used by Loom operations. +type CodeLink = wire.CodeLink + +// CodeMapInput is the request to code.map. +type CodeMapInput = wire.CodeMapInput + +// CodeMapOutput is the response from code.map. +type CodeMapOutput = wire.CodeMapOutput + +// CodeOutcomeInput is the request to code.outcome. +type CodeOutcomeInput = wire.CodeOutcomeInput + +// CodeOutcomeOutput is the response from code.outcome. +type CodeOutcomeOutput = wire.CodeOutcomeOutput + +// CodeOutlineInput is the request to code.outline. +type CodeOutlineInput = wire.CodeOutlineInput + +// CodeOutlineOutput is the response from code.outline. +type CodeOutlineOutput = wire.CodeOutlineOutput + +// CodePathGuardsInput is the request to code.path_guards. +type CodePathGuardsInput = wire.CodePathGuardsInput + +// CodePathGuardsOutput is the response from code.path_guards. +type CodePathGuardsOutput = wire.CodePathGuardsOutput + +// CodePrCheckInput is the request to code.pr_check. +type CodePrCheckInput = wire.CodePrCheckInput + +// CodePrCheckOutput is the response from code.pr_check. +type CodePrCheckOutput = wire.CodePrCheckOutput + +// CodeReadInput is the request to code.read. +type CodeReadInput = wire.CodeReadInput + +// CodeReadOutput is the response from code.read. +type CodeReadOutput = wire.CodeReadOutput + +// CodeReadRange is a model used by Loom operations. +type CodeReadRange = wire.CodeReadRange + +// CodeReadRangeInput is a model used by Loom operations. +type CodeReadRangeInput = wire.CodeReadRangeInput + +// CodeReadWindow is a model used by Loom operations. +type CodeReadWindow = wire.CodeReadWindow + +// CodeRecentCommitRow is a model used by Loom operations. +type CodeRecentCommitRow = wire.CodeRecentCommitRow + +// CodeRecentCommitsInput is the request to code.recent_commits. +type CodeRecentCommitsInput = wire.CodeRecentCommitsInput + +// CodeRecentCommitsOutput is the response from code.recent_commits. +type CodeRecentCommitsOutput = wire.CodeRecentCommitsOutput + +// CodeRefreshInput is the request to code.refresh. +type CodeRefreshInput = wire.CodeRefreshInput + +// CodeRefreshOutput is the response from code.refresh. +type CodeRefreshOutput = wire.CodeRefreshOutput + +// CodeReindexInput is the request to code.reindex. +type CodeReindexInput = wire.CodeReindexInput + +// CodeReindexOutput is the response from code.reindex. +type CodeReindexOutput = wire.CodeReindexOutput + +// CodeRepoAddBranchInput is the request to code.repo.add_branch. +type CodeRepoAddBranchInput = wire.CodeRepoAddBranchInput + +// CodeRepoAddBranchOutput is the response from code.repo.add_branch. +type CodeRepoAddBranchOutput = wire.CodeRepoAddBranchOutput + +// CodeRepoAddInput is the request to code.repo.add. +type CodeRepoAddInput = wire.CodeRepoAddInput + +// CodeRepoAddOutput is the response from code.repo.add. +type CodeRepoAddOutput = wire.CodeRepoAddOutput + +// CodeRepoRemoteBranchesInput is the request to code.repo.remote_branches. +type CodeRepoRemoteBranchesInput = wire.CodeRepoRemoteBranchesInput + +// CodeRepoRemoteBranchesOutput is the response from code.repo.remote_branches. +type CodeRepoRemoteBranchesOutput = wire.CodeRepoRemoteBranchesOutput + +// CodeRepoRemoveInput is the request to code.repo.remove. +type CodeRepoRemoveInput = wire.CodeRepoRemoveInput + +// CodeRepoRemoveOutput is the response from code.repo.remove. +type CodeRepoRemoveOutput = wire.CodeRepoRemoveOutput + +// CodeRepoSetAccessInput is the request to code.repo.set_access. +type CodeRepoSetAccessInput = wire.CodeRepoSetAccessInput + +// CodeRepoSetAccessOutput is the response from code.repo.set_access. +type CodeRepoSetAccessOutput = wire.CodeRepoSetAccessOutput + +// CodeRepoSetSourceInput is the request to code.repo.set_source. +type CodeRepoSetSourceInput = wire.CodeRepoSetSourceInput + +// CodeRepoSetSourceOutput is the response from code.repo.set_source. +type CodeRepoSetSourceOutput = wire.CodeRepoSetSourceOutput + +// CodeRepoSummary is a model used by Loom operations. +type CodeRepoSummary = wire.CodeRepoSummary + +// CodeReposInput is the request to code.repos. +type CodeReposInput = wire.CodeReposInput + +// CodeReposOutput is the response from code.repos. +type CodeReposOutput = wire.CodeReposOutput + +// CodeReviewBriefInput is the request to code.review_brief. +type CodeReviewBriefInput = wire.CodeReviewBriefInput + +// CodeReviewBriefOutput is the response from code.review_brief. +type CodeReviewBriefOutput = wire.CodeReviewBriefOutput + +// CodeScipIngestInput is the request to code.scip_ingest. +type CodeScipIngestInput = wire.CodeScipIngestInput + +// CodeScipIngestOutput is the response from code.scip_ingest. +type CodeScipIngestOutput = wire.CodeScipIngestOutput + +// CodeScipStatusInput is the request to code.scip_status. +type CodeScipStatusInput = wire.CodeScipStatusInput + +// CodeScipStatusOutput is the response from code.scip_status. +type CodeScipStatusOutput = wire.CodeScipStatusOutput + +// CodeSearchInput is the request to code.search. +type CodeSearchInput = wire.CodeSearchInput + +// CodeSearchOutput is the response from code.search. +type CodeSearchOutput = wire.CodeSearchOutput + +// CodeSettingFactsInput is the request to code.setting_facts. +type CodeSettingFactsInput = wire.CodeSettingFactsInput + +// CodeSettingFactsOutput is the response from code.setting_facts. +type CodeSettingFactsOutput = wire.CodeSettingFactsOutput + +// CodeSymbolHistoryInput is the request to code.symbol_history. +type CodeSymbolHistoryInput = wire.CodeSymbolHistoryInput + +// CodeSymbolHistoryOutput is the response from code.symbol_history. +type CodeSymbolHistoryOutput = wire.CodeSymbolHistoryOutput + +// CodeSymbolInput is the request to code.symbol. +type CodeSymbolInput = wire.CodeSymbolInput + +// CodeSymbolOutput is the response from code.symbol. +type CodeSymbolOutput = wire.CodeSymbolOutput + +// CodeTestGateInput is the request to code.test_gate. +type CodeTestGateInput = wire.CodeTestGateInput + +// CodeTestGateOutput is the response from code.test_gate. +type CodeTestGateOutput = wire.CodeTestGateOutput + +// CodeTestHomeInput is the request to code.test_home. +type CodeTestHomeInput = wire.CodeTestHomeInput + +// CodeTestHomeOutput is the response from code.test_home. +type CodeTestHomeOutput = wire.CodeTestHomeOutput + +// CodeTestsForInput is the request to code.tests_for. +type CodeTestsForInput = wire.CodeTestsForInput + +// CodeTestsForOutput is the response from code.tests_for. +type CodeTestsForOutput = wire.CodeTestsForOutput + +// CodeTierCoverage is a model used by Loom operations. +type CodeTierCoverage = wire.CodeTierCoverage + +// CodeTierHealth is a model used by Loom operations. +type CodeTierHealth = wire.CodeTierHealth + +// CodeTraceInput is the request to code.trace. +type CodeTraceInput = wire.CodeTraceInput + +// CodeTraceOutput is the response from code.trace. +type CodeTraceOutput = wire.CodeTraceOutput + +// CodeUnit is a model used by Loom operations. +type CodeUnit = wire.CodeUnit + +// CodeVerifyCitationsInput is the request to code.verify_citations. +type CodeVerifyCitationsInput = wire.CodeVerifyCitationsInput + +// CodeVerifyCitationsOutput is the response from code.verify_citations. +type CodeVerifyCitationsOutput = wire.CodeVerifyCitationsOutput + +// CodeVerifyInput is the request to code.verify. +type CodeVerifyInput = wire.CodeVerifyInput + +// CodeVerifyOutput is the response from code.verify. +type CodeVerifyOutput = wire.CodeVerifyOutput + +// CodeWorkerStatus is a model used by Loom operations. +type CodeWorkerStatus = wire.CodeWorkerStatus + +// CollectionCreateInput is the request to collection.create. +type CollectionCreateInput = wire.CollectionCreateInput + +// CollectionCreateOutput is the response from collection.create. +type CollectionCreateOutput = wire.CollectionCreateOutput + +// CollectionDeleteInput is the request to collection.delete. +type CollectionDeleteInput = wire.CollectionDeleteInput + +// CollectionDeleteOutput is the response from collection.delete. +type CollectionDeleteOutput = wire.CollectionDeleteOutput + +// CollectionEntry is a model used by Loom operations. +type CollectionEntry = wire.CollectionEntry + +// CollectionListInput is the request to collection.list. +type CollectionListInput = wire.CollectionListInput + +// CollectionListOutput is the response from collection.list. +type CollectionListOutput = wire.CollectionListOutput + +// CollectionMoveInput is the request to collection.move. +type CollectionMoveInput = wire.CollectionMoveInput + +// CollectionMoveOutput is the response from collection.move. +type CollectionMoveOutput = wire.CollectionMoveOutput + +// ConflictCandidateMemory is a model used by Loom operations. +type ConflictCandidateMemory = wire.ConflictCandidateMemory + +// ConflictRevisionSuggestion is a model used by Loom operations. +type ConflictRevisionSuggestion = wire.ConflictRevisionSuggestion + +// ConflictRow is a model used by Loom operations. +type ConflictRow = wire.ConflictRow + +// ConflictsAllowlistListInput is the request to conflicts.allowlist_list. +type ConflictsAllowlistListInput = wire.ConflictsAllowlistListInput + +// ConflictsAllowlistListOutput is the response from conflicts.allowlist_list. +type ConflictsAllowlistListOutput = wire.ConflictsAllowlistListOutput + +// ConflictsAllowlistRemoveInput is the request to conflicts.allowlist_remove. +type ConflictsAllowlistRemoveInput = wire.ConflictsAllowlistRemoveInput + +// ConflictsAllowlistRemoveOutput is the response from conflicts.allowlist_remove. +type ConflictsAllowlistRemoveOutput = wire.ConflictsAllowlistRemoveOutput + +// ConflictsListInput is the request to conflicts.list. +type ConflictsListInput = wire.ConflictsListInput + +// ConflictsListOutput is the response from conflicts.list. +type ConflictsListOutput = wire.ConflictsListOutput + +// ConflictsProposeRevisionInput is the request to conflicts.propose_revision. +type ConflictsProposeRevisionInput = wire.ConflictsProposeRevisionInput + +// ConflictsProposeRevisionOutput is the response from conflicts.propose_revision. +type ConflictsProposeRevisionOutput = wire.ConflictsProposeRevisionOutput + +// ConflictsResolveInput is the request to conflicts.resolve. +type ConflictsResolveInput = wire.ConflictsResolveInput + +// ConflictsResolveOutput is the response from conflicts.resolve. +type ConflictsResolveOutput = wire.ConflictsResolveOutput + +// ConnectedAgent is a model used by Loom operations. +type ConnectedAgent = wire.ConnectedAgent + +// ConnectionDisconnectInput is the request to connection.disconnect. +type ConnectionDisconnectInput = wire.ConnectionDisconnectInput + +// ConnectionDisconnectOutput is the response from connection.disconnect. +type ConnectionDisconnectOutput = wire.ConnectionDisconnectOutput + +// ConnectionEntry is a model used by Loom operations. +type ConnectionEntry = wire.ConnectionEntry + +// ConnectionListInput is the request to connection.list. +type ConnectionListInput = wire.ConnectionListInput + +// ConnectionListOutput is the response from connection.list. +type ConnectionListOutput = wire.ConnectionListOutput + +// ConsolidationRunRow is a model used by Loom operations. +type ConsolidationRunRow = wire.ConsolidationRunRow + +// ConsolidationsListInput is the request to consolidations.list. +type ConsolidationsListInput = wire.ConsolidationsListInput + +// ConsolidationsListOutput is the response from consolidations.list. +type ConsolidationsListOutput = wire.ConsolidationsListOutput + +// ContextBlock is a model used by Loom operations. +type ContextBlock = wire.ContextBlock + +// ContextFetchInput is the request to context.fetch. +type ContextFetchInput = wire.ContextFetchInput + +// ContextFetchOutput is the response from context.fetch. +type ContextFetchOutput = wire.ContextFetchOutput + +// ContextOffloadInput is the request to context.offload. +type ContextOffloadInput = wire.ContextOffloadInput + +// ContextOffloadOutput is the response from context.offload. +type ContextOffloadOutput = wire.ContextOffloadOutput + +// ContextPackInput is the request to context.pack. +type ContextPackInput = wire.ContextPackInput + +// ContextPackOutput is the response from context.pack. +type ContextPackOutput = wire.ContextPackOutput + +// ConversationAppendInput is the request to conversation.append. +type ConversationAppendInput = wire.ConversationAppendInput + +// ConversationAppendOutput is the response from conversation.append. +type ConversationAppendOutput = wire.ConversationAppendOutput + +// ConversationCompactInput is the request to conversation.compact. +type ConversationCompactInput = wire.ConversationCompactInput + +// ConversationCompactOutput is the response from conversation.compact. +type ConversationCompactOutput = wire.ConversationCompactOutput + +// ConversationCreateInput is the request to conversation.create. +type ConversationCreateInput = wire.ConversationCreateInput + +// ConversationCreateOutput is the response from conversation.create. +type ConversationCreateOutput = wire.ConversationCreateOutput + +// ConversationDeleteInput is the request to conversation.delete. +type ConversationDeleteInput = wire.ConversationDeleteInput + +// ConversationDeleteOutput is the response from conversation.delete. +type ConversationDeleteOutput = wire.ConversationDeleteOutput + +// ConversationEntry is a model used by Loom operations. +type ConversationEntry = wire.ConversationEntry + +// ConversationGetInput is the request to conversation.get. +type ConversationGetInput = wire.ConversationGetInput + +// ConversationGetOutput is the response from conversation.get. +type ConversationGetOutput = wire.ConversationGetOutput + +// ConversationHit is a model used by Loom operations. +type ConversationHit = wire.ConversationHit + +// ConversationListInput is the request to conversation.list. +type ConversationListInput = wire.ConversationListInput + +// ConversationListOutput is the response from conversation.list. +type ConversationListOutput = wire.ConversationListOutput + +// ConversationListSavedMessagesInput is the request to conversation.list_saved_messages. +type ConversationListSavedMessagesInput = wire.ConversationListSavedMessagesInput + +// ConversationListSavedMessagesOutput is the response from conversation.list_saved_messages. +type ConversationListSavedMessagesOutput = wire.ConversationListSavedMessagesOutput + +// ConversationSaveMessageInput is the request to conversation.save_message. +type ConversationSaveMessageInput = wire.ConversationSaveMessageInput + +// ConversationSaveMessageOutput is the response from conversation.save_message. +type ConversationSaveMessageOutput = wire.ConversationSaveMessageOutput + +// ConversationSavedStatusInput is the request to conversation.saved_status. +type ConversationSavedStatusInput = wire.ConversationSavedStatusInput + +// ConversationSavedStatusOutput is the response from conversation.saved_status. +type ConversationSavedStatusOutput = wire.ConversationSavedStatusOutput + +// ConversationSearchInput is the request to conversation.search. +type ConversationSearchInput = wire.ConversationSearchInput + +// ConversationSearchOutput is the response from conversation.search. +type ConversationSearchOutput = wire.ConversationSearchOutput + +// ConversationSearchSavedMessagesInput is the request to conversation.search_saved_messages. +type ConversationSearchSavedMessagesInput = wire.ConversationSearchSavedMessagesInput + +// ConversationSearchSavedMessagesOutput is the response from conversation.search_saved_messages. +type ConversationSearchSavedMessagesOutput = wire.ConversationSearchSavedMessagesOutput + +// ConversationSetLoggingInput is the request to conversation.set_logging. +type ConversationSetLoggingInput = wire.ConversationSetLoggingInput + +// ConversationSetLoggingOutput is the response from conversation.set_logging. +type ConversationSetLoggingOutput = wire.ConversationSetLoggingOutput + +// ConversationThreadSummary is a model used by Loom operations. +type ConversationThreadSummary = wire.ConversationThreadSummary + +// ConversationThreadsInput is the request to conversation.threads. +type ConversationThreadsInput = wire.ConversationThreadsInput + +// ConversationThreadsOutput is the response from conversation.threads. +type ConversationThreadsOutput = wire.ConversationThreadsOutput + +// ConversationUnsaveMessageInput is the request to conversation.unsave_message. +type ConversationUnsaveMessageInput = wire.ConversationUnsaveMessageInput + +// ConversationUnsaveMessageOutput is the response from conversation.unsave_message. +type ConversationUnsaveMessageOutput = wire.ConversationUnsaveMessageOutput + +// ConversationUpdateInput is the request to conversation.update. +type ConversationUpdateInput = wire.ConversationUpdateInput + +// ConversationUpdateOutput is the response from conversation.update. +type ConversationUpdateOutput = wire.ConversationUpdateOutput + +// CostAgentSummaryInput is the request to cost.agent_summary. +type CostAgentSummaryInput = wire.CostAgentSummaryInput + +// CostAgentSummaryOutput is the response from cost.agent_summary. +type CostAgentSummaryOutput = wire.CostAgentSummaryOutput + +// CostAgentSummaryRow is a model used by Loom operations. +type CostAgentSummaryRow = wire.CostAgentSummaryRow + +// CostBudgetStatusInput is the request to cost.budget_status. +type CostBudgetStatusInput = wire.CostBudgetStatusInput + +// CostBudgetStatusOutput is the response from cost.budget_status. +type CostBudgetStatusOutput = wire.CostBudgetStatusOutput + +// CostRecordTurnsInput is the request to cost.record_turns. +type CostRecordTurnsInput = wire.CostRecordTurnsInput + +// CostRecordTurnsOutput is the response from cost.record_turns. +type CostRecordTurnsOutput = wire.CostRecordTurnsOutput + +// CostSummaryInput is the request to cost.summary. +type CostSummaryInput = wire.CostSummaryInput + +// CostSummaryOutput is the response from cost.summary. +type CostSummaryOutput = wire.CostSummaryOutput + +// CostSummaryRow is a model used by Loom operations. +type CostSummaryRow = wire.CostSummaryRow + +// DatasetClarificationOut is a model used by Loom operations. +type DatasetClarificationOut = wire.DatasetClarificationOut + +// DatasetColumnOut is a model used by Loom operations. +type DatasetColumnOut = wire.DatasetColumnOut + +// DatasetOut is a model used by Loom operations. +type DatasetOut = wire.DatasetOut + +// DatasetRejectedOut is a model used by Loom operations. +type DatasetRejectedOut = wire.DatasetRejectedOut + +// DecisionChainInput is the request to decision.chain. +type DecisionChainInput = wire.DecisionChainInput + +// DecisionChainOutput is the response from decision.chain. +type DecisionChainOutput = wire.DecisionChainOutput + +// DecisionOutcomeInput is the request to decision.outcome. +type DecisionOutcomeInput = wire.DecisionOutcomeInput + +// DecisionOutcomeOutput is the response from decision.outcome. +type DecisionOutcomeOutput = wire.DecisionOutcomeOutput + +// DecisionPrecedentsInput is the request to decision.precedents. +type DecisionPrecedentsInput = wire.DecisionPrecedentsInput + +// DecisionPrecedentsOutput is the response from decision.precedents. +type DecisionPrecedentsOutput = wire.DecisionPrecedentsOutput + +// DecisionRecordInput is the request to decision.record. +type DecisionRecordInput = wire.DecisionRecordInput + +// DecisionRecordOutput is the response from decision.record. +type DecisionRecordOutput = wire.DecisionRecordOutput + +// DecisionRow is a model used by Loom operations. +type DecisionRow = wire.DecisionRow + +// DecisionStage is a model used by Loom operations. +type DecisionStage = wire.DecisionStage + +// DecisionTotals is a model used by Loom operations. +type DecisionTotals = wire.DecisionTotals + +// DedupCluster is a model used by Loom operations. +type DedupCluster = wire.DedupCluster + +// DedupCollapsePair is a model used by Loom operations. +type DedupCollapsePair = wire.DedupCollapsePair + +// DedupDuplicate is a model used by Loom operations. +type DedupDuplicate = wire.DedupDuplicate + +// DefinitionEntry is a model used by Loom operations. +type DefinitionEntry = wire.DefinitionEntry + +// DemonstrationRow is a model used by Loom operations. +type DemonstrationRow = wire.DemonstrationRow + +// DigestRow is a model used by Loom operations. +type DigestRow = wire.DigestRow + +// DocumentChunks is a model used by Loom operations. +type DocumentChunks = wire.DocumentChunks + +// DocumentCount is a model used by Loom operations. +type DocumentCount = wire.DocumentCount + +// DocumentDecisions is a model used by Loom operations. +type DocumentDecisions = wire.DocumentDecisions + +// DocumentFinding is a model used by Loom operations. +type DocumentFinding = wire.DocumentFinding + +// DocumentTotals is a model used by Loom operations. +type DocumentTotals = wire.DocumentTotals + +// ErasureExportInput is the request to erasure.export. +type ErasureExportInput = wire.ErasureExportInput + +// ErasureExportOutput is the response from erasure.export. +type ErasureExportOutput = wire.ErasureExportOutput + +// ErasureExportSection is a model used by Loom operations. +type ErasureExportSection = wire.ErasureExportSection + +// ErasureListInput is the request to erasure.list. +type ErasureListInput = wire.ErasureListInput + +// ErasureListOutput is the response from erasure.list. +type ErasureListOutput = wire.ErasureListOutput + +// ErasureListRow is a model used by Loom operations. +type ErasureListRow = wire.ErasureListRow + +// ErasureRequestInput is the request to erasure.request. +type ErasureRequestInput = wire.ErasureRequestInput + +// ErasureRequestOutput is the response from erasure.request. +type ErasureRequestOutput = wire.ErasureRequestOutput + +// ErasureStatusInput is the request to erasure.status. +type ErasureStatusInput = wire.ErasureStatusInput + +// ErasureStatusOutput is the response from erasure.status. +type ErasureStatusOutput = wire.ErasureStatusOutput + +// ErasureStepResult is a model used by Loom operations. +type ErasureStepResult = wire.ErasureStepResult + +// EvidenceChunk is a model used by Loom operations. +type EvidenceChunk = wire.EvidenceChunk + +// EvidenceDigest is a model used by Loom operations. +type EvidenceDigest = wire.EvidenceDigest + +// EvidenceEdge is a model used by Loom operations. +type EvidenceEdge = wire.EvidenceEdge + +// ExposureSummaryInput is a model used by Loom operations. +type ExposureSummaryInput = wire.ExposureSummaryInput + +// ExposureSummaryOutput is a model used by Loom operations. +type ExposureSummaryOutput = wire.ExposureSummaryOutput + +// ExposureSummaryRow is a model used by Loom operations. +type ExposureSummaryRow = wire.ExposureSummaryRow + +// ExtractionCoverage is a model used by Loom operations. +type ExtractionCoverage = wire.ExtractionCoverage + +// ExtractionPolicyClearInput is the request to extraction_policy.clear. +type ExtractionPolicyClearInput = wire.ExtractionPolicyClearInput + +// ExtractionPolicyClearOutput is the response from extraction_policy.clear. +type ExtractionPolicyClearOutput = wire.ExtractionPolicyClearOutput + +// ExtractionPolicyGetInput is the request to extraction_policy.get. +type ExtractionPolicyGetInput = wire.ExtractionPolicyGetInput + +// ExtractionPolicyGetOutput is the response from extraction_policy.get. +type ExtractionPolicyGetOutput = wire.ExtractionPolicyGetOutput + +// ExtractionPolicyOutput is a model used by Loom operations. +type ExtractionPolicyOutput = wire.ExtractionPolicyOutput + +// ExtractionPolicySetInput is the request to extraction_policy.set. +type ExtractionPolicySetInput = wire.ExtractionPolicySetInput + +// ExtractionPolicySetOutput is the response from extraction_policy.set. +type ExtractionPolicySetOutput = wire.ExtractionPolicySetOutput + +// ExtractionQueueRow is a model used by Loom operations. +type ExtractionQueueRow = wire.ExtractionQueueRow + +// ExtractionTotals is a model used by Loom operations. +type ExtractionTotals = wire.ExtractionTotals + +// FactRow is a model used by Loom operations. +type FactRow = wire.FactRow + +// FactsExpireByAdapterInput is the request to facts.expire_by_adapter. +type FactsExpireByAdapterInput = wire.FactsExpireByAdapterInput + +// FactsExpireByAdapterOutput is the response from facts.expire_by_adapter. +type FactsExpireByAdapterOutput = wire.FactsExpireByAdapterOutput + +// FactsListInput is the request to facts.list. +type FactsListInput = wire.FactsListInput + +// FactsListOutput is the response from facts.list. +type FactsListOutput = wire.FactsListOutput + +// FactsPathInput is the request to facts.path. +type FactsPathInput = wire.FactsPathInput + +// FactsPathOutput is the response from facts.path. +type FactsPathOutput = wire.FactsPathOutput + +// FactsRelatedInput is the request to facts.related. +type FactsRelatedInput = wire.FactsRelatedInput + +// FactsRelatedOutput is the response from facts.related. +type FactsRelatedOutput = wire.FactsRelatedOutput + +// FactsTraverseInput is the request to facts.traverse. +type FactsTraverseInput = wire.FactsTraverseInput + +// FactsTraverseOutput is the response from facts.traverse. +type FactsTraverseOutput = wire.FactsTraverseOutput + +// FindingEvidence is a model used by Loom operations. +type FindingEvidence = wire.FindingEvidence + +// GrantEntry is a model used by Loom operations. +type GrantEntry = wire.GrantEntry + +// GrantsApproveInput is the request to grants.approve. +type GrantsApproveInput = wire.GrantsApproveInput + +// GrantsApproveOutput is the response from grants.approve. +type GrantsApproveOutput = wire.GrantsApproveOutput + +// GrantsCreateInput is the request to grants.create. +type GrantsCreateInput = wire.GrantsCreateInput + +// GrantsCreateOutput is the response from grants.create. +type GrantsCreateOutput = wire.GrantsCreateOutput + +// GrantsListInput is the request to grants.list. +type GrantsListInput = wire.GrantsListInput + +// GrantsListOutput is the response from grants.list. +type GrantsListOutput = wire.GrantsListOutput + +// GrantsPendingForMeInput is the request to grants.pending_for_me. +type GrantsPendingForMeInput = wire.GrantsPendingForMeInput + +// GrantsPendingForMeOutput is the response from grants.pending_for_me. +type GrantsPendingForMeOutput = wire.GrantsPendingForMeOutput + +// GrantsRevokeInput is the request to grants.revoke. +type GrantsRevokeInput = wire.GrantsRevokeInput + +// GrantsRevokeOutput is the response from grants.revoke. +type GrantsRevokeOutput = wire.GrantsRevokeOutput + +// GrantsShareAgentInput is the request to grants.share_agent. +type GrantsShareAgentInput = wire.GrantsShareAgentInput + +// GrantsShareAgentOutput is the response from grants.share_agent. +type GrantsShareAgentOutput = wire.GrantsShareAgentOutput + +// GrantsUnshareAgentInput is the request to grants.unshare_agent. +type GrantsUnshareAgentInput = wire.GrantsUnshareAgentInput + +// GrantsUnshareAgentOutput is the response from grants.unshare_agent. +type GrantsUnshareAgentOutput = wire.GrantsUnshareAgentOutput + +// GrepDependency is a model used by Loom operations. +type GrepDependency = wire.GrepDependency + +// GuideRevision is a model used by Loom operations. +type GuideRevision = wire.GuideRevision + +// HelpGetInput is the request to help.get. +type HelpGetInput = wire.HelpGetInput + +// HelpGetOutput is the response from help.get. +type HelpGetOutput = wire.HelpGetOutput + +// HelpHit is a model used by Loom operations. +type HelpHit = wire.HelpHit + +// HelpOutlineEntry is a model used by Loom operations. +type HelpOutlineEntry = wire.HelpOutlineEntry + +// HelpSearchInput is the request to help.search. +type HelpSearchInput = wire.HelpSearchInput + +// HelpSearchOutput is the response from help.search. +type HelpSearchOutput = wire.HelpSearchOutput + +// InboxCount is a model used by Loom operations. +type InboxCount = wire.InboxCount + +// InboxListInput is the request to inbox.list. +type InboxListInput = wire.InboxListInput + +// InboxListOutput is the response from inbox.list. +type InboxListOutput = wire.InboxListOutput + +// InboxPayload is a model used by Loom operations. +type InboxPayload = wire.InboxPayload + +// InboxPolicyListInput is the request to inbox.policy_list. +type InboxPolicyListInput = wire.InboxPolicyListInput + +// InboxPolicyListOutput is the response from inbox.policy_list. +type InboxPolicyListOutput = wire.InboxPolicyListOutput + +// InboxPolicySetInput is the request to inbox.policy_set. +type InboxPolicySetInput = wire.InboxPolicySetInput + +// InboxPolicySetOutput is the response from inbox.policy_set. +type InboxPolicySetOutput = wire.InboxPolicySetOutput + +// InboxPrincipalsInput is the request to inbox.principals. +type InboxPrincipalsInput = wire.InboxPrincipalsInput + +// InboxPrincipalsOutput is the response from inbox.principals. +type InboxPrincipalsOutput = wire.InboxPrincipalsOutput + +// InboxRegisterInput is the request to inbox.register. +type InboxRegisterInput = wire.InboxRegisterInput + +// InboxRegisterOutput is the response from inbox.register. +type InboxRegisterOutput = wire.InboxRegisterOutput + +// IngestFinding is a model used by Loom operations. +type IngestFinding = wire.IngestFinding + +// IngestJob is a model used by Loom operations. +type IngestJob = wire.IngestJob + +// IngestionTotals is a model used by Loom operations. +type IngestionTotals = wire.IngestionTotals + +// InsightsCatalogInput is the request to insights.catalog. +type InsightsCatalogInput = wire.InsightsCatalogInput + +// InsightsCatalogOutput is the response from insights.catalog. +type InsightsCatalogOutput = wire.InsightsCatalogOutput + +// InsightsQueryInput is the request to insights.query. +type InsightsQueryInput = wire.InsightsQueryInput + +// InsightsQueryOutput is the response from insights.query. +type InsightsQueryOutput = wire.InsightsQueryOutput + +// InspectActivity is a model used by Loom operations. +type InspectActivity = wire.InspectActivity + +// InspectCall is a model used by Loom operations. +type InspectCall = wire.InspectCall + +// InspectCount is a model used by Loom operations. +type InspectCount = wire.InspectCount + +// InspectDocument is a model used by Loom operations. +type InspectDocument = wire.InspectDocument + +// InspectRow is a model used by Loom operations. +type InspectRow = wire.InspectRow + +// InspectSettings is a model used by Loom operations. +type InspectSettings = wire.InspectSettings + +// InspectView is a model used by Loom operations. +type InspectView = wire.InspectView + +// InventoryCapability is a model used by Loom operations. +type InventoryCapability = wire.InventoryCapability + +// InventoryIdentity is a model used by Loom operations. +type InventoryIdentity = wire.InventoryIdentity + +// InventoryPopulation is a model used by Loom operations. +type InventoryPopulation = wire.InventoryPopulation + +// InventoryScope is a model used by Loom operations. +type InventoryScope = wire.InventoryScope + +// InventorySection is a model used by Loom operations. +type InventorySection = wire.InventorySection + +// KnowledgeAddInput is the request to knowledge.add. +type KnowledgeAddInput = wire.KnowledgeAddInput + +// KnowledgeAddOutput is the response from knowledge.add. +type KnowledgeAddOutput = wire.KnowledgeAddOutput + +// KnowledgeBulkAddInput is the request to knowledge.bulk_add. +type KnowledgeBulkAddInput = wire.KnowledgeBulkAddInput + +// KnowledgeBulkAddOutput is the response from knowledge.bulk_add. +type KnowledgeBulkAddOutput = wire.KnowledgeBulkAddOutput + +// KnowledgeBulkDeleteInput is the request to knowledge.bulk_delete. +type KnowledgeBulkDeleteInput = wire.KnowledgeBulkDeleteInput + +// KnowledgeBulkDeleteOutput is the response from knowledge.bulk_delete. +type KnowledgeBulkDeleteOutput = wire.KnowledgeBulkDeleteOutput + +// KnowledgeBulkDeleteResult is a model used by Loom operations. +type KnowledgeBulkDeleteResult = wire.KnowledgeBulkDeleteResult + +// KnowledgeBulkEntry is a model used by Loom operations. +type KnowledgeBulkEntry = wire.KnowledgeBulkEntry + +// KnowledgeBulkEntryResult is a model used by Loom operations. +type KnowledgeBulkEntryResult = wire.KnowledgeBulkEntryResult + +// KnowledgeChunkCluster is a model used by Loom operations. +type KnowledgeChunkCluster = wire.KnowledgeChunkCluster + +// KnowledgeDatasetApproveInput is the request to knowledge.dataset_approve. +type KnowledgeDatasetApproveInput = wire.KnowledgeDatasetApproveInput + +// KnowledgeDatasetApproveOutput is the response from knowledge.dataset_approve. +type KnowledgeDatasetApproveOutput = wire.KnowledgeDatasetApproveOutput + +// KnowledgeDatasetGetInput is the request to knowledge.dataset_get. +type KnowledgeDatasetGetInput = wire.KnowledgeDatasetGetInput + +// KnowledgeDatasetGetOutput is the response from knowledge.dataset_get. +type KnowledgeDatasetGetOutput = wire.KnowledgeDatasetGetOutput + +// KnowledgeDedupListInput is the request to knowledge.dedup_list. +type KnowledgeDedupListInput = wire.KnowledgeDedupListInput + +// KnowledgeDedupListOutput is the response from knowledge.dedup_list. +type KnowledgeDedupListOutput = wire.KnowledgeDedupListOutput + +// KnowledgeDedupResolveInput is the request to knowledge.dedup_resolve. +type KnowledgeDedupResolveInput = wire.KnowledgeDedupResolveInput + +// KnowledgeDedupResolveOutput is the response from knowledge.dedup_resolve. +type KnowledgeDedupResolveOutput = wire.KnowledgeDedupResolveOutput + +// KnowledgeDeleteInput is the request to knowledge.delete. +type KnowledgeDeleteInput = wire.KnowledgeDeleteInput + +// KnowledgeDeleteOutput is the response from knowledge.delete. +type KnowledgeDeleteOutput = wire.KnowledgeDeleteOutput + +// KnowledgeDocCluster is a model used by Loom operations. +type KnowledgeDocCluster = wire.KnowledgeDocCluster + +// KnowledgeFormat is a model used by Loom operations. +type KnowledgeFormat = wire.KnowledgeFormat + +// KnowledgeFormatsInput is the request to knowledge.formats. +type KnowledgeFormatsInput = wire.KnowledgeFormatsInput + +// KnowledgeFormatsOutput is the response from knowledge.formats. +type KnowledgeFormatsOutput = wire.KnowledgeFormatsOutput + +// KnowledgeGap is a model used by Loom operations. +type KnowledgeGap = wire.KnowledgeGap + +// KnowledgeGapsDraftInput is the request to knowledge.gaps.draft. +type KnowledgeGapsDraftInput = wire.KnowledgeGapsDraftInput + +// KnowledgeGapsDraftOutput is the response from knowledge.gaps.draft. +type KnowledgeGapsDraftOutput = wire.KnowledgeGapsDraftOutput + +// KnowledgeGapsListInput is the request to knowledge.gaps.list. +type KnowledgeGapsListInput = wire.KnowledgeGapsListInput + +// KnowledgeGapsListOutput is the response from knowledge.gaps.list. +type KnowledgeGapsListOutput = wire.KnowledgeGapsListOutput + +// KnowledgeGetInput is the request to knowledge.get. +type KnowledgeGetInput = wire.KnowledgeGetInput + +// KnowledgeGetOutput is the response from knowledge.get. +type KnowledgeGetOutput = wire.KnowledgeGetOutput + +// KnowledgeIngestCancelInput is the request to knowledge.ingest_cancel. +type KnowledgeIngestCancelInput = wire.KnowledgeIngestCancelInput + +// KnowledgeIngestCancelOutput is the response from knowledge.ingest_cancel. +type KnowledgeIngestCancelOutput = wire.KnowledgeIngestCancelOutput + +// KnowledgeIngestInput is the request to knowledge.ingest. +type KnowledgeIngestInput = wire.KnowledgeIngestInput + +// KnowledgeIngestOptions is a model used by Loom operations. +type KnowledgeIngestOptions = wire.KnowledgeIngestOptions + +// KnowledgeIngestOutput is the response from knowledge.ingest. +type KnowledgeIngestOutput = wire.KnowledgeIngestOutput + +// KnowledgeIngestStatusInput is the request to knowledge.ingest_status. +type KnowledgeIngestStatusInput = wire.KnowledgeIngestStatusInput + +// KnowledgeIngestStatusOutput is the response from knowledge.ingest_status. +type KnowledgeIngestStatusOutput = wire.KnowledgeIngestStatusOutput + +// KnowledgeInspectInput is the request to knowledge.inspect. +type KnowledgeInspectInput = wire.KnowledgeInspectInput + +// KnowledgeInspectOutput is the response from knowledge.inspect. +type KnowledgeInspectOutput = wire.KnowledgeInspectOutput + +// KnowledgeListEntry is a model used by Loom operations. +type KnowledgeListEntry = wire.KnowledgeListEntry + +// KnowledgeListInput is the request to knowledge.list. +type KnowledgeListInput = wire.KnowledgeListInput + +// KnowledgeListOutput is the response from knowledge.list. +type KnowledgeListOutput = wire.KnowledgeListOutput + +// KnowledgeMoveInput is the request to knowledge.move. +type KnowledgeMoveInput = wire.KnowledgeMoveInput + +// KnowledgeMoveOutput is the response from knowledge.move. +type KnowledgeMoveOutput = wire.KnowledgeMoveOutput + +// KnowledgeMoveResult is a model used by Loom operations. +type KnowledgeMoveResult = wire.KnowledgeMoveResult + +// KnowledgeOutlineInput is the request to knowledge.outline. +type KnowledgeOutlineInput = wire.KnowledgeOutlineInput + +// KnowledgeOutlineOutput is the response from knowledge.outline. +type KnowledgeOutlineOutput = wire.KnowledgeOutlineOutput + +// KnowledgeQueryHistoryAddInput is the request to knowledge.query_history.add. +type KnowledgeQueryHistoryAddInput = wire.KnowledgeQueryHistoryAddInput + +// KnowledgeQueryHistoryAddOutput is the response from knowledge.query_history.add. +type KnowledgeQueryHistoryAddOutput = wire.KnowledgeQueryHistoryAddOutput + +// KnowledgeQueryHistoryListInput is the request to knowledge.query_history.list. +type KnowledgeQueryHistoryListInput = wire.KnowledgeQueryHistoryListInput + +// KnowledgeQueryHistoryListOutput is the response from knowledge.query_history.list. +type KnowledgeQueryHistoryListOutput = wire.KnowledgeQueryHistoryListOutput + +// KnowledgeQueryHistoryRemoveInput is the request to knowledge.query_history.remove. +type KnowledgeQueryHistoryRemoveInput = wire.KnowledgeQueryHistoryRemoveInput + +// KnowledgeQueryHistoryRemoveOutput is the response from knowledge.query_history.remove. +type KnowledgeQueryHistoryRemoveOutput = wire.KnowledgeQueryHistoryRemoveOutput + +// KnowledgeQueryInput is the request to knowledge.query. +type KnowledgeQueryInput = wire.KnowledgeQueryInput + +// KnowledgeQueryOutput is the response from knowledge.query. +type KnowledgeQueryOutput = wire.KnowledgeQueryOutput + +// KnowledgeReadsInput is the request to knowledge.reads. +type KnowledgeReadsInput = wire.KnowledgeReadsInput + +// KnowledgeReadsOutput is the response from knowledge.reads. +type KnowledgeReadsOutput = wire.KnowledgeReadsOutput + +// KnowledgeRestoreInput is the request to knowledge.restore. +type KnowledgeRestoreInput = wire.KnowledgeRestoreInput + +// KnowledgeRestoreOutput is the response from knowledge.restore. +type KnowledgeRestoreOutput = wire.KnowledgeRestoreOutput + +// KnowledgeSearchInput is the request to knowledge.search. +type KnowledgeSearchInput = wire.KnowledgeSearchInput + +// KnowledgeSearchOutput is the response from knowledge.search. +type KnowledgeSearchOutput = wire.KnowledgeSearchOutput + +// KnowledgeSourceAddInput is the request to knowledge.source.add. +type KnowledgeSourceAddInput = wire.KnowledgeSourceAddInput + +// KnowledgeSourceAddOutput is the response from knowledge.source.add. +type KnowledgeSourceAddOutput = wire.KnowledgeSourceAddOutput + +// KnowledgeSourceCheckInput is the request to knowledge.source.check. +type KnowledgeSourceCheckInput = wire.KnowledgeSourceCheckInput + +// KnowledgeSourceCheckOutput is the response from knowledge.source.check. +type KnowledgeSourceCheckOutput = wire.KnowledgeSourceCheckOutput + +// KnowledgeSourceDocument is a model used by Loom operations. +type KnowledgeSourceDocument = wire.KnowledgeSourceDocument + +// KnowledgeSourceEntry is a model used by Loom operations. +type KnowledgeSourceEntry = wire.KnowledgeSourceEntry + +// KnowledgeSourceInspectInput is the request to knowledge.source.inspect. +type KnowledgeSourceInspectInput = wire.KnowledgeSourceInspectInput + +// KnowledgeSourceInspectOutput is the response from knowledge.source.inspect. +type KnowledgeSourceInspectOutput = wire.KnowledgeSourceInspectOutput + +// KnowledgeSourceListInput is the request to knowledge.source.list. +type KnowledgeSourceListInput = wire.KnowledgeSourceListInput + +// KnowledgeSourceListOutput is the response from knowledge.source.list. +type KnowledgeSourceListOutput = wire.KnowledgeSourceListOutput + +// KnowledgeSourceParseLinksInput is the request to knowledge.source.parse_links. +type KnowledgeSourceParseLinksInput = wire.KnowledgeSourceParseLinksInput + +// KnowledgeSourceParseLinksOutput is the response from knowledge.source.parse_links. +type KnowledgeSourceParseLinksOutput = wire.KnowledgeSourceParseLinksOutput + +// KnowledgeSourceParsedLink is a model used by Loom operations. +type KnowledgeSourceParsedLink = wire.KnowledgeSourceParsedLink + +// KnowledgeSourceProbe is a model used by Loom operations. +type KnowledgeSourceProbe = wire.KnowledgeSourceProbe + +// KnowledgeSourcePushConfigureInput is the request to knowledge.source.push_configure. +type KnowledgeSourcePushConfigureInput = wire.KnowledgeSourcePushConfigureInput + +// KnowledgeSourcePushConfigureOutput is the response from knowledge.source.push_configure. +type KnowledgeSourcePushConfigureOutput = wire.KnowledgeSourcePushConfigureOutput + +// KnowledgeSourcePushConfirmInput is the request to knowledge.source.push_confirm. +type KnowledgeSourcePushConfirmInput = wire.KnowledgeSourcePushConfirmInput + +// KnowledgeSourcePushConfirmOutput is the response from knowledge.source.push_confirm. +type KnowledgeSourcePushConfirmOutput = wire.KnowledgeSourcePushConfirmOutput + +// KnowledgeSourcePushStatusInput is the request to knowledge.source.push_status. +type KnowledgeSourcePushStatusInput = wire.KnowledgeSourcePushStatusInput + +// KnowledgeSourcePushStatusOutput is the response from knowledge.source.push_status. +type KnowledgeSourcePushStatusOutput = wire.KnowledgeSourcePushStatusOutput + +// KnowledgeSourceRemoveInput is the request to knowledge.source.remove. +type KnowledgeSourceRemoveInput = wire.KnowledgeSourceRemoveInput + +// KnowledgeSourceRemoveOutput is the response from knowledge.source.remove. +type KnowledgeSourceRemoveOutput = wire.KnowledgeSourceRemoveOutput + +// KnowledgeSourceRotateInput is the request to knowledge.source.rotate. +type KnowledgeSourceRotateInput = wire.KnowledgeSourceRotateInput + +// KnowledgeSourceRotateOutput is the response from knowledge.source.rotate. +type KnowledgeSourceRotateOutput = wire.KnowledgeSourceRotateOutput + +// KnowledgeSourceSync is a model used by Loom operations. +type KnowledgeSourceSync = wire.KnowledgeSourceSync + +// KnowledgeSourceSyncNowInput is the request to knowledge.source.sync_now. +type KnowledgeSourceSyncNowInput = wire.KnowledgeSourceSyncNowInput + +// KnowledgeSourceSyncNowOutput is the response from knowledge.source.sync_now. +type KnowledgeSourceSyncNowOutput = wire.KnowledgeSourceSyncNowOutput + +// KnowledgeSourceUpdateInput is the request to knowledge.source.update. +type KnowledgeSourceUpdateInput = wire.KnowledgeSourceUpdateInput + +// KnowledgeSourceUpdateOutput is the response from knowledge.source.update. +type KnowledgeSourceUpdateOutput = wire.KnowledgeSourceUpdateOutput + +// KnowledgeSynthesizeInput is the request to knowledge.synthesize. +type KnowledgeSynthesizeInput = wire.KnowledgeSynthesizeInput + +// KnowledgeSynthesizeOutput is the response from knowledge.synthesize. +type KnowledgeSynthesizeOutput = wire.KnowledgeSynthesizeOutput + +// KnowledgeUpdateMetadataInput is the request to knowledge.update_metadata. +type KnowledgeUpdateMetadataInput = wire.KnowledgeUpdateMetadataInput + +// KnowledgeUpdateMetadataOutput is the response from knowledge.update_metadata. +type KnowledgeUpdateMetadataOutput = wire.KnowledgeUpdateMetadataOutput + +// KnowledgeUpsertInput is the request to knowledge.upsert. +type KnowledgeUpsertInput = wire.KnowledgeUpsertInput + +// KnowledgeUpsertOutput is the response from knowledge.upsert. +type KnowledgeUpsertOutput = wire.KnowledgeUpsertOutput + +// LearningEntry is a model used by Loom operations. +type LearningEntry = wire.LearningEntry + +// LearningsListInput is the request to learnings.list. +type LearningsListInput = wire.LearningsListInput + +// LearningsListOutput is the response from learnings.list. +type LearningsListOutput = wire.LearningsListOutput + +// LearningsQualityInput is the request to learnings.quality. +type LearningsQualityInput = wire.LearningsQualityInput + +// LearningsQualityOutput is the response from learnings.quality. +type LearningsQualityOutput = wire.LearningsQualityOutput + +// LearningsQualityRow is a model used by Loom operations. +type LearningsQualityRow = wire.LearningsQualityRow + +// LearningsReviewInput is the request to learnings.review. +type LearningsReviewInput = wire.LearningsReviewInput + +// LearningsReviewOutput is the response from learnings.review. +type LearningsReviewOutput = wire.LearningsReviewOutput + +// LineageAuditEvent is a model used by Loom operations. +type LineageAuditEvent = wire.LineageAuditEvent + +// LineageCandidate is a model used by Loom operations. +type LineageCandidate = wire.LineageCandidate + +// LineageSupporter is a model used by Loom operations. +type LineageSupporter = wire.LineageSupporter + +// LiveSearchHit is a model used by Loom operations. +type LiveSearchHit = wire.LiveSearchHit + +// LiveSearchResults is a model used by Loom operations. +type LiveSearchResults = wire.LiveSearchResults + +// LostName is a model used by Loom operations. +type LostName = wire.LostName + +// MemoryAgentsListInput is the request to memory.agents_list. +type MemoryAgentsListInput = wire.MemoryAgentsListInput + +// MemoryAgentsListOutput is the response from memory.agents_list. +type MemoryAgentsListOutput = wire.MemoryAgentsListOutput + +// MemoryAggregateInput is the request to memory.aggregate. +type MemoryAggregateInput = wire.MemoryAggregateInput + +// MemoryAggregateOutput is the response from memory.aggregate. +type MemoryAggregateOutput = wire.MemoryAggregateOutput + +// MemoryAppendBatchInput is the request to memory.append_batch. +type MemoryAppendBatchInput = wire.MemoryAppendBatchInput + +// MemoryAppendBatchOutput is the response from memory.append_batch. +type MemoryAppendBatchOutput = wire.MemoryAppendBatchOutput + +// MemoryApplyInput is the request to memory.apply. +type MemoryApplyInput = wire.MemoryApplyInput + +// MemoryApplyOutput is the response from memory.apply. +type MemoryApplyOutput = wire.MemoryApplyOutput + +// MemoryAskInput is the request to memory.ask. +type MemoryAskInput = wire.MemoryAskInput + +// MemoryAskOutput is the response from memory.ask. +type MemoryAskOutput = wire.MemoryAskOutput + +// MemoryAssignCategoryInput is the request to memory.assign_category. +type MemoryAssignCategoryInput = wire.MemoryAssignCategoryInput + +// MemoryAssignCategoryOutput is the response from memory.assign_category. +type MemoryAssignCategoryOutput = wire.MemoryAssignCategoryOutput + +// MemoryAutoRetirement is a model used by Loom operations. +type MemoryAutoRetirement = wire.MemoryAutoRetirement + +// MemoryAutoRetirementsInput is the request to memory.auto_retirements. +type MemoryAutoRetirementsInput = wire.MemoryAutoRetirementsInput + +// MemoryAutoRetirementsOutput is the response from memory.auto_retirements. +type MemoryAutoRetirementsOutput = wire.MemoryAutoRetirementsOutput + +// MemoryBacklinksInput is the request to memory.backlinks. +type MemoryBacklinksInput = wire.MemoryBacklinksInput + +// MemoryBacklinksOutput is the response from memory.backlinks. +type MemoryBacklinksOutput = wire.MemoryBacklinksOutput + +// MemoryBriefInput is the request to memory.brief. +type MemoryBriefInput = wire.MemoryBriefInput + +// MemoryBriefOutput is the response from memory.brief. +type MemoryBriefOutput = wire.MemoryBriefOutput + +// MemoryBulkGetInput is the request to memory.bulk_get. +type MemoryBulkGetInput = wire.MemoryBulkGetInput + +// MemoryBulkGetOutput is the response from memory.bulk_get. +type MemoryBulkGetOutput = wire.MemoryBulkGetOutput + +// MemoryBulkSetInput is the request to memory.bulk_set. +type MemoryBulkSetInput = wire.MemoryBulkSetInput + +// MemoryBulkSetOutput is the response from memory.bulk_set. +type MemoryBulkSetOutput = wire.MemoryBulkSetOutput + +// MemoryClearInput is the request to memory.clear. +type MemoryClearInput = wire.MemoryClearInput + +// MemoryClearOutput is the response from memory.clear. +type MemoryClearOutput = wire.MemoryClearOutput + +// MemoryConsolidateInput is the request to memory.consolidate. +type MemoryConsolidateInput = wire.MemoryConsolidateInput + +// MemoryConsolidateOutput is the response from memory.consolidate. +type MemoryConsolidateOutput = wire.MemoryConsolidateOutput + +// MemoryConsolidateResult is a model used by Loom operations. +type MemoryConsolidateResult = wire.MemoryConsolidateResult + +// MemoryCopyToInput is the request to memory.copy_to. +type MemoryCopyToInput = wire.MemoryCopyToInput + +// MemoryCopyToOutput is the response from memory.copy_to. +type MemoryCopyToOutput = wire.MemoryCopyToOutput + +// MemoryCrossPromoteInput is the request to memory.cross_promote. +type MemoryCrossPromoteInput = wire.MemoryCrossPromoteInput + +// MemoryCrossPromoteOutput is the response from memory.cross_promote. +type MemoryCrossPromoteOutput = wire.MemoryCrossPromoteOutput + +// MemoryDedupCollapseInput is the request to memory.dedup_collapse. +type MemoryDedupCollapseInput = wire.MemoryDedupCollapseInput + +// MemoryDedupCollapseOutput is the response from memory.dedup_collapse. +type MemoryDedupCollapseOutput = wire.MemoryDedupCollapseOutput + +// MemoryDedupListInput is the request to memory.dedup_list. +type MemoryDedupListInput = wire.MemoryDedupListInput + +// MemoryDedupListOutput is the response from memory.dedup_list. +type MemoryDedupListOutput = wire.MemoryDedupListOutput + +// MemoryDedupResolveInput is the request to memory.dedup_resolve. +type MemoryDedupResolveInput = wire.MemoryDedupResolveInput + +// MemoryDedupResolveOutput is the response from memory.dedup_resolve. +type MemoryDedupResolveOutput = wire.MemoryDedupResolveOutput + +// MemoryDefinitionsListInput is the request to memory.definitions.list. +type MemoryDefinitionsListInput = wire.MemoryDefinitionsListInput + +// MemoryDefinitionsListOutput is the response from memory.definitions.list. +type MemoryDefinitionsListOutput = wire.MemoryDefinitionsListOutput + +// MemoryDeleteInput is the request to memory.delete. +type MemoryDeleteInput = wire.MemoryDeleteInput + +// MemoryDeleteOutput is the response from memory.delete. +type MemoryDeleteOutput = wire.MemoryDeleteOutput + +// MemoryDeleteVersionInput is the request to memory.delete_version. +type MemoryDeleteVersionInput = wire.MemoryDeleteVersionInput + +// MemoryDeleteVersionOutput is the response from memory.delete_version. +type MemoryDeleteVersionOutput = wire.MemoryDeleteVersionOutput + +// MemoryDemonstrateInput is the request to memory.demonstrate. +type MemoryDemonstrateInput = wire.MemoryDemonstrateInput + +// MemoryDemonstrateOutput is the response from memory.demonstrate. +type MemoryDemonstrateOutput = wire.MemoryDemonstrateOutput + +// MemoryDemoteInput is the request to memory.demote. +type MemoryDemoteInput = wire.MemoryDemoteInput + +// MemoryDemoteOutput is the response from memory.demote. +type MemoryDemoteOutput = wire.MemoryDemoteOutput + +// MemoryDigestsInput is the request to memory.digests. +type MemoryDigestsInput = wire.MemoryDigestsInput + +// MemoryDigestsOutput is the response from memory.digests. +type MemoryDigestsOutput = wire.MemoryDigestsOutput + +// MemoryEvidenceInput is the request to memory.evidence. +type MemoryEvidenceInput = wire.MemoryEvidenceInput + +// MemoryEvidenceItem is a model used by Loom operations. +type MemoryEvidenceItem = wire.MemoryEvidenceItem + +// MemoryEvidenceOutput is the response from memory.evidence. +type MemoryEvidenceOutput = wire.MemoryEvidenceOutput + +// MemoryExportEvidenceInput is the request to memory.export_evidence. +type MemoryExportEvidenceInput = wire.MemoryExportEvidenceInput + +// MemoryExportEvidenceOutput is the response from memory.export_evidence. +type MemoryExportEvidenceOutput = wire.MemoryExportEvidenceOutput + +// MemoryExposureSummaryInput is the request to memory.exposure_summary. +type MemoryExposureSummaryInput = wire.MemoryExposureSummaryInput + +// MemoryExposureSummaryOutput is the response from memory.exposure_summary. +type MemoryExposureSummaryOutput = wire.MemoryExposureSummaryOutput + +// MemoryExtractionRetryMineInput is the request to memory.extraction_retry_mine. +type MemoryExtractionRetryMineInput = wire.MemoryExtractionRetryMineInput + +// MemoryExtractionRetryMineOutput is the response from memory.extraction_retry_mine. +type MemoryExtractionRetryMineOutput = wire.MemoryExtractionRetryMineOutput + +// MemoryExtractionStatusInput is the request to memory.extraction_status. +type MemoryExtractionStatusInput = wire.MemoryExtractionStatusInput + +// MemoryExtractionStatusMineInput is the request to memory.extraction_status_mine. +type MemoryExtractionStatusMineInput = wire.MemoryExtractionStatusMineInput + +// MemoryExtractionStatusMineOutput is the response from memory.extraction_status_mine. +type MemoryExtractionStatusMineOutput = wire.MemoryExtractionStatusMineOutput + +// MemoryExtractionStatusOutput is the response from memory.extraction_status. +type MemoryExtractionStatusOutput = wire.MemoryExtractionStatusOutput + +// MemoryFindingRef is a model used by Loom operations. +type MemoryFindingRef = wire.MemoryFindingRef + +// MemoryForFileHit is a model used by Loom operations. +type MemoryForFileHit = wire.MemoryForFileHit + +// MemoryForFileInput is the request to memory.for_file. +type MemoryForFileInput = wire.MemoryForFileInput + +// MemoryForFileOutput is the response from memory.for_file. +type MemoryForFileOutput = wire.MemoryForFileOutput + +// MemoryGetByIDInput is the request to memory.get_by_id. +type MemoryGetByIDInput = wire.MemoryGetByIDInput + +// MemoryGetByIDOutput is the response from memory.get_by_id. +type MemoryGetByIDOutput = wire.MemoryGetByIDOutput + +// MemoryGetInput is the request to memory.get. +type MemoryGetInput = wire.MemoryGetInput + +// MemoryGetOutput is the response from memory.get. +type MemoryGetOutput = wire.MemoryGetOutput + +// MemoryHealthFootprint is a model used by Loom operations. +type MemoryHealthFootprint = wire.MemoryHealthFootprint + +// MemoryHealthInput is the request to memory.health. +type MemoryHealthInput = wire.MemoryHealthInput + +// MemoryHealthOutput is the response from memory.health. +type MemoryHealthOutput = wire.MemoryHealthOutput + +// MemoryHealthStaleness is a model used by Loom operations. +type MemoryHealthStaleness = wire.MemoryHealthStaleness + +// MemoryHealthTopRow is a model used by Loom operations. +type MemoryHealthTopRow = wire.MemoryHealthTopRow + +// MemoryHealthTypeRow is a model used by Loom operations. +type MemoryHealthTypeRow = wire.MemoryHealthTypeRow + +// MemoryHistoryInput is the request to memory.history. +type MemoryHistoryInput = wire.MemoryHistoryInput + +// MemoryHistoryOutput is the response from memory.history. +type MemoryHistoryOutput = wire.MemoryHistoryOutput + +// MemoryHistoryRow is a model used by Loom operations. +type MemoryHistoryRow = wire.MemoryHistoryRow + +// MemoryImportCuratedInput is the request to memory.import_curated. +type MemoryImportCuratedInput = wire.MemoryImportCuratedInput + +// MemoryImportCuratedOutput is the response from memory.import_curated. +type MemoryImportCuratedOutput = wire.MemoryImportCuratedOutput + +// MemoryImportCuratedRow is a model used by Loom operations. +type MemoryImportCuratedRow = wire.MemoryImportCuratedRow + +// MemoryImportEntry is a model used by Loom operations. +type MemoryImportEntry = wire.MemoryImportEntry + +// MemoryImportEvidenceInput is the request to memory.import_evidence. +type MemoryImportEvidenceInput = wire.MemoryImportEvidenceInput + +// MemoryImportEvidenceOutput is the response from memory.import_evidence. +type MemoryImportEvidenceOutput = wire.MemoryImportEvidenceOutput + +// MemoryImportInput is the request to memory.import. +type MemoryImportInput = wire.MemoryImportInput + +// MemoryImportOutput is the response from memory.import. +type MemoryImportOutput = wire.MemoryImportOutput + +// MemoryImportResult is a model used by Loom operations. +type MemoryImportResult = wire.MemoryImportResult + +// MemoryImportTotals is a model used by Loom operations. +type MemoryImportTotals = wire.MemoryImportTotals + +// MemoryInspectInput is the request to memory.inspect. +type MemoryInspectInput = wire.MemoryInspectInput + +// MemoryInspectOutput is the response from memory.inspect. +type MemoryInspectOutput = wire.MemoryInspectOutput + +// MemoryKeyRef is a model used by Loom operations. +type MemoryKeyRef = wire.MemoryKeyRef + +// MemoryKeysInput is the request to memory.keys. +type MemoryKeysInput = wire.MemoryKeysInput + +// MemoryKeysOutput is the response from memory.keys. +type MemoryKeysOutput = wire.MemoryKeysOutput + +// MemoryLineageInput is the request to memory.lineage. +type MemoryLineageInput = wire.MemoryLineageInput + +// MemoryLineageOutput is the response from memory.lineage. +type MemoryLineageOutput = wire.MemoryLineageOutput + +// MemoryLinkInput is the request to memory.link. +type MemoryLinkInput = wire.MemoryLinkInput + +// MemoryLinkOutput is the response from memory.link. +type MemoryLinkOutput = wire.MemoryLinkOutput + +// MemoryListEntry is a model used by Loom operations. +type MemoryListEntry = wire.MemoryListEntry + +// MemoryListInput is the request to memory.list. +type MemoryListInput = wire.MemoryListInput + +// MemoryListOutput is the response from memory.list. +type MemoryListOutput = wire.MemoryListOutput + +// MemoryLockInput is the request to memory.lock. +type MemoryLockInput = wire.MemoryLockInput + +// MemoryLockOutput is the response from memory.lock. +type MemoryLockOutput = wire.MemoryLockOutput + +// MemoryMoveInput is the request to memory.move. +type MemoryMoveInput = wire.MemoryMoveInput + +// MemoryMoveOutput is the response from memory.move. +type MemoryMoveOutput = wire.MemoryMoveOutput + +// MemoryOutcomeInput is the request to memory.outcome. +type MemoryOutcomeInput = wire.MemoryOutcomeInput + +// MemoryOutcomeOutput is the response from memory.outcome. +type MemoryOutcomeOutput = wire.MemoryOutcomeOutput + +// MemoryOutcomeRunInput is the request to memory.outcome_run. +type MemoryOutcomeRunInput = wire.MemoryOutcomeRunInput + +// MemoryOutcomeRunOutput is the response from memory.outcome_run. +type MemoryOutcomeRunOutput = wire.MemoryOutcomeRunOutput + +// MemoryOutlineInput is the request to memory.outline. +type MemoryOutlineInput = wire.MemoryOutlineInput + +// MemoryOutlineOutput is the response from memory.outline. +type MemoryOutlineOutput = wire.MemoryOutlineOutput + +// MemoryOwnerReportInput is the request to memory.owner_report. +type MemoryOwnerReportInput = wire.MemoryOwnerReportInput + +// MemoryOwnerReportOutput is the response from memory.owner_report. +type MemoryOwnerReportOutput = wire.MemoryOwnerReportOutput + +// MemoryPinInput is the request to memory.pin. +type MemoryPinInput = wire.MemoryPinInput + +// MemoryPinOutput is the response from memory.pin. +type MemoryPinOutput = wire.MemoryPinOutput + +// MemoryPromoteInput is the request to memory.promote. +type MemoryPromoteInput = wire.MemoryPromoteInput + +// MemoryPromoteOutput is the response from memory.promote. +type MemoryPromoteOutput = wire.MemoryPromoteOutput + +// MemoryProposal is a model used by Loom operations. +type MemoryProposal = wire.MemoryProposal + +// MemoryProposalDecideInput is the request to memory.proposal_decide. +type MemoryProposalDecideInput = wire.MemoryProposalDecideInput + +// MemoryProposalDecideOutput is the response from memory.proposal_decide. +type MemoryProposalDecideOutput = wire.MemoryProposalDecideOutput + +// MemoryProposalDecision is a model used by Loom operations. +type MemoryProposalDecision = wire.MemoryProposalDecision + +// MemoryProposalsInput is the request to memory.proposals. +type MemoryProposalsInput = wire.MemoryProposalsInput + +// MemoryProposalsOutput is the response from memory.proposals. +type MemoryProposalsOutput = wire.MemoryProposalsOutput + +// MemoryProvenanceInput is the request to memory.provenance. +type MemoryProvenanceInput = wire.MemoryProvenanceInput + +// MemoryProvenanceLink is a model used by Loom operations. +type MemoryProvenanceLink = wire.MemoryProvenanceLink + +// MemoryProvenanceOutput is the response from memory.provenance. +type MemoryProvenanceOutput = wire.MemoryProvenanceOutput + +// MemoryRecallInput is the request to memory.recall. +type MemoryRecallInput = wire.MemoryRecallInput + +// MemoryRecallOutput is the response from memory.recall. +type MemoryRecallOutput = wire.MemoryRecallOutput + +// MemoryRecordConflictRow is a model used by Loom operations. +type MemoryRecordConflictRow = wire.MemoryRecordConflictRow + +// MemoryRecordConflictsInput is the request to memory.record.conflicts. +type MemoryRecordConflictsInput = wire.MemoryRecordConflictsInput + +// MemoryRecordConflictsOutput is the response from memory.record.conflicts. +type MemoryRecordConflictsOutput = wire.MemoryRecordConflictsOutput + +// MemoryRecordHistoryInput is the request to memory.record.history. +type MemoryRecordHistoryInput = wire.MemoryRecordHistoryInput + +// MemoryRecordHistoryOutput is the response from memory.record.history. +type MemoryRecordHistoryOutput = wire.MemoryRecordHistoryOutput + +// MemoryRecordQueryInput is the request to memory.record.query. +type MemoryRecordQueryInput = wire.MemoryRecordQueryInput + +// MemoryRecordQueryOutput is the response from memory.record.query. +type MemoryRecordQueryOutput = wire.MemoryRecordQueryOutput + +// MemoryRecordRow is a model used by Loom operations. +type MemoryRecordRow = wire.MemoryRecordRow + +// MemoryRecordWriteInput is the request to memory.record.write. +type MemoryRecordWriteInput = wire.MemoryRecordWriteInput + +// MemoryRecordWriteOutput is the response from memory.record.write. +type MemoryRecordWriteOutput = wire.MemoryRecordWriteOutput + +// MemoryRedactInput is the request to memory.redact. +type MemoryRedactInput = wire.MemoryRedactInput + +// MemoryRedactOutput is the response from memory.redact. +type MemoryRedactOutput = wire.MemoryRedactOutput + +// MemoryReindexInput is the request to memory.reindex. +type MemoryReindexInput = wire.MemoryReindexInput + +// MemoryReindexOutput is the response from memory.reindex. +type MemoryReindexOutput = wire.MemoryReindexOutput + +// MemoryRejectInput is the request to memory.reject. +type MemoryRejectInput = wire.MemoryRejectInput + +// MemoryRejectOutput is the response from memory.reject. +type MemoryRejectOutput = wire.MemoryRejectOutput + +// MemoryRelatedHit is a model used by Loom operations. +type MemoryRelatedHit = wire.MemoryRelatedHit + +// MemoryRelatedInput is the request to memory.related. +type MemoryRelatedInput = wire.MemoryRelatedInput + +// MemoryRelatedOutput is the response from memory.related. +type MemoryRelatedOutput = wire.MemoryRelatedOutput + +// MemoryResolveOrphanDuplicatesInput is the request to memory.resolve_orphan_duplicates. +type MemoryResolveOrphanDuplicatesInput = wire.MemoryResolveOrphanDuplicatesInput + +// MemoryResolveOrphanDuplicatesOutput is the response from memory.resolve_orphan_duplicates. +type MemoryResolveOrphanDuplicatesOutput = wire.MemoryResolveOrphanDuplicatesOutput + +// MemoryRestoreInput is the request to memory.restore. +type MemoryRestoreInput = wire.MemoryRestoreInput + +// MemoryRestoreOutput is the response from memory.restore. +type MemoryRestoreOutput = wire.MemoryRestoreOutput + +// MemorySchemaApproveInput is the request to memory_schema.approve. +type MemorySchemaApproveInput = wire.MemorySchemaApproveInput + +// MemorySchemaApproveOutput is the response from memory_schema.approve. +type MemorySchemaApproveOutput = wire.MemorySchemaApproveOutput + +// MemorySchemaDecisionInput is a model used by Loom operations. +type MemorySchemaDecisionInput = wire.MemorySchemaDecisionInput + +// MemorySchemaDecisionOutput is a model used by Loom operations. +type MemorySchemaDecisionOutput = wire.MemorySchemaDecisionOutput + +// MemorySchemaListInput is the request to memory_schema.list. +type MemorySchemaListInput = wire.MemorySchemaListInput + +// MemorySchemaListOutput is the response from memory_schema.list. +type MemorySchemaListOutput = wire.MemorySchemaListOutput + +// MemorySchemaProposeInput is the request to memory_schema.propose. +type MemorySchemaProposeInput = wire.MemorySchemaProposeInput + +// MemorySchemaProposeOutput is the response from memory_schema.propose. +type MemorySchemaProposeOutput = wire.MemorySchemaProposeOutput + +// MemorySchemaRegisterInput is the request to memory_schema.register. +type MemorySchemaRegisterInput = wire.MemorySchemaRegisterInput + +// MemorySchemaRegisterOutput is the response from memory_schema.register. +type MemorySchemaRegisterOutput = wire.MemorySchemaRegisterOutput + +// MemorySchemaSummary is a model used by Loom operations. +type MemorySchemaSummary = wire.MemorySchemaSummary + +// MemorySearchHit is a model used by Loom operations. +type MemorySearchHit = wire.MemorySearchHit + +// MemorySearchInput is the request to memory.search. +type MemorySearchInput = wire.MemorySearchInput + +// MemorySearchOutput is the response from memory.search. +type MemorySearchOutput = wire.MemorySearchOutput + +// MemorySearchTraceInput is the request to memory.search_trace. +type MemorySearchTraceInput = wire.MemorySearchTraceInput + +// MemorySearchTraceLogInput is the request to memory.search_trace_log. +type MemorySearchTraceLogInput = wire.MemorySearchTraceLogInput + +// MemorySearchTraceLogOutput is the response from memory.search_trace_log. +type MemorySearchTraceLogOutput = wire.MemorySearchTraceLogOutput + +// MemorySearchTraceOutput is the response from memory.search_trace. +type MemorySearchTraceOutput = wire.MemorySearchTraceOutput + +// MemorySetFromMessagesInput is the request to memory.set_from_messages. +type MemorySetFromMessagesInput = wire.MemorySetFromMessagesInput + +// MemorySetFromMessagesOutput is the response from memory.set_from_messages. +type MemorySetFromMessagesOutput = wire.MemorySetFromMessagesOutput + +// MemorySetInput is the request to memory.set. +type MemorySetInput = wire.MemorySetInput + +// MemorySetOutput is the response from memory.set. +type MemorySetOutput = wire.MemorySetOutput + +// MemorySetPeer is a model used by Loom operations. +type MemorySetPeer = wire.MemorySetPeer + +// MemoryStackInput is the request to memory.stack. +type MemoryStackInput = wire.MemoryStackInput + +// MemoryStackOutput is the response from memory.stack. +type MemoryStackOutput = wire.MemoryStackOutput + +// MemoryStatus is a model used by Loom operations. +type MemoryStatus = wire.MemoryStatus + +// MemoryStatusesInput is the request to memory.statuses. +type MemoryStatusesInput = wire.MemoryStatusesInput + +// MemoryStatusesOutput is the response from memory.statuses. +type MemoryStatusesOutput = wire.MemoryStatusesOutput + +// MemorySweepExpiredInput is the request to memory.sweep_expired. +type MemorySweepExpiredInput = wire.MemorySweepExpiredInput + +// MemorySweepExpiredOutput is the response from memory.sweep_expired. +type MemorySweepExpiredOutput = wire.MemorySweepExpiredOutput + +// MemoryTimelineEntry is a model used by Loom operations. +type MemoryTimelineEntry = wire.MemoryTimelineEntry + +// MemoryTimelineInput is the request to memory.timeline. +type MemoryTimelineInput = wire.MemoryTimelineInput + +// MemoryTimelineOutput is the response from memory.timeline. +type MemoryTimelineOutput = wire.MemoryTimelineOutput + +// MemoryTouchInput is the request to memory.touch. +type MemoryTouchInput = wire.MemoryTouchInput + +// MemoryTouchOutput is the response from memory.touch. +type MemoryTouchOutput = wire.MemoryTouchOutput + +// MemoryTouchResult is a model used by Loom operations. +type MemoryTouchResult = wire.MemoryTouchResult + +// MemoryUnlockInput is the request to memory.unlock. +type MemoryUnlockInput = wire.MemoryUnlockInput + +// MemoryUnlockOutput is the response from memory.unlock. +type MemoryUnlockOutput = wire.MemoryUnlockOutput + +// MemoryUnpinInput is the request to memory.unpin. +type MemoryUnpinInput = wire.MemoryUnpinInput + +// MemoryUnpinOutput is the response from memory.unpin. +type MemoryUnpinOutput = wire.MemoryUnpinOutput + +// MemoryUpdateByIDInput is the request to memory.update_by_id. +type MemoryUpdateByIDInput = wire.MemoryUpdateByIDInput + +// MemoryUpdateByIDOutput is the response from memory.update_by_id. +type MemoryUpdateByIDOutput = wire.MemoryUpdateByIDOutput + +// MemoryUpdateCandidate is a model used by Loom operations. +type MemoryUpdateCandidate = wire.MemoryUpdateCandidate + +// MemoryUpdateInput is the request to memory.update. +type MemoryUpdateInput = wire.MemoryUpdateInput + +// MemoryUpdateOutput is the response from memory.update. +type MemoryUpdateOutput = wire.MemoryUpdateOutput + +// MemoryVerifyInput is the request to memory.verify. +type MemoryVerifyInput = wire.MemoryVerifyInput + +// MemoryVerifyOutput is the response from memory.verify. +type MemoryVerifyOutput = wire.MemoryVerifyOutput + +// MentorAdoption is a model used by Loom operations. +type MentorAdoption = wire.MentorAdoption + +// MentorBriefInput is the request to mentor.brief. +type MentorBriefInput = wire.MentorBriefInput + +// MentorBriefOutput is the response from mentor.brief. +type MentorBriefOutput = wire.MentorBriefOutput + +// MentorGuideInput is the request to mentor.guide. +type MentorGuideInput = wire.MentorGuideInput + +// MentorGuideOutput is the response from mentor.guide. +type MentorGuideOutput = wire.MentorGuideOutput + +// MentorHint is a model used by Loom operations. +type MentorHint = wire.MentorHint + +// MentorPlane is a model used by Loom operations. +type MentorPlane = wire.MentorPlane + +// Message is a model used by Loom operations. +type Message = wire.Message + +// MineEntry is a model used by Loom operations. +type MineEntry = wire.MineEntry + +// ModelMemoryGetOutput is a model used by Loom operations. +type ModelMemoryGetOutput = wire.ModelMemoryGetOutput + +// ModelNamespaceGuideGetOutput is a model used by Loom operations. +type ModelNamespaceGuideGetOutput = wire.ModelNamespaceGuideGetOutput + +// NamespaceAuditFinding is a model used by Loom operations. +type NamespaceAuditFinding = wire.NamespaceAuditFinding + +// NamespaceAuditInput is the request to namespace.audit. +type NamespaceAuditInput = wire.NamespaceAuditInput + +// NamespaceAuditOutput is the response from namespace.audit. +type NamespaceAuditOutput = wire.NamespaceAuditOutput + +// NamespaceAuditSummary is a model used by Loom operations. +type NamespaceAuditSummary = wire.NamespaceAuditSummary + +// NamespaceBrowseInput is the request to namespace.browse. +type NamespaceBrowseInput = wire.NamespaceBrowseInput + +// NamespaceBrowseOutput is the response from namespace.browse. +type NamespaceBrowseOutput = wire.NamespaceBrowseOutput + +// NamespaceCancelRequestInput is the request to namespace.cancel_request. +type NamespaceCancelRequestInput = wire.NamespaceCancelRequestInput + +// NamespaceCancelRequestOutput is the response from namespace.cancel_request. +type NamespaceCancelRequestOutput = wire.NamespaceCancelRequestOutput + +// NamespaceDeleteInput is the request to namespace.delete. +type NamespaceDeleteInput = wire.NamespaceDeleteInput + +// NamespaceDeleteOutput is the response from namespace.delete. +type NamespaceDeleteOutput = wire.NamespaceDeleteOutput + +// NamespaceEntry is a model used by Loom operations. +type NamespaceEntry = wire.NamespaceEntry + +// NamespaceGetInput is the request to namespace.get. +type NamespaceGetInput = wire.NamespaceGetInput + +// NamespaceGetOutput is the response from namespace.get. +type NamespaceGetOutput = wire.NamespaceGetOutput + +// NamespaceGuideGetInput is the request to namespace.guide_get. +type NamespaceGuideGetInput = wire.NamespaceGuideGetInput + +// NamespaceGuideGetOutput is the response from namespace.guide_get. +type NamespaceGuideGetOutput = wire.NamespaceGuideGetOutput + +// NamespaceGuideHistoryInput is the request to namespace.guide_history. +type NamespaceGuideHistoryInput = wire.NamespaceGuideHistoryInput + +// NamespaceGuideHistoryOutput is the response from namespace.guide_history. +type NamespaceGuideHistoryOutput = wire.NamespaceGuideHistoryOutput + +// NamespaceGuideSetInput is the request to namespace.guide_set. +type NamespaceGuideSetInput = wire.NamespaceGuideSetInput + +// NamespaceGuideSetOutput is the response from namespace.guide_set. +type NamespaceGuideSetOutput = wire.NamespaceGuideSetOutput + +// NamespaceInventoryInput is the request to namespace.inventory. +type NamespaceInventoryInput = wire.NamespaceInventoryInput + +// NamespaceInventoryOutput is the response from namespace.inventory. +type NamespaceInventoryOutput = wire.NamespaceInventoryOutput + +// NamespaceJoinInput is the request to namespace.join. +type NamespaceJoinInput = wire.NamespaceJoinInput + +// NamespaceJoinOutput is the response from namespace.join. +type NamespaceJoinOutput = wire.NamespaceJoinOutput + +// NamespaceLeaveInput is the request to namespace.leave. +type NamespaceLeaveInput = wire.NamespaceLeaveInput + +// NamespaceLeaveOutput is the response from namespace.leave. +type NamespaceLeaveOutput = wire.NamespaceLeaveOutput + +// NamespaceListCategoriesInput is the request to namespace.list_categories. +type NamespaceListCategoriesInput = wire.NamespaceListCategoriesInput + +// NamespaceListCategoriesOutput is the response from namespace.list_categories. +type NamespaceListCategoriesOutput = wire.NamespaceListCategoriesOutput + +// NamespaceListInput is the request to namespace.list. +type NamespaceListInput = wire.NamespaceListInput + +// NamespaceListMineInput is the request to namespace.list_mine. +type NamespaceListMineInput = wire.NamespaceListMineInput + +// NamespaceListMineOutput is the response from namespace.list_mine. +type NamespaceListMineOutput = wire.NamespaceListMineOutput + +// NamespaceListOntologyInput is the request to namespace.list_ontology. +type NamespaceListOntologyInput = wire.NamespaceListOntologyInput + +// NamespaceListOntologyOutput is the response from namespace.list_ontology. +type NamespaceListOntologyOutput = wire.NamespaceListOntologyOutput + +// NamespaceListOutput is the response from namespace.list. +type NamespaceListOutput = wire.NamespaceListOutput + +// NamespaceMarkSeenInput is the request to namespace.mark_seen. +type NamespaceMarkSeenInput = wire.NamespaceMarkSeenInput + +// NamespaceMarkSeenOutput is the response from namespace.mark_seen. +type NamespaceMarkSeenOutput = wire.NamespaceMarkSeenOutput + +// NamespacePolicy is a model used by Loom operations. +type NamespacePolicy = wire.NamespacePolicy + +// NamespaceRegisterCategoryInput is the request to namespace.register_category. +type NamespaceRegisterCategoryInput = wire.NamespaceRegisterCategoryInput + +// NamespaceRegisterCategoryOutput is the response from namespace.register_category. +type NamespaceRegisterCategoryOutput = wire.NamespaceRegisterCategoryOutput + +// NamespaceRegisterInput is the request to namespace.register. +type NamespaceRegisterInput = wire.NamespaceRegisterInput + +// NamespaceRegisterOntologyInput is the request to namespace.register_ontology. +type NamespaceRegisterOntologyInput = wire.NamespaceRegisterOntologyInput + +// NamespaceRegisterOntologyOutput is the response from namespace.register_ontology. +type NamespaceRegisterOntologyOutput = wire.NamespaceRegisterOntologyOutput + +// NamespaceRegisterOutput is the response from namespace.register. +type NamespaceRegisterOutput = wire.NamespaceRegisterOutput + +// NamespaceRestoreInput is the request to namespace.restore. +type NamespaceRestoreInput = wire.NamespaceRestoreInput + +// NamespaceRestoreOutput is the response from namespace.restore. +type NamespaceRestoreOutput = wire.NamespaceRestoreOutput + +// NamespaceRetrievalDefaults is a model used by Loom operations. +type NamespaceRetrievalDefaults = wire.NamespaceRetrievalDefaults + +// NamespaceRollbackInput is the request to namespace.rollback. +type NamespaceRollbackInput = wire.NamespaceRollbackInput + +// NamespaceRollbackOutput is the response from namespace.rollback. +type NamespaceRollbackOutput = wire.NamespaceRollbackOutput + +// NamespaceSearchCategoriesInput is the request to namespace.search_categories. +type NamespaceSearchCategoriesInput = wire.NamespaceSearchCategoriesInput + +// NamespaceSearchCategoriesOutput is the response from namespace.search_categories. +type NamespaceSearchCategoriesOutput = wire.NamespaceSearchCategoriesOutput + +// NamespaceSnapshotInput is the request to namespace.snapshot. +type NamespaceSnapshotInput = wire.NamespaceSnapshotInput + +// NamespaceSnapshotOutput is the response from namespace.snapshot. +type NamespaceSnapshotOutput = wire.NamespaceSnapshotOutput + +// NamespaceSnapshotPayload is a model used by Loom operations. +type NamespaceSnapshotPayload = wire.NamespaceSnapshotPayload + +// NamespaceSummaryInput is the request to namespace.summary. +type NamespaceSummaryInput = wire.NamespaceSummaryInput + +// NamespaceSummaryOutput is the response from namespace.summary. +type NamespaceSummaryOutput = wire.NamespaceSummaryOutput + +// NamespaceTaxonomyInput is the request to namespace.taxonomy. +type NamespaceTaxonomyInput = wire.NamespaceTaxonomyInput + +// NamespaceTaxonomyOutput is the response from namespace.taxonomy. +type NamespaceTaxonomyOutput = wire.NamespaceTaxonomyOutput + +// NamespaceTopEntity is a model used by Loom operations. +type NamespaceTopEntity = wire.NamespaceTopEntity + +// NamespaceTuneInput is the request to namespace.tune. +type NamespaceTuneInput = wire.NamespaceTuneInput + +// NamespaceTuneOutput is the response from namespace.tune. +type NamespaceTuneOutput = wire.NamespaceTuneOutput + +// NamespaceTypeConfig is a model used by Loom operations. +type NamespaceTypeConfig = wire.NamespaceTypeConfig + +// NamespaceTypeCount is a model used by Loom operations. +type NamespaceTypeCount = wire.NamespaceTypeCount + +// NamespaceValidateFinding is a model used by Loom operations. +type NamespaceValidateFinding = wire.NamespaceValidateFinding + +// NamespaceValidateInput is the request to namespace.validate. +type NamespaceValidateInput = wire.NamespaceValidateInput + +// NamespaceValidateOutput is the response from namespace.validate. +type NamespaceValidateOutput = wire.NamespaceValidateOutput + +// ObserveCrystallizeInput is the request to observe.crystallize. +type ObserveCrystallizeInput = wire.ObserveCrystallizeInput + +// ObserveCrystallizeOutput is the response from observe.crystallize. +type ObserveCrystallizeOutput = wire.ObserveCrystallizeOutput + +// ObserveRecordInput is the request to observe.record. +type ObserveRecordInput = wire.ObserveRecordInput + +// ObserveRecordOutput is the response from observe.record. +type ObserveRecordOutput = wire.ObserveRecordOutput + +// OntologyEntry is a model used by Loom operations. +type OntologyEntry = wire.OntologyEntry + +// OpCapability is a model used by Loom operations. +type OpCapability = wire.OpCapability + +// OpsCapabilitiesInput is the request to ops.capabilities. +type OpsCapabilitiesInput = wire.OpsCapabilitiesInput + +// OpsCapabilitiesOutput is the response from ops.capabilities. +type OpsCapabilitiesOutput = wire.OpsCapabilitiesOutput + +// OpsHealthCheck is a model used by Loom operations. +type OpsHealthCheck = wire.OpsHealthCheck + +// OpsHealthInput is the request to ops.health. +type OpsHealthInput = wire.OpsHealthInput + +// OpsHealthOutput is the response from ops.health. +type OpsHealthOutput = wire.OpsHealthOutput + +// OpsProjectionFailuresListInput is the request to ops.projection_failures.list. +type OpsProjectionFailuresListInput = wire.OpsProjectionFailuresListInput + +// OpsProjectionFailuresListOutput is the response from ops.projection_failures.list. +type OpsProjectionFailuresListOutput = wire.OpsProjectionFailuresListOutput + +// OpsProjectionFailuresResolveInput is the request to ops.projection_failures.resolve. +type OpsProjectionFailuresResolveInput = wire.OpsProjectionFailuresResolveInput + +// OpsProjectionFailuresResolveOutput is the response from ops.projection_failures.resolve. +type OpsProjectionFailuresResolveOutput = wire.OpsProjectionFailuresResolveOutput + +// OpsProjectionFailuresRetryInput is the request to ops.projection_failures.retry. +type OpsProjectionFailuresRetryInput = wire.OpsProjectionFailuresRetryInput + +// OpsProjectionFailuresRetryOutput is the response from ops.projection_failures.retry. +type OpsProjectionFailuresRetryOutput = wire.OpsProjectionFailuresRetryOutput + +// OrgModelCallsInput is the request to org.model_calls. +type OrgModelCallsInput = wire.OrgModelCallsInput + +// OrgModelCallsOutput is the response from org.model_calls. +type OrgModelCallsOutput = wire.OrgModelCallsOutput + +// OrgSetModelCallsInput is the request to org.set_model_calls. +type OrgSetModelCallsInput = wire.OrgSetModelCallsInput + +// OrgSetModelCallsOutput is the response from org.set_model_calls. +type OrgSetModelCallsOutput = wire.OrgSetModelCallsOutput + +// OutlineCommunity is a model used by Loom operations. +type OutlineCommunity = wire.OutlineCommunity + +// OutlineEntry is a model used by Loom operations. +type OutlineEntry = wire.OutlineEntry + +// OutlineHub is a model used by Loom operations. +type OutlineHub = wire.OutlineHub + +// OutlineSession is a model used by Loom operations. +type OutlineSession = wire.OutlineSession + +// OwnerReadsRow is a model used by Loom operations. +type OwnerReadsRow = wire.OwnerReadsRow + +// OwnerRowsRow is a model used by Loom operations. +type OwnerRowsRow = wire.OwnerRowsRow + +// OwnerUsageRow is a model used by Loom operations. +type OwnerUsageRow = wire.OwnerUsageRow + +// PathEdge is a model used by Loom operations. +type PathEdge = wire.PathEdge + +// PendingForMeEntry is a model used by Loom operations. +type PendingForMeEntry = wire.PendingForMeEntry + +// PolicyCheckInput is the request to policy.check. +type PolicyCheckInput = wire.PolicyCheckInput + +// PolicyCheckOutput is the response from policy.check. +type PolicyCheckOutput = wire.PolicyCheckOutput + +// PolicyDecisionRow is a model used by Loom operations. +type PolicyDecisionRow = wire.PolicyDecisionRow + +// PolicyDecisionsInput is the request to policy.decisions. +type PolicyDecisionsInput = wire.PolicyDecisionsInput + +// PolicyDecisionsOutput is the response from policy.decisions. +type PolicyDecisionsOutput = wire.PolicyDecisionsOutput + +// PolicyDeleteInput is the request to policy.delete. +type PolicyDeleteInput = wire.PolicyDeleteInput + +// PolicyDeleteOutput is the response from policy.delete. +type PolicyDeleteOutput = wire.PolicyDeleteOutput + +// PolicyListInput is the request to policy.list. +type PolicyListInput = wire.PolicyListInput + +// PolicyListOutput is the response from policy.list. +type PolicyListOutput = wire.PolicyListOutput + +// PolicyPayload is a model used by Loom operations. +type PolicyPayload = wire.PolicyPayload + +// PolicyRuleOut is a model used by Loom operations. +type PolicyRuleOut = wire.PolicyRuleOut + +// PolicySetInput is the request to policy.set. +type PolicySetInput = wire.PolicySetInput + +// PolicySetOutput is the response from policy.set. +type PolicySetOutput = wire.PolicySetOutput + +// Principal is a model used by Loom operations. +type Principal = wire.Principal + +// ProcedureAddInput is the request to procedure.add. +type ProcedureAddInput = wire.ProcedureAddInput + +// ProcedureAddOutput is the response from procedure.add. +type ProcedureAddOutput = wire.ProcedureAddOutput + +// ProcedureEvolveInput is the request to procedure.evolve. +type ProcedureEvolveInput = wire.ProcedureEvolveInput + +// ProcedureEvolveOutput is the response from procedure.evolve. +type ProcedureEvolveOutput = wire.ProcedureEvolveOutput + +// ProcedureForkInput is the request to procedure.fork. +type ProcedureForkInput = wire.ProcedureForkInput + +// ProcedureForkOutput is the response from procedure.fork. +type ProcedureForkOutput = wire.ProcedureForkOutput + +// ProcedureListInput is the request to procedure.list. +type ProcedureListInput = wire.ProcedureListInput + +// ProcedureListOutput is the response from procedure.list. +type ProcedureListOutput = wire.ProcedureListOutput + +// ProcedureLocateInput is the request to procedure.locate. +type ProcedureLocateInput = wire.ProcedureLocateInput + +// ProcedureLocateOutput is the response from procedure.locate. +type ProcedureLocateOutput = wire.ProcedureLocateOutput + +// ProcedureMatch is a model used by Loom operations. +type ProcedureMatch = wire.ProcedureMatch + +// ProcedureMatchInput is the request to procedure.match. +type ProcedureMatchInput = wire.ProcedureMatchInput + +// ProcedureMatchOutput is the response from procedure.match. +type ProcedureMatchOutput = wire.ProcedureMatchOutput + +// ProcedureRecordRunInput is the request to procedure.record_run. +type ProcedureRecordRunInput = wire.ProcedureRecordRunInput + +// ProcedureRecordRunOutput is the response from procedure.record_run. +type ProcedureRecordRunOutput = wire.ProcedureRecordRunOutput + +// ProcedureReviseInput is the request to procedure.revise. +type ProcedureReviseInput = wire.ProcedureReviseInput + +// ProcedureReviseOutput is the response from procedure.revise. +type ProcedureReviseOutput = wire.ProcedureReviseOutput + +// ProcedureSummary is a model used by Loom operations. +type ProcedureSummary = wire.ProcedureSummary + +// ProfileActivityEntry is a model used by Loom operations. +type ProfileActivityEntry = wire.ProfileActivityEntry + +// ProfileActivityInput is the request to profile.activity. +type ProfileActivityInput = wire.ProfileActivityInput + +// ProfileActivityOutput is the response from profile.activity. +type ProfileActivityOutput = wire.ProfileActivityOutput + +// ProfileAppendInput is the request to profile.append. +type ProfileAppendInput = wire.ProfileAppendInput + +// ProfileAppendOutput is the response from profile.append. +type ProfileAppendOutput = wire.ProfileAppendOutput + +// ProfileMutationOutput is a model used by Loom operations. +type ProfileMutationOutput = wire.ProfileMutationOutput + +// ProfileRenderInput is the request to profile.render. +type ProfileRenderInput = wire.ProfileRenderInput + +// ProfileRenderOutput is the response from profile.render. +type ProfileRenderOutput = wire.ProfileRenderOutput + +// ProfileReplaceInput is the request to profile.replace. +type ProfileReplaceInput = wire.ProfileReplaceInput + +// ProfileReplaceOutput is the response from profile.replace. +type ProfileReplaceOutput = wire.ProfileReplaceOutput + +// ProfileSchemaClearInput is the request to profile_schema.clear. +type ProfileSchemaClearInput = wire.ProfileSchemaClearInput + +// ProfileSchemaClearOutput is the response from profile_schema.clear. +type ProfileSchemaClearOutput = wire.ProfileSchemaClearOutput + +// ProfileSchemaGetInput is the request to profile_schema.get. +type ProfileSchemaGetInput = wire.ProfileSchemaGetInput + +// ProfileSchemaGetOutput is the response from profile_schema.get. +type ProfileSchemaGetOutput = wire.ProfileSchemaGetOutput + +// ProfileSchemaInput is a model used by Loom operations. +type ProfileSchemaInput = wire.ProfileSchemaInput + +// ProfileSchemaOutput is a model used by Loom operations. +type ProfileSchemaOutput = wire.ProfileSchemaOutput + +// ProfileSchemaSetInput is the request to profile_schema.set. +type ProfileSchemaSetInput = wire.ProfileSchemaSetInput + +// ProfileSchemaSetOutput is the response from profile_schema.set. +type ProfileSchemaSetOutput = wire.ProfileSchemaSetOutput + +// ProfileSetInput is the request to profile.set. +type ProfileSetInput = wire.ProfileSetInput + +// ProfileSetOutput is the response from profile.set. +type ProfileSetOutput = wire.ProfileSetOutput + +// ProfileStructuredInput is the request to profile.structured. +type ProfileStructuredInput = wire.ProfileStructuredInput + +// ProfileStructuredOutput is the response from profile.structured. +type ProfileStructuredOutput = wire.ProfileStructuredOutput + +// ProjectionFailureListInput is a model used by Loom operations. +type ProjectionFailureListInput = wire.ProjectionFailureListInput + +// ProjectionFailureListOutput is a model used by Loom operations. +type ProjectionFailureListOutput = wire.ProjectionFailureListOutput + +// ProjectionFailureResolveInput is a model used by Loom operations. +type ProjectionFailureResolveInput = wire.ProjectionFailureResolveInput + +// ProjectionFailureResolveOutput is a model used by Loom operations. +type ProjectionFailureResolveOutput = wire.ProjectionFailureResolveOutput + +// ProjectionFailureRetryInput is a model used by Loom operations. +type ProjectionFailureRetryInput = wire.ProjectionFailureRetryInput + +// ProjectionFailureRetryOutput is a model used by Loom operations. +type ProjectionFailureRetryOutput = wire.ProjectionFailureRetryOutput + +// ProjectionFailureRetryRow is a model used by Loom operations. +type ProjectionFailureRetryRow = wire.ProjectionFailureRetryRow + +// ProjectionFailureRow is a model used by Loom operations. +type ProjectionFailureRow = wire.ProjectionFailureRow + +// ProposalPolicy is a model used by Loom operations. +type ProposalPolicy = wire.ProposalPolicy + +// PushConfigureInput is a model used by Loom operations. +type PushConfigureInput = wire.PushConfigureInput + +// PushConfirmInput is a model used by Loom operations. +type PushConfirmInput = wire.PushConfirmInput + +// PushStatusInput is a model used by Loom operations. +type PushStatusInput = wire.PushStatusInput + +// PushStatusOutput is a model used by Loom operations. +type PushStatusOutput = wire.PushStatusOutput + +// QueryAggregate is a model used by Loom operations. +type QueryAggregate = wire.QueryAggregate + +// QueryColumn is a model used by Loom operations. +type QueryColumn = wire.QueryColumn + +// QueryDataset is a model used by Loom operations. +type QueryDataset = wire.QueryDataset + +// QueryFilter is a model used by Loom operations. +type QueryFilter = wire.QueryFilter + +// QueryGroup is a model used by Loom operations. +type QueryGroup = wire.QueryGroup + +// QueryHistoryAddInput is a model used by Loom operations. +type QueryHistoryAddInput = wire.QueryHistoryAddInput + +// QueryHistoryListInput is a model used by Loom operations. +type QueryHistoryListInput = wire.QueryHistoryListInput + +// QueryHistoryListOutput is a model used by Loom operations. +type QueryHistoryListOutput = wire.QueryHistoryListOutput + +// QueryHistoryRemoveInput is a model used by Loom operations. +type QueryHistoryRemoveInput = wire.QueryHistoryRemoveInput + +// QueryHistoryRemoveOutput is a model used by Loom operations. +type QueryHistoryRemoveOutput = wire.QueryHistoryRemoveOutput + +// QueryHistorySource is a model used by Loom operations. +type QueryHistorySource = wire.QueryHistorySource + +// QueryHistorySourceHTTPResponse is a model used by Loom operations. +type QueryHistorySourceHTTPResponse = wire.QueryHistorySourceHTTPResponse + +// QueryJoin is a model used by Loom operations. +type QueryJoin = wire.QueryJoin + +// QueryOrder is a model used by Loom operations. +type QueryOrder = wire.QueryOrder + +// QueryReceipt is a model used by Loom operations. +type QueryReceipt = wire.QueryReceipt + +// QueryResultColumn is a model used by Loom operations. +type QueryResultColumn = wire.QueryResultColumn + +// QuerySnapshot is a model used by Loom operations. +type QuerySnapshot = wire.QuerySnapshot + +// RecallByAgent is a model used by Loom operations. +type RecallByAgent = wire.RecallByAgent + +// RecallTurn is a model used by Loom operations. +type RecallTurn = wire.RecallTurn + +// RecentMessage is a model used by Loom operations. +type RecentMessage = wire.RecentMessage + +// RecordFieldInput is a model used by Loom operations. +type RecordFieldInput = wire.RecordFieldInput + +// RecordPredicate is a model used by Loom operations. +type RecordPredicate = wire.RecordPredicate + +// RefusedFact is a model used by Loom operations. +type RefusedFact = wire.RefusedFact + +// RelatedEntity is a model used by Loom operations. +type RelatedEntity = wire.RelatedEntity + +// RelatedGrepEvidence is a model used by Loom operations. +type RelatedGrepEvidence = wire.RelatedGrepEvidence + +// ReportCoverage is a model used by Loom operations. +type ReportCoverage = wire.ReportCoverage + +// RunBeginInput is the request to run.begin. +type RunBeginInput = wire.RunBeginInput + +// RunBeginOutput is the response from run.begin. +type RunBeginOutput = wire.RunBeginOutput + +// RunCompleteInput is the request to run.complete. +type RunCompleteInput = wire.RunCompleteInput + +// RunCompleteOutput is the response from run.complete. +type RunCompleteOutput = wire.RunCompleteOutput + +// RunGetInput is the request to run.get. +type RunGetInput = wire.RunGetInput + +// RunGetOutput is the response from run.get. +type RunGetOutput = wire.RunGetOutput + +// RunGradeInput is the request to run.grade. +type RunGradeInput = wire.RunGradeInput + +// RunGradeOutput is the response from run.grade. +type RunGradeOutput = wire.RunGradeOutput + +// RunGradeProposal is a model used by Loom operations. +type RunGradeProposal = wire.RunGradeProposal + +// RunListInput is the request to run.list. +type RunListInput = wire.RunListInput + +// RunListOutput is the response from run.list. +type RunListOutput = wire.RunListOutput + +// RunReflection is a model used by Loom operations. +type RunReflection = wire.RunReflection + +// RunRow is a model used by Loom operations. +type RunRow = wire.RunRow + +// SavedMessageHit is a model used by Loom operations. +type SavedMessageHit = wire.SavedMessageHit + +// SchemaFieldInput is a model used by Loom operations. +type SchemaFieldInput = wire.SchemaFieldInput + +// SchemaFieldOutput is a model used by Loom operations. +type SchemaFieldOutput = wire.SchemaFieldOutput + +// WireSearchHit is a model used by Loom operations. +type WireSearchHit = wire.SearchHit + +// SearchInput is a model used by Loom operations. +type SearchInput = wire.SearchInput + +// SearchOutput is a model used by Loom operations. +type SearchOutput = wire.SearchOutput + +// SearchQueryInput is the request to search.query. +type SearchQueryInput = wire.SearchQueryInput + +// SearchQueryOutput is the response from search.query. +type SearchQueryOutput = wire.SearchQueryOutput + +// SearchTraceHit is a model used by Loom operations. +type SearchTraceHit = wire.SearchTraceHit + +// SearchTraceLogInput is a model used by Loom operations. +type SearchTraceLogInput = wire.SearchTraceLogInput + +// SearchTraceLogOutput is a model used by Loom operations. +type SearchTraceLogOutput = wire.SearchTraceLogOutput + +// SearchTraceLogRow is a model used by Loom operations. +type SearchTraceLogRow = wire.SearchTraceLogRow + +// SessionBriefDeleteInput is the request to session.brief_delete. +type SessionBriefDeleteInput = wire.SessionBriefDeleteInput + +// SessionBriefDeleteOutput is the response from session.brief_delete. +type SessionBriefDeleteOutput = wire.SessionBriefDeleteOutput + +// SessionBriefGetInput is the request to session.brief_get. +type SessionBriefGetInput = wire.SessionBriefGetInput + +// SessionBriefGetOutput is the response from session.brief_get. +type SessionBriefGetOutput = wire.SessionBriefGetOutput + +// SessionBriefListInput is the request to session.brief_list. +type SessionBriefListInput = wire.SessionBriefListInput + +// SessionBriefListOutput is the response from session.brief_list. +type SessionBriefListOutput = wire.SessionBriefListOutput + +// SessionBriefSaveInput is the request to session.brief_save. +type SessionBriefSaveInput = wire.SessionBriefSaveInput + +// SessionBriefSaveOutput is the response from session.brief_save. +type SessionBriefSaveOutput = wire.SessionBriefSaveOutput + +// SessionBriefStats is a model used by Loom operations. +type SessionBriefStats = wire.SessionBriefStats + +// SessionBriefSummary is a model used by Loom operations. +type SessionBriefSummary = wire.SessionBriefSummary + +// SnapshotAuditRow is a model used by Loom operations. +type SnapshotAuditRow = wire.SnapshotAuditRow + +// SnapshotGrantRow is a model used by Loom operations. +type SnapshotGrantRow = wire.SnapshotGrantRow + +// SnapshotMemoryRow is a model used by Loom operations. +type SnapshotMemoryRow = wire.SnapshotMemoryRow + +// SnapshotTypeRow is a model used by Loom operations. +type SnapshotTypeRow = wire.SnapshotTypeRow + +// SourceJobs is a model used by Loom operations. +type SourceJobs = wire.SourceJobs + +// SourceRef is a model used by Loom operations. +type SourceRef = wire.SourceRef + +// StackEntry is a model used by Loom operations. +type StackEntry = wire.StackEntry + +// SynthesizeCalculation is a model used by Loom operations. +type SynthesizeCalculation = wire.SynthesizeCalculation + +// TaskAcceptInput is the request to task.accept. +type TaskAcceptInput = wire.TaskAcceptInput + +// TaskAcceptOutput is the response from task.accept. +type TaskAcceptOutput = wire.TaskAcceptOutput + +// TaskBlockInput is the request to task.block. +type TaskBlockInput = wire.TaskBlockInput + +// TaskBlockOutput is the response from task.block. +type TaskBlockOutput = wire.TaskBlockOutput + +// TaskCancelInput is the request to task.cancel. +type TaskCancelInput = wire.TaskCancelInput + +// TaskCancelOutput is the response from task.cancel. +type TaskCancelOutput = wire.TaskCancelOutput + +// TaskClaimInput is the request to task.claim. +type TaskClaimInput = wire.TaskClaimInput + +// TaskClaimOutput is the response from task.claim. +type TaskClaimOutput = wire.TaskClaimOutput + +// TaskCompleteInput is the request to task.complete. +type TaskCompleteInput = wire.TaskCompleteInput + +// TaskCompleteOutput is the response from task.complete. +type TaskCompleteOutput = wire.TaskCompleteOutput + +// TaskCountsInput is the request to task.counts. +type TaskCountsInput = wire.TaskCountsInput + +// TaskCountsOutput is the response from task.counts. +type TaskCountsOutput = wire.TaskCountsOutput + +// TaskCreateInput is the request to task.create. +type TaskCreateInput = wire.TaskCreateInput + +// TaskCreateOutput is the response from task.create. +type TaskCreateOutput = wire.TaskCreateOutput + +// TaskDeferInput is the request to task.defer. +type TaskDeferInput = wire.TaskDeferInput + +// TaskDeferOutput is the response from task.defer. +type TaskDeferOutput = wire.TaskDeferOutput + +// TaskEventPayload is a model used by Loom operations. +type TaskEventPayload = wire.TaskEventPayload + +// TaskFailInput is the request to task.fail. +type TaskFailInput = wire.TaskFailInput + +// TaskFailOutput is the response from task.fail. +type TaskFailOutput = wire.TaskFailOutput + +// TaskGetInput is the request to task.get. +type TaskGetInput = wire.TaskGetInput + +// TaskGetOutput is the response from task.get. +type TaskGetOutput = wire.TaskGetOutput + +// TaskHeartbeatInput is the request to task.heartbeat. +type TaskHeartbeatInput = wire.TaskHeartbeatInput + +// TaskHeartbeatOutput is the response from task.heartbeat. +type TaskHeartbeatOutput = wire.TaskHeartbeatOutput + +// TaskHistoryInput is the request to task.history. +type TaskHistoryInput = wire.TaskHistoryInput + +// TaskHistoryOutput is the response from task.history. +type TaskHistoryOutput = wire.TaskHistoryOutput + +// TaskListInput is the request to task.list. +type TaskListInput = wire.TaskListInput + +// TaskListOutput is the response from task.list. +type TaskListOutput = wire.TaskListOutput + +// TaskOutput is a model used by Loom operations. +type TaskOutput = wire.TaskOutput + +// TaskPayload is a model used by Loom operations. +type TaskPayload = wire.TaskPayload + +// TaskProgressInput is the request to task.progress. +type TaskProgressInput = wire.TaskProgressInput + +// TaskProgressOutput is the response from task.progress. +type TaskProgressOutput = wire.TaskProgressOutput + +// TaskPullInput is the request to task.pull. +type TaskPullInput = wire.TaskPullInput + +// TaskPullOutput is the response from task.pull. +type TaskPullOutput = wire.TaskPullOutput + +// TaskReasonInput is a model used by Loom operations. +type TaskReasonInput = wire.TaskReasonInput + +// TaskReassignInput is the request to task.reassign. +type TaskReassignInput = wire.TaskReassignInput + +// TaskReassignOutput is the response from task.reassign. +type TaskReassignOutput = wire.TaskReassignOutput + +// TaskReopenInput is the request to task.reopen. +type TaskReopenInput = wire.TaskReopenInput + +// TaskReopenOutput is the response from task.reopen. +type TaskReopenOutput = wire.TaskReopenOutput + +// TaskResumeInput is the request to task.resume. +type TaskResumeInput = wire.TaskResumeInput + +// TaskResumeOutput is the response from task.resume. +type TaskResumeOutput = wire.TaskResumeOutput + +// TaskUnblockInput is the request to task.unblock. +type TaskUnblockInput = wire.TaskUnblockInput + +// TaskUnblockOutput is the response from task.unblock. +type TaskUnblockOutput = wire.TaskUnblockOutput + +// TaskUpdateInput is the request to task.update. +type TaskUpdateInput = wire.TaskUpdateInput + +// TaskUpdateOutput is the response from task.update. +type TaskUpdateOutput = wire.TaskUpdateOutput + +// TaskUpdatesInput is the request to task.updates. +type TaskUpdatesInput = wire.TaskUpdatesInput + +// TaskUpdatesOutput is the response from task.updates. +type TaskUpdatesOutput = wire.TaskUpdatesOutput + +// TaskWontDoInput is the request to task.wont_do. +type TaskWontDoInput = wire.TaskWontDoInput + +// TaskWontDoOutput is the response from task.wont_do. +type TaskWontDoOutput = wire.TaskWontDoOutput + +// TaxonomyCommunity is a model used by Loom operations. +type TaxonomyCommunity = wire.TaxonomyCommunity + +// TaxonomyEntry is a model used by Loom operations. +type TaxonomyEntry = wire.TaxonomyEntry + +// TrackerAnswerInput is the request to tracker.answer. +type TrackerAnswerInput = wire.TrackerAnswerInput + +// TrackerAnswerOutput is the response from tracker.answer. +type TrackerAnswerOutput = wire.TrackerAnswerOutput + +// TrackerBindingInput is the request to tracker.binding. +type TrackerBindingInput = wire.TrackerBindingInput + +// TrackerBindingOutput is the response from tracker.binding. +type TrackerBindingOutput = wire.TrackerBindingOutput + +// TrackerComponentInput is the request to tracker.component. +type TrackerComponentInput = wire.TrackerComponentInput + +// TrackerComponentOutput is the response from tracker.component. +type TrackerComponentOutput = wire.TrackerComponentOutput + +// TrackerContractInput is the request to tracker.contract. +type TrackerContractInput = wire.TrackerContractInput + +// TrackerContractOutput is the response from tracker.contract. +type TrackerContractOutput = wire.TrackerContractOutput + +// TrackerDuplicateCheckInput is the request to tracker.duplicate_check. +type TrackerDuplicateCheckInput = wire.TrackerDuplicateCheckInput + +// TrackerDuplicateCheckOutput is the response from tracker.duplicate_check. +type TrackerDuplicateCheckOutput = wire.TrackerDuplicateCheckOutput + +// TrackerFlakyInput is the request to tracker.flaky. +type TrackerFlakyInput = wire.TrackerFlakyInput + +// TrackerFlakyOutput is the response from tracker.flaky. +type TrackerFlakyOutput = wire.TrackerFlakyOutput + +// TrackerItemInput is the request to tracker.item. +type TrackerItemInput = wire.TrackerItemInput + +// TrackerItemOutput is the response from tracker.item. +type TrackerItemOutput = wire.TrackerItemOutput + +// TrackerLegStatus is a model used by Loom operations. +type TrackerLegStatus = wire.TrackerLegStatus + +// TrackerLinksInput is the request to tracker.links. +type TrackerLinksInput = wire.TrackerLinksInput + +// TrackerLinksOutput is the response from tracker.links. +type TrackerLinksOutput = wire.TrackerLinksOutput + +// TrackerReleaseInput is the request to tracker.release. +type TrackerReleaseInput = wire.TrackerReleaseInput + +// TrackerReleaseOutput is the response from tracker.release. +type TrackerReleaseOutput = wire.TrackerReleaseOutput + +// TrackerSimilarInput is the request to tracker.similar. +type TrackerSimilarInput = wire.TrackerSimilarInput + +// TrackerSimilarOutput is the response from tracker.similar. +type TrackerSimilarOutput = wire.TrackerSimilarOutput + +// TrackerSourceAddInput is the request to tracker.source.add. +type TrackerSourceAddInput = wire.TrackerSourceAddInput + +// TrackerSourceAddOutput is the response from tracker.source.add. +type TrackerSourceAddOutput = wire.TrackerSourceAddOutput + +// TrackerSourceCheckInput is the request to tracker.source.check. +type TrackerSourceCheckInput = wire.TrackerSourceCheckInput + +// TrackerSourceCheckOutput is the response from tracker.source.check. +type TrackerSourceCheckOutput = wire.TrackerSourceCheckOutput + +// TrackerSourceInspectInput is the request to tracker.source.inspect. +type TrackerSourceInspectInput = wire.TrackerSourceInspectInput + +// TrackerSourceInspectOutput is the response from tracker.source.inspect. +type TrackerSourceInspectOutput = wire.TrackerSourceInspectOutput + +// TrackerSourceListInput is the request to tracker.source.list. +type TrackerSourceListInput = wire.TrackerSourceListInput + +// TrackerSourceListOutput is the response from tracker.source.list. +type TrackerSourceListOutput = wire.TrackerSourceListOutput + +// TrackerSourceNamespaceSpec is a model used by Loom operations. +type TrackerSourceNamespaceSpec = wire.TrackerSourceNamespaceSpec + +// TrackerSourceRemoveInput is the request to tracker.source.remove. +type TrackerSourceRemoveInput = wire.TrackerSourceRemoveInput + +// TrackerSourceRemoveOutput is the response from tracker.source.remove. +type TrackerSourceRemoveOutput = wire.TrackerSourceRemoveOutput + +// TrackerSourceRotateInput is the request to tracker.source.rotate. +type TrackerSourceRotateInput = wire.TrackerSourceRotateInput + +// TrackerSourceRotateOutput is the response from tracker.source.rotate. +type TrackerSourceRotateOutput = wire.TrackerSourceRotateOutput + +// TrackerSourceSetMappingInput is the request to tracker.source.set_mapping. +type TrackerSourceSetMappingInput = wire.TrackerSourceSetMappingInput + +// TrackerSourceSetMappingOutput is the response from tracker.source.set_mapping. +type TrackerSourceSetMappingOutput = wire.TrackerSourceSetMappingOutput + +// TrackerTestSignalInput is the request to tracker.test_signal. +type TrackerTestSignalInput = wire.TrackerTestSignalInput + +// TrackerTestSignalOutput is the response from tracker.test_signal. +type TrackerTestSignalOutput = wire.TrackerTestSignalOutput + +// TraversalNode is a model used by Loom operations. +type TraversalNode = wire.TraversalNode + +// TuneApply is a model used by Loom operations. +type TuneApply = wire.TuneApply + +// TuneEvidence is a model used by Loom operations. +type TuneEvidence = wire.TuneEvidence + +// TuneProposal is a model used by Loom operations. +type TuneProposal = wire.TuneProposal + +// TurnUsage is a model used by Loom operations. +type TurnUsage = wire.TurnUsage + +// UIVitalsInput is the request to ui.vitals. +type UIVitalsInput = wire.UIVitalsInput + +// UIVitalsOutput is the response from ui.vitals. +type UIVitalsOutput = wire.UIVitalsOutput + +// UsageRung is a model used by Loom operations. +type UsageRung = wire.UsageRung + +// UserNamespaceGrant is a model used by Loom operations. +type UserNamespaceGrant = wire.UserNamespaceGrant + +// UserSummary is a model used by Loom operations. +type UserSummary = wire.UserSummary + +// WebhookDeliveriesInput is the request to webhook.deliveries. +type WebhookDeliveriesInput = wire.WebhookDeliveriesInput + +// WebhookDeliveriesOutput is the response from webhook.deliveries. +type WebhookDeliveriesOutput = wire.WebhookDeliveriesOutput + +// WebhookDelivery is a model used by Loom operations. +type WebhookDelivery = wire.WebhookDelivery + +// WebhookInfo is a model used by Loom operations. +type WebhookInfo = wire.WebhookInfo + +// WebhookListInput is the request to webhook.list. +type WebhookListInput = wire.WebhookListInput + +// WebhookListOutput is the response from webhook.list. +type WebhookListOutput = wire.WebhookListOutput + +// WebhookRegisterInput is the request to webhook.register. +type WebhookRegisterInput = wire.WebhookRegisterInput + +// WebhookRegisterOutput is the response from webhook.register. +type WebhookRegisterOutput = wire.WebhookRegisterOutput + +// WebhookRemoveInput is the request to webhook.remove. +type WebhookRemoveInput = wire.WebhookRemoveInput + +// WebhookRemoveOutput is the response from webhook.remove. +type WebhookRemoveOutput = wire.WebhookRemoveOutput + +// WorkingMemoryAppendInput is the request to working_memory.append. +type WorkingMemoryAppendInput = wire.WorkingMemoryAppendInput + +// WorkingMemoryAppendOutput is the response from working_memory.append. +type WorkingMemoryAppendOutput = wire.WorkingMemoryAppendOutput + +// WorkingMemoryBlock is a model used by Loom operations. +type WorkingMemoryBlock = wire.WorkingMemoryBlock + +// WorkingMemoryDeleteInput is the request to working_memory.delete. +type WorkingMemoryDeleteInput = wire.WorkingMemoryDeleteInput + +// WorkingMemoryDeleteOutput is the response from working_memory.delete. +type WorkingMemoryDeleteOutput = wire.WorkingMemoryDeleteOutput + +// WorkingMemoryGetInput is the request to working_memory.get. +type WorkingMemoryGetInput = wire.WorkingMemoryGetInput + +// WorkingMemoryGetOutput is the response from working_memory.get. +type WorkingMemoryGetOutput = wire.WorkingMemoryGetOutput + +// WorkingMemoryMutationOutput is a model used by Loom operations. +type WorkingMemoryMutationOutput = wire.WorkingMemoryMutationOutput + +// WorkingMemoryRenderInput is the request to working_memory.render. +type WorkingMemoryRenderInput = wire.WorkingMemoryRenderInput + +// WorkingMemoryRenderOutput is the response from working_memory.render. +type WorkingMemoryRenderOutput = wire.WorkingMemoryRenderOutput + +// WorkingMemoryReplaceInput is the request to working_memory.replace. +type WorkingMemoryReplaceInput = wire.WorkingMemoryReplaceInput + +// WorkingMemoryReplaceOutput is the response from working_memory.replace. +type WorkingMemoryReplaceOutput = wire.WorkingMemoryReplaceOutput + +// WorkingMemorySetInput is the request to working_memory.set. +type WorkingMemorySetInput = wire.WorkingMemorySetInput + +// WorkingMemorySetOutput is the response from working_memory.set. +type WorkingMemorySetOutput = wire.WorkingMemorySetOutput + +// Client calls Loom operations as one org, namespace and agent. +// Construct it with New. It is safe for concurrent use. +type Client struct { + Admin AdminService + Agents AgentsService + Assistant AssistantService + Audit AuditService + Blacklist BlacklistService + Calibration CalibrationService + Code CodeService + Collection CollectionService + Conflicts ConflictsService + Connection ConnectionService + Consolidations ConsolidationsService + Context ContextService + Conversation ConversationService + Cost CostService + Decision DecisionService + Erasure ErasureService + ExtractionPolicy ExtractionPolicyService + Facts FactsService + Grants GrantsService + Help HelpService + Inbox InboxService + Insights InsightsService + Knowledge KnowledgeService + Learnings LearningsService + LoomSearch LoomSearchService + Memory MemoryService + MemorySchema MemorySchemaService + Mentor MentorService + Namespace NamespaceService + Observe ObserveService + Ops OpsService + Org OrgService + Policy PolicyService + Procedure ProcedureService + Profile ProfileService + ProfileSchema ProfileSchemaService + Run RunService + Session SessionService + Task TaskService + Tracker TrackerService + UI UIService + Webhook WebhookService + WorkingMemory WorkingMemoryService + + clientTransport +} + +func (c *Client) initServices() { + c.Admin = AdminService{client: &c.clientTransport} + c.Agents = AgentsService{client: &c.clientTransport} + c.Assistant = AssistantService{client: &c.clientTransport} + c.Audit = AuditService{client: &c.clientTransport} + c.Blacklist = BlacklistService{client: &c.clientTransport} + c.Calibration = CalibrationService{client: &c.clientTransport} + c.Code = CodeService{client: &c.clientTransport} + c.Collection = CollectionService{client: &c.clientTransport} + c.Conflicts = ConflictsService{client: &c.clientTransport} + c.Connection = ConnectionService{client: &c.clientTransport} + c.Consolidations = ConsolidationsService{client: &c.clientTransport} + c.Context = ContextService{client: &c.clientTransport} + c.Conversation = ConversationService{client: &c.clientTransport} + c.Cost = CostService{client: &c.clientTransport} + c.Decision = DecisionService{client: &c.clientTransport} + c.Erasure = ErasureService{client: &c.clientTransport} + c.ExtractionPolicy = ExtractionPolicyService{client: &c.clientTransport} + c.Facts = FactsService{client: &c.clientTransport} + c.Grants = GrantsService{client: &c.clientTransport} + c.Help = HelpService{client: &c.clientTransport} + c.Inbox = InboxService{client: &c.clientTransport} + c.Insights = InsightsService{client: &c.clientTransport} + c.Knowledge = KnowledgeService{client: &c.clientTransport} + c.Learnings = LearningsService{client: &c.clientTransport} + c.LoomSearch = LoomSearchService{client: &c.clientTransport} + c.Memory = MemoryService{client: &c.clientTransport} + c.MemorySchema = MemorySchemaService{client: &c.clientTransport} + c.Mentor = MentorService{client: &c.clientTransport} + c.Namespace = NamespaceService{client: &c.clientTransport} + c.Observe = ObserveService{client: &c.clientTransport} + c.Ops = OpsService{client: &c.clientTransport} + c.Org = OrgService{client: &c.clientTransport} + c.Policy = PolicyService{client: &c.clientTransport} + c.Procedure = ProcedureService{client: &c.clientTransport} + c.Profile = ProfileService{client: &c.clientTransport} + c.ProfileSchema = ProfileSchemaService{client: &c.clientTransport} + c.Run = RunService{client: &c.clientTransport} + c.Session = SessionService{client: &c.clientTransport} + c.Task = TaskService{client: &c.clientTransport} + c.Tracker = TrackerService{client: &c.clientTransport} + c.UI = UIService{client: &c.clientTransport} + c.Webhook = WebhookService{client: &c.clientTransport} + c.WorkingMemory = WorkingMemoryService{client: &c.clientTransport} +} + +// AdminService provides the operations on Client.Admin. +type AdminService struct{ client *clientTransport } + +// AgentsService provides the operations on Client.Agents. +type AgentsService struct{ client *clientTransport } + +// AssistantService provides the operations on Client.Assistant. +type AssistantService struct{ client *clientTransport } + +// AuditService provides the operations on Client.Audit. +type AuditService struct{ client *clientTransport } + +// BlacklistService provides the operations on Client.Blacklist. +type BlacklistService struct{ client *clientTransport } + +// CalibrationService provides the operations on Client.Calibration. +type CalibrationService struct{ client *clientTransport } + +// CodeService provides the operations on Client.Code. +type CodeService struct{ client *clientTransport } + +// CollectionService provides the operations on Client.Collection. +type CollectionService struct{ client *clientTransport } + +// ConflictsService provides the operations on Client.Conflicts. +type ConflictsService struct{ client *clientTransport } + +// ConnectionService provides the operations on Client.Connection. +type ConnectionService struct{ client *clientTransport } + +// ConsolidationsService provides the operations on Client.Consolidations. +type ConsolidationsService struct{ client *clientTransport } + +// ContextService provides the operations on Client.Context. +type ContextService struct{ client *clientTransport } + +// ConversationService provides the operations on Client.Conversation. +type ConversationService struct{ client *clientTransport } + +// CostService provides the operations on Client.Cost. +type CostService struct{ client *clientTransport } + +// DecisionService provides the operations on Client.Decision. +type DecisionService struct{ client *clientTransport } + +// ErasureService provides the operations on Client.Erasure. +type ErasureService struct{ client *clientTransport } + +// ExtractionPolicyService provides the operations on Client.ExtractionPolicy. +type ExtractionPolicyService struct{ client *clientTransport } + +// FactsService provides the operations on Client.Facts. +type FactsService struct{ client *clientTransport } + +// GrantsService provides the operations on Client.Grants. +type GrantsService struct{ client *clientTransport } + +// HelpService provides the operations on Client.Help. +type HelpService struct{ client *clientTransport } + +// InboxService provides the operations on Client.Inbox. +type InboxService struct{ client *clientTransport } + +// InsightsService provides the operations on Client.Insights. +type InsightsService struct{ client *clientTransport } + +// KnowledgeService provides the operations on Client.Knowledge. +type KnowledgeService struct{ client *clientTransport } + +// LearningsService provides the operations on Client.Learnings. +type LearningsService struct{ client *clientTransport } + +// LoomSearchService provides the operations on Client.LoomSearch. +type LoomSearchService struct{ client *clientTransport } + +// MemoryService provides the operations on Client.Memory. +type MemoryService struct{ client *clientTransport } + +// MemorySchemaService provides the operations on Client.MemorySchema. +type MemorySchemaService struct{ client *clientTransport } + +// MentorService provides the operations on Client.Mentor. +type MentorService struct{ client *clientTransport } + +// NamespaceService provides the operations on Client.Namespace. +type NamespaceService struct{ client *clientTransport } + +// ObserveService provides the operations on Client.Observe. +type ObserveService struct{ client *clientTransport } + +// OpsService provides the operations on Client.Ops. +type OpsService struct{ client *clientTransport } + +// OrgService provides the operations on Client.Org. +type OrgService struct{ client *clientTransport } + +// PolicyService provides the operations on Client.Policy. +type PolicyService struct{ client *clientTransport } + +// ProcedureService provides the operations on Client.Procedure. +type ProcedureService struct{ client *clientTransport } + +// ProfileService provides the operations on Client.Profile. +type ProfileService struct{ client *clientTransport } + +// ProfileSchemaService provides the operations on Client.ProfileSchema. +type ProfileSchemaService struct{ client *clientTransport } + +// RunService provides the operations on Client.Run. +type RunService struct{ client *clientTransport } + +// SessionService provides the operations on Client.Session. +type SessionService struct{ client *clientTransport } + +// TaskService provides the operations on Client.Task. +type TaskService struct{ client *clientTransport } + +// TrackerService provides the operations on Client.Tracker. +type TrackerService struct{ client *clientTransport } + +// UIService provides the operations on Client.UI. +type UIService struct{ client *clientTransport } + +// WebhookService provides the operations on Client.Webhook. +type WebhookService struct{ client *clientTransport } + +// WorkingMemoryService provides the operations on Client.WorkingMemory. +type WorkingMemoryService struct{ client *clientTransport } + +// Users calls admin.users. +// Use WithInput to supply additional request fields. +func (s AdminService) Users(ctx context.Context, opts ...Option[AdminUsersInput]) (*AdminUsersOutput, error) { + in := applyOptions(opts) + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[AdminUsersOutput](s.client, ctx, "admin.users", in) +} + +// Connected calls agents.connected. +// Use WithInput to supply additional request fields. +func (s AgentsService) Connected(ctx context.Context, opts ...Option[AgentsConnectedInput]) (*AgentsConnectedOutput, error) { + in := applyOptions(opts) + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[AgentsConnectedOutput](s.client, ctx, "agents.connected", in) +} + +// Ask calls assistant.ask. +// Use WithInput to supply additional request fields. +func (s AssistantService) Ask(ctx context.Context, question string, opts ...Option[AssistantAskInput]) (*AssistantAskOutput, error) { + in := applyOptions(opts) + in.Question = question + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[AssistantAskOutput](s.client, ctx, "assistant.ask", in) +} + +// List calls audit.list. +// Use WithInput to supply additional request fields. +func (s AuditService) List(ctx context.Context, opts ...Option[AuditListInput]) (*AuditListOutput, error) { + in := applyOptions(opts) + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[AuditListOutput](s.client, ctx, "audit.list", in) +} + +// Add calls blacklist.add. +// Use WithInput to supply additional request fields. +func (s BlacklistService) Add(ctx context.Context, pattern string, opts ...Option[BlacklistAddInput]) (*BlacklistAddOutput, error) { + in := applyOptions(opts) + in.Pattern = pattern + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[BlacklistAddOutput](s.client, ctx, "blacklist.add", in) +} + +// List calls blacklist.list. +// Use WithInput to supply additional request fields. +func (s BlacklistService) List(ctx context.Context, opts ...Option[BlacklistListInput]) (*BlacklistListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[BlacklistListOutput](s.client, ctx, "blacklist.list", in) +} + +// Remove calls blacklist.remove. +// Use WithInput to supply additional request fields. +func (s BlacklistService) Remove(ctx context.Context, patternID string, opts ...Option[BlacklistRemoveInput]) (*BlacklistRemoveOutput, error) { + in := applyOptions(opts) + in.PatternID = patternID + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[BlacklistRemoveOutput](s.client, ctx, "blacklist.remove", in) +} + +// Sweep calls blacklist.sweep. +// Use WithInput to supply additional request fields. +func (s BlacklistService) Sweep(ctx context.Context, patternID string, opts ...Option[BlacklistSweepInput]) (*BlacklistSweepOutput, error) { + in := applyOptions(opts) + in.PatternID = patternID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[BlacklistSweepOutput](s.client, ctx, "blacklist.sweep", in) +} + +// Get calls calibration.get. +// Use WithInput to supply additional request fields. +func (s CalibrationService) Get(ctx context.Context, opts ...Option[CalibrationGetInput]) (*CalibrationGetOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CalibrationGetOutput](s.client, ctx, "calibration.get", in) +} + +// Ask calls code.ask. +// Use WithInput to supply additional request fields. +func (s CodeService) Ask(ctx context.Context, question string, opts ...Option[CodeAskInput]) (*CodeAskOutput, error) { + in := applyOptions(opts) + in.Question = question + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeAskOutput](s.client, ctx, "code.ask", in) +} + +// BackportGap calls code.backport_gap. +// Use WithInput to supply additional request fields. +func (s CodeService) BackportGap(ctx context.Context, opts ...Option[CodeBackportGapInput]) (*CodeBackportGapOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeBackportGapOutput](s.client, ctx, "code.backport_gap", in) +} + +// BackportGaps calls code.backport_gaps. +// Use WithInput to supply additional request fields. +func (s CodeService) BackportGaps(ctx context.Context, opts ...Option[CodeBackportGapsInput]) (*CodeBackportGapsOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeBackportGapsOutput](s.client, ctx, "code.backport_gaps", in) +} + +// BisectCandidates calls code.bisect_candidates. +// Use WithInput to supply additional request fields. +func (s CodeService) BisectCandidates(ctx context.Context, opts ...Option[CodeBisectCandidatesInput]) (*CodeBisectCandidatesOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeBisectCandidatesOutput](s.client, ctx, "code.bisect_candidates", in) +} + +// BlameRange calls code.blame_range. +func (s CodeService) BlameRange(ctx context.Context, in CodeBlameRangeInput) (*CodeBlameRangeOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeBlameRangeOutput](s.client, ctx, "code.blame_range", in) +} + +// Calibrate calls code.calibrate. +// Use WithInput to supply additional request fields. +func (s CodeService) Calibrate(ctx context.Context, opts ...Option[CodeCalibrateInput]) (*CodeCalibrateOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeCalibrateOutput](s.client, ctx, "code.calibrate", in) +} + +// Callees calls code.callees. +// Use WithInput to supply additional request fields. +func (s CodeService) Callees(ctx context.Context, opts ...Option[CodeCalleesInput]) (*CodeCalleesOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeCalleesOutput](s.client, ctx, "code.callees", in) +} + +// Callers calls code.callers. +// Use WithInput to supply additional request fields. +func (s CodeService) Callers(ctx context.Context, opts ...Option[CodeCallersInput]) (*CodeCallersOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeCallersOutput](s.client, ctx, "code.callers", in) +} + +// ContextPack calls code.context_pack. +// Use WithInput to supply additional request fields. +func (s CodeService) ContextPack(ctx context.Context, opts ...Option[CodeContextPackInput]) (*CodeContextPackOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeContextPackOutput](s.client, ctx, "code.context_pack", in) +} + +// ContextPacks calls code.context_packs. +// Use WithInput to supply additional request fields. +func (s CodeService) ContextPacks(ctx context.Context, opts ...Option[CodeContextPacksInput]) (*CodeContextPacksOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeContextPacksOutput](s.client, ctx, "code.context_packs", in) +} + +// Conventions calls code.conventions. +// Use WithInput to supply additional request fields. +func (s CodeService) Conventions(ctx context.Context, opts ...Option[CodeConventionsInput]) (*CodeConventionsOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeConventionsOutput](s.client, ctx, "code.conventions", in) +} + +// Coverage calls code.coverage. +// Use WithInput to supply additional request fields. +func (s CodeService) Coverage(ctx context.Context, opts ...Option[CodeCoverageInput]) (*CodeCoverageOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeCoverageOutput](s.client, ctx, "code.coverage", in) +} + +// CoverageUnwatch calls code.coverage.unwatch. +func (s CodeService) CoverageUnwatch(ctx context.Context, in CodeCoverageUnwatchInput) (*CodeCoverageUnwatchOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeCoverageUnwatchOutput](s.client, ctx, "code.coverage.unwatch", in) +} + +// CoverageWatch calls code.coverage.watch. +func (s CodeService) CoverageWatch(ctx context.Context, in CodeCoverageWatchInput) (*CodeCoverageWatchOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeCoverageWatchOutput](s.client, ctx, "code.coverage.watch", in) +} + +// CoverageClaim calls code.coverage_claim. +// Use WithInput to supply additional request fields. +func (s CodeService) CoverageClaim(ctx context.Context, opts ...Option[CodeCoverageClaimInput]) (*CodeCoverageClaimOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeCoverageClaimOutput](s.client, ctx, "code.coverage_claim", in) +} + +// EditContext calls code.edit_context. +// Use WithInput to supply additional request fields. +func (s CodeService) EditContext(ctx context.Context, opts ...Option[CodeEditContextInput]) (*CodeEditContextOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeEditContextOutput](s.client, ctx, "code.edit_context", in) +} + +// Enclosing calls code.enclosing. +func (s CodeService) Enclosing(ctx context.Context, in CodeEnclosingInput) (*CodeEnclosingOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeEnclosingOutput](s.client, ctx, "code.enclosing", in) +} + +// Examples calls code.examples. +// Use WithInput to supply additional request fields. +func (s CodeService) Examples(ctx context.Context, opts ...Option[CodeExamplesInput]) (*CodeExamplesOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeExamplesOutput](s.client, ctx, "code.examples", in) +} + +// Files calls code.files. +// Use WithInput to supply additional request fields. +func (s CodeService) Files(ctx context.Context, opts ...Option[CodeFilesInput]) (*CodeFilesOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeFilesOutput](s.client, ctx, "code.files", in) +} + +// FirstBuild calls code.first_build. +// Use WithInput to supply additional request fields. +func (s CodeService) FirstBuild(ctx context.Context, opts ...Option[CodeFirstBuildInput]) (*CodeFirstBuildOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeFirstBuildOutput](s.client, ctx, "code.first_build", in) +} + +// Grep calls code.grep. +func (s CodeService) Grep(ctx context.Context, in CodeGrepInput) (*CodeGrepOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeGrepOutput](s.client, ctx, "code.grep", in) +} + +// History calls code.history. +// Use WithInput to supply additional request fields. +func (s CodeService) History(ctx context.Context, opts ...Option[CodeHistoryInput]) (*CodeHistoryOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeHistoryOutput](s.client, ctx, "code.history", in) +} + +// Impact calls code.impact. +// Use WithInput to supply additional request fields. +func (s CodeService) Impact(ctx context.Context, opts ...Option[CodeImpactInput]) (*CodeImpactOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeImpactOutput](s.client, ctx, "code.impact", in) +} + +// IndexErrors calls code.index_errors. +// Use WithInput to supply additional request fields. +func (s CodeService) IndexErrors(ctx context.Context, opts ...Option[CodeIndexErrorsInput]) (*CodeIndexErrorsOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeIndexErrorsOutput](s.client, ctx, "code.index_errors", in) +} + +// IndexStatus calls code.index_status. +// Use WithInput to supply additional request fields. +func (s CodeService) IndexStatus(ctx context.Context, opts ...Option[CodeIndexStatusInput]) (*CodeIndexStatusOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeIndexStatusOutput](s.client, ctx, "code.index_status", in) +} + +// Map calls code.map. +// Use WithInput to supply additional request fields. +func (s CodeService) Map(ctx context.Context, opts ...Option[CodeMapInput]) (*CodeMapOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeMapOutput](s.client, ctx, "code.map", in) +} + +// Outcome calls code.outcome. +// Use WithInput to supply additional request fields. +func (s CodeService) Outcome(ctx context.Context, action string, opts ...Option[CodeOutcomeInput]) (*CodeOutcomeOutput, error) { + in := applyOptions(opts) + in.Action = action + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeOutcomeOutput](s.client, ctx, "code.outcome", in) +} + +// Outline calls code.outline. +// Use WithInput to supply additional request fields. +func (s CodeService) Outline(ctx context.Context, path string, opts ...Option[CodeOutlineInput]) (*CodeOutlineOutput, error) { + in := applyOptions(opts) + in.Path = path + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeOutlineOutput](s.client, ctx, "code.outline", in) +} + +// PathGuards calls code.path_guards. +func (s CodeService) PathGuards(ctx context.Context, in CodePathGuardsInput) (*CodePathGuardsOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodePathGuardsOutput](s.client, ctx, "code.path_guards", in) +} + +// PrCheck calls code.pr_check. +// Use WithInput to supply additional request fields. +func (s CodeService) PrCheck(ctx context.Context, opts ...Option[CodePrCheckInput]) (*CodePrCheckOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodePrCheckOutput](s.client, ctx, "code.pr_check", in) +} + +// Read calls code.read. +// Use WithInput to supply additional request fields. +func (s CodeService) Read(ctx context.Context, opts ...Option[CodeReadInput]) (*CodeReadOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeReadOutput](s.client, ctx, "code.read", in) +} + +// RecentCommits calls code.recent_commits. +// Use WithInput to supply additional request fields. +func (s CodeService) RecentCommits(ctx context.Context, opts ...Option[CodeRecentCommitsInput]) (*CodeRecentCommitsOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeRecentCommitsOutput](s.client, ctx, "code.recent_commits", in) +} + +// Refresh calls code.refresh. +// Use WithInput to supply additional request fields. +func (s CodeService) Refresh(ctx context.Context, opts ...Option[CodeRefreshInput]) (*CodeRefreshOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeRefreshOutput](s.client, ctx, "code.refresh", in) +} + +// Reindex calls code.reindex. +// Use WithInput to supply additional request fields. +func (s CodeService) Reindex(ctx context.Context, gitHead string, opts ...Option[CodeReindexInput]) (*CodeReindexOutput, error) { + in := applyOptions(opts) + in.GitHead = gitHead + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeReindexOutput](s.client, ctx, "code.reindex", in) +} + +// RepoAdd calls code.repo.add. +// Use WithInput to supply additional request fields. +func (s CodeService) RepoAdd(ctx context.Context, repo string, opts ...Option[CodeRepoAddInput]) (*CodeRepoAddOutput, error) { + in := applyOptions(opts) + in.Repo = repo + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CodeRepoAddOutput](s.client, ctx, "code.repo.add", in) +} + +// RepoAddBranch calls code.repo.add_branch. +// Use WithInput to supply additional request fields. +func (s CodeService) RepoAddBranch(ctx context.Context, branch string, opts ...Option[CodeRepoAddBranchInput]) (*CodeRepoAddBranchOutput, error) { + in := applyOptions(opts) + in.Branch = branch + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CodeRepoAddBranchOutput](s.client, ctx, "code.repo.add_branch", in) +} + +// RepoRemoteBranches calls code.repo.remote_branches. +// Use WithInput to supply additional request fields. +func (s CodeService) RepoRemoteBranches(ctx context.Context, repo string, opts ...Option[CodeRepoRemoteBranchesInput]) (*CodeRepoRemoteBranchesOutput, error) { + in := applyOptions(opts) + in.Repo = repo + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CodeRepoRemoteBranchesOutput](s.client, ctx, "code.repo.remote_branches", in) +} + +// RepoRemove calls code.repo.remove. +// Use WithInput to supply additional request fields. +func (s CodeService) RepoRemove(ctx context.Context, opts ...Option[CodeRepoRemoveInput]) (*CodeRepoRemoveOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CodeRepoRemoveOutput](s.client, ctx, "code.repo.remove", in) +} + +// RepoSetAccess calls code.repo.set_access. +func (s CodeService) RepoSetAccess(ctx context.Context, in CodeRepoSetAccessInput) (*CodeRepoSetAccessOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CodeRepoSetAccessOutput](s.client, ctx, "code.repo.set_access", in) +} + +// RepoSetSource calls code.repo.set_source. +func (s CodeService) RepoSetSource(ctx context.Context, in CodeRepoSetSourceInput) (*CodeRepoSetSourceOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CodeRepoSetSourceOutput](s.client, ctx, "code.repo.set_source", in) +} + +// Repos calls code.repos. +// Use WithInput to supply additional request fields. +func (s CodeService) Repos(ctx context.Context, opts ...CodeReposOption) (*CodeReposOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeReposOutput](s.client, ctx, "code.repos", in) +} + +// ReviewBrief calls code.review_brief. +// Use WithInput to supply additional request fields. +func (s CodeService) ReviewBrief(ctx context.Context, opts ...Option[CodeReviewBriefInput]) (*CodeReviewBriefOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeReviewBriefOutput](s.client, ctx, "code.review_brief", in) +} + +// ScipIngest calls code.scip_ingest. +func (s CodeService) ScipIngest(ctx context.Context, in CodeScipIngestInput) (*CodeScipIngestOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeScipIngestOutput](s.client, ctx, "code.scip_ingest", in) +} + +// ScipStatus calls code.scip_status. +// Use WithInput to supply additional request fields. +func (s CodeService) ScipStatus(ctx context.Context, batchID string, opts ...Option[CodeScipStatusInput]) (*CodeScipStatusOutput, error) { + in := applyOptions(opts) + in.BatchID = batchID + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeScipStatusOutput](s.client, ctx, "code.scip_status", in) +} + +// Search calls code.search. +// Use WithInput to supply additional request fields. +func (s CodeService) Search(ctx context.Context, query string, opts ...Option[CodeSearchInput]) (*CodeSearchOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeSearchOutput](s.client, ctx, "code.search", in) +} + +// SettingFacts calls code.setting_facts. +// Use WithInput to supply additional request fields. +func (s CodeService) SettingFacts(ctx context.Context, name string, opts ...Option[CodeSettingFactsInput]) (*CodeSettingFactsOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeSettingFactsOutput](s.client, ctx, "code.setting_facts", in) +} + +// Symbol calls code.symbol. +// Use WithInput to supply additional request fields. +func (s CodeService) Symbol(ctx context.Context, opts ...Option[CodeSymbolInput]) (*CodeSymbolOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeSymbolOutput](s.client, ctx, "code.symbol", in) +} + +// SymbolHistory calls code.symbol_history. +// Use WithInput to supply additional request fields. +func (s CodeService) SymbolHistory(ctx context.Context, opts ...Option[CodeSymbolHistoryInput]) (*CodeSymbolHistoryOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeSymbolHistoryOutput](s.client, ctx, "code.symbol_history", in) +} + +// TestGate calls code.test_gate. +// Use WithInput to supply additional request fields. +func (s CodeService) TestGate(ctx context.Context, opts ...Option[CodeTestGateInput]) (*CodeTestGateOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeTestGateOutput](s.client, ctx, "code.test_gate", in) +} + +// TestHome calls code.test_home. +// Use WithInput to supply additional request fields. +func (s CodeService) TestHome(ctx context.Context, opts ...Option[CodeTestHomeInput]) (*CodeTestHomeOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeTestHomeOutput](s.client, ctx, "code.test_home", in) +} + +// TestsFor calls code.tests_for. +func (s CodeService) TestsFor(ctx context.Context, in CodeTestsForInput) (*CodeTestsForOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeTestsForOutput](s.client, ctx, "code.tests_for", in) +} + +// Trace calls code.trace. +// Use WithInput to supply additional request fields. +func (s CodeService) Trace(ctx context.Context, trace string, opts ...Option[CodeTraceInput]) (*CodeTraceOutput, error) { + in := applyOptions(opts) + in.Trace = trace + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeTraceOutput](s.client, ctx, "code.trace", in) +} + +// Verify calls code.verify. +func (s CodeService) Verify(ctx context.Context, in CodeVerifyInput) (*CodeVerifyOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeVerifyOutput](s.client, ctx, "code.verify", in) +} + +// VerifyCitations calls code.verify_citations. +// Use WithInput to supply additional request fields. +func (s CodeService) VerifyCitations(ctx context.Context, text string, opts ...Option[CodeVerifyCitationsInput]) (*CodeVerifyCitationsOutput, error) { + in := applyOptions(opts) + in.Text = text + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[CodeVerifyCitationsOutput](s.client, ctx, "code.verify_citations", in) +} + +// Create calls collection.create. +// Use WithInput to supply additional request fields. +func (s CollectionService) Create(ctx context.Context, opts ...Option[CollectionCreateInput]) (*CollectionCreateOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CollectionCreateOutput](s.client, ctx, "collection.create", in) +} + +// Delete calls collection.delete. +// Use WithInput to supply additional request fields. +// The namespace must be named explicitly. +func (s CollectionService) Delete(ctx context.Context, namespace string, opts ...Option[CollectionDeleteInput]) (*CollectionDeleteOutput, error) { + in := applyOptions(opts) + in.Namespace = namespace + if err := requireNamedNamespace("collection.delete", in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CollectionDeleteOutput](s.client, ctx, "collection.delete", in) +} + +// List calls collection.list. +// Use WithInput to supply additional request fields. +func (s CollectionService) List(ctx context.Context, opts ...Option[CollectionListInput]) (*CollectionListOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CollectionListOutput](s.client, ctx, "collection.list", in) +} + +// Move calls collection.move. +// Use WithInput to supply additional request fields. +// The namespace must be named explicitly. +func (s CollectionService) Move(ctx context.Context, namespace string, opts ...Option[CollectionMoveInput]) (*CollectionMoveOutput, error) { + in := applyOptions(opts) + in.Namespace = namespace + if err := requireNamedNamespace("collection.move", in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CollectionMoveOutput](s.client, ctx, "collection.move", in) +} + +// AllowlistList calls conflicts.allowlist_list. +// Use WithInput to supply additional request fields. +func (s ConflictsService) AllowlistList(ctx context.Context, opts ...Option[ConflictsAllowlistListInput]) (*ConflictsAllowlistListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConflictsAllowlistListOutput](s.client, ctx, "conflicts.allowlist_list", in) +} + +// AllowlistRemove calls conflicts.allowlist_remove. +func (s ConflictsService) AllowlistRemove(ctx context.Context, in ConflictsAllowlistRemoveInput) (*ConflictsAllowlistRemoveOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConflictsAllowlistRemoveOutput](s.client, ctx, "conflicts.allowlist_remove", in) +} + +// List calls conflicts.list. +// Use WithInput to supply additional request fields. +func (s ConflictsService) List(ctx context.Context, opts ...Option[ConflictsListInput]) (*ConflictsListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConflictsListOutput](s.client, ctx, "conflicts.list", in) +} + +// ProposeRevision calls conflicts.propose_revision. +// Use WithInput to supply additional request fields. +func (s ConflictsService) ProposeRevision(ctx context.Context, memoryID string, opts ...Option[ConflictsProposeRevisionInput]) (*ConflictsProposeRevisionOutput, error) { + in := applyOptions(opts) + in.MemoryID = memoryID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConflictsProposeRevisionOutput](s.client, ctx, "conflicts.propose_revision", in) +} + +// Resolve calls conflicts.resolve. +func (s ConflictsService) Resolve(ctx context.Context, in ConflictsResolveInput) (*ConflictsResolveOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConflictsResolveOutput](s.client, ctx, "conflicts.resolve", in) +} + +// Disconnect calls connection.disconnect. +// Use WithInput to supply additional request fields. +func (s ConnectionService) Disconnect(ctx context.Context, kind string, opts ...Option[ConnectionDisconnectInput]) (*ConnectionDisconnectOutput, error) { + in := applyOptions(opts) + in.Kind = kind + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConnectionDisconnectOutput](s.client, ctx, "connection.disconnect", in) +} + +// List calls connection.list. +// Use WithInput to supply additional request fields. +func (s ConnectionService) List(ctx context.Context, opts ...Option[ConnectionListInput]) (*ConnectionListOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConnectionListOutput](s.client, ctx, "connection.list", in) +} + +// List calls consolidations.list. +// Use WithInput to supply additional request fields. +func (s ConsolidationsService) List(ctx context.Context, opts ...Option[ConsolidationsListInput]) (*ConsolidationsListOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConsolidationsListOutput](s.client, ctx, "consolidations.list", in) +} + +// Fetch calls context.fetch. +// Use WithInput to supply additional request fields. +func (s ContextService) Fetch(ctx context.Context, blobKey string, opts ...Option[ContextFetchInput]) (*ContextFetchOutput, error) { + in := applyOptions(opts) + in.BlobKey = blobKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ContextFetchOutput](s.client, ctx, "context.fetch", in) +} + +// Offload calls context.offload. +// Use WithInput to supply additional request fields. +func (s ContextService) Offload(ctx context.Context, content string, opts ...Option[ContextOffloadInput]) (*ContextOffloadOutput, error) { + in := applyOptions(opts) + in.Content = content + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ContextOffloadOutput](s.client, ctx, "context.offload", in) +} + +// Pack calls context.pack. +// Use WithInput to supply additional request fields. +// If query is empty, options or the server supply the value. +func (s ContextService) Pack(ctx context.Context, query string, opts ...Option[ContextPackInput]) (*ContextPackOutput, error) { + in := applyOptions(opts) + if query != "" { + in.Query = Ptr(query) + } + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ContextPackOutput](s.client, ctx, "context.pack", in) +} + +// WithPackTokenBudget sets token_budget on context.pack. +func WithPackTokenBudget(value int64) Option[ContextPackInput] { + return func(in *ContextPackInput) { in.TokenBudget = Ptr(value) } +} + +// WithPackKnowledge sets include_knowledge on context.pack. +func WithPackKnowledge(value bool) Option[ContextPackInput] { + return func(in *ContextPackInput) { in.IncludeKnowledge = Ptr(value) } +} + +// Append calls conversation.append. +func (s ConversationService) Append(ctx context.Context, in ConversationAppendInput) (*ConversationAppendOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationAppendOutput](s.client, ctx, "conversation.append", in) +} + +// Compact calls conversation.compact. +// Use WithInput to supply additional request fields. +func (s ConversationService) Compact(ctx context.Context, threadID string, opts ...Option[ConversationCompactInput]) (*ConversationCompactOutput, error) { + in := applyOptions(opts) + in.ThreadID = threadID + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationCompactOutput](s.client, ctx, "conversation.compact", in) +} + +// Create calls conversation.create. +// Use WithInput to supply additional request fields. +func (s ConversationService) Create(ctx context.Context, threadID string, opts ...Option[ConversationCreateInput]) (*ConversationCreateOutput, error) { + in := applyOptions(opts) + in.ThreadID = threadID + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationCreateOutput](s.client, ctx, "conversation.create", in) +} + +// Delete calls conversation.delete. +func (s ConversationService) Delete(ctx context.Context, in ConversationDeleteInput) (*ConversationDeleteOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationDeleteOutput](s.client, ctx, "conversation.delete", in) +} + +// Get calls conversation.get. +// Use WithInput to supply additional request fields. +func (s ConversationService) Get(ctx context.Context, threadID string, opts ...Option[ConversationGetInput]) (*ConversationGetOutput, error) { + in := applyOptions(opts) + in.ThreadID = threadID + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationGetOutput](s.client, ctx, "conversation.get", in) +} + +// List calls conversation.list. +// Use WithInput to supply additional request fields. +func (s ConversationService) List(ctx context.Context, threadID string, opts ...Option[ConversationListInput]) (*ConversationListOutput, error) { + in := applyOptions(opts) + in.ThreadID = threadID + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationListOutput](s.client, ctx, "conversation.list", in) +} + +// ListSavedMessages calls conversation.list_saved_messages. +// Use WithInput to supply additional request fields. +func (s ConversationService) ListSavedMessages(ctx context.Context, userID string, opts ...Option[ConversationListSavedMessagesInput]) (*ConversationListSavedMessagesOutput, error) { + in := applyOptions(opts) + in.UserID = userID + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationListSavedMessagesOutput](s.client, ctx, "conversation.list_saved_messages", in) +} + +// SaveMessage calls conversation.save_message. +func (s ConversationService) SaveMessage(ctx context.Context, in ConversationSaveMessageInput) (*ConversationSaveMessageOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationSaveMessageOutput](s.client, ctx, "conversation.save_message", in) +} + +// SavedStatus calls conversation.saved_status. +func (s ConversationService) SavedStatus(ctx context.Context, in ConversationSavedStatusInput) (*ConversationSavedStatusOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationSavedStatusOutput](s.client, ctx, "conversation.saved_status", in) +} + +// Search calls conversation.search. +// Use WithInput to supply additional request fields. +func (s ConversationService) Search(ctx context.Context, query string, opts ...Option[ConversationSearchInput]) (*ConversationSearchOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationSearchOutput](s.client, ctx, "conversation.search", in) +} + +// SearchSavedMessages calls conversation.search_saved_messages. +func (s ConversationService) SearchSavedMessages(ctx context.Context, in ConversationSearchSavedMessagesInput) (*ConversationSearchSavedMessagesOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationSearchSavedMessagesOutput](s.client, ctx, "conversation.search_saved_messages", in) +} + +// SetLogging calls conversation.set_logging. +// Use WithInput to supply additional request fields. +func (s ConversationService) SetLogging(ctx context.Context, enabled bool, opts ...Option[ConversationSetLoggingInput]) (*ConversationSetLoggingOutput, error) { + in := applyOptions(opts) + in.Enabled = enabled + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationSetLoggingOutput](s.client, ctx, "conversation.set_logging", in) +} + +// Threads calls conversation.threads. +// Use WithInput to supply additional request fields. +func (s ConversationService) Threads(ctx context.Context, opts ...Option[ConversationThreadsInput]) (*ConversationThreadsOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationThreadsOutput](s.client, ctx, "conversation.threads", in) +} + +// UnsaveMessage calls conversation.unsave_message. +func (s ConversationService) UnsaveMessage(ctx context.Context, in ConversationUnsaveMessageInput) (*ConversationUnsaveMessageOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationUnsaveMessageOutput](s.client, ctx, "conversation.unsave_message", in) +} + +// Update calls conversation.update. +// Use WithInput to supply additional request fields. +func (s ConversationService) Update(ctx context.Context, threadID string, opts ...Option[ConversationUpdateInput]) (*ConversationUpdateOutput, error) { + in := applyOptions(opts) + in.ThreadID = threadID + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConversationUpdateOutput](s.client, ctx, "conversation.update", in) +} + +// AgentSummary calls cost.agent_summary. +func (s CostService) AgentSummary(ctx context.Context, in CostAgentSummaryInput) (*CostAgentSummaryOutput, error) { + if len(in.Agent) == 0 && s.client.identity.Agent != "" { + in.Agent = Some(s.client.identity.Agent) + } + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CostAgentSummaryOutput](s.client, ctx, "cost.agent_summary", in) +} + +// BudgetStatus calls cost.budget_status. +// Use WithInput to supply additional request fields. +func (s CostService) BudgetStatus(ctx context.Context, opts ...Option[CostBudgetStatusInput]) (*CostBudgetStatusOutput, error) { + in := applyOptions(opts) + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CostBudgetStatusOutput](s.client, ctx, "cost.budget_status", in) +} + +// RecordTurns calls cost.record_turns. +func (s CostService) RecordTurns(ctx context.Context, in CostRecordTurnsInput) (*CostRecordTurnsOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CostRecordTurnsOutput](s.client, ctx, "cost.record_turns", in) +} + +// Summary calls cost.summary. +func (s CostService) Summary(ctx context.Context, in CostSummaryInput) (*CostSummaryOutput, error) { + if len(in.Agent) == 0 && s.client.identity.Agent != "" { + in.Agent = Some(s.client.identity.Agent) + } + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[CostSummaryOutput](s.client, ctx, "cost.summary", in) +} + +// Chain calls decision.chain. +// Use WithInput to supply additional request fields. +func (s DecisionService) Chain(ctx context.Context, memoryKey string, opts ...Option[DecisionChainInput]) (*DecisionChainOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[DecisionChainOutput](s.client, ctx, "decision.chain", in) +} + +// Outcome calls decision.outcome. +func (s DecisionService) Outcome(ctx context.Context, in DecisionOutcomeInput) (*DecisionOutcomeOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[DecisionOutcomeOutput](s.client, ctx, "decision.outcome", in) +} + +// Precedents calls decision.precedents. +// Use WithInput to supply additional request fields. +func (s DecisionService) Precedents(ctx context.Context, query string, opts ...Option[DecisionPrecedentsInput]) (*DecisionPrecedentsOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[DecisionPrecedentsOutput](s.client, ctx, "decision.precedents", in) +} + +// Record calls decision.record. +func (s DecisionService) Record(ctx context.Context, in DecisionRecordInput) (*DecisionRecordOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[DecisionRecordOutput](s.client, ctx, "decision.record", in) +} + +// Export calls erasure.export. +func (s ErasureService) Export(ctx context.Context, in ErasureExportInput) (*ErasureExportOutput, error) { + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ErasureExportOutput](s.client, ctx, "erasure.export", in) +} + +// List calls erasure.list. +// Use WithInput to supply additional request fields. +func (s ErasureService) List(ctx context.Context, opts ...Option[ErasureListInput]) (*ErasureListOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ErasureListOutput](s.client, ctx, "erasure.list", in) +} + +// Request calls erasure.request. +func (s ErasureService) Request(ctx context.Context, in ErasureRequestInput) (*ErasureRequestOutput, error) { + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ErasureRequestOutput](s.client, ctx, "erasure.request", in) +} + +// Status calls erasure.status. +// Use WithInput to supply additional request fields. +func (s ErasureService) Status(ctx context.Context, erasureID string, opts ...Option[ErasureStatusInput]) (*ErasureStatusOutput, error) { + in := applyOptions(opts) + in.ErasureID = erasureID + return callOperation[ErasureStatusOutput](s.client, ctx, "erasure.status", in) +} + +// Clear calls extraction_policy.clear. +// Use WithInput to supply additional request fields. +// Scope "namespace" requires the target namespace in the input. +func (s ExtractionPolicyService) Clear(ctx context.Context, scope string, opts ...Option[ExtractionPolicyClearInput]) (*ExtractionPolicyClearOutput, error) { + in := applyOptions(opts) + in.Scope = scope + if err := requirePolicyNamespace("extraction_policy.clear", in.Scope, in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ExtractionPolicyClearOutput](s.client, ctx, "extraction_policy.clear", in) +} + +// Get calls extraction_policy.get. +// Use WithInput to supply additional request fields. +// Scope "namespace" requires the target namespace in the input. +func (s ExtractionPolicyService) Get(ctx context.Context, scope string, opts ...Option[ExtractionPolicyGetInput]) (*ExtractionPolicyGetOutput, error) { + in := applyOptions(opts) + in.Scope = scope + if err := requirePolicyNamespace("extraction_policy.get", in.Scope, in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ExtractionPolicyGetOutput](s.client, ctx, "extraction_policy.get", in) +} + +// Set calls extraction_policy.set. +// Scope "namespace" requires the target namespace in the input. +func (s ExtractionPolicyService) Set(ctx context.Context, in ExtractionPolicySetInput) (*ExtractionPolicySetOutput, error) { + if err := requirePolicyNamespace("extraction_policy.set", in.Scope, in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ExtractionPolicySetOutput](s.client, ctx, "extraction_policy.set", in) +} + +// ExpireByAdapter calls facts.expire_by_adapter. +// Use WithInput to supply additional request fields. +func (s FactsService) ExpireByAdapter(ctx context.Context, adapterName string, opts ...Option[FactsExpireByAdapterInput]) (*FactsExpireByAdapterOutput, error) { + in := applyOptions(opts) + in.AdapterName = adapterName + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[FactsExpireByAdapterOutput](s.client, ctx, "facts.expire_by_adapter", in) +} + +// List calls facts.list. +// Use WithInput to supply additional request fields. +func (s FactsService) List(ctx context.Context, opts ...Option[FactsListInput]) (*FactsListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[FactsListOutput](s.client, ctx, "facts.list", in) +} + +// Path calls facts.path. +func (s FactsService) Path(ctx context.Context, in FactsPathInput) (*FactsPathOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[FactsPathOutput](s.client, ctx, "facts.path", in) +} + +// Related calls facts.related. +// Use WithInput to supply additional request fields. +func (s FactsService) Related(ctx context.Context, entity string, opts ...Option[FactsRelatedInput]) (*FactsRelatedOutput, error) { + in := applyOptions(opts) + in.Entity = entity + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[FactsRelatedOutput](s.client, ctx, "facts.related", in) +} + +// Traverse calls facts.traverse. +// Use WithInput to supply additional request fields. +func (s FactsService) Traverse(ctx context.Context, seedEntity string, opts ...Option[FactsTraverseInput]) (*FactsTraverseOutput, error) { + in := applyOptions(opts) + in.SeedEntity = seedEntity + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[FactsTraverseOutput](s.client, ctx, "facts.traverse", in) +} + +// Approve calls grants.approve. +// Use WithInput to supply additional request fields. +func (s GrantsService) Approve(ctx context.Context, subject string, opts ...Option[GrantsApproveInput]) (*GrantsApproveOutput, error) { + in := applyOptions(opts) + in.Subject = subject + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsApproveOutput](s.client, ctx, "grants.approve", in) +} + +// Create calls grants.create. +func (s GrantsService) Create(ctx context.Context, in GrantsCreateInput) (*GrantsCreateOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsCreateOutput](s.client, ctx, "grants.create", in) +} + +// List calls grants.list. +// Use WithInput to supply additional request fields. +func (s GrantsService) List(ctx context.Context, opts ...Option[GrantsListInput]) (*GrantsListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsListOutput](s.client, ctx, "grants.list", in) +} + +// PendingForMe calls grants.pending_for_me. +// Use WithInput to supply additional request fields. +func (s GrantsService) PendingForMe(ctx context.Context, opts ...Option[GrantsPendingForMeInput]) (*GrantsPendingForMeOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsPendingForMeOutput](s.client, ctx, "grants.pending_for_me", in) +} + +// Revoke calls grants.revoke. +// Use WithInput to supply additional request fields. +func (s GrantsService) Revoke(ctx context.Context, subject string, opts ...Option[GrantsRevokeInput]) (*GrantsRevokeOutput, error) { + in := applyOptions(opts) + in.Subject = subject + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsRevokeOutput](s.client, ctx, "grants.revoke", in) +} + +// ShareAgent calls grants.share_agent. +// Use WithInput to supply additional request fields. +func (s GrantsService) ShareAgent(ctx context.Context, grantee string, opts ...Option[GrantsShareAgentInput]) (*GrantsShareAgentOutput, error) { + in := applyOptions(opts) + in.Grantee = grantee + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsShareAgentOutput](s.client, ctx, "grants.share_agent", in) +} + +// UnshareAgent calls grants.unshare_agent. +// Use WithInput to supply additional request fields. +func (s GrantsService) UnshareAgent(ctx context.Context, grantee string, opts ...Option[GrantsUnshareAgentInput]) (*GrantsUnshareAgentOutput, error) { + in := applyOptions(opts) + in.Grantee = grantee + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsUnshareAgentOutput](s.client, ctx, "grants.unshare_agent", in) +} + +// Get calls help.get. +// Use WithInput to supply additional request fields. +func (s HelpService) Get(ctx context.Context, path string, opts ...Option[HelpGetInput]) (*HelpGetOutput, error) { + in := applyOptions(opts) + in.Path = path + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[HelpGetOutput](s.client, ctx, "help.get", in) +} + +// Search calls help.search. +// Use WithInput to supply additional request fields. +func (s HelpService) Search(ctx context.Context, query string, opts ...Option[HelpSearchInput]) (*HelpSearchOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[HelpSearchOutput](s.client, ctx, "help.search", in) +} + +// List calls inbox.list. +// Use WithInput to supply additional request fields. +func (s InboxService) List(ctx context.Context, opts ...Option[InboxListInput]) (*InboxListOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[InboxListOutput](s.client, ctx, "inbox.list", in) +} + +// PolicyList calls inbox.policy_list. +// Use WithInput to supply additional request fields. +func (s InboxService) PolicyList(ctx context.Context, inbox string, opts ...Option[InboxPolicyListInput]) (*InboxPolicyListOutput, error) { + in := applyOptions(opts) + in.Inbox = inbox + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[InboxPolicyListOutput](s.client, ctx, "inbox.policy_list", in) +} + +// PolicySet calls inbox.policy_set. +func (s InboxService) PolicySet(ctx context.Context, in InboxPolicySetInput) (*InboxPolicySetOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[InboxPolicySetOutput](s.client, ctx, "inbox.policy_set", in) +} + +// Principals calls inbox.principals. +// Use WithInput to supply additional request fields. +func (s InboxService) Principals(ctx context.Context, inbox string, opts ...Option[InboxPrincipalsInput]) (*InboxPrincipalsOutput, error) { + in := applyOptions(opts) + in.Inbox = inbox + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[InboxPrincipalsOutput](s.client, ctx, "inbox.principals", in) +} + +// Register calls inbox.register. +func (s InboxService) Register(ctx context.Context, in InboxRegisterInput) (*InboxRegisterOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[InboxRegisterOutput](s.client, ctx, "inbox.register", in) +} + +// Catalog calls insights.catalog. +// Use WithInput to supply additional request fields. +func (s InsightsService) Catalog(ctx context.Context, opts ...Option[InsightsCatalogInput]) (*InsightsCatalogOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[InsightsCatalogOutput](s.client, ctx, "insights.catalog", in) +} + +// Query calls insights.query. +// Use WithInput to supply additional request fields. +func (s InsightsService) Query(ctx context.Context, sql string, opts ...Option[InsightsQueryInput]) (*InsightsQueryOutput, error) { + in := applyOptions(opts) + in.SQL = sql + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[InsightsQueryOutput](s.client, ctx, "insights.query", in) +} + +// Add calls knowledge.add. +func (s KnowledgeService) Add(ctx context.Context, in KnowledgeAddInput) (*KnowledgeAddOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeAddOutput](s.client, ctx, "knowledge.add", in) +} + +// BulkAdd calls knowledge.bulk_add. +func (s KnowledgeService) BulkAdd(ctx context.Context, in KnowledgeBulkAddInput) (*KnowledgeBulkAddOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeBulkAddOutput](s.client, ctx, "knowledge.bulk_add", in) +} + +// BulkDelete calls knowledge.bulk_delete. +func (s KnowledgeService) BulkDelete(ctx context.Context, in KnowledgeBulkDeleteInput) (*KnowledgeBulkDeleteOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeBulkDeleteOutput](s.client, ctx, "knowledge.bulk_delete", in) +} + +// DatasetApprove calls knowledge.dataset_approve. +func (s KnowledgeService) DatasetApprove(ctx context.Context, in KnowledgeDatasetApproveInput) (*KnowledgeDatasetApproveOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeDatasetApproveOutput](s.client, ctx, "knowledge.dataset_approve", in) +} + +// DatasetGet calls knowledge.dataset_get. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) DatasetGet(ctx context.Context, sourceURI string, opts ...Option[KnowledgeDatasetGetInput]) (*KnowledgeDatasetGetOutput, error) { + in := applyOptions(opts) + in.SourceURI = sourceURI + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeDatasetGetOutput](s.client, ctx, "knowledge.dataset_get", in) +} + +// DedupList calls knowledge.dedup_list. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) DedupList(ctx context.Context, opts ...Option[KnowledgeDedupListInput]) (*KnowledgeDedupListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeDedupListOutput](s.client, ctx, "knowledge.dedup_list", in) +} + +// DedupResolve calls knowledge.dedup_resolve. +func (s KnowledgeService) DedupResolve(ctx context.Context, in KnowledgeDedupResolveInput) (*KnowledgeDedupResolveOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeDedupResolveOutput](s.client, ctx, "knowledge.dedup_resolve", in) +} + +// Delete calls knowledge.delete. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) Delete(ctx context.Context, sourceURI string, opts ...Option[KnowledgeDeleteInput]) (*KnowledgeDeleteOutput, error) { + in := applyOptions(opts) + in.SourceURI = sourceURI + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeDeleteOutput](s.client, ctx, "knowledge.delete", in) +} + +// Formats calls knowledge.formats. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) Formats(ctx context.Context, opts ...Option[KnowledgeFormatsInput]) (*KnowledgeFormatsOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeFormatsOutput](s.client, ctx, "knowledge.formats", in) +} + +// GapsDraft calls knowledge.gaps.draft. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) GapsDraft(ctx context.Context, gapID string, opts ...Option[KnowledgeGapsDraftInput]) (*KnowledgeGapsDraftOutput, error) { + in := applyOptions(opts) + in.GapID = gapID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeGapsDraftOutput](s.client, ctx, "knowledge.gaps.draft", in) +} + +// GapsList calls knowledge.gaps.list. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) GapsList(ctx context.Context, opts ...Option[KnowledgeGapsListInput]) (*KnowledgeGapsListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeGapsListOutput](s.client, ctx, "knowledge.gaps.list", in) +} + +// Get calls knowledge.get. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) Get(ctx context.Context, sourceURI string, opts ...Option[KnowledgeGetInput]) (*KnowledgeGetOutput, error) { + in := applyOptions(opts) + in.SourceURI = sourceURI + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeGetOutput](s.client, ctx, "knowledge.get", in) +} + +// Ingest calls knowledge.ingest. +func (s KnowledgeService) Ingest(ctx context.Context, in KnowledgeIngestInput) (*KnowledgeIngestOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeIngestOutput](s.client, ctx, "knowledge.ingest", in) +} + +// IngestCancel calls knowledge.ingest_cancel. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) IngestCancel(ctx context.Context, ingestionID string, opts ...Option[KnowledgeIngestCancelInput]) (*KnowledgeIngestCancelOutput, error) { + in := applyOptions(opts) + in.IngestionID = ingestionID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeIngestCancelOutput](s.client, ctx, "knowledge.ingest_cancel", in) +} + +// IngestStatus calls knowledge.ingest_status. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) IngestStatus(ctx context.Context, ingestionID string, opts ...Option[KnowledgeIngestStatusInput]) (*KnowledgeIngestStatusOutput, error) { + in := applyOptions(opts) + in.IngestionID = ingestionID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeIngestStatusOutput](s.client, ctx, "knowledge.ingest_status", in) +} + +// Inspect calls knowledge.inspect. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) Inspect(ctx context.Context, opts ...Option[KnowledgeInspectInput]) (*KnowledgeInspectOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeInspectOutput](s.client, ctx, "knowledge.inspect", in) +} + +// List calls knowledge.list. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) List(ctx context.Context, opts ...Option[KnowledgeListInput]) (*KnowledgeListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeListOutput](s.client, ctx, "knowledge.list", in) +} + +// Move calls knowledge.move. +func (s KnowledgeService) Move(ctx context.Context, in KnowledgeMoveInput) (*KnowledgeMoveOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeMoveOutput](s.client, ctx, "knowledge.move", in) +} + +// Outline calls knowledge.outline. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) Outline(ctx context.Context, sourceURI string, opts ...Option[KnowledgeOutlineInput]) (*KnowledgeOutlineOutput, error) { + in := applyOptions(opts) + in.SourceURI = sourceURI + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeOutlineOutput](s.client, ctx, "knowledge.outline", in) +} + +// Query calls knowledge.query. +func (s KnowledgeService) Query(ctx context.Context, in KnowledgeQueryInput) (*KnowledgeQueryOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeQueryOutput](s.client, ctx, "knowledge.query", in) +} + +// QueryHistoryAdd calls knowledge.query_history.add. +func (s KnowledgeService) QueryHistoryAdd(ctx context.Context, in KnowledgeQueryHistoryAddInput) (*KnowledgeQueryHistoryAddOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeQueryHistoryAddOutput](s.client, ctx, "knowledge.query_history.add", in) +} + +// QueryHistoryList calls knowledge.query_history.list. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) QueryHistoryList(ctx context.Context, opts ...Option[KnowledgeQueryHistoryListInput]) (*KnowledgeQueryHistoryListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeQueryHistoryListOutput](s.client, ctx, "knowledge.query_history.list", in) +} + +// QueryHistoryRemove calls knowledge.query_history.remove. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) QueryHistoryRemove(ctx context.Context, name string, opts ...Option[KnowledgeQueryHistoryRemoveInput]) (*KnowledgeQueryHistoryRemoveOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeQueryHistoryRemoveOutput](s.client, ctx, "knowledge.query_history.remove", in) +} + +// Reads calls knowledge.reads. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) Reads(ctx context.Context, opts ...Option[KnowledgeReadsInput]) (*KnowledgeReadsOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeReadsOutput](s.client, ctx, "knowledge.reads", in) +} + +// Restore calls knowledge.restore. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) Restore(ctx context.Context, sourceURI string, opts ...Option[KnowledgeRestoreInput]) (*KnowledgeRestoreOutput, error) { + in := applyOptions(opts) + in.SourceURI = sourceURI + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeRestoreOutput](s.client, ctx, "knowledge.restore", in) +} + +// Search calls knowledge.search. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) Search(ctx context.Context, query string, opts ...Option[KnowledgeSearchInput]) (*KnowledgeSearchOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSearchOutput](s.client, ctx, "knowledge.search", in) +} + +// WithKnowledgeSearchTopK sets top_k on knowledge.search. +func WithKnowledgeSearchTopK(value int64) Option[KnowledgeSearchInput] { + return func(in *KnowledgeSearchInput) { in.TopK = Ptr(value) } +} + +// SourceAdd calls knowledge.source.add. +func (s KnowledgeService) SourceAdd(ctx context.Context, in KnowledgeSourceAddInput) (*KnowledgeSourceAddOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourceAddOutput](s.client, ctx, "knowledge.source.add", in) +} + +// SourceCheck calls knowledge.source.check. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) SourceCheck(ctx context.Context, name string, opts ...Option[KnowledgeSourceCheckInput]) (*KnowledgeSourceCheckOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourceCheckOutput](s.client, ctx, "knowledge.source.check", in) +} + +// SourceInspect calls knowledge.source.inspect. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) SourceInspect(ctx context.Context, name string, opts ...Option[KnowledgeSourceInspectInput]) (*KnowledgeSourceInspectOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourceInspectOutput](s.client, ctx, "knowledge.source.inspect", in) +} + +// SourceList calls knowledge.source.list. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) SourceList(ctx context.Context, opts ...Option[KnowledgeSourceListInput]) (*KnowledgeSourceListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourceListOutput](s.client, ctx, "knowledge.source.list", in) +} + +// SourceParseLinks calls knowledge.source.parse_links. +func (s KnowledgeService) SourceParseLinks(ctx context.Context, in KnowledgeSourceParseLinksInput) (*KnowledgeSourceParseLinksOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourceParseLinksOutput](s.client, ctx, "knowledge.source.parse_links", in) +} + +// SourcePushConfigure calls knowledge.source.push_configure. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) SourcePushConfigure(ctx context.Context, name string, opts ...Option[KnowledgeSourcePushConfigureInput]) (*KnowledgeSourcePushConfigureOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourcePushConfigureOutput](s.client, ctx, "knowledge.source.push_configure", in) +} + +// SourcePushConfirm calls knowledge.source.push_confirm. +func (s KnowledgeService) SourcePushConfirm(ctx context.Context, in KnowledgeSourcePushConfirmInput) (*KnowledgeSourcePushConfirmOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourcePushConfirmOutput](s.client, ctx, "knowledge.source.push_confirm", in) +} + +// SourcePushStatus calls knowledge.source.push_status. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) SourcePushStatus(ctx context.Context, name string, opts ...Option[KnowledgeSourcePushStatusInput]) (*KnowledgeSourcePushStatusOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourcePushStatusOutput](s.client, ctx, "knowledge.source.push_status", in) +} + +// SourceRemove calls knowledge.source.remove. +func (s KnowledgeService) SourceRemove(ctx context.Context, in KnowledgeSourceRemoveInput) (*KnowledgeSourceRemoveOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourceRemoveOutput](s.client, ctx, "knowledge.source.remove", in) +} + +// SourceRotate calls knowledge.source.rotate. +func (s KnowledgeService) SourceRotate(ctx context.Context, in KnowledgeSourceRotateInput) (*KnowledgeSourceRotateOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourceRotateOutput](s.client, ctx, "knowledge.source.rotate", in) +} + +// SourceSyncNow calls knowledge.source.sync_now. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) SourceSyncNow(ctx context.Context, name string, opts ...Option[KnowledgeSourceSyncNowInput]) (*KnowledgeSourceSyncNowOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourceSyncNowOutput](s.client, ctx, "knowledge.source.sync_now", in) +} + +// SourceUpdate calls knowledge.source.update. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) SourceUpdate(ctx context.Context, name string, opts ...Option[KnowledgeSourceUpdateInput]) (*KnowledgeSourceUpdateOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSourceUpdateOutput](s.client, ctx, "knowledge.source.update", in) +} + +// Synthesize calls knowledge.synthesize. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) Synthesize(ctx context.Context, task string, opts ...Option[KnowledgeSynthesizeInput]) (*KnowledgeSynthesizeOutput, error) { + in := applyOptions(opts) + in.Task = task + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeSynthesizeOutput](s.client, ctx, "knowledge.synthesize", in) +} + +// UpdateMetadata calls knowledge.update_metadata. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) UpdateMetadata(ctx context.Context, sourceURI string, opts ...Option[KnowledgeUpdateMetadataInput]) (*KnowledgeUpdateMetadataOutput, error) { + in := applyOptions(opts) + in.SourceURI = sourceURI + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeUpdateMetadataOutput](s.client, ctx, "knowledge.update_metadata", in) +} + +// Upsert calls knowledge.upsert. +func (s KnowledgeService) Upsert(ctx context.Context, in KnowledgeUpsertInput) (*KnowledgeUpsertOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeUpsertOutput](s.client, ctx, "knowledge.upsert", in) +} + +// List calls learnings.list. +// Use WithInput to supply additional request fields. +func (s LearningsService) List(ctx context.Context, opts ...Option[LearningsListInput]) (*LearningsListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[LearningsListOutput](s.client, ctx, "learnings.list", in) +} + +// Quality calls learnings.quality. +// Use WithInput to supply additional request fields. +func (s LearningsService) Quality(ctx context.Context, opts ...Option[LearningsQualityInput]) (*LearningsQualityOutput, error) { + in := applyOptions(opts) + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[LearningsQualityOutput](s.client, ctx, "learnings.quality", in) +} + +// Review calls learnings.review. +func (s LearningsService) Review(ctx context.Context, in LearningsReviewInput) (*LearningsReviewOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[LearningsReviewOutput](s.client, ctx, "learnings.review", in) +} + +// AgentsList calls memory.agents_list. +// Use WithInput to supply additional request fields. +func (s MemoryService) AgentsList(ctx context.Context, opts ...Option[MemoryAgentsListInput]) (*MemoryAgentsListOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryAgentsListOutput](s.client, ctx, "memory.agents_list", in) +} + +// Aggregate calls memory.aggregate. +// Use WithInput to supply additional request fields. +func (s MemoryService) Aggregate(ctx context.Context, opts ...Option[MemoryAggregateInput]) (*MemoryAggregateOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryAggregateOutput](s.client, ctx, "memory.aggregate", in) +} + +// AppendBatch calls memory.append_batch. +func (s MemoryService) AppendBatch(ctx context.Context, in MemoryAppendBatchInput) (*MemoryAppendBatchOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryAppendBatchOutput](s.client, ctx, "memory.append_batch", in) +} + +// Apply calls memory.apply. +func (s MemoryService) Apply(ctx context.Context, in MemoryApplyInput) (*MemoryApplyOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryApplyOutput](s.client, ctx, "memory.apply", in) +} + +// Ask calls memory.ask. +// Use WithInput to supply additional request fields. +func (s MemoryService) Ask(ctx context.Context, query string, opts ...Option[MemoryAskInput]) (*MemoryAskOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryAskOutput](s.client, ctx, "memory.ask", in) +} + +// AssignCategory calls memory.assign_category. +func (s MemoryService) AssignCategory(ctx context.Context, in MemoryAssignCategoryInput) (*MemoryAssignCategoryOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryAssignCategoryOutput](s.client, ctx, "memory.assign_category", in) +} + +// AutoRetirements calls memory.auto_retirements. +// Use WithInput to supply additional request fields. +func (s MemoryService) AutoRetirements(ctx context.Context, opts ...Option[MemoryAutoRetirementsInput]) (*MemoryAutoRetirementsOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryAutoRetirementsOutput](s.client, ctx, "memory.auto_retirements", in) +} + +// Backlinks calls memory.backlinks. +// Use WithInput to supply additional request fields. +func (s MemoryService) Backlinks(ctx context.Context, memoryKey string, opts ...Option[MemoryBacklinksInput]) (*MemoryBacklinksOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryBacklinksOutput](s.client, ctx, "memory.backlinks", in) +} + +// Brief calls memory.brief. +// Use WithInput to supply additional request fields. +func (s MemoryService) Brief(ctx context.Context, query string, opts ...Option[MemoryBriefInput]) (*MemoryBriefOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryBriefOutput](s.client, ctx, "memory.brief", in) +} + +// BulkGet calls memory.bulk_get. +func (s MemoryService) BulkGet(ctx context.Context, in MemoryBulkGetInput) (*MemoryBulkGetOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryBulkGetOutput](s.client, ctx, "memory.bulk_get", in) +} + +// BulkSet calls memory.bulk_set. +func (s MemoryService) BulkSet(ctx context.Context, in MemoryBulkSetInput) (*MemoryBulkSetOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryBulkSetOutput](s.client, ctx, "memory.bulk_set", in) +} + +// Clear calls memory.clear. +// Use WithInput to supply additional request fields. +func (s MemoryService) Clear(ctx context.Context, confirmSubject string, opts ...Option[MemoryClearInput]) (*MemoryClearOutput, error) { + in := applyOptions(opts) + in.ConfirmSubject = confirmSubject + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryClearOutput](s.client, ctx, "memory.clear", in) +} + +// Consolidate calls memory.consolidate. +// Use WithInput to supply additional request fields. +func (s MemoryService) Consolidate(ctx context.Context, opts ...Option[MemoryConsolidateInput]) (*MemoryConsolidateOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryConsolidateOutput](s.client, ctx, "memory.consolidate", in) +} + +// CopyTo calls memory.copy_to. +func (s MemoryService) CopyTo(ctx context.Context, in MemoryCopyToInput) (*MemoryCopyToOutput, error) { + return callOperation[MemoryCopyToOutput](s.client, ctx, "memory.copy_to", in) +} + +// CrossPromote calls memory.cross_promote. +func (s MemoryService) CrossPromote(ctx context.Context, in MemoryCrossPromoteInput) (*MemoryCrossPromoteOutput, error) { + return callOperation[MemoryCrossPromoteOutput](s.client, ctx, "memory.cross_promote", in) +} + +// DedupCollapse calls memory.dedup_collapse. +// Use WithInput to supply additional request fields. +func (s MemoryService) DedupCollapse(ctx context.Context, opts ...Option[MemoryDedupCollapseInput]) (*MemoryDedupCollapseOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryDedupCollapseOutput](s.client, ctx, "memory.dedup_collapse", in) +} + +// DedupList calls memory.dedup_list. +// Use WithInput to supply additional request fields. +func (s MemoryService) DedupList(ctx context.Context, opts ...Option[MemoryDedupListInput]) (*MemoryDedupListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryDedupListOutput](s.client, ctx, "memory.dedup_list", in) +} + +// DedupResolve calls memory.dedup_resolve. +func (s MemoryService) DedupResolve(ctx context.Context, in MemoryDedupResolveInput) (*MemoryDedupResolveOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryDedupResolveOutput](s.client, ctx, "memory.dedup_resolve", in) +} + +// DefinitionsList calls memory.definitions.list. +// Use WithInput to supply additional request fields. +func (s MemoryService) DefinitionsList(ctx context.Context, opts ...Option[MemoryDefinitionsListInput]) (*MemoryDefinitionsListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryDefinitionsListOutput](s.client, ctx, "memory.definitions.list", in) +} + +// Delete calls memory.delete. +// Use WithInput to supply additional request fields. +func (s MemoryService) Delete(ctx context.Context, memoryKey string, opts ...Option[MemoryDeleteInput]) (*MemoryDeleteOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryDeleteOutput](s.client, ctx, "memory.delete", in) +} + +// DeleteVersion calls memory.delete_version. +func (s MemoryService) DeleteVersion(ctx context.Context, in MemoryDeleteVersionInput) (*MemoryDeleteVersionOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryDeleteVersionOutput](s.client, ctx, "memory.delete_version", in) +} + +// Demonstrate calls memory.demonstrate. +// Use WithInput to supply additional request fields. +func (s MemoryService) Demonstrate(ctx context.Context, query string, opts ...Option[MemoryDemonstrateInput]) (*MemoryDemonstrateOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryDemonstrateOutput](s.client, ctx, "memory.demonstrate", in) +} + +// Demote calls memory.demote. +// Use WithInput to supply additional request fields. +func (s MemoryService) Demote(ctx context.Context, memoryKey string, opts ...Option[MemoryDemoteInput]) (*MemoryDemoteOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryDemoteOutput](s.client, ctx, "memory.demote", in) +} + +// Digests calls memory.digests. +// Use WithInput to supply additional request fields. +func (s MemoryService) Digests(ctx context.Context, opts ...Option[MemoryDigestsInput]) (*MemoryDigestsOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryDigestsOutput](s.client, ctx, "memory.digests", in) +} + +// Evidence calls memory.evidence. +// Use WithInput to supply additional request fields. +func (s MemoryService) Evidence(ctx context.Context, memoryKey string, opts ...Option[MemoryEvidenceInput]) (*MemoryEvidenceOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryEvidenceOutput](s.client, ctx, "memory.evidence", in) +} + +// ExportEvidence calls memory.export_evidence. +// Use WithInput to supply additional request fields. +func (s MemoryService) ExportEvidence(ctx context.Context, opts ...Option[MemoryExportEvidenceInput]) (*MemoryExportEvidenceOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryExportEvidenceOutput](s.client, ctx, "memory.export_evidence", in) +} + +// ExposureSummary calls memory.exposure_summary. +// Use WithInput to supply additional request fields. +func (s MemoryService) ExposureSummary(ctx context.Context, opts ...Option[MemoryExposureSummaryInput]) (*MemoryExposureSummaryOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryExposureSummaryOutput](s.client, ctx, "memory.exposure_summary", in) +} + +// ExtractionRetryMine calls memory.extraction_retry_mine. +func (s MemoryService) ExtractionRetryMine(ctx context.Context, in MemoryExtractionRetryMineInput) (*MemoryExtractionRetryMineOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryExtractionRetryMineOutput](s.client, ctx, "memory.extraction_retry_mine", in) +} + +// ExtractionStatus calls memory.extraction_status. +// Use WithInput to supply additional request fields. +func (s MemoryService) ExtractionStatus(ctx context.Context, opts ...Option[MemoryExtractionStatusInput]) (*MemoryExtractionStatusOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryExtractionStatusOutput](s.client, ctx, "memory.extraction_status", in) +} + +// ExtractionStatusMine calls memory.extraction_status_mine. +func (s MemoryService) ExtractionStatusMine(ctx context.Context, in MemoryExtractionStatusMineInput) (*MemoryExtractionStatusMineOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryExtractionStatusMineOutput](s.client, ctx, "memory.extraction_status_mine", in) +} + +// ForFile calls memory.for_file. +// Use WithInput to supply additional request fields. +func (s MemoryService) ForFile(ctx context.Context, path string, opts ...Option[MemoryForFileInput]) (*MemoryForFileOutput, error) { + in := applyOptions(opts) + in.Path = path + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryForFileOutput](s.client, ctx, "memory.for_file", in) +} + +// Get calls memory.get. +// Use WithInput to supply additional request fields. +func (s MemoryService) Get(ctx context.Context, memoryKey string, opts ...Option[MemoryGetInput]) (*MemoryGetOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryGetOutput](s.client, ctx, "memory.get", in) +} + +// GetByID calls memory.get_by_id. +// Use WithInput to supply additional request fields. +func (s MemoryService) GetByID(ctx context.Context, memoryID string, opts ...Option[MemoryGetByIDInput]) (*MemoryGetByIDOutput, error) { + in := applyOptions(opts) + in.MemoryID = memoryID + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryGetByIDOutput](s.client, ctx, "memory.get_by_id", in) +} + +// Health calls memory.health. +// Use WithInput to supply additional request fields. +func (s MemoryService) Health(ctx context.Context, opts ...Option[MemoryHealthInput]) (*MemoryHealthOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryHealthOutput](s.client, ctx, "memory.health", in) +} + +// History calls memory.history. +// Use WithInput to supply additional request fields. +func (s MemoryService) History(ctx context.Context, memoryKey string, opts ...Option[MemoryHistoryInput]) (*MemoryHistoryOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryHistoryOutput](s.client, ctx, "memory.history", in) +} + +// Import calls memory.import. +func (s MemoryService) Import(ctx context.Context, in MemoryImportInput) (*MemoryImportOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryImportOutput](s.client, ctx, "memory.import", in) +} + +// ImportCurated calls memory.import_curated. +// Use WithInput to supply additional request fields. +func (s MemoryService) ImportCurated(ctx context.Context, content string, opts ...Option[MemoryImportCuratedInput]) (*MemoryImportCuratedOutput, error) { + in := applyOptions(opts) + in.Content = content + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryImportCuratedOutput](s.client, ctx, "memory.import_curated", in) +} + +// ImportEvidence calls memory.import_evidence. +// Use WithInput to supply additional request fields. +func (s MemoryService) ImportEvidence(ctx context.Context, opts ...Option[MemoryImportEvidenceInput]) (*MemoryImportEvidenceOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryImportEvidenceOutput](s.client, ctx, "memory.import_evidence", in) +} + +// Inspect calls memory.inspect. +func (s MemoryService) Inspect(ctx context.Context, in MemoryInspectInput) (*MemoryInspectOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryInspectOutput](s.client, ctx, "memory.inspect", in) +} + +// Keys calls memory.keys. +// Use WithInput to supply additional request fields. +func (s MemoryService) Keys(ctx context.Context, opts ...Option[MemoryKeysInput]) (*MemoryKeysOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryKeysOutput](s.client, ctx, "memory.keys", in) +} + +// Lineage calls memory.lineage. +// Use WithInput to supply additional request fields. +func (s MemoryService) Lineage(ctx context.Context, memoryKey string, opts ...Option[MemoryLineageInput]) (*MemoryLineageOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryLineageOutput](s.client, ctx, "memory.lineage", in) +} + +// Link calls memory.link. +func (s MemoryService) Link(ctx context.Context, in MemoryLinkInput) (*MemoryLinkOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryLinkOutput](s.client, ctx, "memory.link", in) +} + +// List calls memory.list. +// Use WithInput to supply additional request fields. +func (s MemoryService) List(ctx context.Context, opts ...Option[MemoryListInput]) (*MemoryListOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryListOutput](s.client, ctx, "memory.list", in) +} + +// Lock calls memory.lock. +func (s MemoryService) Lock(ctx context.Context, in MemoryLockInput) (*MemoryLockOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryLockOutput](s.client, ctx, "memory.lock", in) +} + +// Move calls memory.move. +func (s MemoryService) Move(ctx context.Context, in MemoryMoveInput) (*MemoryMoveOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryMoveOutput](s.client, ctx, "memory.move", in) +} + +// Outcome calls memory.outcome. +// Use WithInput to supply additional request fields. +func (s MemoryService) Outcome(ctx context.Context, outcome string, opts ...Option[MemoryOutcomeInput]) (*MemoryOutcomeOutput, error) { + in := applyOptions(opts) + in.Outcome = outcome + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryOutcomeOutput](s.client, ctx, "memory.outcome", in) +} + +// OutcomeRun calls memory.outcome_run. +// Use WithInput to supply additional request fields. +func (s MemoryService) OutcomeRun(ctx context.Context, outcome string, opts ...Option[MemoryOutcomeRunInput]) (*MemoryOutcomeRunOutput, error) { + in := applyOptions(opts) + in.Outcome = outcome + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryOutcomeRunOutput](s.client, ctx, "memory.outcome_run", in) +} + +// Outline calls memory.outline. +// Use WithInput to supply additional request fields. +func (s MemoryService) Outline(ctx context.Context, opts ...Option[MemoryOutlineInput]) (*MemoryOutlineOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryOutlineOutput](s.client, ctx, "memory.outline", in) +} + +// OwnerReport calls memory.owner_report. +// Use WithInput to supply additional request fields. +func (s MemoryService) OwnerReport(ctx context.Context, opts ...Option[MemoryOwnerReportInput]) (*MemoryOwnerReportOutput, error) { + in := applyOptions(opts) + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryOwnerReportOutput](s.client, ctx, "memory.owner_report", in) +} + +// Pin calls memory.pin. +func (s MemoryService) Pin(ctx context.Context, in MemoryPinInput) (*MemoryPinOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryPinOutput](s.client, ctx, "memory.pin", in) +} + +// Promote calls memory.promote. +// Use WithInput to supply additional request fields. +func (s MemoryService) Promote(ctx context.Context, memoryKey string, opts ...Option[MemoryPromoteInput]) (*MemoryPromoteOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryPromoteOutput](s.client, ctx, "memory.promote", in) +} + +// ProposalDecide calls memory.proposal_decide. +func (s MemoryService) ProposalDecide(ctx context.Context, in MemoryProposalDecideInput) (*MemoryProposalDecideOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryProposalDecideOutput](s.client, ctx, "memory.proposal_decide", in) +} + +// Proposals calls memory.proposals. +// Use WithInput to supply additional request fields. +func (s MemoryService) Proposals(ctx context.Context, opts ...Option[MemoryProposalsInput]) (*MemoryProposalsOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryProposalsOutput](s.client, ctx, "memory.proposals", in) +} + +// Provenance calls memory.provenance. +// Use WithInput to supply additional request fields. +func (s MemoryService) Provenance(ctx context.Context, memoryKey string, opts ...Option[MemoryProvenanceInput]) (*MemoryProvenanceOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryProvenanceOutput](s.client, ctx, "memory.provenance", in) +} + +// Recall calls memory.recall. +// Use WithInput to supply additional request fields. +func (s MemoryService) Recall(ctx context.Context, opts ...Option[MemoryRecallInput]) (*MemoryRecallOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryRecallOutput](s.client, ctx, "memory.recall", in) +} + +// RecordConflicts calls memory.record.conflicts. +// Use WithInput to supply additional request fields. +func (s MemoryService) RecordConflicts(ctx context.Context, opts ...Option[MemoryRecordConflictsInput]) (*MemoryRecordConflictsOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryRecordConflictsOutput](s.client, ctx, "memory.record.conflicts", in) +} + +// RecordHistory calls memory.record.history. +// Use WithInput to supply additional request fields. +func (s MemoryService) RecordHistory(ctx context.Context, recordID string, opts ...Option[MemoryRecordHistoryInput]) (*MemoryRecordHistoryOutput, error) { + in := applyOptions(opts) + in.RecordID = recordID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryRecordHistoryOutput](s.client, ctx, "memory.record.history", in) +} + +// RecordQuery calls memory.record.query. +// Use WithInput to supply additional request fields. +func (s MemoryService) RecordQuery(ctx context.Context, schemaName string, opts ...Option[MemoryRecordQueryInput]) (*MemoryRecordQueryOutput, error) { + in := applyOptions(opts) + in.SchemaName = schemaName + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryRecordQueryOutput](s.client, ctx, "memory.record.query", in) +} + +// RecordWrite calls memory.record.write. +func (s MemoryService) RecordWrite(ctx context.Context, in MemoryRecordWriteInput) (*MemoryRecordWriteOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryRecordWriteOutput](s.client, ctx, "memory.record.write", in) +} + +// Redact calls memory.redact. +func (s MemoryService) Redact(ctx context.Context, in MemoryRedactInput) (*MemoryRedactOutput, error) { + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryRedactOutput](s.client, ctx, "memory.redact", in) +} + +// Reindex calls memory.reindex. +// Use WithInput to supply additional request fields. +func (s MemoryService) Reindex(ctx context.Context, opts ...Option[MemoryReindexInput]) (*MemoryReindexOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryReindexOutput](s.client, ctx, "memory.reindex", in) +} + +// Reject calls memory.reject. +// Use WithInput to supply additional request fields. +func (s MemoryService) Reject(ctx context.Context, memoryKey string, opts ...Option[MemoryRejectInput]) (*MemoryRejectOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryRejectOutput](s.client, ctx, "memory.reject", in) +} + +// Related calls memory.related. +// Use WithInput to supply additional request fields. +func (s MemoryService) Related(ctx context.Context, memoryKey string, opts ...Option[MemoryRelatedInput]) (*MemoryRelatedOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryRelatedOutput](s.client, ctx, "memory.related", in) +} + +// ResolveOrphanDuplicates calls memory.resolve_orphan_duplicates. +// Use WithInput to supply additional request fields. +func (s MemoryService) ResolveOrphanDuplicates(ctx context.Context, opts ...Option[MemoryResolveOrphanDuplicatesInput]) (*MemoryResolveOrphanDuplicatesOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryResolveOrphanDuplicatesOutput](s.client, ctx, "memory.resolve_orphan_duplicates", in) +} + +// Restore calls memory.restore. +// Use WithInput to supply additional request fields. +func (s MemoryService) Restore(ctx context.Context, memoryKey string, opts ...Option[MemoryRestoreInput]) (*MemoryRestoreOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryRestoreOutput](s.client, ctx, "memory.restore", in) +} + +// Search calls memory.search. +// Use WithInput to supply additional request fields. +func (s MemoryService) Search(ctx context.Context, query string, opts ...Option[MemorySearchInput]) (*MemorySearchOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemorySearchOutput](s.client, ctx, "memory.search", in) +} + +// SearchTrace calls memory.search_trace. +// Use WithInput to supply additional request fields. +func (s MemoryService) SearchTrace(ctx context.Context, query string, opts ...Option[MemorySearchTraceInput]) (*MemorySearchTraceOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemorySearchTraceOutput](s.client, ctx, "memory.search_trace", in) +} + +// SearchTraceLog calls memory.search_trace_log. +// Use WithInput to supply additional request fields. +func (s MemoryService) SearchTraceLog(ctx context.Context, opts ...Option[MemorySearchTraceLogInput]) (*MemorySearchTraceLogOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemorySearchTraceLogOutput](s.client, ctx, "memory.search_trace_log", in) +} + +// Set calls memory.set. +func (s MemoryService) Set(ctx context.Context, in MemorySetInput) (*MemorySetOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemorySetOutput](s.client, ctx, "memory.set", in) +} + +// SetFromMessages calls memory.set_from_messages. +func (s MemoryService) SetFromMessages(ctx context.Context, in MemorySetFromMessagesInput) (*MemorySetFromMessagesOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemorySetFromMessagesOutput](s.client, ctx, "memory.set_from_messages", in) +} + +// Stack calls memory.stack. +// Use WithInput to supply additional request fields. +func (s MemoryService) Stack(ctx context.Context, opts ...Option[MemoryStackInput]) (*MemoryStackOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryStackOutput](s.client, ctx, "memory.stack", in) +} + +// Statuses calls memory.statuses. +func (s MemoryService) Statuses(ctx context.Context, in MemoryStatusesInput) (*MemoryStatusesOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryStatusesOutput](s.client, ctx, "memory.statuses", in) +} + +// SweepExpired calls memory.sweep_expired. +// Use WithInput to supply additional request fields. +func (s MemoryService) SweepExpired(ctx context.Context, opts ...Option[MemorySweepExpiredInput]) (*MemorySweepExpiredOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemorySweepExpiredOutput](s.client, ctx, "memory.sweep_expired", in) +} + +// Timeline calls memory.timeline. +// Use WithInput to supply additional request fields. +func (s MemoryService) Timeline(ctx context.Context, opts ...Option[MemoryTimelineInput]) (*MemoryTimelineOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryTimelineOutput](s.client, ctx, "memory.timeline", in) +} + +// Touch calls memory.touch. +// Use WithInput to supply additional request fields. +func (s MemoryService) Touch(ctx context.Context, opts ...Option[MemoryTouchInput]) (*MemoryTouchOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryTouchOutput](s.client, ctx, "memory.touch", in) +} + +// Unlock calls memory.unlock. +// Use WithInput to supply additional request fields. +func (s MemoryService) Unlock(ctx context.Context, memoryKey string, opts ...Option[MemoryUnlockInput]) (*MemoryUnlockOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryUnlockOutput](s.client, ctx, "memory.unlock", in) +} + +// Unpin calls memory.unpin. +// Use WithInput to supply additional request fields. +func (s MemoryService) Unpin(ctx context.Context, memoryKey string, opts ...Option[MemoryUnpinInput]) (*MemoryUnpinOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryUnpinOutput](s.client, ctx, "memory.unpin", in) +} + +// Update calls memory.update. +// Use WithInput to supply additional request fields. +func (s MemoryService) Update(ctx context.Context, memoryKey string, opts ...Option[MemoryUpdateInput]) (*MemoryUpdateOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryUpdateOutput](s.client, ctx, "memory.update", in) +} + +// UpdateByID calls memory.update_by_id. +// Use WithInput to supply additional request fields. +func (s MemoryService) UpdateByID(ctx context.Context, memoryID string, opts ...Option[MemoryUpdateByIDInput]) (*MemoryUpdateByIDOutput, error) { + in := applyOptions(opts) + in.MemoryID = memoryID + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryUpdateByIDOutput](s.client, ctx, "memory.update_by_id", in) +} + +// Verify calls memory.verify. +// Use WithInput to supply additional request fields. +func (s MemoryService) Verify(ctx context.Context, opts ...Option[MemoryVerifyInput]) (*MemoryVerifyOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == nil && s.client.identity.Namespace != "" { + in.Namespace = Ptr(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemoryVerifyOutput](s.client, ctx, "memory.verify", in) +} + +// Approve calls memory_schema.approve. +func (s MemorySchemaService) Approve(ctx context.Context, in MemorySchemaApproveInput) (*MemorySchemaApproveOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemorySchemaApproveOutput](s.client, ctx, "memory_schema.approve", in) +} + +// List calls memory_schema.list. +// Use WithInput to supply additional request fields. +func (s MemorySchemaService) List(ctx context.Context, opts ...Option[MemorySchemaListInput]) (*MemorySchemaListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemorySchemaListOutput](s.client, ctx, "memory_schema.list", in) +} + +// Propose calls memory_schema.propose. +func (s MemorySchemaService) Propose(ctx context.Context, in MemorySchemaProposeInput) (*MemorySchemaProposeOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemorySchemaProposeOutput](s.client, ctx, "memory_schema.propose", in) +} + +// Register calls memory_schema.register. +func (s MemorySchemaService) Register(ctx context.Context, in MemorySchemaRegisterInput) (*MemorySchemaRegisterOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MemorySchemaRegisterOutput](s.client, ctx, "memory_schema.register", in) +} + +// Brief calls mentor.brief. +// Use WithInput to supply additional request fields. +func (s MentorService) Brief(ctx context.Context, opts ...Option[MentorBriefInput]) (*MentorBriefOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[MentorBriefOutput](s.client, ctx, "mentor.brief", in) +} + +// Guide calls mentor.guide. +// Use WithInput to supply additional request fields. +func (s MentorService) Guide(ctx context.Context, opts ...Option[MentorGuideInput]) (*MentorGuideOutput, error) { + in := applyOptions(opts) + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[MentorGuideOutput](s.client, ctx, "mentor.guide", in) +} + +// Audit calls namespace.audit. +// Use WithInput to supply additional request fields. +func (s NamespaceService) Audit(ctx context.Context, opts ...Option[NamespaceAuditInput]) (*NamespaceAuditOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceAuditOutput](s.client, ctx, "namespace.audit", in) +} + +// Browse calls namespace.browse. +// Use WithInput to supply additional request fields. +func (s NamespaceService) Browse(ctx context.Context, opts ...Option[NamespaceBrowseInput]) (*NamespaceBrowseOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceBrowseOutput](s.client, ctx, "namespace.browse", in) +} + +// CancelRequest calls namespace.cancel_request. +// Use WithInput to supply additional request fields. +// The namespace must be named explicitly. +func (s NamespaceService) CancelRequest(ctx context.Context, namespace string, opts ...Option[NamespaceCancelRequestInput]) (*NamespaceCancelRequestOutput, error) { + in := applyOptions(opts) + in.Namespace = namespace + if err := requireNamedNamespace("namespace.cancel_request", in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceCancelRequestOutput](s.client, ctx, "namespace.cancel_request", in) +} + +// Delete calls namespace.delete. +// Use WithInput to supply additional request fields. +// The namespace must be named explicitly. +func (s NamespaceService) Delete(ctx context.Context, namespace string, opts ...Option[NamespaceDeleteInput]) (*NamespaceDeleteOutput, error) { + in := applyOptions(opts) + in.Namespace = namespace + if err := requireNamedNamespace("namespace.delete", in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceDeleteOutput](s.client, ctx, "namespace.delete", in) +} + +// Get calls namespace.get. +// Use WithInput to supply additional request fields. +func (s NamespaceService) Get(ctx context.Context, opts ...Option[NamespaceGetInput]) (*NamespaceGetOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceGetOutput](s.client, ctx, "namespace.get", in) +} + +// GuideGet calls namespace.guide_get. +// Use WithInput to supply additional request fields. +func (s NamespaceService) GuideGet(ctx context.Context, opts ...Option[NamespaceGuideGetInput]) (*NamespaceGuideGetOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceGuideGetOutput](s.client, ctx, "namespace.guide_get", in) +} + +// GuideHistory calls namespace.guide_history. +// Use WithInput to supply additional request fields. +func (s NamespaceService) GuideHistory(ctx context.Context, opts ...Option[NamespaceGuideHistoryInput]) (*NamespaceGuideHistoryOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceGuideHistoryOutput](s.client, ctx, "namespace.guide_history", in) +} + +// GuideSet calls namespace.guide_set. +func (s NamespaceService) GuideSet(ctx context.Context, in NamespaceGuideSetInput) (*NamespaceGuideSetOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceGuideSetOutput](s.client, ctx, "namespace.guide_set", in) +} + +// Inventory calls namespace.inventory. +// Use WithInput to supply additional request fields. +func (s NamespaceService) Inventory(ctx context.Context, opts ...Option[NamespaceInventoryInput]) (*NamespaceInventoryOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceInventoryOutput](s.client, ctx, "namespace.inventory", in) +} + +// Join calls namespace.join. +// Use WithInput to supply additional request fields. +// The namespace must be named explicitly. +func (s NamespaceService) Join(ctx context.Context, namespace string, opts ...Option[NamespaceJoinInput]) (*NamespaceJoinOutput, error) { + in := applyOptions(opts) + in.Namespace = namespace + if err := requireNamedNamespace("namespace.join", in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceJoinOutput](s.client, ctx, "namespace.join", in) +} + +// Leave calls namespace.leave. +// Use WithInput to supply additional request fields. +// The namespace must be named explicitly. +func (s NamespaceService) Leave(ctx context.Context, namespace string, opts ...Option[NamespaceLeaveInput]) (*NamespaceLeaveOutput, error) { + in := applyOptions(opts) + in.Namespace = namespace + if err := requireNamedNamespace("namespace.leave", in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceLeaveOutput](s.client, ctx, "namespace.leave", in) +} + +// List calls namespace.list. +// Use WithInput to supply additional request fields. +func (s NamespaceService) List(ctx context.Context, opts ...Option[NamespaceListInput]) (*NamespaceListOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceListOutput](s.client, ctx, "namespace.list", in) +} + +// ListCategories calls namespace.list_categories. +// Use WithInput to supply additional request fields. +func (s NamespaceService) ListCategories(ctx context.Context, opts ...Option[NamespaceListCategoriesInput]) (*NamespaceListCategoriesOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceListCategoriesOutput](s.client, ctx, "namespace.list_categories", in) +} + +// ListMine calls namespace.list_mine. +// Use WithInput to supply additional request fields. +func (s NamespaceService) ListMine(ctx context.Context, opts ...Option[NamespaceListMineInput]) (*NamespaceListMineOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceListMineOutput](s.client, ctx, "namespace.list_mine", in) +} + +// ListOntology calls namespace.list_ontology. +// Use WithInput to supply additional request fields. +func (s NamespaceService) ListOntology(ctx context.Context, opts ...Option[NamespaceListOntologyInput]) (*NamespaceListOntologyOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceListOntologyOutput](s.client, ctx, "namespace.list_ontology", in) +} + +// MarkSeen calls namespace.mark_seen. +// Use WithInput to supply additional request fields. +// The namespace must be named explicitly. +func (s NamespaceService) MarkSeen(ctx context.Context, namespace string, opts ...Option[NamespaceMarkSeenInput]) (*NamespaceMarkSeenOutput, error) { + in := applyOptions(opts) + in.Namespace = namespace + if err := requireNamedNamespace("namespace.mark_seen", in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceMarkSeenOutput](s.client, ctx, "namespace.mark_seen", in) +} + +// Register calls namespace.register. +// The namespace must be named explicitly. +func (s NamespaceService) Register(ctx context.Context, in NamespaceRegisterInput) (*NamespaceRegisterOutput, error) { + if err := requireNamedNamespace("namespace.register", in.Namespace); err != nil { + return nil, err + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceRegisterOutput](s.client, ctx, "namespace.register", in) +} + +// RegisterCategory calls namespace.register_category. +// Use WithInput to supply additional request fields. +func (s NamespaceService) RegisterCategory(ctx context.Context, name string, opts ...Option[NamespaceRegisterCategoryInput]) (*NamespaceRegisterCategoryOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceRegisterCategoryOutput](s.client, ctx, "namespace.register_category", in) +} + +// RegisterOntology calls namespace.register_ontology. +func (s NamespaceService) RegisterOntology(ctx context.Context, in NamespaceRegisterOntologyInput) (*NamespaceRegisterOntologyOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceRegisterOntologyOutput](s.client, ctx, "namespace.register_ontology", in) +} + +// Restore calls namespace.restore. +func (s NamespaceService) Restore(ctx context.Context, in NamespaceRestoreInput) (*NamespaceRestoreOutput, error) { + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceRestoreOutput](s.client, ctx, "namespace.restore", in) +} + +// Rollback calls namespace.rollback. +// Use WithInput to supply additional request fields. +// Applying a rollback requires an explicit namespace. +func (s NamespaceService) Rollback(ctx context.Context, asOf string, opts ...Option[NamespaceRollbackInput]) (*NamespaceRollbackOutput, error) { + in := applyOptions(opts) + in.AsOf = asOf + if in.DryRun != nil && !*in.DryRun { + if err := requireNamedNamespace("namespace.rollback", in.Namespace); err != nil { + return nil, err + } + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceRollbackOutput](s.client, ctx, "namespace.rollback", in) +} + +// SearchCategories calls namespace.search_categories. +// Use WithInput to supply additional request fields. +func (s NamespaceService) SearchCategories(ctx context.Context, query string, opts ...Option[NamespaceSearchCategoriesInput]) (*NamespaceSearchCategoriesOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceSearchCategoriesOutput](s.client, ctx, "namespace.search_categories", in) +} + +// Snapshot calls namespace.snapshot. +// Use WithInput to supply additional request fields. +func (s NamespaceService) Snapshot(ctx context.Context, opts ...Option[NamespaceSnapshotInput]) (*NamespaceSnapshotOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceSnapshotOutput](s.client, ctx, "namespace.snapshot", in) +} + +// Summary calls namespace.summary. +// Use WithInput to supply additional request fields. +func (s NamespaceService) Summary(ctx context.Context, opts ...Option[NamespaceSummaryInput]) (*NamespaceSummaryOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceSummaryOutput](s.client, ctx, "namespace.summary", in) +} + +// Taxonomy calls namespace.taxonomy. +// Use WithInput to supply additional request fields. +func (s NamespaceService) Taxonomy(ctx context.Context, opts ...Option[NamespaceTaxonomyInput]) (*NamespaceTaxonomyOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceTaxonomyOutput](s.client, ctx, "namespace.taxonomy", in) +} + +// Tune calls namespace.tune. +// Use WithInput to supply additional request fields. +func (s NamespaceService) Tune(ctx context.Context, opts ...Option[NamespaceTuneInput]) (*NamespaceTuneOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceTuneOutput](s.client, ctx, "namespace.tune", in) +} + +// Validate calls namespace.validate. +// Use WithInput to supply additional request fields. +func (s NamespaceService) Validate(ctx context.Context, opts ...Option[NamespaceValidateInput]) (*NamespaceValidateOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[NamespaceValidateOutput](s.client, ctx, "namespace.validate", in) +} + +// Crystallize calls observe.crystallize. +// Use WithInput to supply additional request fields. +func (s ObserveService) Crystallize(ctx context.Context, opts ...Option[ObserveCrystallizeInput]) (*ObserveCrystallizeOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ObserveCrystallizeOutput](s.client, ctx, "observe.crystallize", in) +} + +// Record calls observe.record. +// Use WithInput to supply additional request fields. +func (s ObserveService) Record(ctx context.Context, toolName string, opts ...Option[ObserveRecordInput]) (*ObserveRecordOutput, error) { + in := applyOptions(opts) + in.ToolName = toolName + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ObserveRecordOutput](s.client, ctx, "observe.record", in) +} + +// Capabilities calls ops.capabilities. +// Use WithInput to supply additional request fields. +func (s OpsService) Capabilities(ctx context.Context, opts ...Option[OpsCapabilitiesInput]) (*OpsCapabilitiesOutput, error) { + in := applyOptions(opts) + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[OpsCapabilitiesOutput](s.client, ctx, "ops.capabilities", in) +} + +// Health calls ops.health. +// Use WithInput to supply additional request fields. +func (s OpsService) Health(ctx context.Context, opts ...Option[OpsHealthInput]) (*OpsHealthOutput, error) { + in := applyOptions(opts) + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[OpsHealthOutput](s.client, ctx, "ops.health", in) +} + +// ProjectionFailuresList calls ops.projection_failures.list. +// Use WithInput to supply additional request fields. +func (s OpsService) ProjectionFailuresList(ctx context.Context, opts ...Option[OpsProjectionFailuresListInput]) (*OpsProjectionFailuresListOutput, error) { + in := applyOptions(opts) + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[OpsProjectionFailuresListOutput](s.client, ctx, "ops.projection_failures.list", in) +} + +// ProjectionFailuresResolve calls ops.projection_failures.resolve. +func (s OpsService) ProjectionFailuresResolve(ctx context.Context, in OpsProjectionFailuresResolveInput) (*OpsProjectionFailuresResolveOutput, error) { + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[OpsProjectionFailuresResolveOutput](s.client, ctx, "ops.projection_failures.resolve", in) +} + +// ProjectionFailuresRetry calls ops.projection_failures.retry. +// Use WithInput to supply additional request fields. +func (s OpsService) ProjectionFailuresRetry(ctx context.Context, opts ...Option[OpsProjectionFailuresRetryInput]) (*OpsProjectionFailuresRetryOutput, error) { + in := applyOptions(opts) + if len(in.Namespace) == 0 && s.client.identity.Namespace != "" { + in.Namespace = Some(s.client.identity.Namespace) + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[OpsProjectionFailuresRetryOutput](s.client, ctx, "ops.projection_failures.retry", in) +} + +// ModelCalls calls org.model_calls. +// Use WithInput to supply additional request fields. +func (s OrgService) ModelCalls(ctx context.Context, opts ...Option[OrgModelCallsInput]) (*OrgModelCallsOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[OrgModelCallsOutput](s.client, ctx, "org.model_calls", in) +} + +// SetModelCalls calls org.set_model_calls. +// Use WithInput to supply additional request fields. +func (s OrgService) SetModelCalls(ctx context.Context, enabled bool, opts ...Option[OrgSetModelCallsInput]) (*OrgSetModelCallsOutput, error) { + in := applyOptions(opts) + in.Enabled = enabled + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[OrgSetModelCallsOutput](s.client, ctx, "org.set_model_calls", in) +} + +// Check calls policy.check. +// Use WithInput to supply additional request fields. +func (s PolicyService) Check(ctx context.Context, operation string, opts ...Option[PolicyCheckInput]) (*PolicyCheckOutput, error) { + in := applyOptions(opts) + in.Operation = operation + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[PolicyCheckOutput](s.client, ctx, "policy.check", in) +} + +// Decisions calls policy.decisions. +// Use WithInput to supply additional request fields. +func (s PolicyService) Decisions(ctx context.Context, opts ...Option[PolicyDecisionsInput]) (*PolicyDecisionsOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[PolicyDecisionsOutput](s.client, ctx, "policy.decisions", in) +} + +// Delete calls policy.delete. +// Use WithInput to supply additional request fields. +func (s PolicyService) Delete(ctx context.Context, policyID string, opts ...Option[PolicyDeleteInput]) (*PolicyDeleteOutput, error) { + in := applyOptions(opts) + in.PolicyID = policyID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[PolicyDeleteOutput](s.client, ctx, "policy.delete", in) +} + +// List calls policy.list. +// Use WithInput to supply additional request fields. +func (s PolicyService) List(ctx context.Context, opts ...Option[PolicyListInput]) (*PolicyListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[PolicyListOutput](s.client, ctx, "policy.list", in) +} + +// Set calls policy.set. +func (s PolicyService) Set(ctx context.Context, in PolicySetInput) (*PolicySetOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[PolicySetOutput](s.client, ctx, "policy.set", in) +} + +// Add calls procedure.add. +func (s ProcedureService) Add(ctx context.Context, in ProcedureAddInput) (*ProcedureAddOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProcedureAddOutput](s.client, ctx, "procedure.add", in) +} + +// Evolve calls procedure.evolve. +// Use WithInput to supply additional request fields. +func (s ProcedureService) Evolve(ctx context.Context, memoryKey string, opts ...Option[ProcedureEvolveInput]) (*ProcedureEvolveOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProcedureEvolveOutput](s.client, ctx, "procedure.evolve", in) +} + +// Fork calls procedure.fork. +func (s ProcedureService) Fork(ctx context.Context, in ProcedureForkInput) (*ProcedureForkOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProcedureForkOutput](s.client, ctx, "procedure.fork", in) +} + +// List calls procedure.list. +// Use WithInput to supply additional request fields. +func (s ProcedureService) List(ctx context.Context, opts ...Option[ProcedureListInput]) (*ProcedureListOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProcedureListOutput](s.client, ctx, "procedure.list", in) +} + +// Locate calls procedure.locate. +// Use WithInput to supply additional request fields. +func (s ProcedureService) Locate(ctx context.Context, memoryKey string, opts ...Option[ProcedureLocateInput]) (*ProcedureLocateOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProcedureLocateOutput](s.client, ctx, "procedure.locate", in) +} + +// Match calls procedure.match. +// Use WithInput to supply additional request fields. +func (s ProcedureService) Match(ctx context.Context, situation string, opts ...Option[ProcedureMatchInput]) (*ProcedureMatchOutput, error) { + in := applyOptions(opts) + in.Situation = situation + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProcedureMatchOutput](s.client, ctx, "procedure.match", in) +} + +// RecordRun calls procedure.record_run. +// Use WithInput to supply additional request fields. +func (s ProcedureService) RecordRun(ctx context.Context, memoryKey string, opts ...Option[ProcedureRecordRunInput]) (*ProcedureRecordRunOutput, error) { + in := applyOptions(opts) + in.MemoryKey = memoryKey + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProcedureRecordRunOutput](s.client, ctx, "procedure.record_run", in) +} + +// Revise calls procedure.revise. +func (s ProcedureService) Revise(ctx context.Context, in ProcedureReviseInput) (*ProcedureReviseOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProcedureReviseOutput](s.client, ctx, "procedure.revise", in) +} + +// Activity calls profile.activity. +// Use WithInput to supply additional request fields. +func (s ProfileService) Activity(ctx context.Context, opts ...Option[ProfileActivityInput]) (*ProfileActivityOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProfileActivityOutput](s.client, ctx, "profile.activity", in) +} + +// Append calls profile.append. +func (s ProfileService) Append(ctx context.Context, in ProfileAppendInput) (*ProfileAppendOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProfileAppendOutput](s.client, ctx, "profile.append", in) +} + +// Render calls profile.render. +// Use WithInput to supply additional request fields. +func (s ProfileService) Render(ctx context.Context, opts ...Option[ProfileRenderInput]) (*ProfileRenderOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProfileRenderOutput](s.client, ctx, "profile.render", in) +} + +// Replace calls profile.replace. +func (s ProfileService) Replace(ctx context.Context, in ProfileReplaceInput) (*ProfileReplaceOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProfileReplaceOutput](s.client, ctx, "profile.replace", in) +} + +// Set calls profile.set. +func (s ProfileService) Set(ctx context.Context, in ProfileSetInput) (*ProfileSetOutput, error) { + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProfileSetOutput](s.client, ctx, "profile.set", in) +} + +// Structured calls profile.structured. +// Use WithInput to supply additional request fields. +func (s ProfileService) Structured(ctx context.Context, opts ...Option[ProfileStructuredInput]) (*ProfileStructuredOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProfileStructuredOutput](s.client, ctx, "profile.structured", in) +} + +// Clear calls profile_schema.clear. +// Use WithInput to supply additional request fields. +func (s ProfileSchemaService) Clear(ctx context.Context, opts ...Option[ProfileSchemaClearInput]) (*ProfileSchemaClearOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProfileSchemaClearOutput](s.client, ctx, "profile_schema.clear", in) +} + +// Get calls profile_schema.get. +// Use WithInput to supply additional request fields. +func (s ProfileSchemaService) Get(ctx context.Context, opts ...Option[ProfileSchemaGetInput]) (*ProfileSchemaGetOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProfileSchemaGetOutput](s.client, ctx, "profile_schema.get", in) +} + +// Set calls profile_schema.set. +func (s ProfileSchemaService) Set(ctx context.Context, in ProfileSchemaSetInput) (*ProfileSchemaSetOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ProfileSchemaSetOutput](s.client, ctx, "profile_schema.set", in) +} + +// Begin calls run.begin. +// Use WithInput to supply additional request fields. +func (s RunService) Begin(ctx context.Context, goal string, opts ...Option[RunBeginInput]) (*RunBeginOutput, error) { + in := applyOptions(opts) + in.Goal = goal + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[RunBeginOutput](s.client, ctx, "run.begin", in) +} + +// Complete calls run.complete. +func (s RunService) Complete(ctx context.Context, in RunCompleteInput) (*RunCompleteOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[RunCompleteOutput](s.client, ctx, "run.complete", in) +} + +// Get calls run.get. +// Use WithInput to supply additional request fields. +func (s RunService) Get(ctx context.Context, runID string, opts ...Option[RunGetInput]) (*RunGetOutput, error) { + in := applyOptions(opts) + in.RunID = runID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[RunGetOutput](s.client, ctx, "run.get", in) +} + +// Grade calls run.grade. +// Use WithInput to supply additional request fields. +func (s RunService) Grade(ctx context.Context, grade string, opts ...Option[RunGradeInput]) (*RunGradeOutput, error) { + in := applyOptions(opts) + in.Grade = grade + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[RunGradeOutput](s.client, ctx, "run.grade", in) +} + +// List calls run.list. +// Use WithInput to supply additional request fields. +func (s RunService) List(ctx context.Context, opts ...Option[RunListInput]) (*RunListOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[RunListOutput](s.client, ctx, "run.list", in) +} + +// Query calls search.query. +// Use WithInput to supply additional request fields. +func (s LoomSearchService) Query(ctx context.Context, query string, opts ...Option[SearchQueryInput]) (*SearchQueryOutput, error) { + in := applyOptions(opts) + in.Query = query + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[SearchQueryOutput](s.client, ctx, "search.query", in) +} + +// BriefDelete calls session.brief_delete. +// Use WithInput to supply additional request fields. +func (s SessionService) BriefDelete(ctx context.Context, briefKey string, opts ...Option[SessionBriefDeleteInput]) (*SessionBriefDeleteOutput, error) { + in := applyOptions(opts) + in.BriefKey = briefKey + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[SessionBriefDeleteOutput](s.client, ctx, "session.brief_delete", in) +} + +// BriefGet calls session.brief_get. +// Use WithInput to supply additional request fields. +func (s SessionService) BriefGet(ctx context.Context, opts ...Option[SessionBriefGetInput]) (*SessionBriefGetOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[SessionBriefGetOutput](s.client, ctx, "session.brief_get", in) +} + +// BriefList calls session.brief_list. +// Use WithInput to supply additional request fields. +func (s SessionService) BriefList(ctx context.Context, opts ...Option[SessionBriefListInput]) (*SessionBriefListOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[SessionBriefListOutput](s.client, ctx, "session.brief_list", in) +} + +// BriefSave calls session.brief_save. +// Use WithInput to supply additional request fields. +func (s SessionService) BriefSave(ctx context.Context, opts ...Option[SessionBriefSaveInput]) (*SessionBriefSaveOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[SessionBriefSaveOutput](s.client, ctx, "session.brief_save", in) +} + +// Accept calls task.accept. +// Use WithInput to supply additional request fields. +func (s TaskService) Accept(ctx context.Context, taskID string, opts ...Option[TaskAcceptInput]) (*TaskAcceptOutput, error) { + in := applyOptions(opts) + in.TaskID = taskID + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskAcceptOutput](s.client, ctx, "task.accept", in) +} + +// Block calls task.block. +func (s TaskService) Block(ctx context.Context, in TaskBlockInput) (*TaskBlockOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskBlockOutput](s.client, ctx, "task.block", in) +} + +// Cancel calls task.cancel. +func (s TaskService) Cancel(ctx context.Context, in TaskCancelInput) (*TaskCancelOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskCancelOutput](s.client, ctx, "task.cancel", in) +} + +// Claim calls task.claim. +// Use WithInput to supply additional request fields. +func (s TaskService) Claim(ctx context.Context, taskID string, opts ...Option[TaskClaimInput]) (*TaskClaimOutput, error) { + in := applyOptions(opts) + in.TaskID = taskID + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskClaimOutput](s.client, ctx, "task.claim", in) +} + +// Complete calls task.complete. +func (s TaskService) Complete(ctx context.Context, in TaskCompleteInput) (*TaskCompleteOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskCompleteOutput](s.client, ctx, "task.complete", in) +} + +// Counts calls task.counts. +// Use WithInput to supply additional request fields. +func (s TaskService) Counts(ctx context.Context, opts ...Option[TaskCountsInput]) (*TaskCountsOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskCountsOutput](s.client, ctx, "task.counts", in) +} + +// Create calls task.create. +func (s TaskService) Create(ctx context.Context, in TaskCreateInput) (*TaskCreateOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskCreateOutput](s.client, ctx, "task.create", in) +} + +// Defer calls task.defer. +func (s TaskService) Defer(ctx context.Context, in TaskDeferInput) (*TaskDeferOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskDeferOutput](s.client, ctx, "task.defer", in) +} + +// Fail calls task.fail. +func (s TaskService) Fail(ctx context.Context, in TaskFailInput) (*TaskFailOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskFailOutput](s.client, ctx, "task.fail", in) +} + +// Get calls task.get. +// Use WithInput to supply additional request fields. +func (s TaskService) Get(ctx context.Context, taskID string, opts ...Option[TaskGetInput]) (*TaskGetOutput, error) { + in := applyOptions(opts) + in.TaskID = taskID + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskGetOutput](s.client, ctx, "task.get", in) +} + +// Heartbeat calls task.heartbeat. +func (s TaskService) Heartbeat(ctx context.Context, in TaskHeartbeatInput) (*TaskHeartbeatOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskHeartbeatOutput](s.client, ctx, "task.heartbeat", in) +} + +// History calls task.history. +// Use WithInput to supply additional request fields. +func (s TaskService) History(ctx context.Context, taskID string, opts ...Option[TaskHistoryInput]) (*TaskHistoryOutput, error) { + in := applyOptions(opts) + in.TaskID = taskID + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskHistoryOutput](s.client, ctx, "task.history", in) +} + +// List calls task.list. +// Use WithInput to supply additional request fields. +func (s TaskService) List(ctx context.Context, opts ...Option[TaskListInput]) (*TaskListOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskListOutput](s.client, ctx, "task.list", in) +} + +// Progress calls task.progress. +func (s TaskService) Progress(ctx context.Context, in TaskProgressInput) (*TaskProgressOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskProgressOutput](s.client, ctx, "task.progress", in) +} + +// Pull calls task.pull. +// Use WithInput to supply additional request fields. +func (s TaskService) Pull(ctx context.Context, inbox string, opts ...Option[TaskPullInput]) (*TaskPullOutput, error) { + in := applyOptions(opts) + in.Inbox = inbox + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskPullOutput](s.client, ctx, "task.pull", in) +} + +// Reassign calls task.reassign. +func (s TaskService) Reassign(ctx context.Context, in TaskReassignInput) (*TaskReassignOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskReassignOutput](s.client, ctx, "task.reassign", in) +} + +// Reopen calls task.reopen. +func (s TaskService) Reopen(ctx context.Context, in TaskReopenInput) (*TaskReopenOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskReopenOutput](s.client, ctx, "task.reopen", in) +} + +// Resume calls task.resume. +// Use WithInput to supply additional request fields. +func (s TaskService) Resume(ctx context.Context, taskID string, opts ...Option[TaskResumeInput]) (*TaskResumeOutput, error) { + in := applyOptions(opts) + in.TaskID = taskID + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskResumeOutput](s.client, ctx, "task.resume", in) +} + +// Unblock calls task.unblock. +// Use WithInput to supply additional request fields. +func (s TaskService) Unblock(ctx context.Context, taskID string, opts ...Option[TaskUnblockInput]) (*TaskUnblockOutput, error) { + in := applyOptions(opts) + in.TaskID = taskID + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskUnblockOutput](s.client, ctx, "task.unblock", in) +} + +// Update calls task.update. +func (s TaskService) Update(ctx context.Context, in TaskUpdateInput) (*TaskUpdateOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskUpdateOutput](s.client, ctx, "task.update", in) +} + +// Updates calls task.updates. +// Use WithInput to supply additional request fields. +func (s TaskService) Updates(ctx context.Context, opts ...Option[TaskUpdatesInput]) (*TaskUpdatesOutput, error) { + in := applyOptions(opts) + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskUpdatesOutput](s.client, ctx, "task.updates", in) +} + +// WontDo calls task.wont_do. +func (s TaskService) WontDo(ctx context.Context, in TaskWontDoInput) (*TaskWontDoOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TaskWontDoOutput](s.client, ctx, "task.wont_do", in) +} + +// Answer calls tracker.answer. +// Use WithInput to supply additional request fields. +func (s TrackerService) Answer(ctx context.Context, opts ...Option[TrackerAnswerInput]) (*TrackerAnswerOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[TrackerAnswerOutput](s.client, ctx, "tracker.answer", in) +} + +// Binding calls tracker.binding. +// Use WithInput to supply additional request fields. +func (s TrackerService) Binding(ctx context.Context, opts ...Option[TrackerBindingInput]) (*TrackerBindingOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[TrackerBindingOutput](s.client, ctx, "tracker.binding", in) +} + +// Component calls tracker.component. +// Use WithInput to supply additional request fields. +func (s TrackerService) Component(ctx context.Context, component string, opts ...Option[TrackerComponentInput]) (*TrackerComponentOutput, error) { + in := applyOptions(opts) + in.Component = component + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[TrackerComponentOutput](s.client, ctx, "tracker.component", in) +} + +// Contract calls tracker.contract. +// Use WithInput to supply additional request fields. +func (s TrackerService) Contract(ctx context.Context, opts ...Option[TrackerContractInput]) (*TrackerContractOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TrackerContractOutput](s.client, ctx, "tracker.contract", in) +} + +// DuplicateCheck calls tracker.duplicate_check. +// Use WithInput to supply additional request fields. +func (s TrackerService) DuplicateCheck(ctx context.Context, opts ...Option[TrackerDuplicateCheckInput]) (*TrackerDuplicateCheckOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[TrackerDuplicateCheckOutput](s.client, ctx, "tracker.duplicate_check", in) +} + +// Flaky calls tracker.flaky. +// Use WithInput to supply additional request fields. +func (s TrackerService) Flaky(ctx context.Context, testName string, opts ...Option[TrackerFlakyInput]) (*TrackerFlakyOutput, error) { + in := applyOptions(opts) + in.TestName = testName + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[TrackerFlakyOutput](s.client, ctx, "tracker.flaky", in) +} + +// Item calls tracker.item. +func (s TrackerService) Item(ctx context.Context, in TrackerItemInput) (*TrackerItemOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[TrackerItemOutput](s.client, ctx, "tracker.item", in) +} + +// Links calls tracker.links. +// Use WithInput to supply additional request fields. +func (s TrackerService) Links(ctx context.Context, opts ...Option[TrackerLinksInput]) (*TrackerLinksOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[TrackerLinksOutput](s.client, ctx, "tracker.links", in) +} + +// Release calls tracker.release. +// Use WithInput to supply additional request fields. +func (s TrackerService) Release(ctx context.Context, version string, opts ...Option[TrackerReleaseInput]) (*TrackerReleaseOutput, error) { + in := applyOptions(opts) + in.Version = version + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[TrackerReleaseOutput](s.client, ctx, "tracker.release", in) +} + +// Similar calls tracker.similar. +// Use WithInput to supply additional request fields. +func (s TrackerService) Similar(ctx context.Context, opts ...Option[TrackerSimilarInput]) (*TrackerSimilarOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[TrackerSimilarOutput](s.client, ctx, "tracker.similar", in) +} + +// SourceAdd calls tracker.source.add. +func (s TrackerService) SourceAdd(ctx context.Context, in TrackerSourceAddInput) (*TrackerSourceAddOutput, error) { + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TrackerSourceAddOutput](s.client, ctx, "tracker.source.add", in) +} + +// SourceCheck calls tracker.source.check. +// Use WithInput to supply additional request fields. +func (s TrackerService) SourceCheck(ctx context.Context, name string, opts ...Option[TrackerSourceCheckInput]) (*TrackerSourceCheckOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TrackerSourceCheckOutput](s.client, ctx, "tracker.source.check", in) +} + +// SourceInspect calls tracker.source.inspect. +// Use WithInput to supply additional request fields. +func (s TrackerService) SourceInspect(ctx context.Context, opts ...Option[TrackerSourceInspectInput]) (*TrackerSourceInspectOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TrackerSourceInspectOutput](s.client, ctx, "tracker.source.inspect", in) +} + +// SourceList calls tracker.source.list. +// Use WithInput to supply additional request fields. +func (s TrackerService) SourceList(ctx context.Context, opts ...Option[TrackerSourceListInput]) (*TrackerSourceListOutput, error) { + in := applyOptions(opts) + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TrackerSourceListOutput](s.client, ctx, "tracker.source.list", in) +} + +// SourceRemove calls tracker.source.remove. +func (s TrackerService) SourceRemove(ctx context.Context, in TrackerSourceRemoveInput) (*TrackerSourceRemoveOutput, error) { + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TrackerSourceRemoveOutput](s.client, ctx, "tracker.source.remove", in) +} + +// SourceRotate calls tracker.source.rotate. +func (s TrackerService) SourceRotate(ctx context.Context, in TrackerSourceRotateInput) (*TrackerSourceRotateOutput, error) { + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TrackerSourceRotateOutput](s.client, ctx, "tracker.source.rotate", in) +} + +// SourceSetMapping calls tracker.source.set_mapping. +// Use WithInput to supply additional request fields. +func (s TrackerService) SourceSetMapping(ctx context.Context, name string, opts ...Option[TrackerSourceSetMappingInput]) (*TrackerSourceSetMappingOutput, error) { + in := applyOptions(opts) + in.Name = name + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[TrackerSourceSetMappingOutput](s.client, ctx, "tracker.source.set_mapping", in) +} + +// TestSignal calls tracker.test_signal. +// Use WithInput to supply additional request fields. +func (s TrackerService) TestSignal(ctx context.Context, testName string, opts ...Option[TrackerTestSignalInput]) (*TrackerTestSignalOutput, error) { + in := applyOptions(opts) + in.TestName = testName + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == nil && s.client.identity.Org != "" { + in.Org = Ptr(s.client.identity.Org) + } + return callOperation[TrackerTestSignalOutput](s.client, ctx, "tracker.test_signal", in) +} + +// Vitals calls ui.vitals. +// Use WithInput to supply additional request fields. +func (s UIService) Vitals(ctx context.Context, route string, opts ...Option[UIVitalsInput]) (*UIVitalsOutput, error) { + in := applyOptions(opts) + in.Route = route + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[UIVitalsOutput](s.client, ctx, "ui.vitals", in) +} + +// Deliveries calls webhook.deliveries. +// Use WithInput to supply additional request fields. +func (s WebhookService) Deliveries(ctx context.Context, opts ...Option[WebhookDeliveriesInput]) (*WebhookDeliveriesOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[WebhookDeliveriesOutput](s.client, ctx, "webhook.deliveries", in) +} + +// List calls webhook.list. +// Use WithInput to supply additional request fields. +func (s WebhookService) List(ctx context.Context, opts ...Option[WebhookListInput]) (*WebhookListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[WebhookListOutput](s.client, ctx, "webhook.list", in) +} + +// Register calls webhook.register. +func (s WebhookService) Register(ctx context.Context, in WebhookRegisterInput) (*WebhookRegisterOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[WebhookRegisterOutput](s.client, ctx, "webhook.register", in) +} + +// Remove calls webhook.remove. +// Use WithInput to supply additional request fields. +func (s WebhookService) Remove(ctx context.Context, webhookID string, opts ...Option[WebhookRemoveInput]) (*WebhookRemoveOutput, error) { + in := applyOptions(opts) + in.WebhookID = webhookID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[WebhookRemoveOutput](s.client, ctx, "webhook.remove", in) +} + +// Append calls working_memory.append. +// Use WithInput to supply additional request fields. +func (s WorkingMemoryService) Append(ctx context.Context, addition string, opts ...Option[WorkingMemoryAppendInput]) (*WorkingMemoryAppendOutput, error) { + in := applyOptions(opts) + in.Addition = addition + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[WorkingMemoryAppendOutput](s.client, ctx, "working_memory.append", in) +} + +// Delete calls working_memory.delete. +// Use WithInput to supply additional request fields. +func (s WorkingMemoryService) Delete(ctx context.Context, opts ...Option[WorkingMemoryDeleteInput]) (*WorkingMemoryDeleteOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[WorkingMemoryDeleteOutput](s.client, ctx, "working_memory.delete", in) +} + +// Get calls working_memory.get. +// Use WithInput to supply additional request fields. +func (s WorkingMemoryService) Get(ctx context.Context, opts ...Option[WorkingMemoryGetInput]) (*WorkingMemoryGetOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[WorkingMemoryGetOutput](s.client, ctx, "working_memory.get", in) +} + +// WithWorkingMemoryGetBlockKey sets block_key on working_memory.get. +func WithWorkingMemoryGetBlockKey(value string) Option[WorkingMemoryGetInput] { + return func(in *WorkingMemoryGetInput) { in.BlockKey = Ptr(value) } +} + +// Render calls working_memory.render. +// Use WithInput to supply additional request fields. +func (s WorkingMemoryService) Render(ctx context.Context, opts ...Option[WorkingMemoryRenderInput]) (*WorkingMemoryRenderOutput, error) { + in := applyOptions(opts) + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[WorkingMemoryRenderOutput](s.client, ctx, "working_memory.render", in) +} + +// Replace calls working_memory.replace. +// Use WithInput to supply additional request fields. +func (s WorkingMemoryService) Replace(ctx context.Context, old string, opts ...Option[WorkingMemoryReplaceInput]) (*WorkingMemoryReplaceOutput, error) { + in := applyOptions(opts) + in.Old = old + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[WorkingMemoryReplaceOutput](s.client, ctx, "working_memory.replace", in) +} + +// Set calls working_memory.set. +// Use WithInput to supply additional request fields. +// If content is empty, options or the server supply the value. +func (s WorkingMemoryService) Set(ctx context.Context, content string, opts ...Option[WorkingMemorySetInput]) (*WorkingMemorySetOutput, error) { + in := applyOptions(opts) + if content != "" { + in.Content = Ptr(content) + } + if in.Agent == "" { + in.Agent = s.client.identity.Agent + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[WorkingMemorySetOutput](s.client, ctx, "working_memory.set", in) +} + +// WithWorkingMemorySetBlockKey sets block_key on working_memory.set. +func WithWorkingMemorySetBlockKey(value string) Option[WorkingMemorySetInput] { + return func(in *WorkingMemorySetInput) { in.BlockKey = Ptr(value) } +} diff --git a/sdk/go/client.go b/sdk/go/client.go index e460212c04d..223092d76b0 100644 --- a/sdk/go/client.go +++ b/sdk/go/client.go @@ -1,7 +1,7 @@ -// Package loom calls Loom's memory operations over HTTP. +// Package loom calls Loom operations over HTTP. // // Every operation is POST /v1/ with a JSON body. A Client binds the org, -// namespace and agent once and sends them with every call. +// namespace and agent once and uses them for operations that accept caller identity. package loom import ( @@ -41,9 +41,7 @@ type Config struct { HTTPClient *http.Client } -// Client calls the memory operations as one org, namespace and agent. -// It is safe for concurrent use. -type Client struct { +type clientTransport struct { baseURL string apiKey string identity identity @@ -69,13 +67,16 @@ func New(cfg Config) *Client { // Following one would resend the memory body and the bearer token to wherever it points. client.CheckRedirect = func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse } } - return &Client{ - baseURL: strings.TrimRight(baseURL, "/"), - // An exported but empty LOOM_API_KEY must not send "Bearer " and turn a clear 401 into a puzzle. - apiKey: firstNonBlank(cfg.APIKey, os.Getenv("LOOM_API_KEY")), - identity: identity{Org: cfg.Org, Namespace: cfg.Namespace, Agent: cfg.Agent}, - http: &client, + c := &Client{ + clientTransport: clientTransport{ + baseURL: strings.TrimRight(baseURL, "/"), + apiKey: firstNonBlank(cfg.APIKey, os.Getenv("LOOM_API_KEY")), + identity: identity{Org: cfg.Org, Namespace: cfg.Namespace, Agent: cfg.Agent}, + http: &client, + }, } + c.initServices() + return c } func firstNonBlank(values ...string) string { @@ -88,7 +89,7 @@ func firstNonBlank(values ...string) string { } // call posts in to /v1/ and decodes a 2xx answer into out. -func (c *Client) call(ctx context.Context, op string, in, out any) error { +func (c *clientTransport) call(ctx context.Context, op string, in, out any) error { body, err := json.Marshal(in) if err != nil { return fmt.Errorf("%s: encode request: %w", op, err) diff --git a/sdk/go/code.go b/sdk/go/code.go new file mode 100644 index 00000000000..de60bc9fd6a --- /dev/null +++ b/sdk/go/code.go @@ -0,0 +1,27 @@ +package loom + +import "slices" + +// CodeReposOption sets fields on a repository listing request. +type CodeReposOption = Option[CodeReposInput] + +// WithRepo filters the listing to an owner/name or repository URL. +func WithRepo(repo string) CodeReposOption { + return func(input *CodeReposInput) { + input.Repo = Ptr(repo) + } +} + +// WithRepoCandidates asks Loom to resolve an ordered list of repository candidates. +func WithRepoCandidates(repos ...string) CodeReposOption { + repos = append([]string{}, repos...) + return func(input *CodeReposInput) { + input.Repos = Ptr(slices.Clone(repos)) + } +} + +// WithRepoFields selects fields to return for each entry. +func WithRepoFields(fields ...string) CodeReposOption { + fields = append([]string{}, fields...) + return func(input *CodeReposInput) { input.Fields = Some(slices.Clone(fields)) } +} diff --git a/sdk/go/code_test.go b/sdk/go/code_test.go new file mode 100644 index 00000000000..23d2f851cb5 --- /dev/null +++ b/sdk/go/code_test.go @@ -0,0 +1,71 @@ +package loom + +import ( + "context" + "errors" + "net/http" + "testing" +) + +func TestCodeReposUsesClientIdentityAndReturnsRepositoryEntries(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{"repos":[{"repo":"team/service","namespace":"code","branch":"main"}]}`, nil) + repo := "team/service" + out, err := newClient(srv).Code.Repos(context.Background(), WithRepo(repo), WithRepoFields("repo", "branch")) + if err != nil { + t.Fatal(err) + } + if rec.method != http.MethodPost || rec.path != "/v1/code.repos" || rec.header.Get("Authorization") != "Bearer tok" { + t.Fatalf("unexpected request: %s %s, headers %v", rec.method, rec.path, rec.header) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "support", "agent": "assistant", "repo": repo, + "fields": []any{"repo", "branch"}, + }) + if len(out.Repos) != 1 || out.Repos[0].Repo == nil || *out.Repos[0].Repo != repo { + t.Fatalf("unexpected repos: %+v", out.Repos) + } +} + +func TestCodeReposWithNoOptionsListsAllVisibleEntries(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{"repos":[]}`, nil) + out, err := newClient(srv).Code.Repos(context.Background()) + if err != nil || out == nil || out.Repos == nil || len(out.Repos) != 0 { + t.Fatalf("Repos = (%v, %v), want an empty list", out, err) + } + assertBody(t, rec, map[string]any{"org": "acme", "namespace": "support", "agent": "assistant"}) +} + +func TestCodeReposKeepsCandidateOrder(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{"repos":[]}`, nil) + _, err := newClient(srv).Code.Repos(context.Background(), WithRepoCandidates("team/fork", "team/upstream")) + if err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "support", "agent": "assistant", + "repos": []any{"team/fork", "team/upstream"}, + }) +} + +func TestCodeReposKeepsExplicitIdentityAndServerError(t *testing.T) { + srv, rec := fakeServer(t, http.StatusForbidden, `{"detail":{"code":"AUTH_INSUFFICIENT"}}`, nil) + namespace := "requested" + out, err := newClient(srv).Code.Repos(context.Background(), func(input *CodeReposInput) { + input.Namespace = &namespace + }) + var apiErr *Error + if out != nil || !errors.As(err, &apiErr) || apiErr.Code != "AUTH_INSUFFICIENT" { + t.Fatalf("Repos = (%v, %v), want a typed authorization error", out, err) + } + assertBody(t, rec, map[string]any{"org": "acme", "namespace": namespace, "agent": "assistant"}) +} + +func TestCodeReposPreservesContextCancellation(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{"repos":[]}`, nil) + ctx, cancel := context.WithCancel(context.Background()) + cancel() + _, err := newClient(srv).Code.Repos(ctx) + if !errors.Is(err, context.Canceled) || rec.path != "" { + t.Fatalf("error = %v, request path = %q", err, rec.path) + } +} diff --git a/sdk/go/examples/listrepos/main.go b/sdk/go/examples/listrepos/main.go new file mode 100644 index 00000000000..0f81db8224c --- /dev/null +++ b/sdk/go/examples/listrepos/main.go @@ -0,0 +1,49 @@ +// List the code repositories visible to a Loom credential. +package main + +import ( + "context" + "flag" + "fmt" + "log" + "os" + "time" + + loom "github.com/ClickHouse/loom/sdk/go" +) + +func main() { + repo := flag.String("repo", "", "repository to list, as owner/name or URL") + flag.Parse() + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + client := loom.New(loom.Config{ + Org: os.Getenv("LOOM_ORG"), + Agent: "repo-inventory", + }) + var opts []loom.CodeReposOption + if *repo != "" { + opts = append(opts, loom.WithRepo(*repo)) + } + out, err := client.Code.Repos(ctx, opts...) + if err != nil { + log.Fatal(err) + } + if len(out.Repos) == 0 { + fmt.Println("No code repositories are visible to this client.") + return + } + fmt.Println("REPOSITORY\tBRANCH\tNAMESPACE") + for _, repo := range out.Repos { + fmt.Printf("%s\t%s\t%s\n", text(repo.Repo), text(repo.Branch), text(repo.Namespace)) + } +} + +func text(value *string) string { + if value == nil { + return "-" + } + return *value +} diff --git a/sdk/go/examples/runbook/main.go b/sdk/go/examples/runbook/main.go new file mode 100644 index 00000000000..5980733918e --- /dev/null +++ b/sdk/go/examples/runbook/main.go @@ -0,0 +1,74 @@ +// The runbook example gives a release agent a document and a working memory +// block, then asks Loom to assemble context for the next step. +package main + +import ( + "context" + "fmt" + "log" + "os" + "strings" + "time" + + loom "github.com/ClickHouse/loom/sdk/go" +) + +func main() { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + client := loom.New(loom.Config{ + Org: os.Getenv("LOOM_ORG"), + Namespace: os.Getenv("LOOM_NAMESPACE"), + Agent: "release-assistant", + }) + if err := run(ctx, client); err != nil { + log.Fatal(err) + } +} + +func run(ctx context.Context, client *loom.Client) error { + const uri = "https://example.com/runbooks/loom-go-sdk-release-demo" + const runbook = "# Release checklist\nVerify staging health and confirm the rollback version before deploying." + doc, err := client.Knowledge.Upsert(ctx, loom.KnowledgeUpsertInput{ + SourceURI: uri, + Title: loom.Ptr("Release checklist"), + Content: runbook, + }) + if err != nil { + return err + } + saved, err := client.Knowledge.Get(ctx, uri) + if err != nil { + return err + } + if content, ok := saved.Content.Get(); !saved.Found || !ok || content != runbook { + return fmt.Errorf("could not read back runbook %q", uri) + } + fmt.Printf("Read runbook %s\n", doc.DocID) + + const block = "go-sdk-release-demo" + const note = "Staging is healthy. The rollback version still needs confirmation." + if _, err := client.WorkingMemory.Set(ctx, note, loom.WithWorkingMemorySetBlockKey(block)); err != nil { + return err + } + memory, err := client.WorkingMemory.Get(ctx, loom.WithWorkingMemoryGetBlockKey(block)) + if err != nil { + return err + } + if !memory.Found || memory.Content == nil || *memory.Content != note { + return fmt.Errorf("could not read back working memory block %q", block) + } + fmt.Printf("Read working memory: %s\n", *memory.Content) + + pack, err := client.Context.Pack(ctx, "What does the release checklist say about staging health and rollback?", + loom.WithPackKnowledge(true), loom.WithPackTokenBudget(800)) + if err != nil { + return err + } + if !strings.Contains(pack.Sections["knowledge"], "Verify staging health") || + !strings.Contains(pack.Sections["working_memory"], note) { + return fmt.Errorf("context pack did not contain both the runbook and working memory") + } + fmt.Printf("Context pack: %d sections, %d token budget\n%s\n", pack.SectionCount, pack.TokenBudget, pack.Rendered) + return nil +} diff --git a/sdk/go/generated_client_test.go b/sdk/go/generated_client_test.go new file mode 100644 index 00000000000..258bd857abd --- /dev/null +++ b/sdk/go/generated_client_test.go @@ -0,0 +1,424 @@ +package loom + +import ( + "context" + "encoding/json" + "errors" + "io" + "net/http" + "net/http/httptest" + "testing" +) + +func TestCollectionDeleteRequiresExplicitNamespace(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{"deleted":true}`, nil) + c := newClient(srv) + ctx := context.Background() + for _, target := range []string{"", " \t", "-", "*"} { + _, err := c.Collection.Delete(ctx, target, + WithInput(CollectionDeleteInput{Namespace: "col-option"})) + if err == nil || rec.path != "" { + t.Fatalf("delete %q: error = %v, request = %v", target, err, rec.body) + } + } + if _, err := c.Collection.Delete(ctx, "col-runbooks"); err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{"org": "acme", "namespace": "col-runbooks"}) +} + +func TestCollectionCreateDoesNotDefaultTargetName(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + _, err := newClient(srv).Collection.Create(context.Background(), WithInput(CollectionCreateInput{ + DeriveName: Ptr(true), Title: Ptr("Runbooks"), + })) + if err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{"org": "acme", "derive_name": true, "title": "Runbooks"}) +} + +func TestCollectionMoveAndNamespaceDeleteRequireExplicitTargets(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + c := newClient(srv) + ctx := context.Background() + if _, err := c.Collection.Move(ctx, ""); err == nil || rec.path != "" { + t.Fatalf("targetless move: error = %v, request = %v", err, rec.body) + } + if _, err := c.Namespace.Delete(ctx, ""); err == nil || rec.path != "" { + t.Fatalf("targetless namespace delete: error = %v, request = %v", err, rec.body) + } +} + +func TestMemoryUpdateUsesOnlyAnExplicitAgentFilter(t *testing.T) { + for _, agent := range []*string{nil, Ptr("writer"), Ptr("")} { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + _, err := newClient(srv).Memory.Update(context.Background(), "plan", + WithInput(MemoryUpdateInput{Agent: agent})) + if err != nil { + t.Fatal(err) + } + want := map[string]any{"org": "acme", "namespace": "support", "memory_key": "plan"} + if agent != nil { + want["agent"] = *agent + } + assertBody(t, rec, want) + } +} + +func TestMemoryClearDoesNotDefaultAgentSelector(t *testing.T) { + ctx := context.Background() + t.Run("user across agents", func(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + if _, err := newClient(srv).Memory.Clear(ctx, "user-42", + WithInput(MemoryClearInput{UserID: Some("user-42")})); err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "support", "confirm_subject": "user-42", "user_id": "user-42", + }) + }) + t.Run("no selector", func(t *testing.T) { + srv, rec := fakeServer(t, http.StatusBadRequest, `{"detail":{"code":"MISSING_SCOPE"}}`, nil) + _, err := newClient(srv).Memory.Clear(ctx, "assistant") + var apiErr *Error + if !errors.As(err, &apiErr) || apiErr.Code != "MISSING_SCOPE" { + t.Fatalf("error = %v, want MISSING_SCOPE", err) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "support", "confirm_subject": "assistant", + }) + }) + t.Run("explicit agent", func(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + if _, err := newClient(srv).Memory.Clear(ctx, "writer", + WithInput(MemoryClearInput{Agent: Some("writer")})); err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "support", "confirm_subject": "writer", "agent": "writer", + }) + }) +} + +func TestNamespaceRollbackRequiresExplicitApplyTarget(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + c := newClient(srv) + ctx := context.Background() + const asOf = "2026-01-01T00:00:00Z" + for _, target := range []string{"", " \t", "-", "*"} { + _, err := c.Namespace.Rollback(ctx, asOf, + WithInput(NamespaceRollbackInput{Namespace: target, DryRun: Ptr(false)})) + if err == nil || rec.path != "" { + t.Fatalf("rollback %q: error = %v, request = %v", target, err, rec.body) + } + } + for _, dryRun := range []*bool{nil, Ptr(true)} { + if _, err := c.Namespace.Rollback(ctx, asOf, + WithInput(NamespaceRollbackInput{DryRun: dryRun})); err != nil { + t.Fatal(err) + } + want := map[string]any{"org": "acme", "namespace": "support", "as_of": asOf} + if dryRun != nil { + want["dry_run"] = true + } + assertBody(t, rec, want) + } + if _, err := c.Namespace.Rollback(ctx, asOf, + WithInput(NamespaceRollbackInput{Namespace: "ops", DryRun: Ptr(false)})); err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "ops", "as_of": asOf, "dry_run": false, + }) +} + +func TestGroupedMethodKeepsRequiredIdentityForServerValidation(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + _, err := New(Config{BaseURL: srv.URL, Namespace: "support"}). + Context.Pack(context.Background(), "deploy") + if err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{"org": "", "namespace": "support", "agent": "", "query": "deploy"}) +} + +func TestGroupedMethodOmitsBlankOptionalIdentity(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + _, err := New(Config{BaseURL: srv.URL}).Learnings.Quality(context.Background()) + if err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{"org": ""}) +} + +func TestMemoryHistoryLetsServerValidateMissingAgent(t *testing.T) { + for _, agent := range []string{"", "writer"} { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + c := New(Config{BaseURL: srv.URL, Org: "acme", Namespace: "support"}) + _, err := c.Memory.History(context.Background(), "plan", WithInput(MemoryHistoryInput{ + Agent: agent, SessionID: Ptr("session-1"), + })) + if err != nil { + t.Fatal(err) + } + want := map[string]any{ + "org": "acme", "namespace": "support", "memory_key": "plan", "session_id": "session-1", + } + if agent != "" { + want["agent"] = agent + } + assertBody(t, rec, want) + } +} + +func TestExtractionPolicyDoesNotDefaultTargetNamespace(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + c := newClient(srv) + ctx := context.Background() + if _, err := c.ExtractionPolicy.Clear(ctx, "namespace"); err == nil || rec.path != "" { + t.Fatalf("targetless policy clear: error = %v, request = %v", err, rec.body) + } + if _, err := c.ExtractionPolicy.Clear(ctx, "org"); err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{"org": "acme", "scope": "org"}) + if _, err := c.ExtractionPolicy.Clear(ctx, "namespace", + WithInput(ExtractionPolicyClearInput{Namespace: Ptr("ops")})); err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{"org": "acme", "scope": "namespace", "namespace": "ops"}) +} + +func TestNamespaceRegisterRequiresExplicitNamespace(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + c := newClient(srv) + ctx := context.Background() + in := NamespaceRegisterInput{OwnerEmail: "owner@example.com"} + if _, err := c.Namespace.Register(ctx, in); err == nil || rec.path != "" { + t.Fatalf("targetless registration: error = %v, request = %v", err, rec.body) + } + in.Namespace = "ops" + if _, err := c.Namespace.Register(ctx, in); err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "ops", "owner_email": "owner@example.com", + }) +} + +func TestConflictsListRoundTripsUnsignedCursor(t *testing.T) { + const cursor = "9223372036854775809" + requests := make(chan map[string]json.RawMessage, 2) + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + var in map[string]json.RawMessage + if err := json.NewDecoder(r.Body).Decode(&in); err != nil { + t.Errorf("decode request: %v", err) + } + requests <- in + _, _ = io.WriteString(w, `{"rows":[{"version":`+cursor+`}],"next_before_version":`+cursor+`}`) + })) + defer srv.Close() + c := newClient(srv) + ctx := context.Background() + page, err := c.Conflicts.List(ctx) + if err != nil { + t.Fatal(err) + } + if len(page.Rows) != 1 || page.Rows[0].Version == nil || len(page.NextBeforeVersion) == 0 { + t.Fatalf("missing version or cursor: %+v", page) + } + version, err := json.Marshal(page.Rows[0].Version) + if err != nil || string(version) != cursor { + t.Fatalf("decoded row version = %s, %v; want %s", version, err, cursor) + } + _, err = c.Conflicts.List(ctx, WithInput(ConflictsListInput{BeforeVersion: page.NextBeforeVersion})) + if err != nil { + t.Fatal(err) + } + if in := <-requests; in["before_version"] != nil { + t.Fatalf("first page sent cursor: %s", in["before_version"]) + } + if in := <-requests; string(in["before_version"]) != cursor { + t.Fatalf("next page sent cursor %s, want %s", in["before_version"], cursor) + } +} + +func TestContextPackSendsQueryAndOptionsWithClientIdentity(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{"rendered":"deploy checklist","token_budget":800}`, nil) + out, err := newClient(srv).Context.Pack(context.Background(), "how to deploy", WithPackTokenBudget(800)) + if err != nil || out.Rendered != "deploy checklist" { + t.Fatalf("Pack = (%v, %v)", out, err) + } + if rec.path != "/v1/context.pack" || rec.header.Get("Authorization") != "Bearer tok" { + t.Fatalf("Pack path = %q, headers = %v", rec.path, rec.header) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "support", "agent": "assistant", + "query": "how to deploy", "token_budget": float64(800), + }) +} + +func TestWorkingMemoryGetUsesDefaultBlockWhenOmitted(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{"found":true,"block_key":"scratchpad","content":"check logs"}`, nil) + out, err := newClient(srv).WorkingMemory.Get(context.Background()) + if err != nil || !out.Found || out.Content == nil || *out.Content != "check logs" { + t.Fatalf("Get = (%v, %v)", out, err) + } + assertBody(t, rec, map[string]any{"org": "acme", "namespace": "support", "agent": "assistant"}) +} + +func TestKnowledgeAddUsesTypedInputWithoutMutatingIt(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{"doc_id":"d1"}`, nil) + c := newClient(srv) + in := KnowledgeAddInput{ + Namespace: "ops", + SourceURI: "https://example.com/runbook", + Content: "deploy checklist", + Tags: Ptr([]string{}), + } + out, err := c.Knowledge.Add(context.Background(), in) + if err != nil || out.DocID != "d1" { + t.Fatalf("Add = (%v, %v)", out, err) + } + if rec.path != "/v1/knowledge.add" || in.Org != "" || in.Agent != nil { + t.Fatalf("Add path = %q, original input = %+v", rec.path, in) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "ops", "agent": "assistant", + "source_uri": "https://example.com/runbook", "content": "deploy checklist", "tags": []any{}, + }) +} + +func TestKnowledgeSearchDoesNotSendUnsupportedAgentOrLoseExplicitNull(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{"results":[]}`, nil) + _, err := newClient(srv).Knowledge.Search(context.Background(), "deploy", + WithInput(KnowledgeSearchInput{SinceSeconds: Null[int64]()}), WithKnowledgeSearchTopK(4)) + if err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "support", "query": "deploy", + "since_seconds": nil, "top_k": float64(4), + }) +} + +func TestGeneratedMethodPreservesExplicitFalseAndNamespaceOverride(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{"found":false}`, nil) + _, err := newClient(srv).Knowledge.Get(context.Background(), "https://example.com/runbook", + WithInput(KnowledgeGetInput{Namespace: "ops", IncludeSuperseded: Ptr(false)})) + if err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{ + "org": "acme", "namespace": "ops", "source_uri": "https://example.com/runbook", + "include_superseded": false, + }) +} + +func TestMemoryConditionalWritesPreservePrecondition(t *testing.T) { + const previousHash = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + const value = `"revised plan"` + for _, tc := range []struct { + op string + call func(context.Context, *Client) error + body map[string]any + }{ + { + op: "memory.set", + call: func(ctx context.Context, c *Client) error { + _, err := c.Memory.Set(ctx, MemorySetInput{ + MemoryKey: "plan", Value: json.RawMessage(value), IfMatchSHA256: Ptr(previousHash), + }) + return err + }, + body: map[string]any{ + "org": "acme", "namespace": "support", "agent": "assistant", + "memory_key": "plan", "value": "revised plan", "if_match_sha256": previousHash, + }, + }, + { + op: "memory.update_by_id", + call: func(ctx context.Context, c *Client) error { + _, err := c.Memory.UpdateByID(ctx, "m-1", WithInput(MemoryUpdateByIDInput{ + Value: json.RawMessage(value), IfMatchSHA256: Ptr(previousHash), + })) + return err + }, + body: map[string]any{ + "org": "acme", "memory_id": "m-1", "value": "revised plan", "if_match_sha256": previousHash, + }, + }, + } { + t.Run(tc.op, func(t *testing.T) { + srv, rec := fakeServer(t, http.StatusConflict, + `{"detail":{"code":"PRECONDITION_FAILED","message":"content changed","current_sha256":"new-hash"}}`, nil) + err := tc.call(context.Background(), newClient(srv)) + var apiErr *Error + if !errors.As(err, &apiErr) || apiErr.Status != http.StatusConflict || + apiErr.Code != "PRECONDITION_FAILED" || apiErr.Op != tc.op || apiErr.Retryable { + t.Fatalf("error = %#v, want non-retryable 409 PRECONDITION_FAILED for %s", err, tc.op) + } + if rec.path != "/v1/"+tc.op { + t.Errorf("path = %q, want /v1/%s", rec.path, tc.op) + } + assertBody(t, rec, tc.body) + }) + } +} + +func TestLearningsQualityNullableNamespace(t *testing.T) { + for _, tc := range []struct { + name string + in LearningsQualityInput + want any + }{ + {name: "omitted uses client default", want: "support"}, + {name: "explicit null stays null", in: LearningsQualityInput{Namespace: Null[string]()}}, + {name: "explicit value overrides default", in: LearningsQualityInput{Namespace: Some("ops")}, want: "ops"}, + } { + t.Run(tc.name, func(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + _, err := newClient(srv).Learnings.Quality(context.Background(), WithInput(tc.in)) + if err != nil { + t.Fatal(err) + } + assertBody(t, rec, map[string]any{"org": "acme", "namespace": tc.want}) + }) + } +} + +func TestContextPackQueryPrecedence(t *testing.T) { + for _, tc := range []struct { + name string + query string + opts []Option[ContextPackInput] + want *string + }{ + { + name: "argument overrides option", + query: "positional query", + opts: []Option[ContextPackInput]{WithInput(ContextPackInput{Query: Ptr("option query")})}, + want: Ptr("positional query"), + }, + { + name: "empty argument keeps option", + opts: []Option[ContextPackInput]{WithInput(ContextPackInput{Query: Ptr("option query")})}, + want: Ptr("option query"), + }, + {name: "empty argument without option omits query"}, + } { + t.Run(tc.name, func(t *testing.T) { + srv, rec := fakeServer(t, http.StatusOK, `{}`, nil) + _, err := newClient(srv).Context.Pack(context.Background(), tc.query, tc.opts...) + if err != nil { + t.Fatal(err) + } + want := map[string]any{"org": "acme", "namespace": "support", "agent": "assistant"} + if tc.want != nil { + want["query"] = *tc.want + } + assertBody(t, rec, want) + }) + } +} diff --git a/sdk/go/options.go b/sdk/go/options.go new file mode 100644 index 00000000000..26b28fc30fc --- /dev/null +++ b/sdk/go/options.go @@ -0,0 +1,63 @@ +package loom + +import ( + "context" + "fmt" + "strings" + + "github.com/ClickHouse/loom/sdk/go/wire" +) + +func requireNamedNamespace(op, namespace string) error { + switch strings.TrimSpace(namespace) { + case "", "-", "*": + return fmt.Errorf("%s: namespace must be named explicitly", op) + } + return nil +} + +func requirePolicyNamespace(op, scope string, namespace *string) error { + if scope != "namespace" { + return nil + } + if namespace == nil { + return requireNamedNamespace(op, "") + } + return requireNamedNamespace(op, *namespace) +} + +// Option sets fields on an operation's input. Options apply in order. +type Option[T any] func(*T) + +// WithInput starts from a typed input. It replaces fields set by earlier options. +// A positional argument takes precedence unless the method treats it as omitted. +func WithInput[T any](input T) Option[T] { + return func(dst *T) { *dst = input } +} + +// Ptr marks an optional non-nullable field as present, even when value is zero. +func Ptr[T any](value T) *T { return &value } + +// Some marks an optional nullable field as present with a value. +func Some[T any](value T) wire.Optional[T] { return wire.Some(value) } + +// Null marks an optional nullable field as explicitly null. +func Null[T any]() wire.Optional[T] { return wire.Null[T]() } + +func applyOptions[T any](opts []Option[T]) T { + var input T + for _, opt := range opts { + if opt != nil { + opt(&input) + } + } + return input +} + +func callOperation[T any](client *clientTransport, ctx context.Context, op string, in any) (*T, error) { + var out T + if err := client.call(ctx, op, in, &out); err != nil { + return nil, err + } + return &out, nil +} diff --git a/sdk/go/snapshot_test.go b/sdk/go/snapshot_test.go new file mode 100644 index 00000000000..f74bd8a97f5 --- /dev/null +++ b/sdk/go/snapshot_test.go @@ -0,0 +1,70 @@ +package loom_test + +import ( + "context" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "reflect" + "testing" + + loom "github.com/ClickHouse/loom/sdk/go" +) + +func TestNamespaceSnapshotCanBeRestoredAsTypedPayload(t *testing.T) { + const snapshotJSON = `{"snapshot_id":"12345678-1234-4234-8234-123456789abc", + "org":"acme","source_namespace":"support","created_at":"2026-01-01T00:00:00Z", + "memory_count":0,"type_count":0,"grant_count":0,"audit_tail_count":0, + "include_embeddings":false,"memories":[],"types":[],"grants":[],"audit_tail":[]}` + mux := http.NewServeMux() + mux.HandleFunc("/v1/namespace.snapshot", func(w http.ResponseWriter, _ *http.Request) { + var response map[string]json.RawMessage + if err := json.Unmarshal([]byte(snapshotJSON), &response); err != nil { + t.Error(err) + w.WriteHeader(http.StatusInternalServerError) + return + } + response["ignored_args"] = json.RawMessage(`["extra"]`) + _ = json.NewEncoder(w).Encode(response) + }) + requests := make(chan json.RawMessage, 1) + mux.HandleFunc("/v1/namespace.restore", func(w http.ResponseWriter, r *http.Request) { + var body json.RawMessage + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + t.Error(err) + w.WriteHeader(http.StatusBadRequest) + return + } + requests <- body + _, _ = io.WriteString(w, `{"restored":true}`) + }) + srv := httptest.NewServer(mux) + defer srv.Close() + c := loom.New(loom.Config{BaseURL: srv.URL, Org: "acme", Namespace: "support"}) + ctx := context.Background() + snapshot, err := c.Namespace.Snapshot(ctx) + if err != nil { + t.Fatal(err) + } + if snapshot.IgnoredArgs == nil || len(*snapshot.IgnoredArgs) != 1 { + t.Fatalf("missing response feedback: %v", snapshot.IgnoredArgs) + } + restored, err := c.Namespace.Restore(ctx, loom.NamespaceRestoreInput{ + TargetNamespace: "archive", + Payload: snapshot.NamespaceSnapshotPayload, + }) + if err != nil || !restored.Restored { + t.Fatalf("restore: %v, %v", restored, err) + } + var got, want any + if err := json.Unmarshal(<-requests, &got); err != nil { + t.Fatal(err) + } + if err := json.Unmarshal([]byte(`{"org":"acme","target_namespace":"archive","payload":`+snapshotJSON+`}`), &want); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, want) { + t.Fatalf("restore body = %v, want %v", got, want) + } +} diff --git a/sdk/go/wire/models.gen.go b/sdk/go/wire/models.gen.go new file mode 100644 index 00000000000..f515cfeb4d6 --- /dev/null +++ b/sdk/go/wire/models.gen.go @@ -0,0 +1,12772 @@ +// Code generated by scripts/codegen/sdk_go_gen.py; DO NOT EDIT. +// Registry model schema SHA-256: de827ca9c57963620b38d2e67b4367f0b0be4c68bb187b9a0d3c6a14bcf035ac + +// Package wire contains the Go requests and responses for Loom operations. +package wire + +import "encoding/json" + +// AdminUsersInput is the request to admin.users. +type AdminUsersInput struct { + Org string `json:"org"` + Namespace Optional[string] `json:"namespace,omitempty"` + IncludeServiceAccounts *bool `json:"include_service_accounts,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// AdminUsersOutput is the response from admin.users. +type AdminUsersOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Users []UserSummary `json:"users"` + Total int64 `json:"total"` + TotalPendingElevations *int64 `json:"total_pending_elevations,omitempty"` + TotalActiveLast7D *int64 `json:"total_active_last_7d,omitempty"` + PlatformAdminsConfigured []string `json:"platform_admins_configured"` +} + +// AgentsConnectedInput is the request to agents.connected. +type AgentsConnectedInput struct { + Org string `json:"org"` + Namespace Optional[string] `json:"namespace,omitempty"` + WindowHours *int64 `json:"window_hours,omitempty"` + CountOnly *bool `json:"count_only,omitempty"` +} + +// AgentsConnectedOutput is the response from agents.connected. +type AgentsConnectedOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []ConnectedAgent `json:"rows"` + WindowHours int64 `json:"window_hours"` + NewCount Optional[int64] `json:"new_count,omitempty"` +} + +// AggregateRow is a model used by Loom operations. +type AggregateRow struct { + Group *map[string]string `json:"group,omitempty"` + Metric float64 `json:"metric"` +} + +// AllowlistRow is a model used by Loom operations. +type AllowlistRow struct { + MemoryKeyA string `json:"memory_key_a"` + MemoryKeyB string `json:"memory_key_b"` + AllowedAt string `json:"allowed_at"` + AllowedBy string `json:"allowed_by"` + Reason string `json:"reason"` +} + +// AnalysisColumn is a model used by Loom operations. +type AnalysisColumn struct { + Name string `json:"name"` + Type string `json:"type"` +} + +// AppendBatchEntry is a model used by Loom operations. +type AppendBatchEntry struct { + MemoryKey string `json:"memory_key"` + Value json.RawMessage `json:"value"` + SourceTrace *string `json:"source_trace,omitempty"` + SourceClass Optional[string] `json:"source_class,omitempty"` +} + +// ApplyDemote is a model used by Loom operations. +type ApplyDemote struct { + ConfidenceDelta Optional[float64] `json:"confidence_delta,omitempty"` + ConfidenceFactor Optional[float64] `json:"confidence_factor,omitempty"` + Floor *float64 `json:"floor,omitempty"` +} + +// ApplyExpire is a model used by Loom operations. +type ApplyExpire struct { + TTLSeconds Optional[int64] `json:"ttl_seconds,omitempty"` + Until Optional[string] `json:"until,omitempty"` + OnExpire *string `json:"on_expire,omitempty"` +} + +// ApplyFilter is a model used by Loom operations. +type ApplyFilter struct { + MemoryType Optional[string] `json:"memory_type,omitempty"` + TagsAny *[]string `json:"tags_any,omitempty"` + TagsAll *[]string `json:"tags_all,omitempty"` + KeyPrefix Optional[string] `json:"key_prefix,omitempty"` + CreatedBefore Optional[string] `json:"created_before,omitempty"` + CreatedAfter Optional[string] `json:"created_after,omitempty"` + ConfidenceLte Optional[float64] `json:"confidence_lte,omitempty"` + SourceTrace Optional[string] `json:"source_trace,omitempty"` +} + +// ApplyLabel is a model used by Loom operations. +type ApplyLabel struct { + Tags []string `json:"tags"` + Mode *string `json:"mode,omitempty"` +} + +// ApplyLock is a model used by Loom operations. +type ApplyLock struct { + Mode *string `json:"mode,omitempty"` + Until Optional[string] `json:"until,omitempty"` + TTLSeconds Optional[int64] `json:"ttl_seconds,omitempty"` +} + +// ApplyRow is a model used by Loom operations. +type ApplyRow struct { + MemoryKey string `json:"memory_key"` + MemoryID *string `json:"memory_id,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Status string `json:"status"` + Version Optional[int64] `json:"version,omitempty"` + Detail *string `json:"detail,omitempty"` +} + +// ApplySearch is a model used by Loom operations. +type ApplySearch struct { + Query string `json:"query"` + MinScore Optional[float64] `json:"min_score,omitempty"` +} + +// ApplyTarget is a model used by Loom operations. +type ApplyTarget struct { + Keys Optional[[]string] `json:"keys,omitempty"` + Filter Optional[ApplyFilter] `json:"filter,omitempty"` + Search Optional[ApplySearch] `json:"search,omitempty"` +} + +// AssistantAskInput is the request to assistant.ask. +type AssistantAskInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Question string `json:"question"` + History *[]AssistantMessage `json:"history,omitempty"` +} + +// AssistantAskOutput is the response from assistant.ask. +type AssistantAskOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Answer *string `json:"answer,omitempty"` + RunID *string `json:"run_id,omitempty"` + Model *string `json:"model,omitempty"` + Citations *[]AssistantCitation `json:"citations,omitempty"` + Support *string `json:"support,omitempty"` + UnknownNames *[]string `json:"unknown_names,omitempty"` +} + +// AssistantCitation is a model used by Loom operations. +type AssistantCitation struct { + Kind string `json:"kind"` + Text string `json:"text"` + Verified *bool `json:"verified,omitempty"` + Reason *string `json:"reason,omitempty"` + Ref *string `json:"ref,omitempty"` + Anchor *string `json:"anchor,omitempty"` +} + +// AssistantMessage is a model used by Loom operations. +type AssistantMessage struct { + Role string `json:"role"` + Content string `json:"content"` +} + +// AuditListInput is the request to audit.list. +type AuditListInput struct { + Org string `json:"org"` + Namespace Optional[string] `json:"namespace,omitempty"` + EventType Optional[string] `json:"event_type,omitempty"` + Since Optional[string] `json:"since,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Cursor Optional[string] `json:"cursor,omitempty"` + Fields Optional[[]string] `json:"fields,omitempty"` +} + +// AuditListOutput is the response from audit.list. +type AuditListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []AuditListRow `json:"rows"` + NextCursor Optional[string] `json:"next_cursor,omitempty"` +} + +// AuditListRow is a model used by Loom operations. +type AuditListRow struct { + Ts *string `json:"ts,omitempty"` + EventType *string `json:"event_type,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Actor *string `json:"actor,omitempty"` + Subject *string `json:"subject,omitempty"` + RequestID *string `json:"request_id,omitempty"` + RowHash *string `json:"row_hash,omitempty"` +} + +// BacklinkDigest is a model used by Loom operations. +type BacklinkDigest struct { + SessionID string `json:"session_id"` + Date *string `json:"date,omitempty"` +} + +// BacklinkEdge is a model used by Loom operations. +type BacklinkEdge struct { + MemoryKey string `json:"memory_key"` + Relation *string `json:"relation,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` +} + +// BacklinkRelated is a model used by Loom operations. +type BacklinkRelated struct { + MemoryKey string `json:"memory_key"` + SharedEntities *[]string `json:"shared_entities,omitempty"` +} + +// BacklinkVersion is a model used by Loom operations. +type BacklinkVersion struct { + Version int64 `json:"version"` + Status *string `json:"status,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` +} + +// BlacklistAddInput is the request to blacklist.add. +type BlacklistAddInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Pattern string `json:"pattern"` + PatternType *string `json:"pattern_type,omitempty"` + Scope *string `json:"scope,omitempty"` + Reason *string `json:"reason,omitempty"` + CreatedBy *string `json:"created_by,omitempty"` + Sweep *bool `json:"sweep,omitempty"` +} + +// BlacklistAddOutput is the response from blacklist.add. +type BlacklistAddOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + PatternID string `json:"pattern_id"` + CreatedAt string `json:"created_at"` + Swept *int64 `json:"swept,omitempty"` + SweptTruncated *bool `json:"swept_truncated,omitempty"` + SweepError *string `json:"sweep_error,omitempty"` +} + +// BlacklistListInput is the request to blacklist.list. +type BlacklistListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Scope Optional[string] `json:"scope,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// BlacklistListOutput is the response from blacklist.list. +type BlacklistListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []BlacklistRow `json:"rows"` +} + +// BlacklistRemoveInput is the request to blacklist.remove. +type BlacklistRemoveInput struct { + Org string `json:"org"` + PatternID string `json:"pattern_id"` + RemovedBy *string `json:"removed_by,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// BlacklistRemoveOutput is the response from blacklist.remove. +type BlacklistRemoveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Removed bool `json:"removed"` + RemovedAt Optional[string] `json:"removed_at,omitempty"` +} + +// BlacklistRow is a model used by Loom operations. +type BlacklistRow struct { + PatternID string `json:"pattern_id"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Pattern string `json:"pattern"` + PatternType string `json:"pattern_type"` + Scope string `json:"scope"` + Reason string `json:"reason"` + CreatedBy string `json:"created_by"` + HitCount int64 `json:"hit_count"` + LastHitAt Optional[string] `json:"last_hit_at,omitempty"` + CreatedAt string `json:"created_at"` +} + +// BlacklistSweepInput is the request to blacklist.sweep. +type BlacklistSweepInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + PatternID string `json:"pattern_id"` +} + +// BlacklistSweepOutput is the response from blacklist.sweep. +type BlacklistSweepOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + PatternID string `json:"pattern_id"` + Matched int64 `json:"matched"` + Tombstoned int64 `json:"tombstoned"` + Truncated bool `json:"truncated"` + Error *string `json:"error,omitempty"` +} + +// BriefCheckout is a model used by Loom operations. +type BriefCheckout struct { + Dirty Optional[bool] `json:"dirty,omitempty"` + HeadInRemoteRefs Optional[bool] `json:"head_in_remote_refs,omitempty"` +} + +// BriefDeadEnd is a model used by Loom operations. +type BriefDeadEnd struct { + Tried *string `json:"tried,omitempty"` + WhyNot *string `json:"why_not,omitempty"` +} + +// BriefDecision is a model used by Loom operations. +type BriefDecision struct { + What *string `json:"what,omitempty"` + Why *string `json:"why,omitempty"` +} + +// BriefDone is a model used by Loom operations. +type BriefDone struct { + What *string `json:"what,omitempty"` + Ref *string `json:"ref,omitempty"` +} + +// BriefEvent is a model used by Loom operations. +type BriefEvent struct { + Kind string `json:"kind"` + Text *string `json:"text,omitempty"` + Path *string `json:"path,omitempty"` + Ts *string `json:"ts,omitempty"` + Ref *string `json:"ref,omitempty"` +} + +// BriefEvidence is a model used by Loom operations. +type BriefEvidence struct { + MemoryKey string `json:"memory_key"` + Source *string `json:"source,omitempty"` + SourceClass *string `json:"source_class,omitempty"` + Verified *bool `json:"verified,omitempty"` + When *string `json:"when,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Excerpt *string `json:"excerpt,omitempty"` +} + +// BriefFile is a model used by Loom operations. +type BriefFile struct { + Path *string `json:"path,omitempty"` + Role *string `json:"role,omitempty"` +} + +// BriefSections is a model used by Loom operations. +type BriefSections struct { + Goal *string `json:"goal,omitempty"` + Status *string `json:"status,omitempty"` + Verification *string `json:"verification,omitempty"` + Decisions *[]BriefDecision `json:"decisions,omitempty"` + DeadEnds *[]BriefDeadEnd `json:"dead_ends,omitempty"` + Done *[]BriefDone `json:"done,omitempty"` + OpenQuestions *[]string `json:"open_questions,omitempty"` + NextSteps *[]string `json:"next_steps,omitempty"` + Files *[]BriefFile `json:"files,omitempty"` + Constraints *[]string `json:"constraints,omitempty"` + Pointers *[]string `json:"pointers,omitempty"` + ClientSummary *string `json:"client_summary,omitempty"` + ClientSummaryAt *string `json:"client_summary_at,omitempty"` +} + +// BrowseEntry is a model used by Loom operations. +type BrowseEntry struct { + Namespace string `json:"namespace"` + Kind *string `json:"kind,omitempty"` + Description string `json:"description"` + OwnerEmail string `json:"owner_email"` + MemberCount int64 `json:"member_count"` + RequiresApproval *bool `json:"requires_approval,omitempty"` + CreatedAt string `json:"created_at"` + JoinPolicy *string `json:"join_policy,omitempty"` + Visibility *string `json:"visibility,omitempty"` + MyStatus *string `json:"my_status,omitempty"` + MyRole *string `json:"my_role,omitempty"` + Repo *string `json:"repo,omitempty"` + Branch *string `json:"branch,omitempty"` + GuideRevision *int64 `json:"guide_revision,omitempty"` + GuideSummary *string `json:"guide_summary,omitempty"` +} + +// BudgetStatusInput is a model used by Loom operations. +type BudgetStatusInput struct { + Org string `json:"org"` + Namespace Optional[string] `json:"namespace,omitempty"` + UserID Optional[string] `json:"user_id,omitempty"` +} + +// BudgetStatusOutput is a model used by Loom operations. +type BudgetStatusOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Namespace string `json:"namespace"` + UserID Optional[string] `json:"user_id,omitempty"` + Spent24HUsd *float64 `json:"spent_24h_usd"` + CapUsd float64 `json:"cap_usd"` + CapSource string `json:"cap_source"` + OverCap bool `json:"over_cap"` + NamespaceOverCap Optional[bool] `json:"namespace_over_cap,omitempty"` + PctOfCap Optional[float64] `json:"pct_of_cap,omitempty"` + NamespacesWithSpend *int64 `json:"namespaces_with_spend,omitempty"` +} + +// BulkSetEntry is a model used by Loom operations. +type BulkSetEntry struct { + MemoryKey string `json:"memory_key"` + MemoryType *string `json:"memory_type,omitempty"` + Value json.RawMessage `json:"value"` + Confidence *float64 `json:"confidence,omitempty"` + SourceTrace *string `json:"source_trace,omitempty"` + SourceClass Optional[string] `json:"source_class,omitempty"` + TTLSeconds Optional[int64] `json:"ttl_seconds,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Entities *[]string `json:"entities,omitempty"` + Relations *[][3]string `json:"relations,omitempty"` + Derived *[]map[string]json.RawMessage `json:"derived,omitempty"` + TemporalAnchor Optional[string] `json:"temporal_anchor,omitempty"` + TemporalConfidence *float64 `json:"temporal_confidence,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + ValidTo Optional[string] `json:"valid_to,omitempty"` + CharLimit Optional[int64] `json:"char_limit,omitempty"` + Pinned *bool `json:"pinned,omitempty"` + Files *[]string `json:"files,omitempty"` + Concepts *[]string `json:"concepts,omitempty"` + Topics *[]string `json:"topics,omitempty"` + QuestionTopic *string `json:"question_topic,omitempty"` + Evidence *string `json:"evidence,omitempty"` + Grounding *string `json:"grounding,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` +} + +// BulkSetResult is a model used by Loom operations. +type BulkSetResult struct { + MemoryKey string `json:"memory_key"` + Version int64 `json:"version"` + MemoryID *string `json:"memory_id,omitempty"` + ConflictVerdict *string `json:"conflict_verdict,omitempty"` + Peers *[]MemorySetPeer `json:"peers,omitempty"` + Next *string `json:"next,omitempty"` + PinnedBlockerID *string `json:"pinned_blocker_id,omitempty"` +} + +// CalibrationGetInput is the request to calibration.get. +type CalibrationGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// CalibrationGetOutput is the response from calibration.get. +type CalibrationGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Source string `json:"source"` + EmbedderModel *string `json:"embedder_model,omitempty"` + NoiseFloor float64 `json:"noise_floor"` + RerankSkipAbove float64 `json:"rerank_skip_above"` + HydeFallbackThreshold float64 `json:"hyde_fallback_threshold"` + QueryRewriteThreshold float64 `json:"query_rewrite_threshold"` + AbstainThreshold float64 `json:"abstain_threshold"` + ConflictThreshold float64 `json:"conflict_threshold"` + DuplicateThreshold float64 `json:"duplicate_threshold"` + SimilarP10 *float64 `json:"similar_p10,omitempty"` + SimilarP25 *float64 `json:"similar_p25,omitempty"` + SimilarP50 *float64 `json:"similar_p50,omitempty"` + SimilarP75 *float64 `json:"similar_p75,omitempty"` + DistractorP50 *float64 `json:"distractor_p50,omitempty"` + DistractorP90 *float64 `json:"distractor_p90,omitempty"` + SimilarPairsN *int64 `json:"similar_pairs_n,omitempty"` + DistractorPairsN *int64 `json:"distractor_pairs_n,omitempty"` +} + +// CatalogColumn is a model used by Loom operations. +type CatalogColumn struct { + Name string `json:"name"` + Type string `json:"type"` + Comment string `json:"comment"` +} + +// CatalogTable is a model used by Loom operations. +type CatalogTable struct { + Name string `json:"name"` + Comment string `json:"comment"` + Notes string `json:"notes"` + Columns []CatalogColumn `json:"columns"` +} + +// CategoryEntry is a model used by Loom operations. +type CategoryEntry struct { + CategoryID string `json:"category_id"` + Name string `json:"name"` + Description string `json:"description"` + ItemCount int64 `json:"item_count"` +} + +// CategoryHit is a model used by Loom operations. +type CategoryHit struct { + CategoryID string `json:"category_id"` + Name string `json:"name"` + Description string `json:"description"` + SummaryExcerpt string `json:"summary_excerpt"` + Distance float64 `json:"distance"` + Similarity float64 `json:"similarity"` +} + +// ChainNodeRow is a model used by Loom operations. +type ChainNodeRow struct { + MemoryKey string `json:"memory_key"` + Hop int64 `json:"hop"` + Relation string `json:"relation"` + Direction string `json:"direction"` + Via string `json:"via"` + Decision Optional[DecisionRow] `json:"decision,omitempty"` +} + +// ChangedFile is a model used by Loom operations. +type ChangedFile struct { + Path string `json:"path"` + ModifiedAt string `json:"modified_at"` +} + +// ChunkModelCount is a model used by Loom operations. +type ChunkModelCount struct { + Model string `json:"model"` + Live int64 `json:"live"` + Embedded int64 `json:"embedded"` +} + +// ChunkStats is a model used by Loom operations. +type ChunkStats struct { + Size int64 `json:"size"` + Stride int64 `json:"stride"` + Chunks int64 `json:"chunks"` + MinChars int64 `json:"min_chars"` + MedianChars int64 `json:"median_chars"` + P90Chars int64 `json:"p90_chars"` + MaxChars int64 `json:"max_chars"` + Sections int64 `json:"sections"` + SectionsCut int64 `json:"sections_cut"` + MaxInputTokens int64 `json:"max_input_tokens"` + OverInputLimit Optional[int64] `json:"over_input_limit,omitempty"` +} + +// ChunkTotals is a model used by Loom operations. +type ChunkTotals struct { + EmbedderModel *string `json:"embedder_model,omitempty"` + Live Optional[int64] `json:"live,omitempty"` + Searchable Optional[int64] `json:"searchable,omitempty"` + Unembedded Optional[int64] `json:"unembedded,omitempty"` + ByModel *[]ChunkModelCount `json:"by_model,omitempty"` +} + +// ChunkingPreview is a model used by Loom operations. +type ChunkingPreview struct { + Before ChunkStats `json:"before"` + After ChunkStats `json:"after"` +} + +// ChunkingSample is a model used by Loom operations. +type ChunkingSample struct { + Cap int64 `json:"cap"` + Population Optional[int64] `json:"population,omitempty"` + Documents int64 `json:"documents"` + Unread int64 `json:"unread"` + LoadCap int64 `json:"load_cap"` + EmbedderModel string `json:"embedder_model"` + InputTokenLimit Optional[int64] `json:"input_token_limit,omitempty"` + Current ChunkStats `json:"current"` +} + +// CitedChunk is a model used by Loom operations. +type CitedChunk struct { + SourceURI string `json:"source_uri"` + ChunkIdx int64 `json:"chunk_idx"` + Revision *int64 `json:"revision,omitempty"` + Locator Optional[map[string]json.RawMessage] `json:"locator,omitempty"` +} + +// CodeAskInput is the request to code.ask. +type CodeAskInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Question string `json:"question"` + Synthesize *bool `json:"synthesize,omitempty"` + Rerank *string `json:"rerank,omitempty"` + NoCache *bool `json:"no_cache,omitempty"` + TokenBudget Optional[int64] `json:"token_budget,omitempty"` +} + +// CodeAskOutput is the response from code.ask. +type CodeAskOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Answer *string `json:"answer,omitempty"` + Partial *bool `json:"partial,omitempty"` + PartialReason *string `json:"partial_reason,omitempty"` + Note *string `json:"note,omitempty"` + Coverage *string `json:"coverage,omitempty"` + Citations *[]map[string]json.RawMessage `json:"citations,omitempty"` + Source string `json:"source"` + CacheSimilarity *float64 `json:"cache_similarity,omitempty"` + Cache *string `json:"cache,omitempty"` + CacheSavedMs *int64 `json:"cache_saved_ms,omitempty"` + CacheSavedUsd *float64 `json:"cache_saved_usd,omitempty"` + Abstain *bool `json:"abstain,omitempty"` + AbstainReason *string `json:"abstain_reason,omitempty"` + RetrievalConfidence *float64 `json:"retrieval_confidence,omitempty"` + TokensReturned *int64 `json:"tokens_returned,omitempty"` + ContextTokens *int64 `json:"context_tokens,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` + AsOf *map[string]json.RawMessage `json:"as_of,omitempty"` +} + +// CodeBackportGapInput is the request to code.backport_gap. +type CodeBackportGapInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + IssueNumber *int64 `json:"issue_number,omitempty"` + Branches *[]string `json:"branches,omitempty"` + MaxSymbols *int64 `json:"max_symbols,omitempty"` + Exact *bool `json:"exact,omitempty"` + History *bool `json:"history,omitempty"` +} + +// CodeBackportGapOutput is the response from code.backport_gap. +type CodeBackportGapOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + SkippedBranches *[]map[string]string `json:"skipped_branches,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Causes *[]string `json:"causes,omitempty"` + Fix *map[string]json.RawMessage `json:"fix,omitempty"` + Issue *map[string]json.RawMessage `json:"issue,omitempty"` + Fixes *[]map[string]json.RawMessage `json:"fixes,omitempty"` + Symbols *[]string `json:"symbols,omitempty"` + Files *[]string `json:"files,omitempty"` + Branches *[]map[string]json.RawMessage `json:"branches,omitempty"` + Summary *map[string][]string `json:"summary,omitempty"` + FixCandidate Optional[map[string]json.RawMessage] `json:"fix_candidate,omitempty"` + TrackerNamespace *string `json:"tracker_namespace,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` + Ms *int64 `json:"ms,omitempty"` + StageMs *map[string]int64 `json:"stage_ms,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeBackportGapsInput is the request to code.backport_gaps. +type CodeBackportGapsInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Branch *string `json:"branch,omitempty"` + WantedOnly *bool `json:"wanted_only,omitempty"` + Days *int64 `json:"days,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// CodeBackportGapsOutput is the response from code.backport_gaps. +type CodeBackportGapsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + SkippedBranches *[]map[string]string `json:"skipped_branches,omitempty"` + Branch *string `json:"branch,omitempty"` + BranchNamespace *string `json:"branch_namespace,omitempty"` + Branches *[]string `json:"branches,omitempty"` + Rows *[]map[string]json.RawMessage `json:"rows,omitempty"` + Counts *map[string]int64 `json:"counts,omitempty"` + CountsByBranch *map[string]map[string]int64 `json:"counts_by_branch,omitempty"` + Fixes *int64 `json:"fixes,omitempty"` + WantedOnly *bool `json:"wanted_only,omitempty"` + Since *string `json:"since,omitempty"` + Computed *map[string]json.RawMessage `json:"computed,omitempty"` + Stale *bool `json:"stale,omitempty"` + Ms *int64 `json:"ms,omitempty"` +} + +// CodeBisectCandidatesInput is the request to code.bisect_candidates. +type CodeBisectCandidatesInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Symbols *[]string `json:"symbols,omitempty"` + Paths *[]string `json:"paths,omitempty"` + Patterns *[]string `json:"patterns,omitempty"` + IssueNumber *int64 `json:"issue_number,omitempty"` + Text *string `json:"text,omitempty"` + Rerank *bool `json:"rerank,omitempty"` + DeadlineMs Optional[int64] `json:"deadline_ms,omitempty"` + FixPr *int64 `json:"fix_pr,omitempty"` + BadVersion *string `json:"bad_version,omitempty"` + Before *string `json:"before,omitempty"` + After *string `json:"after,omitempty"` + BadSHA *string `json:"bad_sha,omitempty"` + GoodVersion *string `json:"good_version,omitempty"` + WidenToDirectories *bool `json:"widen_to_directories,omitempty"` + Wideners *[]string `json:"wideners,omitempty"` + Rescan *bool `json:"rescan,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Marks *bool `json:"marks,omitempty"` +} + +// CodeBisectCandidatesOutput is the response from code.bisect_candidates. +type CodeBisectCandidatesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Verdict *string `json:"verdict,omitempty"` + CandidatesFrom *string `json:"candidates_from,omitempty"` + Causes *[]string `json:"causes,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Candidates *[]map[string]json.RawMessage `json:"candidates,omitempty"` + Marks *map[string]json.RawMessage `json:"marks,omitempty"` + NamedByGraph *[]int64 `json:"named_by_graph,omitempty"` + FixBlame *map[string]json.RawMessage `json:"fix_blame,omitempty"` + Fusion *map[string]json.RawMessage `json:"fusion,omitempty"` + Patterns *[]string `json:"patterns,omitempty"` + PatternWeights *map[string]float64 `json:"pattern_weights,omitempty"` + Scope *string `json:"scope,omitempty"` + WidenedBy *[]string `json:"widened_by,omitempty"` + DupcheckFix *map[string]json.RawMessage `json:"dupcheck_fix,omitempty"` + Component *string `json:"component,omitempty"` + ComponentDirs *[]string `json:"component_dirs,omitempty"` + DroppedAfterReport *int64 `json:"dropped_after_report,omitempty"` + VersionsSearched *[]string `json:"versions_searched,omitempty"` + BadVersion *string `json:"bad_version,omitempty"` + GoodVersion *string `json:"good_version,omitempty"` + Window *string `json:"window,omitempty"` + HubPathsDropped *[]string `json:"hub_paths_dropped,omitempty"` + Resolved *[]map[string]json.RawMessage `json:"resolved,omitempty"` + Paths *[]string `json:"paths,omitempty"` + Frames *[]string `json:"frames,omitempty"` + Issue *map[string]json.RawMessage `json:"issue,omitempty"` + IntroducedCommit *string `json:"introduced_commit,omitempty"` + FixCandidate Optional[map[string]json.RawMessage] `json:"fix_candidate,omitempty"` + TrackerNamespace *string `json:"tracker_namespace,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` + Partial *bool `json:"partial,omitempty"` + PartialReason *string `json:"partial_reason,omitempty"` + Before *string `json:"before,omitempty"` + After *string `json:"after,omitempty"` +} + +// CodeBlameRangeInput is the request to code.blame_range. +type CodeBlameRangeInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Path string `json:"path"` + StartLine int64 `json:"start_line"` + EndLine int64 `json:"end_line"` + FromVersion *string `json:"from_version,omitempty"` + ToVersion *string `json:"to_version,omitempty"` + FromSHA *string `json:"from_sha,omitempty"` + ToSHA *string `json:"to_sha,omitempty"` + Limit *int64 `json:"limit,omitempty"` + ReviewsPerPr *int64 `json:"reviews_per_pr,omitempty"` + Stage *string `json:"stage,omitempty"` + Mentions *string `json:"mentions,omitempty"` +} + +// CodeBlameRangeOutput is the response from code.blame_range. +type CodeBlameRangeOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Causes *[]string `json:"causes,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Stage *string `json:"stage,omitempty"` + Note *string `json:"note,omitempty"` + Path *string `json:"path,omitempty"` + PathIndexed *bool `json:"path_indexed,omitempty"` + Range *map[string]json.RawMessage `json:"range,omitempty"` + Window *map[string]json.RawMessage `json:"window,omitempty"` + Candidates *[]map[string]json.RawMessage `json:"candidates,omitempty"` + LastTouched *[]map[string]json.RawMessage `json:"last_touched,omitempty"` + Symbol *map[string]json.RawMessage `json:"symbol,omitempty"` + LatestPr *int64 `json:"latest_pr,omitempty"` + Lines *map[string]json.RawMessage `json:"lines,omitempty"` + Legs *map[string]json.RawMessage `json:"legs,omitempty"` + FirstReleaseBasis *string `json:"first_release_basis,omitempty"` + TrackerNamespace *string `json:"tracker_namespace,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeCalibrateInput is the request to code.calibrate. +type CodeCalibrateInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` +} + +// CodeCalibrateOutput is the response from code.calibrate. +type CodeCalibrateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + NoiseFloor float64 `json:"noise_floor"` + AbstainThreshold float64 `json:"abstain_threshold"` + RerankSkipAbove float64 `json:"rerank_skip_above"` + EmbedderModel string `json:"embedder_model"` + Positives int64 `json:"positives"` + Distractors int64 `json:"distractors"` +} + +// CodeCalleesInput is the request to code.callees. +type CodeCalleesInput = CodeCallersInput + +// CodeCalleesOutput is the response from code.callees. +type CodeCalleesOutput = CodeCallersOutput + +// CodeCallersInput is the request to code.callers. +type CodeCallersInput struct { + IncludeLessons *bool `json:"include_lessons,omitempty"` + LessonNamespaces *[]string `json:"lesson_namespaces,omitempty"` + PrFiles *map[string]string `json:"pr_files,omitempty"` + PrDiff *string `json:"pr_diff,omitempty"` + PrHeadSHA *string `json:"pr_head_sha,omitempty"` + PrBaseSHA *string `json:"pr_base_sha,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Name *string `json:"name,omitempty"` + SymbolID *string `json:"symbol_id,omitempty"` + Depth *int64 `json:"depth,omitempty"` + MaxNodes *int64 `json:"max_nodes,omitempty"` + MinConfidence *float64 `json:"min_confidence,omitempty"` + IncludeAmbiguous Optional[bool] `json:"include_ambiguous,omitempty"` + CandidateMinConfidence Optional[float64] `json:"candidate_min_confidence,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + EdgeKinds *[]string `json:"edge_kinds,omitempty"` +} + +// CodeCallersOutput is the response from code.callers. +type CodeCallersOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Lessons *[]map[string]json.RawMessage `json:"lessons,omitempty"` + LessonsLeftOut *int64 `json:"lessons_left_out,omitempty"` + Edges []CodeEdgeWire `json:"edges"` + SeedSymbols []string `json:"seed_symbols"` + Overlay *bool `json:"overlay,omitempty"` + OverlayHeadSHA *string `json:"overlay_head_sha,omitempty"` + OverlayAdded *int64 `json:"overlay_added,omitempty"` + OverlayNote *string `json:"overlay_note,omitempty"` + ResolvedBy *string `json:"resolved_by,omitempty"` + Ambiguous *bool `json:"ambiguous,omitempty"` + Candidates *[]string `json:"candidates,omitempty"` + DispatchSeeds *[]map[string]string `json:"dispatch_seeds,omitempty"` + Note *string `json:"note,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + CountsFloor *bool `json:"counts_floor,omitempty"` + UnresolvedCalls *int64 `json:"unresolved_calls,omitempty"` + AmbiguousCalls *int64 `json:"ambiguous_calls,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Causes *[]string `json:"causes,omitempty"` + ByHopCounts *map[string]int64 `json:"by_hop_counts,omitempty"` + CandidateSites Optional[CodeCandidateSitesWire] `json:"candidate_sites,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeCandidateGroupWire is a model used by Loom operations. +type CodeCandidateGroupWire struct { + Kind string `json:"kind"` + Key string `json:"key"` + N int64 `json:"n"` + Confidence float64 `json:"confidence"` + Sites []CodeCandidateSiteWire `json:"sites"` +} + +// CodeCandidateSiteWire is a model used by Loom operations. +type CodeCandidateSiteWire struct { + Path string `json:"path"` + Line int64 `json:"line"` + Caller *string `json:"caller,omitempty"` + CalleeText *string `json:"callee_text,omitempty"` + Reason string `json:"reason"` + Confidence float64 `json:"confidence"` + Disposition string `json:"disposition"` + Candidates *int64 `json:"candidates,omitempty"` +} + +// CodeCandidateSitesWire is a model used by Loom operations. +type CodeCandidateSitesWire struct { + Epistemic *string `json:"epistemic,omitempty"` + Total *int64 `json:"total,omitempty"` + Returned *int64 `json:"returned,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + ReadCapped *bool `json:"read_capped,omitempty"` + ByReason *map[string]int64 `json:"by_reason,omitempty"` + Groups *[]CodeCandidateGroupWire `json:"groups,omitempty"` + Note *string `json:"note,omitempty"` +} + +// CodeCommitCoverage is a model used by Loom operations. +type CodeCommitCoverage struct { + Commit *string `json:"commit,omitempty"` + InMirror *bool `json:"in_mirror,omitempty"` + Fast Optional[bool] `json:"fast,omitempty"` + Tiers *[]CodeCommitTierCoverage `json:"tiers,omitempty"` + Ready *bool `json:"ready,omitempty"` + WaitingOn *[]string `json:"waiting_on,omitempty"` + CommitsSince *int64 `json:"commits_since,omitempty"` + PathsChangedSince *[]string `json:"paths_changed_since,omitempty"` + PathsChangedCount *int64 `json:"paths_changed_count,omitempty"` + PathsTruncated *bool `json:"paths_truncated,omitempty"` + PathsChangedOverlap *[]string `json:"paths_changed_overlap,omitempty"` +} + +// CodeCommitTierCoverage is a model used by Loom operations. +type CodeCommitTierCoverage struct { + Producer *string `json:"producer,omitempty"` + Label *string `json:"label,omitempty"` + WatermarkKey *string `json:"watermark_key,omitempty"` + Watermark *string `json:"watermark,omitempty"` + Covered Optional[bool] `json:"covered,omitempty"` + CommitsSince *int64 `json:"commits_since,omitempty"` +} + +// CodeCompilerTier is a model used by Loom operations. +type CodeCompilerTier struct { + Producer string `json:"producer"` + Tool string `json:"tool"` + Label string `json:"label"` + WatermarkKey string `json:"watermark_key"` + Commit *string `json:"commit,omitempty"` + Lag *int64 `json:"lag,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + Primary *bool `json:"primary,omitempty"` + Workers *[]string `json:"workers,omitempty"` + Note *string `json:"note,omitempty"` +} + +// CodeContextPackInput is the request to code.context_pack. +type CodeContextPackInput struct { + IncludeLessons *bool `json:"include_lessons,omitempty"` + LessonNamespaces *[]string `json:"lesson_namespaces,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + Task *string `json:"task,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` + Sections *[]string `json:"sections,omitempty"` +} + +// CodeContextPackOutput is the response from code.context_pack. +type CodeContextPackOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Lessons *[]map[string]json.RawMessage `json:"lessons,omitempty"` + LessonsLeftOut *int64 `json:"lessons_left_out,omitempty"` + Context string `json:"context"` + TokensUsed int64 `json:"tokens_used"` + Source string `json:"source"` + Truncated *bool `json:"truncated,omitempty"` + MergeCommitSHA *string `json:"merge_commit_sha,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeContextPackRow is a model used by Loom operations. +type CodeContextPackRow struct { + PrNumber int64 `json:"pr_number"` + MergeCommitSHA *string `json:"merge_commit_sha,omitempty"` + PackTokens *int64 `json:"pack_tokens,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Title *string `json:"title,omitempty"` + Author *string `json:"author,omitempty"` + MergedAt *string `json:"merged_at,omitempty"` +} + +// CodeContextPacksInput is the request to code.context_packs. +type CodeContextPacksInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Offset *int64 `json:"offset,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` +} + +// CodeContextPacksOutput is the response from code.context_packs. +type CodeContextPacksOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []CodeContextPackRow `json:"rows"` + Total *int64 `json:"total,omitempty"` +} + +// CodeConventionsInput is the request to code.conventions. +type CodeConventionsInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + Files *[]string `json:"files,omitempty"` + Diff *string `json:"diff,omitempty"` + Rules *[]string `json:"rules,omitempty"` +} + +// CodeConventionsOutput is the response from code.conventions. +type CodeConventionsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + Source *string `json:"source,omitempty"` + Title *string `json:"title,omitempty"` + Labels *[]string `json:"labels,omitempty"` + Category *string `json:"category,omitempty"` + CategorySource *string `json:"category_source,omitempty"` + MergedAt *string `json:"merged_at,omitempty"` + MergeCommitSHA *string `json:"merge_commit_sha,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + FilesTotal *int64 `json:"files_total,omitempty"` + FilesInDiff *int64 `json:"files_in_diff,omitempty"` + DiffBytes *int64 `json:"diff_bytes,omitempty"` + DiffTruncated *bool `json:"diff_truncated,omitempty"` + Rules *[]map[string]json.RawMessage `json:"rules,omitempty"` + Summary *map[string]int64 `json:"summary,omitempty"` + Control *map[string]json.RawMessage `json:"control,omitempty"` + Notes *[]string `json:"notes,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeCoverageClaimInput is the request to code.coverage_claim. +type CodeCoverageClaimInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Symbol *string `json:"symbol,omitempty"` + Path *string `json:"path,omitempty"` + Setting *string `json:"setting,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// CodeCoverageClaimOutput is the response from code.coverage_claim. +type CodeCoverageClaimOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Subject *string `json:"subject,omitempty"` + SubjectKind *string `json:"subject_kind,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Tests *[]map[string]json.RawMessage `json:"tests,omitempty"` + TestsTotal *int64 `json:"tests_total,omitempty"` + SrcPaths *[]string `json:"src_paths,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + StrongestTier *string `json:"strongest_tier,omitempty"` + SearchTerms *map[string]string `json:"search_terms,omitempty"` + ResolvedBy *string `json:"resolved_by,omitempty"` + Control *map[string]json.RawMessage `json:"control,omitempty"` + Measured *map[string]json.RawMessage `json:"measured,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeCoverageGaps is a model used by Loom operations. +type CodeCoverageGaps struct { + FunctionsScanned *int64 `json:"functions_scanned,omitempty"` + FunctionsUncalled *int64 `json:"functions_uncalled,omitempty"` + UncalledShare *float64 `json:"uncalled_share,omitempty"` + SourceFiles *int64 `json:"source_files,omitempty"` + SourceFilesUntested *int64 `json:"source_files_untested,omitempty"` + UntestedShare *float64 `json:"untested_share,omitempty"` + CodeFiles *int64 `json:"code_files,omitempty"` + CodeFilesNoSymbols *int64 `json:"code_files_no_symbols,omitempty"` + NoSymbolsShare *float64 `json:"no_symbols_share,omitempty"` +} + +// CodeCoverageInput is the request to code.coverage. +type CodeCoverageInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` +} + +// CodeCoverageOutput is the response from code.coverage. +type CodeCoverageOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + AsOfCommit *string `json:"as_of_commit,omitempty"` + Languages []CodeLanguageCoverage `json:"languages"` + Tiers []CodeTierCoverage `json:"tiers"` + Gaps Optional[CodeCoverageGaps] `json:"gaps,omitempty"` + PrHistoryFrom *string `json:"pr_history_from,omitempty"` + PrHistoryTo *string `json:"pr_history_to,omitempty"` + PrHistoryLastFetchAt *string `json:"pr_history_last_fetch_at,omitempty"` + PrHistoryEnabled *bool `json:"pr_history_enabled,omitempty"` + PrHistoryAuth *string `json:"pr_history_auth,omitempty"` + ContextPacksLastAt *string `json:"context_packs_last_at,omitempty"` + SummariesLastAt *string `json:"summaries_last_at,omitempty"` +} + +// CodeCoverageUnwatchInput is the request to code.coverage.unwatch. +type CodeCoverageUnwatchInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Commit string `json:"commit"` + Inbox string `json:"inbox"` +} + +// CodeCoverageUnwatchOutput is the response from code.coverage.unwatch. +type CodeCoverageUnwatchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Commit string `json:"commit"` + Inbox string `json:"inbox"` + Removed bool `json:"removed"` +} + +// CodeCoverageWatchInput is the request to code.coverage.watch. +type CodeCoverageWatchInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Commit string `json:"commit"` + Inbox string `json:"inbox"` +} + +// CodeCoverageWatchOutput is the response from code.coverage.watch. +type CodeCoverageWatchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Commit string `json:"commit"` + Inbox string `json:"inbox"` + Ready *bool `json:"ready,omitempty"` + Emitted *bool `json:"emitted,omitempty"` + DeliveredAt Optional[string] `json:"delivered_at,omitempty"` + EventID string `json:"event_id"` + CommitCoverage Optional[CodeCommitCoverage] `json:"commit_coverage,omitempty"` +} + +// CodeEdgeWire is a model used by Loom operations. +type CodeEdgeWire struct { + EdgeKind string `json:"edge_kind"` + FromSymbol string `json:"from_symbol"` + ToSymbol string `json:"to_symbol"` + FromSymbolID string `json:"from_symbol_id"` + ToSymbolID string `json:"to_symbol_id"` + Path string `json:"path"` + Line int64 `json:"line"` + Tier string `json:"tier"` + Confidence float64 `json:"confidence"` + ViaOverride *string `json:"via_override,omitempty"` + Via *string `json:"via,omitempty"` +} + +// CodeEditContextInput is the request to code.edit_context. +type CodeEditContextInput struct { + IncludeLessons *bool `json:"include_lessons,omitempty"` + LessonNamespaces *[]string `json:"lesson_namespaces,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Name *string `json:"name,omitempty"` + Clues *[]string `json:"clues,omitempty"` + Names *[]string `json:"names,omitempty"` + IncludeRelatedSource *bool `json:"include_related_source,omitempty"` +} + +// CodeEditContextOutput is the response from code.edit_context. +type CodeEditContextOutput = CodeSymbolOutput + +// CodeEditContextTarget is a model used by Loom operations. +type CodeEditContextTarget struct { + Name string `json:"name"` + Status string `json:"status"` + DefinitionIndices *[]int64 `json:"definition_indices,omitempty"` + Candidates *[]map[string]json.RawMessage `json:"candidates,omitempty"` + ResolvedBy *string `json:"resolved_by,omitempty"` + Presence *[]map[string]json.RawMessage `json:"presence,omitempty"` + Hierarchy *map[string][]map[string]json.RawMessage `json:"hierarchy,omitempty"` + DocumentedIn *[]map[string]json.RawMessage `json:"documented_in,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeEditReadSite is a model used by Loom operations. +type CodeEditReadSite struct { + Path string `json:"path"` + Symbol string `json:"symbol"` + Line int64 `json:"line"` +} + +// CodeEditReadSource is a model used by Loom operations. +type CodeEditReadSource struct { + QualifiedName string `json:"qualified_name"` + Path string `json:"path"` + StartLine int64 `json:"start_line"` + EndLine int64 `json:"end_line"` + Commit string `json:"commit"` + Body string `json:"body"` + Sites []CodeEditReadSite `json:"sites"` +} + +// CodeEnclosingInput is the request to code.enclosing. +type CodeEnclosingInput struct { + IncludeLessons *bool `json:"include_lessons,omitempty"` + LessonNamespaces *[]string `json:"lesson_namespaces,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Locations []string `json:"locations"` + IncludeBody *bool `json:"include_body,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` + Neighbours Optional[bool] `json:"neighbours,omitempty"` + NeighbourK *int64 `json:"neighbour_k,omitempty"` +} + +// CodeEnclosingOutput is the response from code.enclosing. +type CodeEnclosingOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Lessons *[]map[string]json.RawMessage `json:"lessons,omitempty"` + LessonsLeftOut *int64 `json:"lessons_left_out,omitempty"` + Results []map[string]json.RawMessage `json:"results"` + Resolved int64 `json:"resolved"` + PathsIndexed int64 `json:"paths_indexed"` + PathsTotal int64 `json:"paths_total"` + TookMs int64 `json:"took_ms"` + AsOf *map[string]json.RawMessage `json:"as_of,omitempty"` + BodiesReturned *int64 `json:"bodies_returned,omitempty"` + BodiesElided *int64 `json:"bodies_elided,omitempty"` + TokensReturned *int64 `json:"tokens_returned,omitempty"` + Neighbours *[]map[string]json.RawMessage `json:"neighbours,omitempty"` + Anchors *int64 `json:"anchors,omitempty"` + AnchorsCapped *bool `json:"anchors_capped,omitempty"` + NeighbourTokens *int64 `json:"neighbour_tokens,omitempty"` +} + +// CodeExamplesInput is the request to code.examples. +type CodeExamplesInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Name *string `json:"name,omitempty"` + SymbolID *string `json:"symbol_id,omitempty"` + TopK *int64 `json:"top_k,omitempty"` +} + +// CodeExamplesOutput is the response from code.examples. +type CodeExamplesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Examples []map[string]json.RawMessage `json:"examples"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeFilesInput is the request to code.files. +type CodeFilesInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Glob *string `json:"glob,omitempty"` + Stem *string `json:"stem,omitempty"` + PathPrefix *string `json:"path_prefix,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// CodeFilesOutput is the response from code.files. +type CodeFilesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Files *[]map[string]json.RawMessage `json:"files,omitempty"` + Total *int64 `json:"total,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + AsOf *map[string]json.RawMessage `json:"as_of,omitempty"` + NotCovered *bool `json:"not_covered,omitempty"` + Note *string `json:"note,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeFirstBuildInput is the request to code.first_build. +type CodeFirstBuildInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + SHA *string `json:"sha,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` +} + +// CodeFirstBuildOutput is the response from code.first_build. +type CodeFirstBuildOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Causes *[]string `json:"causes,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + SHA *string `json:"sha,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + MergedAt *string `json:"merged_at,omitempty"` + CommitTime *string `json:"commit_time,omitempty"` + LedgerKnown *bool `json:"ledger_known,omitempty"` + MirrorKnown *bool `json:"mirror_known,omitempty"` + FirstBuild *map[string]json.RawMessage `json:"first_build,omitempty"` + LagHours Optional[float64] `json:"lag_hours,omitempty"` + LaterBuilds *int64 `json:"later_builds,omitempty"` + WindowHours *int64 `json:"window_hours,omitempty"` + CandidatesChecked *int64 `json:"candidates_checked,omitempty"` + CandidatesTotal *int64 `json:"candidates_total,omitempty"` + OwnBuilds *[]map[string]json.RawMessage `json:"own_builds,omitempty"` + ContainingBranches *[]string `json:"containing_branches,omitempty"` + ContainingNamespaces *[]string `json:"containing_namespaces,omitempty"` + NearestNamespace *string `json:"nearest_namespace,omitempty"` + Note *string `json:"note,omitempty"` + TrackerNamespace *string `json:"tracker_namespace,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeGrepInput is the request to code.grep. +type CodeGrepInput struct { + IncludeLessons *bool `json:"include_lessons,omitempty"` + LessonNamespaces *[]string `json:"lesson_namespaces,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Pattern json.RawMessage `json:"pattern"` + PrioritizePatterns *bool `json:"prioritize_patterns,omitempty"` + Regex *bool `json:"regex,omitempty"` + RelatedOnMiss *bool `json:"related_on_miss,omitempty"` + RelatedOnPrefix *bool `json:"related_on_prefix,omitempty"` + IncludeDependencies *bool `json:"include_dependencies,omitempty"` + CaseSensitive *bool `json:"case_sensitive,omitempty"` + ContextLines *int64 `json:"context_lines,omitempty"` + PreferCompleteContext *bool `json:"prefer_complete_context,omitempty"` + PathPrefix *string `json:"path_prefix,omitempty"` + Cursor *string `json:"cursor,omitempty"` + ExcludeUnitIds *[]string `json:"exclude_unit_ids,omitempty"` + Mode *string `json:"mode,omitempty"` + IncludeBody *bool `json:"include_body,omitempty"` + Limit Optional[int64] `json:"limit,omitempty"` + PathGlobs *[]string `json:"path_globs,omitempty"` + ExcludeGlobs *[]string `json:"exclude_globs,omitempty"` + Langs *[]string `json:"langs,omitempty"` + Namespaces *[]string `json:"namespaces,omitempty"` + Neighbours Optional[bool] `json:"neighbours,omitempty"` + NeighbourK *int64 `json:"neighbour_k,omitempty"` + DeadlineMs Optional[int64] `json:"deadline_ms,omitempty"` +} + +// CodeGrepOutput is the response from code.grep. +type CodeGrepOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Lessons *[]map[string]json.RawMessage `json:"lessons,omitempty"` + LessonsLeftOut *int64 `json:"lessons_left_out,omitempty"` + Matches []map[string]json.RawMessage `json:"matches"` + Related Optional[RelatedGrepEvidence] `json:"related,omitempty"` + Contexts *[]map[string]json.RawMessage `json:"contexts,omitempty"` + ContextsPartial *bool `json:"contexts_partial,omitempty"` + Definitions *[]map[string]json.RawMessage `json:"definitions,omitempty"` + DefinitionsPartial *bool `json:"definitions_partial,omitempty"` + DefinitionsNote *string `json:"definitions_note,omitempty"` + NextCursor *string `json:"next_cursor,omitempty"` + HasMore *bool `json:"has_more,omitempty"` + Files *[]map[string]json.RawMessage `json:"files,omitempty"` + FilesTotal *int64 `json:"files_total,omitempty"` + ChunksMatched int64 `json:"chunks_matched"` + Truncated *bool `json:"truncated,omitempty"` + CoverageFloor *bool `json:"coverage_floor,omitempty"` + AsOf *map[string]json.RawMessage `json:"as_of,omitempty"` + NotCovered *bool `json:"not_covered,omitempty"` + Neighbours *[]map[string]json.RawMessage `json:"neighbours,omitempty"` + Anchors *int64 `json:"anchors,omitempty"` + AnchorsCapped *bool `json:"anchors_capped,omitempty"` + NeighbourTokens *int64 `json:"neighbour_tokens,omitempty"` + Note *string `json:"note,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Template *string `json:"template,omitempty"` + ErrorCode *string `json:"error_code,omitempty"` + Coverage *float64 `json:"coverage,omitempty"` + Presence *[]map[string]json.RawMessage `json:"presence,omitempty"` + Summary *map[string][]string `json:"summary,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` + Partial *bool `json:"partial,omitempty"` + PartialReason *string `json:"partial_reason,omitempty"` + Fallback *string `json:"fallback,omitempty"` +} + +// CodeHistoryInput is the request to code.history. +type CodeHistoryInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Name *string `json:"name,omitempty"` + SymbolID *string `json:"symbol_id,omitempty"` + Path *string `json:"path,omitempty"` + Numbers *[]int64 `json:"numbers,omitempty"` + Limit *int64 `json:"limit,omitempty"` + ReviewsPerPr *int64 `json:"reviews_per_pr,omitempty"` +} + +// CodeHistoryOutput is the response from code.history. +type CodeHistoryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Prs []map[string]json.RawMessage `json:"prs"` + Paths []string `json:"paths"` + Items *[]map[string]json.RawMessage `json:"items,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeImpactInput is the request to code.impact. +type CodeImpactInput struct { + IncludeLessons *bool `json:"include_lessons,omitempty"` + LessonNamespaces *[]string `json:"lesson_namespaces,omitempty"` + PrFiles *map[string]string `json:"pr_files,omitempty"` + PrDiff *string `json:"pr_diff,omitempty"` + PrHeadSHA *string `json:"pr_head_sha,omitempty"` + PrBaseSHA *string `json:"pr_base_sha,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Name *string `json:"name,omitempty"` + SymbolID *string `json:"symbol_id,omitempty"` + Depth *int64 `json:"depth,omitempty"` + Files *[]string `json:"files,omitempty"` + Diff *string `json:"diff,omitempty"` + ExcludeAuthors *[]string `json:"exclude_authors,omitempty"` + SummaryOnly *bool `json:"summary_only,omitempty"` + PerHopLimit *int64 `json:"per_hop_limit,omitempty"` + Offset *int64 `json:"offset,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` +} + +// CodeImpactOutput is the response from code.impact. +type CodeImpactOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Lessons *[]map[string]json.RawMessage `json:"lessons,omitempty"` + LessonsLeftOut *int64 `json:"lessons_left_out,omitempty"` + ImpactedSymbols []map[string]json.RawMessage `json:"impacted_symbols"` + ImpactedTests []map[string]json.RawMessage `json:"impacted_tests"` + CoChangeFiles []map[string]json.RawMessage `json:"co_change_files"` + BlastRadiusScore *float64 `json:"blast_radius_score,omitempty"` + TouchedSymbols *[]map[string]json.RawMessage `json:"touched_symbols,omitempty"` + CoChangeMissing *[]map[string]json.RawMessage `json:"co_change_missing,omitempty"` + Owners *[]map[string]json.RawMessage `json:"owners,omitempty"` + Reverts *[]map[string]json.RawMessage `json:"reverts,omitempty"` + CountsFloor *bool `json:"counts_floor,omitempty"` + UnresolvedCalls *int64 `json:"unresolved_calls,omitempty"` + AmbiguousCalls *int64 `json:"ambiguous_calls,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Causes *[]string `json:"causes,omitempty"` + ByHopCounts *map[string]int64 `json:"by_hop_counts,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + ResolvedBy *string `json:"resolved_by,omitempty"` + Verdict *string `json:"verdict,omitempty"` + PathsSeen *[]map[string]string `json:"paths_seen,omitempty"` + Overlay *bool `json:"overlay,omitempty"` + OverlayHeadSHA *string `json:"overlay_head_sha,omitempty"` + OverlayAdded *int64 `json:"overlay_added,omitempty"` + OverlayNote *string `json:"overlay_note,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeIndexErrorRow is a model used by Loom operations. +type CodeIndexErrorRow struct { + Path string `json:"path"` + Lang *string `json:"lang,omitempty"` + Error string `json:"error"` + IndexedCommit *string `json:"indexed_commit,omitempty"` + At *string `json:"at,omitempty"` +} + +// CodeIndexErrorsInput is the request to code.index_errors. +type CodeIndexErrorsInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// CodeIndexErrorsOutput is the response from code.index_errors. +type CodeIndexErrorsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []CodeIndexErrorRow `json:"rows"` + Total *int64 `json:"total,omitempty"` +} + +// CodeIndexStatusInput is the request to code.index_status. +type CodeIndexStatusInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Commit *string `json:"commit,omitempty"` + Paths *[]string `json:"paths,omitempty"` + Brief Optional[bool] `json:"brief,omitempty"` +} + +// CodeIndexStatusOutput is the response from code.index_status. +type CodeIndexStatusOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Repo string `json:"repo"` + Branch string `json:"branch"` + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` + Provider *string `json:"provider,omitempty"` + Profile *string `json:"profile,omitempty"` + CompilerCandidates *[]string `json:"compiler_candidates,omitempty"` + QualityWarnings *[]string `json:"quality_warnings,omitempty"` + GitHead *string `json:"git_head,omitempty"` + ScipCommit *string `json:"scip_commit,omitempty"` + ScipCommitPy *string `json:"scip_commit_py,omitempty"` + ScipProducer *string `json:"scip_producer,omitempty"` + CompilerTiers *[]CodeCompilerTier `json:"compiler_tiers,omitempty"` + TierHealth *[]CodeTierHealth `json:"tier_health,omitempty"` + PrCursor *string `json:"pr_cursor,omitempty"` + CommitCoverage Optional[CodeCommitCoverage] `json:"commit_coverage,omitempty"` + CloneHead *string `json:"clone_head,omitempty"` + CloneFetchedAt *string `json:"clone_fetched_at,omitempty"` + FetchOverdue *bool `json:"fetch_overdue,omitempty"` + FastTierLag *int64 `json:"fast_tier_lag,omitempty"` + ScipLag *int64 `json:"scip_lag,omitempty"` + ScipPyLag *int64 `json:"scip_py_lag,omitempty"` + LastRefreshAt *string `json:"last_refresh_at,omitempty"` + LastRefreshDetail *string `json:"last_refresh_detail,omitempty"` + OrgReadable *bool `json:"org_readable,omitempty"` + PathPrefixes *[]string `json:"path_prefixes,omitempty"` + Counts *map[string]int64 `json:"counts,omitempty"` + State *map[string]map[string]string `json:"state,omitempty"` + Workers *map[string]CodeWorkerStatus `json:"workers,omitempty"` + BuildCommit *string `json:"build_commit,omitempty"` + Ops *[]string `json:"ops,omitempty"` + RequestFields *map[string][]string `json:"request_fields,omitempty"` + OpMaturity *map[string]string `json:"op_maturity,omitempty"` + OpReach *map[string][]string `json:"op_reach,omitempty"` + OpToolsets *map[string][]string `json:"op_toolsets,omitempty"` + SymbolStatsRows *int64 `json:"symbol_stats_rows,omitempty"` + SymbolStatsAt *string `json:"symbol_stats_at,omitempty"` + UnitRiskRows *int64 `json:"unit_risk_rows,omitempty"` + UnitRiskAt *string `json:"unit_risk_at,omitempty"` + ChunksTotal *int64 `json:"chunks_total,omitempty"` + ChunksEmbedded *int64 `json:"chunks_embedded,omitempty"` + EmbeddingCoverage *float64 `json:"embedding_coverage,omitempty"` +} + +// CodeLanguageCoverage is a model used by Loom operations. +type CodeLanguageCoverage struct { + Lang string `json:"lang"` + Files *int64 `json:"files,omitempty"` + FilesErrored *int64 `json:"files_errored,omitempty"` + FilesFirstAt *string `json:"files_first_at,omitempty"` + FilesLastAt *string `json:"files_last_at,omitempty"` + Chunks *int64 `json:"chunks,omitempty"` + ChunksEmbedded *int64 `json:"chunks_embedded,omitempty"` + ChunksDescribed *int64 `json:"chunks_described,omitempty"` + ChunksLastAt *string `json:"chunks_last_at,omitempty"` + SymbolsTreesitter *int64 `json:"symbols_treesitter,omitempty"` + SymbolsTreesitterLastAt *string `json:"symbols_treesitter_last_at,omitempty"` + SymbolsScip *int64 `json:"symbols_scip,omitempty"` + SymbolsScipLastAt *string `json:"symbols_scip_last_at,omitempty"` +} + +// CodeLink is a model used by Loom operations. +type CodeLink struct { + CodeNamespace string `json:"code_namespace"` + Path string `json:"path"` + Symbol *string `json:"symbol,omitempty"` + StartLine *int64 `json:"start_line,omitempty"` + EndLine *int64 `json:"end_line,omitempty"` + State string `json:"state"` + ChangedSince *string `json:"changed_since,omitempty"` + Suggestion *string `json:"suggestion,omitempty"` + WasPath *string `json:"was_path,omitempty"` + WasSymbol *string `json:"was_symbol,omitempty"` +} + +// CodeMapInput is the request to code.map. +type CodeMapInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` + ModulePrefix *string `json:"module_prefix,omitempty"` +} + +// CodeMapOutput is the response from code.map. +type CodeMapOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Map string `json:"map"` + TokensUsed int64 `json:"tokens_used"` + CommitSHA *string `json:"commit_sha,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeOutcomeInput is the request to code.outcome. +type CodeOutcomeInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` + Action string `json:"action"` + Targets *[]string `json:"targets,omitempty"` + Source *string `json:"source,omitempty"` + TokensSaved *int64 `json:"tokens_saved,omitempty"` + Spans *[]string `json:"spans,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// CodeOutcomeOutput is the response from code.outcome. +type CodeOutcomeOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Recorded bool `json:"recorded"` +} + +// CodeOutlineInput is the request to code.outline. +type CodeOutlineInput struct { + IncludeLessons *bool `json:"include_lessons,omitempty"` + LessonNamespaces *[]string `json:"lesson_namespaces,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Path string `json:"path"` + Kinds *[]string `json:"kinds,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` +} + +// CodeOutlineOutput is the response from code.outline. +type CodeOutlineOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Lessons *[]map[string]json.RawMessage `json:"lessons,omitempty"` + LessonsLeftOut *int64 `json:"lessons_left_out,omitempty"` + Path string `json:"path"` + Entries []map[string]json.RawMessage `json:"entries"` + Total int64 `json:"total"` + Returned int64 `json:"returned"` + Elided int64 `json:"elided"` + Next *string `json:"next,omitempty"` + Indexed *bool `json:"indexed,omitempty"` + Verdict *string `json:"verdict,omitempty"` + TokensReturned *int64 `json:"tokens_returned,omitempty"` + TookMs *int64 `json:"took_ms,omitempty"` + Head *string `json:"head,omitempty"` + HeadTruncated *bool `json:"head_truncated,omitempty"` + AsOf *map[string]json.RawMessage `json:"as_of,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodePathGuardsInput is the request to code.path_guards. +type CodePathGuardsInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + FromSymbol string `json:"from_symbol"` + ToSymbol string `json:"to_symbol"` + Mentions *string `json:"mentions,omitempty"` + Depth *int64 `json:"depth,omitempty"` +} + +// CodePathGuardsOutput is the response from code.path_guards. +type CodePathGuardsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Verdict string `json:"verdict"` + Causes *[]string `json:"causes,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Explanation *string `json:"explanation,omitempty"` + Hops *[]map[string]json.RawMessage `json:"hops,omitempty"` + NamedAt *[]string `json:"named_at,omitempty"` + VisitedSymbols *int64 `json:"visited_symbols,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodePrCheckInput is the request to code.pr_check. +type CodePrCheckInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Title *string `json:"title,omitempty"` + Body *string `json:"body,omitempty"` + Paths *[]string `json:"paths,omitempty"` + Symbols *[]string `json:"symbols,omitempty"` + Issues *[]int64 `json:"issues,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + TopK *int64 `json:"top_k,omitempty"` +} + +// CodePrCheckOutput is the response from code.pr_check. +type CodePrCheckOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Items *[]map[string]json.RawMessage `json:"items,omitempty"` + Undecided *bool `json:"undecided,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Thresholds *map[string]float64 `json:"thresholds,omitempty"` + Legs *map[string]json.RawMessage `json:"legs,omitempty"` + Draft *map[string]json.RawMessage `json:"draft,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeReadInput is the request to code.read. +type CodeReadInput struct { + IncludeLessons *bool `json:"include_lessons,omitempty"` + LessonNamespaces *[]string `json:"lesson_namespaces,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Ranges json.RawMessage `json:"ranges,omitempty"` + Path Optional[string] `json:"path,omitempty"` + StartLine Optional[int64] `json:"start_line,omitempty"` + EndLine Optional[int64] `json:"end_line,omitempty"` +} + +// CodeReadOutput is the response from code.read. +type CodeReadOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Lessons *[]map[string]json.RawMessage `json:"lessons,omitempty"` + LessonsLeftOut *int64 `json:"lessons_left_out,omitempty"` + Results []CodeReadRange `json:"results"` + AsOf map[string]json.RawMessage `json:"as_of"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeReadRange is a model used by Loom operations. +type CodeReadRange struct { + Path string `json:"path"` + StartLine int64 `json:"start_line"` + EndLine int64 `json:"end_line"` + Status string `json:"status"` + IndexedCommit *string `json:"indexed_commit,omitempty"` + Windows *[]CodeReadWindow `json:"windows,omitempty"` +} + +// CodeReadRangeInput is a model used by Loom operations. +type CodeReadRangeInput struct { + Path string `json:"path"` + StartLine int64 `json:"start_line"` + EndLine Optional[int64] `json:"end_line,omitempty"` +} + +// CodeReadWindow is a model used by Loom operations. +type CodeReadWindow struct { + StartLine int64 `json:"start_line"` + EndLine int64 `json:"end_line"` + Text string `json:"text"` +} + +// CodeRecentCommitRow is a model used by Loom operations. +type CodeRecentCommitRow struct { + Commit string `json:"commit"` + Subject *string `json:"subject,omitempty"` + CommittedAt *string `json:"committed_at,omitempty"` + IngestedAt *string `json:"ingested_at,omitempty"` + Files *int64 `json:"files,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` +} + +// CodeRecentCommitsInput is the request to code.recent_commits. +type CodeRecentCommitsInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// CodeRecentCommitsOutput is the response from code.recent_commits. +type CodeRecentCommitsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []CodeRecentCommitRow `json:"rows"` +} + +// CodeRefreshInput is the request to code.refresh. +type CodeRefreshInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + ExpectedHead *string `json:"expected_head,omitempty"` + Wait *bool `json:"wait,omitempty"` + WaitTimeoutSeconds *int64 `json:"wait_timeout_seconds,omitempty"` +} + +// CodeRefreshOutput is the response from code.refresh. +type CodeRefreshOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Triggered bool `json:"triggered"` + AlreadyRunning *bool `json:"already_running,omitempty"` + HeadBefore *string `json:"head_before,omitempty"` + HeadAfter *string `json:"head_after,omitempty"` +} + +// CodeReindexInput is the request to code.reindex. +type CodeReindexInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + GitHead string `json:"git_head"` +} + +// CodeReindexOutput is the response from code.reindex. +type CodeReindexOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + PreviousHead string `json:"previous_head"` + NewHead string `json:"new_head"` +} + +// CodeRepoAddBranchInput is the request to code.repo.add_branch. +type CodeRepoAddBranchInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Branch string `json:"branch"` +} + +// CodeRepoAddBranchOutput is the response from code.repo.add_branch. +type CodeRepoAddBranchOutput = CodeRepoAddOutput + +// CodeRepoAddInput is the request to code.repo.add. +type CodeRepoAddInput struct { + Org string `json:"org"` + Repo string `json:"repo"` + Branch *string `json:"branch,omitempty"` + JoinPolicy *string `json:"join_policy,omitempty"` + Classification *string `json:"classification,omitempty"` + AccessToken *string `json:"access_token,omitempty"` + GitProxyIdentity *string `json:"git_proxy_identity,omitempty"` + PathPrefixes *[]string `json:"path_prefixes,omitempty"` + Exclude *[]string `json:"exclude,omitempty"` + ExcludeGenerated *bool `json:"exclude_generated,omitempty"` + ScipProducer *string `json:"scip_producer,omitempty"` + Branches *[]string `json:"branches,omitempty"` +} + +// CodeRepoAddOutput is the response from code.repo.add. +type CodeRepoAddOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Repo string `json:"repo"` + Remote *string `json:"remote,omitempty"` + Provider *string `json:"provider,omitempty"` + Branch string `json:"branch"` + JoinPolicy string `json:"join_policy"` + Classification string `json:"classification"` + IndexStage *string `json:"index_stage,omitempty"` + MyRole *string `json:"my_role,omitempty"` + RemoteHead *string `json:"remote_head,omitempty"` + Also *[]map[string]string `json:"also,omitempty"` + Skipped *[]map[string]string `json:"skipped,omitempty"` +} + +// CodeRepoRemoteBranchesInput is the request to code.repo.remote_branches. +type CodeRepoRemoteBranchesInput struct { + Org string `json:"org"` + Repo string `json:"repo"` + AccessToken *string `json:"access_token,omitempty"` + GitProxyIdentity *string `json:"git_proxy_identity,omitempty"` + Query *string `json:"query,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// CodeRepoRemoteBranchesOutput is the response from code.repo.remote_branches. +type CodeRepoRemoteBranchesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Repo string `json:"repo"` + Remote *string `json:"remote,omitempty"` + Provider *string `json:"provider,omitempty"` + Warnings *[]string `json:"warnings,omitempty"` + DefaultBranch *string `json:"default_branch,omitempty"` + Branches *[]map[string]string `json:"branches,omitempty"` + Suggested *[]string `json:"suggested,omitempty"` + Indexed *[]map[string]string `json:"indexed,omitempty"` + Cap *int64 `json:"cap,omitempty"` + Total *int64 `json:"total,omitempty"` + Matched *int64 `json:"matched,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Query *string `json:"query,omitempty"` +} + +// CodeRepoRemoveInput is the request to code.repo.remove. +type CodeRepoRemoveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Confirm *string `json:"confirm,omitempty"` +} + +// CodeRepoRemoveOutput is the response from code.repo.remove. +type CodeRepoRemoveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Repo string `json:"repo"` + Branch string `json:"branch"` + RegistryDeactivated bool `json:"registry_deactivated"` + DirectoryDeactivated bool `json:"directory_deactivated"` + PurgedTables int64 `json:"purged_tables"` + ErasureID *string `json:"erasure_id,omitempty"` + MirrorRemoved *bool `json:"mirror_removed,omitempty"` + SourcesDeactivated *[]string `json:"sources_deactivated,omitempty"` +} + +// CodeRepoSetAccessInput is the request to code.repo.set_access. +type CodeRepoSetAccessInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Classification string `json:"classification"` + JoinPolicy string `json:"join_policy"` + Confirm *string `json:"confirm,omitempty"` +} + +// CodeRepoSetAccessOutput is the response from code.repo.set_access. +type CodeRepoSetAccessOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Repo string `json:"repo"` + Classification string `json:"classification"` + JoinPolicy string `json:"join_policy"` + PreviousClassification string `json:"previous_classification"` + PreviousJoinPolicy string `json:"previous_join_policy"` + DirectoryUpdated bool `json:"directory_updated"` + EffectiveWithinS int64 `json:"effective_within_s"` +} + +// CodeRepoSetSourceInput is the request to code.repo.set_source. +type CodeRepoSetSourceInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + TrackerNamespaces []string `json:"tracker_namespaces"` +} + +// CodeRepoSetSourceOutput is the response from code.repo.set_source. +type CodeRepoSetSourceOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + TrackerNamespaces *[]string `json:"tracker_namespaces,omitempty"` + PreviousTrackerNamespaces *[]string `json:"previous_tracker_namespaces,omitempty"` + EffectiveWithinS int64 `json:"effective_within_s"` + NotCovering *[]string `json:"not_covering,omitempty"` + Warning *string `json:"warning,omitempty"` +} + +// CodeRepoSummary is a model used by Loom operations. +type CodeRepoSummary struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Repo *string `json:"repo,omitempty"` + Branch *string `json:"branch,omitempty"` + GitHead *string `json:"git_head,omitempty"` + CloneHead *string `json:"clone_head,omitempty"` + CloneFetchedAt *string `json:"clone_fetched_at,omitempty"` + FetchOverdue *bool `json:"fetch_overdue,omitempty"` + FastTierLag *int64 `json:"fast_tier_lag,omitempty"` + ScipLag *int64 `json:"scip_lag,omitempty"` + ScipPyLag *int64 `json:"scip_py_lag,omitempty"` + ScipProducer *string `json:"scip_producer,omitempty"` + TierHealth *[]CodeTierHealth `json:"tier_health,omitempty"` + IndexedAt *string `json:"indexed_at,omitempty"` + LastRefreshAt *string `json:"last_refresh_at,omitempty"` + Counts *map[string]int64 `json:"counts,omitempty"` + Readable *bool `json:"readable,omitempty"` + JoinPolicy *string `json:"join_policy,omitempty"` + Classification *string `json:"classification,omitempty"` + MyStatus *string `json:"my_status,omitempty"` + MyRole *string `json:"my_role,omitempty"` + Source *string `json:"source,omitempty"` + Stage *string `json:"stage,omitempty"` + StageDetail *string `json:"stage_detail,omitempty"` + ChunksTotal *int64 `json:"chunks_total,omitempty"` + ChunksEmbedded *int64 `json:"chunks_embedded,omitempty"` + EmbeddingCoverage *float64 `json:"embedding_coverage,omitempty"` + Searchable *bool `json:"searchable,omitempty"` + HasMaintainer *bool `json:"has_maintainer,omitempty"` + UnreadableReason *string `json:"unreadable_reason,omitempty"` + DocsNamespace *string `json:"docs_namespace,omitempty"` + PrimaryNamespace *string `json:"primary_namespace,omitempty"` + BoundTrackers Optional[[]string] `json:"bound_trackers,omitempty"` + MatchedVia Optional[string] `json:"matched_via,omitempty"` + CheckoutSlug Optional[string] `json:"checkout_slug,omitempty"` +} + +// CodeReposInput is the request to code.repos. +type CodeReposInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Repo *string `json:"repo,omitempty"` + Repos *[]string `json:"repos,omitempty"` + Fields Optional[[]string] `json:"fields,omitempty"` +} + +// CodeReposOutput is the response from code.repos. +type CodeReposOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Repos []CodeRepoSummary `json:"repos"` +} + +// CodeReviewBriefInput is the request to code.review_brief. +type CodeReviewBriefInput struct { + PrFiles *map[string]string `json:"pr_files,omitempty"` + PrDiff *string `json:"pr_diff,omitempty"` + PrHeadSHA *string `json:"pr_head_sha,omitempty"` + PrBaseSHA *string `json:"pr_base_sha,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + MergeSHA *string `json:"merge_sha,omitempty"` + Sections *[]string `json:"sections,omitempty"` + Tier *string `json:"tier,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` + Store *bool `json:"store,omitempty"` + Open *bool `json:"open,omitempty"` +} + +// CodeReviewBriefOutput is the response from code.review_brief. +type CodeReviewBriefOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + MergeSHA *string `json:"merge_sha,omitempty"` + Source *string `json:"source,omitempty"` + Ledger *string `json:"ledger,omitempty"` + Stored *bool `json:"stored,omitempty"` + Provenance *map[string]json.RawMessage `json:"provenance,omitempty"` + Overlay *bool `json:"overlay,omitempty"` + OverlayHeadSHA *string `json:"overlay_head_sha,omitempty"` + OverlayAdded *int64 `json:"overlay_added,omitempty"` + OverlayNote *string `json:"overlay_note,omitempty"` + Tier *string `json:"tier,omitempty"` + BuiltAt *string `json:"built_at,omitempty"` + IndexedCommit *string `json:"indexed_commit,omitempty"` + BuildMs *int64 `json:"build_ms,omitempty"` + TokensUsed *int64 `json:"tokens_used,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` + Decisions *map[string]bool `json:"decisions,omitempty"` + Sections *map[string]map[string]json.RawMessage `json:"sections,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeScipIngestInput is the request to code.scip_ingest. +type CodeScipIngestInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + BatchID string `json:"batch_id"` + Seq int64 `json:"seq"` + TotalParts int64 `json:"total_parts"` + CommitSHA *string `json:"commit_sha,omitempty"` + BaseSHA *string `json:"base_sha,omitempty"` + Producer *string `json:"producer,omitempty"` + Payload string `json:"payload"` + EntryLeaseHolder *string `json:"entry_lease_holder,omitempty"` +} + +// CodeScipIngestOutput is the response from code.scip_ingest. +type CodeScipIngestOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + BatchID string `json:"batch_id"` + PartsReceived int64 `json:"parts_received"` + TotalParts int64 `json:"total_parts"` + Complete bool `json:"complete"` +} + +// CodeScipStatusInput is the request to code.scip_status. +type CodeScipStatusInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + BatchID string `json:"batch_id"` +} + +// CodeScipStatusOutput is the response from code.scip_status. +type CodeScipStatusOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + BatchID string `json:"batch_id"` + Status string `json:"status"` + PartsReceived int64 `json:"parts_received"` + TotalParts int64 `json:"total_parts"` + Error *string `json:"error,omitempty"` + CommitSHA *string `json:"commit_sha,omitempty"` + AppliedAt *string `json:"applied_at,omitempty"` +} + +// CodeSearchInput is the request to code.search. +type CodeSearchInput struct { + IncludeLessons *bool `json:"include_lessons,omitempty"` + LessonNamespaces *[]string `json:"lesson_namespaces,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Query string `json:"query"` + TopK *int64 `json:"top_k,omitempty"` + TokenBudget Optional[int64] `json:"token_budget,omitempty"` + PathPrefix *string `json:"path_prefix,omitempty"` + Cursor *string `json:"cursor,omitempty"` + ExcludeUnitIds *[]string `json:"exclude_unit_ids,omitempty"` + Rerank *string `json:"rerank,omitempty"` + Expand *bool `json:"expand,omitempty"` + Annotate *bool `json:"annotate,omitempty"` + Bodies Optional[string] `json:"bodies,omitempty"` + KindPrior Optional[string] `json:"kind_prior,omitempty"` + PrLegBefore Optional[string] `json:"pr_leg_before,omitempty"` + EmbeddingModel *string `json:"embedding_model,omitempty"` + Fresh *bool `json:"fresh,omitempty"` + MinFanIn *int64 `json:"min_fan_in,omitempty"` + SortBy *string `json:"sort_by,omitempty"` + Pattern *string `json:"pattern,omitempty"` + Regex *bool `json:"regex,omitempty"` + CaseSensitive *bool `json:"case_sensitive,omitempty"` + PathGlobs *[]string `json:"path_globs,omitempty"` + ExcludeGlobs *[]string `json:"exclude_globs,omitempty"` + Langs *[]string `json:"langs,omitempty"` + Legs Optional[string] `json:"legs,omitempty"` + TrackPath *string `json:"track_path,omitempty"` + VectorModel *string `json:"vector_model,omitempty"` + VectorShortlist Optional[int64] `json:"vector_shortlist,omitempty"` + LLMLegs Optional[string] `json:"llm_legs,omitempty"` + DeadlineMs Optional[int64] `json:"deadline_ms,omitempty"` + Namespaces *[]string `json:"namespaces,omitempty"` +} + +// CodeSearchOutput is the response from code.search. +type CodeSearchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Lessons *[]map[string]json.RawMessage `json:"lessons,omitempty"` + LessonsLeftOut *int64 `json:"lessons_left_out,omitempty"` + Results []CodeUnit `json:"results"` + Route string `json:"route"` + NextCursor *string `json:"next_cursor,omitempty"` + HasMore *bool `json:"has_more,omitempty"` + History *map[string]json.RawMessage `json:"history,omitempty"` + Abstain *bool `json:"abstain,omitempty"` + AbstainCode *string `json:"abstain_code,omitempty"` + AbstainReason *string `json:"abstain_reason,omitempty"` + RetrievalRisk *string `json:"retrieval_risk,omitempty"` + RetrievalConfidence *float64 `json:"retrieval_confidence,omitempty"` + RouteAgreement *float64 `json:"route_agreement,omitempty"` + CalibrationExplanation *string `json:"calibration_explanation,omitempty"` + TokensReturned *int64 `json:"tokens_returned,omitempty"` + Constrained *bool `json:"constrained,omitempty"` + MatchedFiles *int64 `json:"matched_files,omitempty"` + AsOf *map[string]json.RawMessage `json:"as_of,omitempty"` + ScoreExplanation *string `json:"score_explanation,omitempty"` + RetrievalWork *map[string]json.RawMessage `json:"retrieval_work,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` + TopSimilarity *float64 `json:"top_similarity,omitempty"` + Tracked *map[string]json.RawMessage `json:"tracked,omitempty"` + Fanout *map[string]json.RawMessage `json:"fanout,omitempty"` + Note *string `json:"note,omitempty"` + LegsTimedOut *[]string `json:"legs_timed_out,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Partial *bool `json:"partial,omitempty"` + PartialReason *string `json:"partial_reason,omitempty"` +} + +// CodeSettingFactsInput is the request to code.setting_facts. +type CodeSettingFactsInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Name string `json:"name"` + HistoryLimit *int64 `json:"history_limit,omitempty"` +} + +// CodeSettingFactsOutput is the response from code.setting_facts. +type CodeSettingFactsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Verdict *string `json:"verdict,omitempty"` + Causes *[]string `json:"causes,omitempty"` + Declaration *map[string]json.RawMessage `json:"declaration,omitempty"` + Tier *string `json:"tier,omitempty"` + History *[]map[string]json.RawMessage `json:"history,omitempty"` + RandomizedInCi *map[string]json.RawMessage `json:"randomized_in_ci,omitempty"` + TestsTotal *int64 `json:"tests_total,omitempty"` + Control *map[string]json.RawMessage `json:"control,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeSymbolHistoryInput is the request to code.symbol_history. +type CodeSymbolHistoryInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Name *string `json:"name,omitempty"` + SymbolID *string `json:"symbol_id,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// CodeSymbolHistoryOutput is the response from code.symbol_history. +type CodeSymbolHistoryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Causes *[]string `json:"causes,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Symbol *map[string]json.RawMessage `json:"symbol,omitempty"` + Ambiguous *bool `json:"ambiguous,omitempty"` + Candidates *[]string `json:"candidates,omitempty"` + Prs *[]map[string]json.RawMessage `json:"prs,omitempty"` + ReviewComments *[]map[string]json.RawMessage `json:"review_comments,omitempty"` + OpenIssuesNaming *[]map[string]json.RawMessage `json:"open_issues_naming,omitempty"` + Summary *map[string]json.RawMessage `json:"summary,omitempty"` + TrackerNamespace *string `json:"tracker_namespace,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeSymbolInput is the request to code.symbol. +type CodeSymbolInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Name *string `json:"name,omitempty"` + SymbolID *string `json:"symbol_id,omitempty"` + IncludeBody *bool `json:"include_body,omitempty"` + IncludeHistory *bool `json:"include_history,omitempty"` + IncludeExamples *bool `json:"include_examples,omitempty"` + TestExamplesOnly *bool `json:"test_examples_only,omitempty"` + ExampleContextLines *int64 `json:"example_context_lines,omitempty"` + IncludeLessons *bool `json:"include_lessons,omitempty"` + LessonNamespaces *[]string `json:"lesson_namespaces,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` + MinFanIn *int64 `json:"min_fan_in,omitempty"` + SortBy *string `json:"sort_by,omitempty"` + Uses Optional[bool] `json:"uses,omitempty"` + UsesLimit *int64 `json:"uses_limit,omitempty"` + UsesBrief *bool `json:"uses_brief,omitempty"` + NearPaths *[]string `json:"near_paths,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + Namespaces *[]string `json:"namespaces,omitempty"` + Presence *bool `json:"presence,omitempty"` + Neighbours Optional[bool] `json:"neighbours,omitempty"` + NeighbourK *int64 `json:"neighbour_k,omitempty"` +} + +// CodeSymbolOutput is the response from code.symbol. +type CodeSymbolOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Definitions []CodeUnit `json:"definitions"` + LessonsLeftOut *int64 `json:"lessons_left_out,omitempty"` + Ambiguous *bool `json:"ambiguous,omitempty"` + Hierarchy *map[string][]map[string]json.RawMessage `json:"hierarchy,omitempty"` + Candidates *[]map[string]json.RawMessage `json:"candidates,omitempty"` + TokensReturned *int64 `json:"tokens_returned,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` + Uses json.RawMessage `json:"uses,omitempty"` + UsesTruncated *bool `json:"uses_truncated,omitempty"` + UsesSkipped *string `json:"uses_skipped,omitempty"` + UsesTokens *int64 `json:"uses_tokens,omitempty"` + PickedBy *string `json:"picked_by,omitempty"` + ResolvedBy *string `json:"resolved_by,omitempty"` + DocumentedIn *[]map[string]json.RawMessage `json:"documented_in,omitempty"` + Neighbours *[]map[string]json.RawMessage `json:"neighbours,omitempty"` + Anchors *int64 `json:"anchors,omitempty"` + NeighbourTokens *int64 `json:"neighbour_tokens,omitempty"` + Presence *[]map[string]json.RawMessage `json:"presence,omitempty"` + Summary *map[string][]string `json:"summary,omitempty"` + EditTargets *[]CodeEditContextTarget `json:"edit_targets,omitempty"` + ReadSources Optional[[]CodeEditReadSource] `json:"read_sources,omitempty"` +} + +// CodeTestGateInput is the request to code.test_gate. +type CodeTestGateInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Files *[]string `json:"files,omitempty"` + Diff *string `json:"diff,omitempty"` + Depth *int64 `json:"depth,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// CodeTestGateOutput is the response from code.test_gate. +type CodeTestGateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Tests *[]map[string]json.RawMessage `json:"tests,omitempty"` + Untested *[]map[string]json.RawMessage `json:"untested,omitempty"` + Unlinked *[]map[string]json.RawMessage `json:"unlinked,omitempty"` + ChangedFiles *[]string `json:"changed_files,omitempty"` + TouchedSymbols *[]map[string]json.RawMessage `json:"touched_symbols,omitempty"` + Obligations *bool `json:"obligations,omitempty"` + TestsTotal *int64 `json:"tests_total,omitempty"` + UntestedTotal *int64 `json:"untested_total,omitempty"` + UnlinkedTotal *int64 `json:"unlinked_total,omitempty"` + TestsCapped *bool `json:"tests_capped,omitempty"` + UntestedCapped *bool `json:"untested_capped,omitempty"` + UnlinkedCapped *bool `json:"unlinked_capped,omitempty"` + CountsFloor *bool `json:"counts_floor,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Causes *[]string `json:"causes,omitempty"` + ByHopCounts *map[string]int64 `json:"by_hop_counts,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeTestHomeInput is the request to code.test_home. +type CodeTestHomeInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + FileStems *[]string `json:"file_stems,omitempty"` + Settings *[]string `json:"settings,omitempty"` + Engine *string `json:"engine,omitempty"` + Symbols *[]string `json:"symbols,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// CodeTestHomeOutput is the response from code.test_home. +type CodeTestHomeOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Home *string `json:"home,omitempty"` + Candidates *[]map[string]json.RawMessage `json:"candidates,omitempty"` + Parts *[]string `json:"parts,omitempty"` + SrcPaths *[]string `json:"src_paths,omitempty"` + NextFreeStatelessNumber *int64 `json:"next_free_stateless_number,omitempty"` + Control *map[string]json.RawMessage `json:"control,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeTestsForInput is the request to code.tests_for. +type CodeTestsForInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Facets []map[string]string `json:"facets"` + Limit *int64 `json:"limit,omitempty"` + Closest *bool `json:"closest,omitempty"` +} + +// CodeTestsForOutput is the response from code.tests_for. +type CodeTestsForOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Tests *[]map[string]json.RawMessage `json:"tests,omitempty"` + Total *int64 `json:"total,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Facets *[]map[string]string `json:"facets,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Abstain *bool `json:"abstain,omitempty"` + UncoveredKinds *[]string `json:"uncovered_kinds,omitempty"` + AsOf *map[string]json.RawMessage `json:"as_of,omitempty"` + TokensReturned *int64 `json:"tokens_returned,omitempty"` + TookMs *int64 `json:"took_ms,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeTierCoverage is a model used by Loom operations. +type CodeTierCoverage struct { + Tier string `json:"tier"` + Edges *int64 `json:"edges,omitempty"` + EdgesLastAt *string `json:"edges_last_at,omitempty"` +} + +// CodeTierHealth is a model used by Loom operations. +type CodeTierHealth struct { + Tier string `json:"tier"` + State *string `json:"state,omitempty"` + Kind *string `json:"kind,omitempty"` + Error *string `json:"error,omitempty"` + Fix *string `json:"fix,omitempty"` + FailingSince *string `json:"failing_since,omitempty"` + LastFailedAt *string `json:"last_failed_at,omitempty"` + FailedPasses *int64 `json:"failed_passes,omitempty"` + LastOkAt *string `json:"last_ok_at,omitempty"` + LagCommits *int64 `json:"lag_commits,omitempty"` +} + +// CodeTraceInput is the request to code.trace. +type CodeTraceInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Trace string `json:"trace"` + MaxFrames *int64 `json:"max_frames,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` +} + +// CodeTraceOutput is the response from code.trace. +type CodeTraceOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Frames []map[string]json.RawMessage `json:"frames"` + Definitions []CodeUnit `json:"definitions"` + TokensReturned *int64 `json:"tokens_returned,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeUnit is a model used by Loom operations. +type CodeUnit struct { + UnitID *string `json:"unit_id,omitempty"` + Path string `json:"path"` + StartLine *int64 `json:"start_line,omitempty"` + EndLine *int64 `json:"end_line,omitempty"` + Symbol *string `json:"symbol,omitempty"` + Kind *string `json:"kind,omitempty"` + Signature *string `json:"signature,omitempty"` + Body *string `json:"body,omitempty"` + Elided *bool `json:"elided,omitempty"` + BodyHash *string `json:"body_hash,omitempty"` + Description *string `json:"description,omitempty"` + Tier *string `json:"tier,omitempty"` + Score *float64 `json:"score,omitempty"` + RecentPrs *[]map[string]json.RawMessage `json:"recent_prs,omitempty"` + Examples *[]map[string]json.RawMessage `json:"examples,omitempty"` + Tests *[]map[string]json.RawMessage `json:"tests,omitempty"` + TestLinkState *string `json:"test_link_state,omitempty"` + Lessons *[]map[string]json.RawMessage `json:"lessons,omitempty"` + LessonsUnread *bool `json:"lessons_unread,omitempty"` + Churn *int64 `json:"churn,omitempty"` + Amp *int64 `json:"amp,omitempty"` + Tested *bool `json:"tested,omitempty"` + Callees *[]map[string]json.RawMessage `json:"callees,omitempty"` + Granularity *string `json:"granularity,omitempty"` + Next *string `json:"next,omitempty"` + Outline *[]map[string]json.RawMessage `json:"outline,omitempty"` + FanIn *int64 `json:"fan_in,omitempty"` + Via *string `json:"via,omitempty"` + LexicalRank *int64 `json:"lexical_rank,omitempty"` + VectorRank *int64 `json:"vector_rank,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +// CodeVerifyCitationsInput is the request to code.verify_citations. +type CodeVerifyCitationsInput struct { + PrFiles *map[string]string `json:"pr_files,omitempty"` + PrDiff *string `json:"pr_diff,omitempty"` + PrHeadSHA *string `json:"pr_head_sha,omitempty"` + PrBaseSHA *string `json:"pr_base_sha,omitempty"` + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Text string `json:"text"` + AtCommit *string `json:"at_commit,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + BaseNamespace *string `json:"base_namespace,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// CodeVerifyCitationsOutput is the response from code.verify_citations. +type CodeVerifyCitationsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Verdict string `json:"verdict"` + Counts *map[string]int64 `json:"counts,omitempty"` + Citations *[]map[string]json.RawMessage `json:"citations,omitempty"` + Skipped *[]map[string]json.RawMessage `json:"skipped,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Epistemic *map[string]string `json:"epistemic,omitempty"` + AtCommit *map[string]json.RawMessage `json:"at_commit,omitempty"` + PrDiff *map[string]json.RawMessage `json:"pr_diff,omitempty"` + Namespaces *[]string `json:"namespaces,omitempty"` + TookMs *int64 `json:"took_ms,omitempty"` + AsOf *map[string]json.RawMessage `json:"as_of,omitempty"` + Note *string `json:"note,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeVerifyInput is the request to code.verify. +type CodeVerifyInput struct { + Org *string `json:"org,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Kind string `json:"kind"` + Subject string `json:"subject"` + Object *string `json:"object,omitempty"` + Depth *int64 `json:"depth,omitempty"` +} + +// CodeVerifyOutput is the response from code.verify. +type CodeVerifyOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Verdict string `json:"verdict"` + Reason *string `json:"reason,omitempty"` + Explanation string `json:"explanation"` + Evidence *[]map[string]json.RawMessage `json:"evidence,omitempty"` + Floors *map[string]json.RawMessage `json:"floors,omitempty"` + IndexVerdict *string `json:"index_verdict,omitempty"` + TraceRunID *string `json:"trace_run_id,omitempty"` +} + +// CodeWorkerStatus is a model used by Loom operations. +type CodeWorkerStatus struct { + Enabled *bool `json:"enabled,omitempty"` + IntervalSeconds *int64 `json:"interval_seconds,omitempty"` + LastRunAt *string `json:"last_run_at,omitempty"` + LastDurationMs *int64 `json:"last_duration_ms,omitempty"` + ConsecutiveFailures *int64 `json:"consecutive_failures,omitempty"` + TotalRuns *int64 `json:"total_runs,omitempty"` + LastError *string `json:"last_error,omitempty"` +} + +// CollectionCreateInput is the request to collection.create. +type CollectionCreateInput struct { + Org string `json:"org"` + Namespace *string `json:"namespace,omitempty"` + Title *string `json:"title,omitempty"` + DeriveName *bool `json:"derive_name,omitempty"` + Parent *string `json:"parent,omitempty"` + Description *string `json:"description,omitempty"` +} + +// CollectionCreateOutput is the response from collection.create. +type CollectionCreateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Namespace string `json:"namespace"` + Parent string `json:"parent"` + Created bool `json:"created"` + Title *string `json:"title,omitempty"` +} + +// CollectionDeleteInput is the request to collection.delete. +type CollectionDeleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// CollectionDeleteOutput is the response from collection.delete. +type CollectionDeleteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Namespace string `json:"namespace"` + Deleted bool `json:"deleted"` + ErasureID *string `json:"erasure_id,omitempty"` + ErasureStatus *string `json:"erasure_status,omitempty"` +} + +// CollectionEntry is a model used by Loom operations. +type CollectionEntry struct { + Namespace string `json:"namespace"` + Parent string `json:"parent"` + Personal bool `json:"personal"` + Role string `json:"role"` + Description *string `json:"description,omitempty"` + Title *string `json:"title,omitempty"` + DocumentCount Optional[int64] `json:"document_count,omitempty"` +} + +// CollectionListInput is the request to collection.list. +type CollectionListInput struct { + Org string `json:"org"` + Limit *int64 `json:"limit,omitempty"` + IncludeDocumentCounts *bool `json:"include_document_counts,omitempty"` + Cursor Optional[string] `json:"cursor,omitempty"` +} + +// CollectionListOutput is the response from collection.list. +type CollectionListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Collections []CollectionEntry `json:"collections"` + NextCursor Optional[string] `json:"next_cursor,omitempty"` +} + +// CollectionMoveInput is the request to collection.move. +type CollectionMoveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Parent *string `json:"parent,omitempty"` +} + +// CollectionMoveOutput is the response from collection.move. +type CollectionMoveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Namespace string `json:"namespace"` + Parent string `json:"parent"` + Moved bool `json:"moved"` +} + +// ConflictCandidateMemory is a model used by Loom operations. +type ConflictCandidateMemory struct { + LocalID int64 `json:"local_id"` + MemoryID string `json:"memory_id"` + MemoryKey string `json:"memory_key"` + Value json.RawMessage `json:"value"` + Pinned bool `json:"pinned"` + CreatedAt string `json:"created_at"` +} + +// ConflictRevisionSuggestion is a model used by Loom operations. +type ConflictRevisionSuggestion struct { + Decision string `json:"decision"` + TargetLocalID int64 `json:"target_local_id"` + PeerLocalIds []int64 `json:"peer_local_ids"` + Rationale string `json:"rationale"` + ApplyOperation *string `json:"apply_operation,omitempty"` +} + +// ConflictRow is a model used by Loom operations. +type ConflictRow struct { + MemoryID *string `json:"memory_id,omitempty"` + MemoryKey *string `json:"memory_key,omitempty"` + MemoryType *string `json:"memory_type,omitempty"` + Value json.RawMessage `json:"value,omitempty"` + Version *uint64 `json:"version,omitempty"` + Pinned *bool `json:"pinned,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + ConflictWith *[]string `json:"conflict_with,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` +} + +// ConflictsAllowlistListInput is the request to conflicts.allowlist_list. +type ConflictsAllowlistListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` +} + +// ConflictsAllowlistListOutput is the response from conflicts.allowlist_list. +type ConflictsAllowlistListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []AllowlistRow `json:"rows"` +} + +// ConflictsAllowlistRemoveInput is the request to conflicts.allowlist_remove. +type ConflictsAllowlistRemoveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryKeyA string `json:"memory_key_a"` + MemoryKeyB string `json:"memory_key_b"` + RemovedBy *string `json:"removed_by,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// ConflictsAllowlistRemoveOutput is the response from conflicts.allowlist_remove. +type ConflictsAllowlistRemoveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Removed bool `json:"removed"` +} + +// ConflictsListInput is the request to conflicts.list. +type ConflictsListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` + BeforeVersion Optional[uint64] `json:"before_version,omitempty"` + CountOnly *bool `json:"count_only,omitempty"` + Fresh *bool `json:"fresh,omitempty"` + KeysOnly *bool `json:"keys_only,omitempty"` + Fields Optional[[]string] `json:"fields,omitempty"` +} + +// ConflictsListOutput is the response from conflicts.list. +type ConflictsListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []ConflictRow `json:"rows"` + NextBeforeVersion Optional[uint64] `json:"next_before_version,omitempty"` + Total Optional[int64] `json:"total,omitempty"` + Keys Optional[[]string] `json:"keys,omitempty"` +} + +// ConflictsProposeRevisionInput is the request to conflicts.propose_revision. +type ConflictsProposeRevisionInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryID string `json:"memory_id"` + PeerID Optional[string] `json:"peer_id,omitempty"` +} + +// ConflictsProposeRevisionOutput is the response from conflicts.propose_revision. +type ConflictsProposeRevisionOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + Memories *[]ConflictCandidateMemory `json:"memories,omitempty"` + Suggestions *[]ConflictRevisionSuggestion `json:"suggestions,omitempty"` + Note *string `json:"note,omitempty"` +} + +// ConflictsResolveInput is the request to conflicts.resolve. +type ConflictsResolveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryID string `json:"memory_id"` + Decision string `json:"decision"` + PeerID Optional[string] `json:"peer_id,omitempty"` + Reason *string `json:"reason,omitempty"` + ResolvedBy *string `json:"resolved_by,omitempty"` +} + +// ConflictsResolveOutput is the response from conflicts.resolve. +type ConflictsResolveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Resolved bool `json:"resolved"` + Decision string `json:"decision"` + AffectedMemoryIds []string `json:"affected_memory_ids"` + ResolvedAt Optional[string] `json:"resolved_at,omitempty"` + Total Optional[int64] `json:"total,omitempty"` +} + +// ConnectedAgent is a model used by Loom operations. +type ConnectedAgent struct { + Agent string `json:"agent"` + LastSeen string `json:"last_seen"` + FirstSeen string `json:"first_seen"` + Ops int64 `json:"ops"` + NamespacesTouched int64 `json:"namespaces_touched"` + PrimaryNamespace string `json:"primary_namespace"` + CostUsd *float64 `json:"cost_usd,omitempty"` +} + +// ConnectionDisconnectInput is the request to connection.disconnect. +type ConnectionDisconnectInput struct { + Org string `json:"org"` + Kind string `json:"kind"` +} + +// ConnectionDisconnectOutput is the response from connection.disconnect. +type ConnectionDisconnectOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Disconnected bool `json:"disconnected"` +} + +// ConnectionEntry is a model used by Loom operations. +type ConnectionEntry struct { + Kind string `json:"kind"` + Connected bool `json:"connected"` + AccountEmail Optional[string] `json:"account_email,omitempty"` + Scopes *[]string `json:"scopes,omitempty"` + ConnectURL string `json:"connect_url"` +} + +// ConnectionListInput is the request to connection.list. +type ConnectionListInput struct { + Org string `json:"org"` +} + +// ConnectionListOutput is the response from connection.list. +type ConnectionListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Connections []ConnectionEntry `json:"connections"` +} + +// ConsolidationRunRow is a model used by Loom operations. +type ConsolidationRunRow struct { + RunID string `json:"run_id"` + MemoryType string `json:"memory_type"` + SourceMemoryIds []string `json:"source_memory_ids"` + SourceMemoryKeys []string `json:"source_memory_keys"` + ClusterSize int64 `json:"cluster_size"` + ClusterCohesion float64 `json:"cluster_cohesion"` + OutputMemoryID string `json:"output_memory_id"` + OutputMemoryKey string `json:"output_memory_key"` + LLMProvider string `json:"llm_provider"` + LLMModel string `json:"llm_model"` + TokensIn int64 `json:"tokens_in"` + TokensOut int64 `json:"tokens_out"` + DurationMs int64 `json:"duration_ms"` + Status string `json:"status"` + FailureReason string `json:"failure_reason"` + RanAt string `json:"ran_at"` +} + +// ConsolidationsListInput is the request to consolidations.list. +type ConsolidationsListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// ConsolidationsListOutput is the response from consolidations.list. +type ConsolidationsListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []ConsolidationRunRow `json:"rows"` +} + +// ContextBlock is a model used by Loom operations. +type ContextBlock struct { + Label string `json:"label"` + Section string `json:"section"` + Rendered string `json:"rendered"` + TokensEstimate int64 `json:"tokens_estimate"` + Citations *[]string `json:"citations,omitempty"` + Priority *int64 `json:"priority,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + SourceCount *int64 `json:"source_count,omitempty"` +} + +// ContextFetchInput is the request to context.fetch. +type ContextFetchInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + BlobKey string `json:"blob_key"` + Offset *int64 `json:"offset,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Pattern *string `json:"pattern,omitempty"` + ContextLines *int64 `json:"context_lines,omitempty"` +} + +// ContextFetchOutput is the response from context.fetch. +type ContextFetchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + BlobKey string `json:"blob_key"` + Content *string `json:"content,omitempty"` + ContentType *string `json:"content_type,omitempty"` + Summary *string `json:"summary,omitempty"` + TotalChars *int64 `json:"total_chars,omitempty"` + TotalLines *int64 `json:"total_lines,omitempty"` + Offset *int64 `json:"offset,omitempty"` + NextOffset *int64 `json:"next_offset,omitempty"` + MatchedLines *int64 `json:"matched_lines,omitempty"` + ExpiresAt Optional[string] `json:"expires_at,omitempty"` +} + +// ContextOffloadInput is the request to context.offload. +type ContextOffloadInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Content string `json:"content"` + BlobKey *string `json:"blob_key,omitempty"` + ContentType *string `json:"content_type,omitempty"` + Summary *string `json:"summary,omitempty"` + TTLSeconds *int64 `json:"ttl_seconds,omitempty"` +} + +// ContextOffloadOutput is the response from context.offload. +type ContextOffloadOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + BlobKey string `json:"blob_key"` + ContentBytes int64 `json:"content_bytes"` + ContentChars int64 `json:"content_chars"` + SHA256 string `json:"sha256"` + Summary string `json:"summary"` + ExpiresAt string `json:"expires_at"` + Pointer string `json:"pointer"` +} + +// ContextPackInput is the request to context.pack. +type ContextPackInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Query *string `json:"query,omitempty"` + Situation *string `json:"situation,omitempty"` + ProcedureExploreRate Optional[float64] `json:"procedure_explore_rate,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + ReadScope *string `json:"read_scope,omitempty"` + Mode *string `json:"mode,omitempty"` + IncludeKnowledge *bool `json:"include_knowledge,omitempty"` + IncludeConversations *bool `json:"include_conversations,omitempty"` + IncludeRuns *bool `json:"include_runs,omitempty"` + RunsLimit *int64 `json:"runs_limit,omitempty"` + IncludeChunks *bool `json:"include_chunks,omitempty"` + SectionTokenBudgets *map[string]int64 `json:"section_token_budgets,omitempty"` + BlockOrder *[]string `json:"block_order,omitempty"` + SessionBlock *string `json:"session_block,omitempty"` + OnlySections *[]string `json:"only_sections,omitempty"` + IncludeDecisions *bool `json:"include_decisions,omitempty"` +} + +// ContextPackOutput is the response from context.pack. +type ContextPackOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rendered string `json:"rendered"` + Sections map[string]string `json:"sections"` + Blocks *[]ContextBlock `json:"blocks,omitempty"` + SectionMeta *map[string]map[string]json.RawMessage `json:"section_meta,omitempty"` + SectionCount int64 `json:"section_count"` + Truncated *bool `json:"truncated,omitempty"` + TokenBudget int64 `json:"token_budget"` + Mode *string `json:"mode,omitempty"` + TokensEstimate *int64 `json:"tokens_estimate,omitempty"` + FillRatio *float64 `json:"fill_ratio,omitempty"` + StableSections *[]string `json:"stable_sections,omitempty"` + StablePrefixChars *int64 `json:"stable_prefix_chars,omitempty"` + StableHash *string `json:"stable_hash,omitempty"` + ProcedureKeys *[]string `json:"procedure_keys,omitempty"` + ProcedureKeysWithheld *[]string `json:"procedure_keys_withheld,omitempty"` +} + +// ConversationAppendInput is the request to conversation.append. +type ConversationAppendInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + ThreadID string `json:"thread_id"` + MsgID *string `json:"msg_id,omitempty"` + Role string `json:"role"` + Content string `json:"content"` + Reasoning *string `json:"reasoning,omitempty"` + UserID *string `json:"user_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + Tokens *int64 `json:"tokens,omitempty"` +} + +// ConversationAppendOutput is the response from conversation.append. +type ConversationAppendOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MsgID string `json:"msg_id"` + Ts string `json:"ts"` + Stored *bool `json:"stored,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// ConversationCompactInput is the request to conversation.compact. +type ConversationCompactInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + ThreadID string `json:"thread_id"` + KeepRecent *int64 `json:"keep_recent,omitempty"` + MinToCompact *int64 `json:"min_to_compact,omitempty"` +} + +// ConversationCompactOutput is the response from conversation.compact. +type ConversationCompactOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Compacted bool `json:"compacted"` + MessagesSummarized int64 `json:"messages_summarized"` + SummaryMsgID *string `json:"summary_msg_id,omitempty"` + TokensIn *int64 `json:"tokens_in,omitempty"` + TokensOut *int64 `json:"tokens_out,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// ConversationCreateInput is the request to conversation.create. +type ConversationCreateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + ThreadID string `json:"thread_id"` + Title *string `json:"title,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + RunID *string `json:"run_id,omitempty"` + UserID *string `json:"user_id,omitempty"` +} + +// ConversationCreateOutput is the response from conversation.create. +type ConversationCreateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ThreadID string `json:"thread_id"` + CreatedAt string `json:"created_at"` +} + +// ConversationDeleteInput is the request to conversation.delete. +type ConversationDeleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + ThreadID string `json:"thread_id"` + ConfirmThreadID string `json:"confirm_thread_id"` +} + +// ConversationDeleteOutput is the response from conversation.delete. +type ConversationDeleteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + TombstonedAt string `json:"tombstoned_at"` + ThreadID string `json:"thread_id"` + RowsAffected map[string]int64 `json:"rows_affected"` + Total int64 `json:"total"` +} + +// ConversationEntry is a model used by Loom operations. +type ConversationEntry struct { + MsgID string `json:"msg_id"` + Agent *string `json:"agent,omitempty"` + Role string `json:"role"` + Content string `json:"content"` + Reasoning string `json:"reasoning"` + UserID string `json:"user_id"` + RunID string `json:"run_id"` + Metadata map[string]json.RawMessage `json:"metadata"` + Tokens int64 `json:"tokens"` + Ts string `json:"ts"` +} + +// ConversationGetInput is the request to conversation.get. +type ConversationGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + ThreadID string `json:"thread_id"` + IncludeMessages *bool `json:"include_messages,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Offset *int64 `json:"offset,omitempty"` + Order *string `json:"order,omitempty"` +} + +// ConversationGetOutput is the response from conversation.get. +type ConversationGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + ThreadID string `json:"thread_id"` + Title *string `json:"title,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + RunID *string `json:"run_id,omitempty"` + UserID *string `json:"user_id,omitempty"` + Agent *string `json:"agent,omitempty"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + MsgCount *int64 `json:"msg_count,omitempty"` + Messages *[]ConversationEntry `json:"messages,omitempty"` + NextCursor Optional[string] `json:"next_cursor,omitempty"` +} + +// ConversationHit is a model used by Loom operations. +type ConversationHit struct { + ThreadID string `json:"thread_id"` + MsgID string `json:"msg_id"` + Role string `json:"role"` + ContentExcerpt string `json:"content_excerpt"` + Ts string `json:"ts"` + Namespace *string `json:"namespace,omitempty"` +} + +// ConversationListInput is the request to conversation.list. +type ConversationListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + ThreadID string `json:"thread_id"` + RunID Optional[string] `json:"run_id,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Cursor Optional[string] `json:"cursor,omitempty"` +} + +// ConversationListOutput is the response from conversation.list. +type ConversationListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []ConversationEntry `json:"rows"` + NextCursor Optional[string] `json:"next_cursor,omitempty"` +} + +// ConversationListSavedMessagesInput is the request to conversation.list_saved_messages. +type ConversationListSavedMessagesInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID string `json:"user_id"` + ConversationID Optional[string] `json:"conversation_id,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Cursor Optional[string] `json:"cursor,omitempty"` + Fields Optional[[]string] `json:"fields,omitempty"` +} + +// ConversationListSavedMessagesOutput is the response from conversation.list_saved_messages. +type ConversationListSavedMessagesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []SavedMessageHit `json:"rows"` + NextCursor Optional[string] `json:"next_cursor,omitempty"` +} + +// ConversationSaveMessageInput is the request to conversation.save_message. +type ConversationSaveMessageInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + ConversationID string `json:"conversation_id"` + MessageID string `json:"message_id"` + Role string `json:"role"` + Content string `json:"content"` + UserID string `json:"user_id"` +} + +// ConversationSaveMessageOutput is the response from conversation.save_message. +type ConversationSaveMessageOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ConversationID string `json:"conversation_id"` + MessageID string `json:"message_id"` + Indexed bool `json:"indexed"` + Reason *string `json:"reason,omitempty"` + Ts string `json:"ts"` +} + +// ConversationSavedStatusInput is the request to conversation.saved_status. +type ConversationSavedStatusInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID string `json:"user_id"` + ConversationID string `json:"conversation_id"` + MessageIds []string `json:"message_ids"` +} + +// ConversationSavedStatusOutput is the response from conversation.saved_status. +type ConversationSavedStatusOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Saved []string `json:"saved"` +} + +// ConversationSearchInput is the request to conversation.search. +type ConversationSearchInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + Query string `json:"query"` + ThreadID Optional[string] `json:"thread_id,omitempty"` + RunID Optional[string] `json:"run_id,omitempty"` + Role Optional[string] `json:"role,omitempty"` + UserID Optional[string] `json:"user_id,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + NamespaceScope *string `json:"namespace_scope,omitempty"` +} + +// ConversationSearchOutput is the response from conversation.search. +type ConversationSearchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Hits []ConversationHit `json:"hits"` + NamespacesSkipped *[]string `json:"namespaces_skipped,omitempty"` +} + +// ConversationSearchSavedMessagesInput is the request to conversation.search_saved_messages. +type ConversationSearchSavedMessagesInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID string `json:"user_id"` + Query string `json:"query"` + ConversationID Optional[string] `json:"conversation_id,omitempty"` + Role Optional[string] `json:"role,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + SearchMode *string `json:"search_mode,omitempty"` + LexicalWeight *float64 `json:"lexical_weight,omitempty"` +} + +// ConversationSearchSavedMessagesOutput is the response from conversation.search_saved_messages. +type ConversationSearchSavedMessagesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Hits []SavedMessageHit `json:"hits"` +} + +// ConversationSetLoggingInput is the request to conversation.set_logging. +type ConversationSetLoggingInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Enabled bool `json:"enabled"` +} + +// ConversationSetLoggingOutput is the response from conversation.set_logging. +type ConversationSetLoggingOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Namespace string `json:"namespace"` + Enabled bool `json:"enabled"` +} + +// ConversationThreadSummary is a model used by Loom operations. +type ConversationThreadSummary struct { + ThreadID *string `json:"thread_id,omitempty"` + Agent *string `json:"agent,omitempty"` + MsgCount *int64 `json:"msg_count,omitempty"` + FirstSeen *string `json:"first_seen,omitempty"` + LastSeen *string `json:"last_seen,omitempty"` + LastRole *string `json:"last_role,omitempty"` + LastContentExcerpt *string `json:"last_content_excerpt,omitempty"` + Title *string `json:"title,omitempty"` +} + +// ConversationThreadsInput is the request to conversation.threads. +type ConversationThreadsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + WindowDays *int64 `json:"window_days,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Offset *int64 `json:"offset,omitempty"` + Fields Optional[[]string] `json:"fields,omitempty"` +} + +// ConversationThreadsOutput is the response from conversation.threads. +type ConversationThreadsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Threads []ConversationThreadSummary `json:"threads"` +} + +// ConversationUnsaveMessageInput is the request to conversation.unsave_message. +type ConversationUnsaveMessageInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + ConversationID string `json:"conversation_id"` + MessageID string `json:"message_id"` + UserID string `json:"user_id"` +} + +// ConversationUnsaveMessageOutput is the response from conversation.unsave_message. +type ConversationUnsaveMessageOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ConversationID string `json:"conversation_id"` + MessageID string `json:"message_id"` + Found bool `json:"found"` + Removed *bool `json:"removed,omitempty"` + Ts string `json:"ts"` +} + +// ConversationUpdateInput is the request to conversation.update. +type ConversationUpdateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + ThreadID string `json:"thread_id"` + Title Optional[string] `json:"title,omitempty"` + Metadata Optional[map[string]json.RawMessage] `json:"metadata,omitempty"` + RunID Optional[string] `json:"run_id,omitempty"` +} + +// ConversationUpdateOutput is the response from conversation.update. +type ConversationUpdateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Updated bool `json:"updated"` + ThreadID string `json:"thread_id"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` +} + +// CostAgentSummaryInput is the request to cost.agent_summary. +type CostAgentSummaryInput struct { + Org string `json:"org"` + Namespace Optional[string] `json:"namespace,omitempty"` + FromDate string `json:"from_date"` + ToDate string `json:"to_date"` + GroupBy *[]string `json:"group_by,omitempty"` + Agent Optional[string] `json:"agent,omitempty"` + Consumer Optional[string] `json:"consumer,omitempty"` +} + +// CostAgentSummaryOutput is the response from cost.agent_summary. +type CostAgentSummaryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []CostAgentSummaryRow `json:"rows"` + TotalTurns int64 `json:"total_turns"` + TotalSessions int64 `json:"total_sessions"` + TotalCostUsd float64 `json:"total_cost_usd"` + UnpricedTurns int64 `json:"unpriced_turns"` +} + +// CostAgentSummaryRow is a model used by Loom operations. +type CostAgentSummaryRow struct { + Namespace Optional[string] `json:"namespace,omitempty"` + Agent Optional[string] `json:"agent,omitempty"` + Day Optional[string] `json:"day,omitempty"` + Model Optional[string] `json:"model,omitempty"` + Consumer Optional[string] `json:"consumer,omitempty"` + SessionID Optional[string] `json:"session_id,omitempty"` + Turns int64 `json:"turns"` + Sessions int64 `json:"sessions"` + InputTokens int64 `json:"input_tokens"` + CacheReadTokens int64 `json:"cache_read_tokens"` + CacheWriteTokens int64 `json:"cache_write_tokens"` + OutputTokens int64 `json:"output_tokens"` + CostUsd float64 `json:"cost_usd"` + UnpricedTurns int64 `json:"unpriced_turns"` +} + +// CostBudgetStatusInput is the request to cost.budget_status. +type CostBudgetStatusInput = BudgetStatusInput + +// CostBudgetStatusOutput is the response from cost.budget_status. +type CostBudgetStatusOutput = BudgetStatusOutput + +// CostRecordTurnsInput is the request to cost.record_turns. +type CostRecordTurnsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID string `json:"session_id"` + Consumer *string `json:"consumer,omitempty"` + Turns []TurnUsage `json:"turns"` +} + +// CostRecordTurnsOutput is the response from cost.record_turns. +type CostRecordTurnsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Recorded int64 `json:"recorded"` + Priced int64 `json:"priced"` + UnpricedModels *[]string `json:"unpriced_models,omitempty"` + CostUsd *float64 `json:"cost_usd,omitempty"` + TurnsDatedAhead *int64 `json:"turns_dated_ahead,omitempty"` +} + +// CostSummaryInput is the request to cost.summary. +type CostSummaryInput struct { + Org string `json:"org"` + Namespace Optional[string] `json:"namespace,omitempty"` + FromDate string `json:"from_date"` + ToDate string `json:"to_date"` + GroupBy *[]string `json:"group_by,omitempty"` + Agent Optional[string] `json:"agent,omitempty"` + Operation Optional[string] `json:"operation,omitempty"` + UserID Optional[string] `json:"user_id,omitempty"` + TrafficClass Optional[string] `json:"traffic_class,omitempty"` + InstanceLabel Optional[string] `json:"instance_label,omitempty"` + IncludeCache *bool `json:"include_cache,omitempty"` +} + +// CostSummaryOutput is the response from cost.summary. +type CostSummaryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []CostSummaryRow `json:"rows"` + TotalOps int64 `json:"total_ops"` + TotalErrors int64 `json:"total_errors"` + TotalCostUsd float64 `json:"total_cost_usd"` + CacheHits *int64 `json:"cache_hits,omitempty"` + CacheSavedUsd *float64 `json:"cache_saved_usd,omitempty"` +} + +// CostSummaryRow is a model used by Loom operations. +type CostSummaryRow struct { + Namespace Optional[string] `json:"namespace,omitempty"` + Agent Optional[string] `json:"agent,omitempty"` + Day Optional[string] `json:"day,omitempty"` + Operation Optional[string] `json:"operation,omitempty"` + MemoryKey Optional[string] `json:"memory_key,omitempty"` + UserID Optional[string] `json:"user_id,omitempty"` + Model Optional[string] `json:"model,omitempty"` + TrafficClass Optional[string] `json:"traffic_class,omitempty"` + InstanceLabel Optional[string] `json:"instance_label,omitempty"` + BuildCommit Optional[string] `json:"build_commit,omitempty"` + Ops int64 `json:"ops"` + Errors int64 `json:"errors"` + Tokens int64 `json:"tokens"` + EmbedTokens int64 `json:"embed_tokens"` + CostUsd float64 `json:"cost_usd"` + LatencyP50Ms float64 `json:"latency_p50_ms"` + LatencyP95Ms float64 `json:"latency_p95_ms"` + LatencyP99Ms float64 `json:"latency_p99_ms"` + CacheHits *int64 `json:"cache_hits,omitempty"` + CacheSavedUsd *float64 `json:"cache_saved_usd,omitempty"` +} + +// DatasetClarificationOut is a model used by Loom operations. +type DatasetClarificationOut struct { + Code string `json:"code"` + Column string `json:"column"` + Detail string `json:"detail"` +} + +// DatasetColumnOut is a model used by Loom operations. +type DatasetColumnOut struct { + Name string `json:"name"` + Type string `json:"type"` + Inferred string `json:"inferred"` + Stored bool `json:"stored"` +} + +// DatasetOut is a model used by Loom operations. +type DatasetOut struct { + DatasetID string `json:"dataset_id"` + SourceURI string `json:"source_uri"` + Name string `json:"name"` + Sheet *string `json:"sheet,omitempty"` + RowStart *int64 `json:"row_start,omitempty"` + RowEnd *int64 `json:"row_end,omitempty"` + Revision int64 `json:"revision"` + SnapshotID string `json:"snapshot_id"` + SchemaState string `json:"schema_state"` + Columns []DatasetColumnOut `json:"columns"` + Clarifications *[]DatasetClarificationOut `json:"clarifications,omitempty"` + RowCount int64 `json:"row_count"` + RejectedRows *int64 `json:"rejected_rows,omitempty"` + Rejected *[]DatasetRejectedOut `json:"rejected,omitempty"` + Complete *bool `json:"complete,omitempty"` + ApprovedBy *string `json:"approved_by,omitempty"` + ApprovedAt Optional[string] `json:"approved_at,omitempty"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + Rows *[]map[string]json.RawMessage `json:"rows,omitempty"` +} + +// DatasetRejectedOut is a model used by Loom operations. +type DatasetRejectedOut struct { + Row int64 `json:"row"` + Column string `json:"column"` + Reason string `json:"reason"` +} + +// DecisionChainInput is the request to decision.chain. +type DecisionChainInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryKey string `json:"memory_key"` + Direction *string `json:"direction,omitempty"` + MaxHops *int64 `json:"max_hops,omitempty"` +} + +// DecisionChainOutput is the response from decision.chain. +type DecisionChainOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Seed string `json:"seed"` + SeedDecision Optional[DecisionRow] `json:"seed_decision,omitempty"` + Nodes []ChainNodeRow `json:"nodes"` +} + +// DecisionOutcomeInput is the request to decision.outcome. +type DecisionOutcomeInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryKey string `json:"memory_key"` + RealizedOutcome string `json:"realized_outcome"` + Success Optional[bool] `json:"success,omitempty"` + Agent *string `json:"agent,omitempty"` +} + +// DecisionOutcomeOutput is the response from decision.outcome. +type DecisionOutcomeOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MemoryKey string `json:"memory_key"` + Updated bool `json:"updated"` + MemoriesCredited *int64 `json:"memories_credited,omitempty"` +} + +// DecisionPrecedentsInput is the request to decision.precedents. +type DecisionPrecedentsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Query string `json:"query"` + Category *string `json:"category,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + WithOutcomeOnly *bool `json:"with_outcome_only,omitempty"` +} + +// DecisionPrecedentsOutput is the response from decision.precedents. +type DecisionPrecedentsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Precedents []DecisionRow `json:"precedents"` + EmbeddingModel *string `json:"embedding_model,omitempty"` +} + +// DecisionRecordInput is the request to decision.record. +type DecisionRecordInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Category string `json:"category"` + Scenario string `json:"scenario"` + Reasoning string `json:"reasoning"` + Outcome string `json:"outcome"` + Alternatives *[]string `json:"alternatives,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Stage *string `json:"stage,omitempty"` + DecisionMaker *string `json:"decision_maker,omitempty"` + CausedBy *[]string `json:"caused_by,omitempty"` + InfluencedBy *[]string `json:"influenced_by,omitempty"` + Tags *[]string `json:"tags,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + Files Optional[[]string] `json:"files,omitempty"` + SourceClass Optional[string] `json:"source_class,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` +} + +// DecisionRecordOutput is the response from decision.record. +type DecisionRecordOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MemoryKey string `json:"memory_key"` + RecordID string `json:"record_id"` + SupersededPrior *bool `json:"superseded_prior,omitempty"` + EdgesWritten *int64 `json:"edges_written,omitempty"` + Next *string `json:"next,omitempty"` +} + +// DecisionRow is a model used by Loom operations. +type DecisionRow struct { + MemoryKey string `json:"memory_key"` + Category *string `json:"category,omitempty"` + Scenario *string `json:"scenario,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` + Outcome *string `json:"outcome,omitempty"` + Alternatives *[]string `json:"alternatives,omitempty"` + Confidence Optional[float64] `json:"confidence,omitempty"` + DecisionMaker *string `json:"decision_maker,omitempty"` + RunID *string `json:"run_id,omitempty"` + RealizedOutcome *string `json:"realized_outcome,omitempty"` + Success Optional[bool] `json:"success,omitempty"` + MadeAt *string `json:"made_at,omitempty"` + Stage *string `json:"stage,omitempty"` + Similarity *float64 `json:"similarity,omitempty"` +} + +// DecisionStage is a model used by Loom operations. +type DecisionStage struct { + Total int64 `json:"total"` + Confirmed int64 `json:"confirmed"` + Unconfirmed int64 `json:"unconfirmed"` + SourceChanged int64 `json:"source_changed"` + OutcomeKnown int64 `json:"outcome_known"` +} + +// DecisionTotals is a model used by Loom operations. +type DecisionTotals struct { + Definition string `json:"definition"` + Refs *[]string `json:"refs,omitempty"` + AllDocuments Optional[DocumentDecisions] `json:"all_documents,omitempty"` +} + +// DedupCluster is a model used by Loom operations. +type DedupCluster struct { + CanonicalID string `json:"canonical_id"` + CanonicalKey *string `json:"canonical_key,omitempty"` + CanonicalAgent *string `json:"canonical_agent,omitempty"` + DupCount int64 `json:"dup_count"` + Duplicates *[]DedupDuplicate `json:"duplicates,omitempty"` +} + +// DedupCollapsePair is a model used by Loom operations. +type DedupCollapsePair struct { + DuplicateKey string `json:"duplicate_key"` + CanonicalKey string `json:"canonical_key"` +} + +// DedupDuplicate is a model used by Loom operations. +type DedupDuplicate struct { + MemoryID string `json:"memory_id"` + MemoryKey string `json:"memory_key"` + Agent string `json:"agent"` + CreatedAt Optional[string] `json:"created_at,omitempty"` +} + +// DefinitionEntry is a model used by Loom operations. +type DefinitionEntry struct { + MemoryKey string `json:"memory_key"` + PromotedAt string `json:"promoted_at"` + Capped *bool `json:"capped,omitempty"` + Term Optional[string] `json:"term,omitempty"` + Aliases *[]string `json:"aliases,omitempty"` + Verdict Optional[string] `json:"verdict,omitempty"` + LapseReason Optional[string] `json:"lapse_reason,omitempty"` + Lost *[]LostName `json:"lost,omitempty"` +} + +// DemonstrationRow is a model used by Loom operations. +type DemonstrationRow struct { + MemoryKey string `json:"memory_key"` + Text string `json:"text"` + Label string `json:"label"` + Similarity float64 `json:"similarity"` +} + +// DigestRow is a model used by Loom operations. +type DigestRow struct { + SessionID string `json:"session_id"` + SummaryText string `json:"summary_text"` + KeyFacts *[]string `json:"key_facts,omitempty"` + DerivedFrom *[]string `json:"derived_from,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + Version *int64 `json:"version,omitempty"` +} + +// DocumentChunks is a model used by Loom operations. +type DocumentChunks struct { + Live int64 `json:"live"` + Searchable int64 `json:"searchable"` + Unembedded int64 `json:"unembedded"` + OtherModel int64 `json:"other_model"` + Versions int64 `json:"versions"` + MinChars int64 `json:"min_chars"` + MedianChars int64 `json:"median_chars"` + MaxChars int64 `json:"max_chars"` + Models *[]string `json:"models,omitempty"` +} + +// DocumentCount is a model used by Loom operations. +type DocumentCount struct { + Name string `json:"name"` + Live int64 `json:"live"` + Deleted int64 `json:"deleted"` +} + +// DocumentDecisions is a model used by Loom operations. +type DocumentDecisions struct { + Decided DecisionStage `json:"decided"` + Proposed DecisionStage `json:"proposed"` +} + +// DocumentFinding is a model used by Loom operations. +type DocumentFinding struct { + Kind string `json:"kind"` + RuleVersion int64 `json:"rule_version"` + SourceOp string `json:"source_op"` + WindowSeconds Optional[int64] `json:"window_seconds,omitempty"` + Population Optional[int64] `json:"population,omitempty"` + SampleLimit int64 `json:"sample_limit"` + SamplesComplete bool `json:"samples_complete"` + Evidence *[]FindingEvidence `json:"evidence,omitempty"` + Exceptions *string `json:"exceptions,omitempty"` + Uncertainty *string `json:"uncertainty,omitempty"` + Code string `json:"code"` + Severity string `json:"severity"` + Count int64 `json:"count"` + Share float64 `json:"share"` + Samples *[]string `json:"samples,omitempty"` + Ingested *int64 `json:"ingested,omitempty"` + IngestedSamples *[]string `json:"ingested_samples,omitempty"` + Detail string `json:"detail"` + Remedy string `json:"remedy"` + Refs *[]string `json:"refs,omitempty"` +} + +// DocumentTotals is a model used by Loom operations. +type DocumentTotals struct { + Live Optional[int64] `json:"live,omitempty"` + Deleted Optional[int64] `json:"deleted,omitempty"` + NewestIngestedAt Optional[string] `json:"newest_ingested_at,omitempty"` + ByFormat *[]DocumentCount `json:"by_format,omitempty"` + BySourceScheme *[]DocumentCount `json:"by_source_scheme,omitempty"` + EarlierRevisions Optional[int64] `json:"earlier_revisions,omitempty"` + Unnumbered Optional[int64] `json:"unnumbered,omitempty"` + RetiredVersions Optional[int64] `json:"retired_versions,omitempty"` +} + +// ErasureExportInput is the request to erasure.export. +type ErasureExportInput struct { + Org string `json:"org"` + ScopeType string `json:"scope_type"` + ScopeValue string `json:"scope_value"` + Requester string `json:"requester"` + IncludeTombstoned *bool `json:"include_tombstoned,omitempty"` + SectionLimit *int64 `json:"section_limit,omitempty"` +} + +// ErasureExportOutput is the response from erasure.export. +type ErasureExportOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ExportedAt string `json:"exported_at"` + Org string `json:"org"` + ScopeType string `json:"scope_type"` + ScopeValue string `json:"scope_value"` + Requester string `json:"requester"` + Counts map[string]int64 `json:"counts"` + Memory ErasureExportSection `json:"memory"` + Knowledge ErasureExportSection `json:"knowledge"` + Conversations ErasureExportSection `json:"conversations"` + ConversationThreads ErasureExportSection `json:"conversation_threads"` + AgentEvents ErasureExportSection `json:"agent_events"` + AuditLog ErasureExportSection `json:"audit_log"` +} + +// ErasureExportSection is a model used by Loom operations. +type ErasureExportSection struct { + Rows []map[string]json.RawMessage `json:"rows"` + Count int64 `json:"count"` + Truncated *bool `json:"truncated,omitempty"` +} + +// ErasureListInput is the request to erasure.list. +type ErasureListInput struct { + Org string `json:"org"` + Limit *int64 `json:"limit,omitempty"` + Status Optional[string] `json:"status,omitempty"` +} + +// ErasureListOutput is the response from erasure.list. +type ErasureListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []ErasureListRow `json:"rows"` +} + +// ErasureListRow is a model used by Loom operations. +type ErasureListRow struct { + ErasureID string `json:"erasure_id"` + ScopeType string `json:"scope_type"` + ScopeValue string `json:"scope_value"` + Requester string `json:"requester"` + Status string `json:"status"` + RequestedAt string `json:"requested_at"` + CompletedAt Optional[string] `json:"completed_at,omitempty"` + FailureReason *string `json:"failure_reason,omitempty"` + StepsCompletedCount *int64 `json:"steps_completed_count,omitempty"` + ReversalsCount *int64 `json:"reversals_count,omitempty"` + ResidueCount *int64 `json:"residue_count,omitempty"` + VerifiedAt Optional[string] `json:"verified_at,omitempty"` +} + +// ErasureRequestInput is the request to erasure.request. +type ErasureRequestInput struct { + Org string `json:"org"` + ScopeType string `json:"scope_type"` + ScopeValue string `json:"scope_value"` + Requester string `json:"requester"` + Urgency *string `json:"urgency,omitempty"` + Purge *bool `json:"purge,omitempty"` + External *bool `json:"external,omitempty"` +} + +// ErasureRequestOutput is the response from erasure.request. +type ErasureRequestOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ErasureID string `json:"erasure_id"` + Status string `json:"status"` + Steps []ErasureStepResult `json:"steps"` + RequestedAt string `json:"requested_at"` + CompletedAt Optional[string] `json:"completed_at,omitempty"` + ResidueCount *int64 `json:"residue_count,omitempty"` + Residue *map[string]int64 `json:"residue,omitempty"` + VerifiedAt Optional[string] `json:"verified_at,omitempty"` + Census Optional[map[string]int64] `json:"census,omitempty"` + Purge *bool `json:"purge,omitempty"` + FailureReason *string `json:"failure_reason,omitempty"` + StepsCompleted *[]string `json:"steps_completed,omitempty"` +} + +// ErasureStatusInput is the request to erasure.status. +type ErasureStatusInput struct { + ErasureID string `json:"erasure_id"` +} + +// ErasureStatusOutput is the response from erasure.status. +type ErasureStatusOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + ErasureID string `json:"erasure_id"` + Org Optional[string] `json:"org,omitempty"` + ScopeType Optional[string] `json:"scope_type,omitempty"` + ScopeValue Optional[string] `json:"scope_value,omitempty"` + Requester Optional[string] `json:"requester,omitempty"` + Status Optional[string] `json:"status,omitempty"` + CurrentStep Optional[int64] `json:"current_step,omitempty"` + RequestedAt Optional[string] `json:"requested_at,omitempty"` + CompletedAt Optional[string] `json:"completed_at,omitempty"` + FailureReason Optional[string] `json:"failure_reason,omitempty"` + ResidueCount *int64 `json:"residue_count,omitempty"` + Residue *map[string]int64 `json:"residue,omitempty"` + VerifiedAt Optional[string] `json:"verified_at,omitempty"` + Census Optional[map[string]int64] `json:"census,omitempty"` + Purge *bool `json:"purge,omitempty"` +} + +// ErasureStepResult is a model used by Loom operations. +type ErasureStepResult struct { + Step string `json:"step"` + RowsAffected int64 `json:"rows_affected"` + Notes *string `json:"notes,omitempty"` +} + +// EvidenceChunk is a model used by Loom operations. +type EvidenceChunk struct { + SessionID string `json:"session_id"` + ChunkIndex *int64 `json:"chunk_index,omitempty"` + Content string `json:"content"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + ParentMemoryKey *string `json:"parent_memory_key,omitempty"` + MemoryKeys *[]string `json:"memory_keys,omitempty"` + LineStart *int64 `json:"line_start,omitempty"` + LineEnd *int64 `json:"line_end,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + SourceURL *string `json:"source_url,omitempty"` +} + +// EvidenceDigest is a model used by Loom operations. +type EvidenceDigest struct { + SessionID string `json:"session_id"` + SummaryText string `json:"summary_text"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + KeyFacts *[]string `json:"key_facts,omitempty"` + DerivedFrom *[]string `json:"derived_from,omitempty"` + ValidAt *string `json:"valid_at,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` +} + +// EvidenceEdge is a model used by Loom operations. +type EvidenceEdge struct { + FromKey string `json:"from_key"` + ToKey string `json:"to_key"` + Relation string `json:"relation"` + Confidence *float64 `json:"confidence,omitempty"` + Explanation *string `json:"explanation,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` +} + +// ExposureSummaryInput is a model used by Loom operations. +type ExposureSummaryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SinceHours *int64 `json:"since_hours,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// ExposureSummaryOutput is a model used by Loom operations. +type ExposureSummaryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + NamespaceRows int64 `json:"namespace_rows"` + Rows []ExposureSummaryRow `json:"rows"` +} + +// ExposureSummaryRow is a model used by Loom operations. +type ExposureSummaryRow struct { + Actor string `json:"actor"` + Agent string `json:"agent"` + DistinctKeys int64 `json:"distinct_keys"` + Calls int64 `json:"calls"` + Fraction float64 `json:"fraction"` + FirstHour string `json:"first_hour"` + LastHour string `json:"last_hour"` +} + +// ExtractionCoverage is a model used by Loom operations. +type ExtractionCoverage struct { + Unit string `json:"unit"` + Total int64 `json:"total"` + Extracted int64 `json:"extracted"` + Failed int64 `json:"failed"` + Lost *[]string `json:"lost,omitempty"` + Complete bool `json:"complete"` +} + +// ExtractionPolicyClearInput is the request to extraction_policy.clear. +type ExtractionPolicyClearInput struct { + Org string `json:"org"` + Scope string `json:"scope"` + Namespace *string `json:"namespace,omitempty"` +} + +// ExtractionPolicyClearOutput is the response from extraction_policy.clear. +type ExtractionPolicyClearOutput = ExtractionPolicyOutput + +// ExtractionPolicyGetInput is the request to extraction_policy.get. +type ExtractionPolicyGetInput struct { + Org string `json:"org"` + Scope string `json:"scope"` + Namespace *string `json:"namespace,omitempty"` +} + +// ExtractionPolicyGetOutput is the response from extraction_policy.get. +type ExtractionPolicyGetOutput = ExtractionPolicyOutput + +// ExtractionPolicyOutput is a model used by Loom operations. +type ExtractionPolicyOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Scope string `json:"scope"` + Namespace *string `json:"namespace,omitempty"` + Policy *string `json:"policy,omitempty"` + UpdatedBy *string `json:"updated_by,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + Effective *string `json:"effective,omitempty"` + NamespacePolicies *[]NamespacePolicy `json:"namespace_policies,omitempty"` +} + +// ExtractionPolicySetInput is the request to extraction_policy.set. +type ExtractionPolicySetInput struct { + Org string `json:"org"` + Scope string `json:"scope"` + Namespace *string `json:"namespace,omitempty"` + Policy string `json:"policy"` +} + +// ExtractionPolicySetOutput is the response from extraction_policy.set. +type ExtractionPolicySetOutput = ExtractionPolicyOutput + +// ExtractionQueueRow is a model used by Loom operations. +type ExtractionQueueRow struct { + QueueID string `json:"queue_id"` + Agent string `json:"agent"` + UserID string `json:"user_id"` + SessionID string `json:"session_id"` + Status string `json:"status"` + Attempts int64 `json:"attempts"` + MessageCount int64 `json:"message_count"` + ContentChars int64 `json:"content_chars"` + Written int64 `json:"written"` + LastError string `json:"last_error"` + EnqueuedAt Optional[string] `json:"enqueued_at,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` +} + +// ExtractionTotals is a model used by Loom operations. +type ExtractionTotals struct { + Documents Optional[int64] `json:"documents,omitempty"` + Incomplete Optional[int64] `json:"incomplete,omitempty"` + Lost *[]DocumentCount `json:"lost,omitempty"` +} + +// FactRow is a model used by Loom operations. +type FactRow struct { + Subject string `json:"subject"` + Relation string `json:"relation"` + Object string `json:"object"` + CoOccur int64 `json:"co_occur"` + LastSeen string `json:"last_seen"` + Provenance *string `json:"provenance,omitempty"` + SourceKeys *[]string `json:"source_keys,omitempty"` + Sources *[]SourceRef `json:"sources,omitempty"` + Stale *bool `json:"stale,omitempty"` +} + +// FactsExpireByAdapterInput is the request to facts.expire_by_adapter. +type FactsExpireByAdapterInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + AdapterName string `json:"adapter_name"` + MaxConfidence *float64 `json:"max_confidence,omitempty"` +} + +// FactsExpireByAdapterOutput is the response from facts.expire_by_adapter. +type FactsExpireByAdapterOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ExpiredTriples int64 `json:"expired_triples"` + ExpiredTripleMemories int64 `json:"expired_triple_memories"` +} + +// FactsListInput is the request to facts.list. +type FactsListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Subject Optional[string] `json:"subject,omitempty"` + Object Optional[string] `json:"object,omitempty"` + Relation Optional[string] `json:"relation,omitempty"` + Entity Optional[string] `json:"entity,omitempty"` + Limit *int64 `json:"limit,omitempty"` + SortBy *string `json:"sort_by,omitempty"` + IncludeSources *bool `json:"include_sources,omitempty"` + IncludeSourceStatus *bool `json:"include_source_status,omitempty"` + MinCoOccur *int64 `json:"min_co_occur,omitempty"` + AsOf Optional[string] `json:"as_of,omitempty"` + Provenance Optional[[]string] `json:"provenance,omitempty"` +} + +// FactsListOutput is the response from facts.list. +type FactsListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []FactRow `json:"rows"` + Truncated *bool `json:"truncated,omitempty"` +} + +// FactsPathInput is the request to facts.path. +type FactsPathInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + EntityA string `json:"entity_a"` + EntityB string `json:"entity_b"` + MaxHops *int64 `json:"max_hops,omitempty"` + TopKPerHop *int64 `json:"top_k_per_hop,omitempty"` + MinCoOccur *int64 `json:"min_co_occur,omitempty"` + AsOf Optional[string] `json:"as_of,omitempty"` + Relations *[]string `json:"relations,omitempty"` + Labeled *bool `json:"labeled,omitempty"` +} + +// FactsPathOutput is the response from facts.path. +type FactsPathOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + EntityA string `json:"entity_a"` + EntityB string `json:"entity_b"` + Found bool `json:"found"` + Path []string `json:"path"` + Edges []PathEdge `json:"edges"` + Hops int64 `json:"hops"` + Truncated bool `json:"truncated"` +} + +// FactsRelatedInput is the request to facts.related. +type FactsRelatedInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Entity string `json:"entity"` + TopK *int64 `json:"top_k,omitempty"` + AsOf Optional[string] `json:"as_of,omitempty"` +} + +// FactsRelatedOutput is the response from facts.related. +type FactsRelatedOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Entity string `json:"entity"` + Related []RelatedEntity `json:"related"` +} + +// FactsTraverseInput is the request to facts.traverse. +type FactsTraverseInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SeedEntity string `json:"seed_entity"` + MaxHops *int64 `json:"max_hops,omitempty"` + TopKPerHop *int64 `json:"top_k_per_hop,omitempty"` + MinCoOccur *int64 `json:"min_co_occur,omitempty"` + MaxNodes *int64 `json:"max_nodes,omitempty"` + AsOf Optional[string] `json:"as_of,omitempty"` + Relations *[]string `json:"relations,omitempty"` + Labeled *bool `json:"labeled,omitempty"` + HubDegree Optional[int64] `json:"hub_degree,omitempty"` + HubShare Optional[float64] `json:"hub_share,omitempty"` + RankBy Optional[string] `json:"rank_by,omitempty"` +} + +// FactsTraverseOutput is the response from facts.traverse. +type FactsTraverseOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Seed string `json:"seed"` + SeedCommunityID Optional[int64] `json:"seed_community_id,omitempty"` + Nodes []TraversalNode `json:"nodes"` + Truncated *bool `json:"truncated,omitempty"` + Hubs *[]string `json:"hubs,omitempty"` +} + +// FindingEvidence is a model used by Loom operations. +type FindingEvidence struct { + MemoryKey string `json:"memory_key"` + MemoryID string `json:"memory_id"` + Version int64 `json:"version"` + ContentSHA256 string `json:"content_sha256"` + Agent string `json:"agent"` + UserID string `json:"user_id"` + SessionID string `json:"session_id"` + MemoryType string `json:"memory_type"` + SourceClass string `json:"source_class"` + UpdatedAt string `json:"updated_at"` +} + +// GrantEntry is a model used by Loom operations. +type GrantEntry struct { + Subject *string `json:"subject,omitempty"` + Role *string `json:"role,omitempty"` + Status *string `json:"status,omitempty"` + PendingRole Optional[string] `json:"pending_role,omitempty"` + PendingSince Optional[string] `json:"pending_since,omitempty"` + GrantedAt *string `json:"granted_at,omitempty"` + GrantedBy *string `json:"granted_by,omitempty"` + Also *[]string `json:"also,omitempty"` +} + +// GrantsApproveInput is the request to grants.approve. +type GrantsApproveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Subject string `json:"subject"` + Decision *string `json:"decision,omitempty"` + Role Optional[string] `json:"role,omitempty"` +} + +// GrantsApproveOutput is the response from grants.approve. +type GrantsApproveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Subject string `json:"subject"` + Namespace string `json:"namespace"` + Decision string `json:"decision"` + Role Optional[string] `json:"role,omitempty"` + DecidedAt string `json:"decided_at"` +} + +// GrantsCreateInput is the request to grants.create. +type GrantsCreateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Subject string `json:"subject"` + Role string `json:"role"` + GrantedBy *string `json:"granted_by,omitempty"` + Replace *bool `json:"replace,omitempty"` +} + +// GrantsCreateOutput is the response from grants.create. +type GrantsCreateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Subject string `json:"subject"` + Role string `json:"role"` + GrantedAt string `json:"granted_at"` +} + +// GrantsListInput is the request to grants.list. +type GrantsListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` + Cursor Optional[string] `json:"cursor,omitempty"` + Fields Optional[[]string] `json:"fields,omitempty"` +} + +// GrantsListOutput is the response from grants.list. +type GrantsListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []GrantEntry `json:"rows"` + NextCursor Optional[string] `json:"next_cursor,omitempty"` + Truncated *bool `json:"truncated,omitempty"` +} + +// GrantsPendingForMeInput is the request to grants.pending_for_me. +type GrantsPendingForMeInput struct { + Org string `json:"org"` + Limit *int64 `json:"limit,omitempty"` +} + +// GrantsPendingForMeOutput is the response from grants.pending_for_me. +type GrantsPendingForMeOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []PendingForMeEntry `json:"rows"` +} + +// GrantsRevokeInput is the request to grants.revoke. +type GrantsRevokeInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Subject string `json:"subject"` +} + +// GrantsRevokeOutput is the response from grants.revoke. +type GrantsRevokeOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Revoked bool `json:"revoked"` + RevokedAt Optional[string] `json:"revoked_at,omitempty"` +} + +// GrantsShareAgentInput is the request to grants.share_agent. +type GrantsShareAgentInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Grantee string `json:"grantee"` + Role *string `json:"role,omitempty"` +} + +// GrantsShareAgentOutput is the response from grants.share_agent. +type GrantsShareAgentOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Namespace string `json:"namespace"` + Subject string `json:"subject"` + Role string `json:"role"` + GrantedAt string `json:"granted_at"` +} + +// GrantsUnshareAgentInput is the request to grants.unshare_agent. +type GrantsUnshareAgentInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Grantee string `json:"grantee"` +} + +// GrantsUnshareAgentOutput is the response from grants.unshare_agent. +type GrantsUnshareAgentOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Revoked bool `json:"revoked"` + RevokedAt Optional[string] `json:"revoked_at,omitempty"` +} + +// GrepDependency is a model used by Loom operations. +type GrepDependency struct { + QualifiedName string `json:"qualified_name"` + Path string `json:"path"` + StartLine int64 `json:"start_line"` + EndLine int64 `json:"end_line"` + Body string `json:"body"` +} + +// GuideRevision is a model used by Loom operations. +type GuideRevision struct { + Revision int64 `json:"revision"` + Summary string `json:"summary"` + Note string `json:"note"` + UpdatedBy string `json:"updated_by"` + UpdatedAt string `json:"updated_at"` + Chars int64 `json:"chars"` +} + +// HelpGetInput is the request to help.get. +type HelpGetInput struct { + Org *string `json:"org,omitempty"` + Path string `json:"path"` + Section *string `json:"section,omitempty"` + Anchor *string `json:"anchor,omitempty"` + Offset *int64 `json:"offset,omitempty"` +} + +// HelpGetOutput is the response from help.get. +type HelpGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Available bool `json:"available"` + Found bool `json:"found"` + Path string `json:"path"` + Title *string `json:"title,omitempty"` + Section *string `json:"section,omitempty"` + Anchor *string `json:"anchor,omitempty"` + Audience *string `json:"audience,omitempty"` + Text *string `json:"text,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + NextOffset *int64 `json:"next_offset,omitempty"` + Sections *[]HelpOutlineEntry `json:"sections,omitempty"` +} + +// HelpHit is a model used by Loom operations. +type HelpHit struct { + Path string `json:"path"` + Title string `json:"title"` + Section string `json:"section"` + Anchor string `json:"anchor"` + Audience string `json:"audience"` + Snippet string `json:"snippet"` + Score float64 `json:"score"` +} + +// HelpOutlineEntry is a model used by Loom operations. +type HelpOutlineEntry struct { + Section string `json:"section"` + Anchor string `json:"anchor"` + Heading *string `json:"heading,omitempty"` +} + +// HelpSearchInput is the request to help.search. +type HelpSearchInput struct { + Org *string `json:"org,omitempty"` + Query string `json:"query"` + Limit *int64 `json:"limit,omitempty"` +} + +// HelpSearchOutput is the response from help.search. +type HelpSearchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Available bool `json:"available"` + Hits []HelpHit `json:"hits"` +} + +// InboxCount is a model used by Loom operations. +type InboxCount struct { + Inbox string `json:"inbox"` + Status string `json:"status"` + BlockedOn *string `json:"blocked_on,omitempty"` + N int64 `json:"n"` + Oldest Optional[string] `json:"oldest,omitempty"` +} + +// InboxListInput is the request to inbox.list. +type InboxListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + MineEverywhere *bool `json:"mine_everywhere,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// InboxListOutput is the response from inbox.list. +type InboxListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Inboxes []InboxPayload `json:"inboxes"` +} + +// InboxPayload is a model used by Loom operations. +type InboxPayload struct { + Org string `json:"org"` + Inbox string `json:"inbox"` + OwnerAgent string `json:"owner_agent"` + OwnerNamespace string `json:"owner_namespace"` + Description *string `json:"description,omitempty"` + Posters *[]string `json:"posters,omitempty"` + AcceptDisclosure *[]string `json:"accept_disclosure,omitempty"` + DefaultLeaseSeconds int64 `json:"default_lease_seconds"` + MaxAttempts int64 `json:"max_attempts"` + MaxDefers int64 `json:"max_defers"` + TriageEscalateAfterSeconds int64 `json:"triage_escalate_after_seconds"` + WebhookURL *string `json:"webhook_url,omitempty"` + CreatedBy *string `json:"created_by,omitempty"` + OwnerSubject *string `json:"owner_subject,omitempty"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + Version int64 `json:"version"` +} + +// InboxPolicyListInput is the request to inbox.policy_list. +type InboxPolicyListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Inbox string `json:"inbox"` +} + +// InboxPolicyListOutput is the response from inbox.policy_list. +type InboxPolicyListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Policies []PolicyPayload `json:"policies"` +} + +// InboxPolicySetInput is the request to inbox.policy_set. +type InboxPolicySetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Inbox string `json:"inbox"` + Poster string `json:"poster"` + Kind *string `json:"kind,omitempty"` + Mode string `json:"mode"` + RequireEvidence *[]string `json:"require_evidence,omitempty"` + Remove *bool `json:"remove,omitempty"` +} + +// InboxPolicySetOutput is the response from inbox.policy_set. +type InboxPolicySetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Policy *PolicyPayload `json:"policy"` + Removed *bool `json:"removed,omitempty"` +} + +// InboxPrincipalsInput is the request to inbox.principals. +type InboxPrincipalsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Inbox string `json:"inbox"` + Query *string `json:"query,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// InboxPrincipalsOutput is the response from inbox.principals. +type InboxPrincipalsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Principals []Principal `json:"principals"` + Truncated bool `json:"truncated"` +} + +// InboxRegisterInput is the request to inbox.register. +type InboxRegisterInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Inbox string `json:"inbox"` + OwnerAgent string `json:"owner_agent"` + Description *string `json:"description,omitempty"` + Posters *[]string `json:"posters,omitempty"` + AcceptDisclosure *[]string `json:"accept_disclosure,omitempty"` + DefaultLeaseSeconds *int64 `json:"default_lease_seconds,omitempty"` + MaxAttempts *int64 `json:"max_attempts,omitempty"` + MaxDefers *int64 `json:"max_defers,omitempty"` + TriageEscalateAfterSeconds *int64 `json:"triage_escalate_after_seconds,omitempty"` + WebhookURL *string `json:"webhook_url,omitempty"` + WebhookSecretRef *string `json:"webhook_secret_ref,omitempty"` + IfMatchVersion Optional[int64] `json:"if_match_version,omitempty"` +} + +// InboxRegisterOutput is the response from inbox.register. +type InboxRegisterOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Inbox InboxPayload `json:"inbox"` + Created bool `json:"created"` +} + +// IngestFinding is a model used by Loom operations. +type IngestFinding struct { + Kind string `json:"kind"` + RuleVersion int64 `json:"rule_version"` + SourceOp string `json:"source_op"` + WindowSeconds Optional[int64] `json:"window_seconds,omitempty"` + Population Optional[int64] `json:"population,omitempty"` + SampleLimit int64 `json:"sample_limit"` + SamplesComplete bool `json:"samples_complete"` + Evidence *[]FindingEvidence `json:"evidence,omitempty"` + Exceptions *string `json:"exceptions,omitempty"` + Uncertainty *string `json:"uncertainty,omitempty"` + Code string `json:"code"` + Severity string `json:"severity"` + Count int64 `json:"count"` + Share float64 `json:"share"` + Samples *[]string `json:"samples,omitempty"` + IngestionIds *[]string `json:"ingestion_ids,omitempty"` + WithoutDocument *int64 `json:"without_document,omitempty"` + Detail string `json:"detail"` + Remedy string `json:"remedy"` + Refs *[]string `json:"refs,omitempty"` +} + +// IngestJob is a model used by Loom operations. +type IngestJob struct { + IngestionID string `json:"ingestion_id"` + State string `json:"state"` + Stage string `json:"stage"` + Attempts int64 `json:"attempts"` + ErrorCode string `json:"error_code"` + FailureClass string `json:"failure_class"` + QueuedAt string `json:"queued_at"` + UpdatedAt string `json:"updated_at"` + EndedAt Optional[string] `json:"ended_at,omitempty"` + NextAttemptAt Optional[string] `json:"next_attempt_at,omitempty"` + Stalled *bool `json:"stalled,omitempty"` +} + +// IngestionTotals is a model used by Loom operations. +type IngestionTotals struct { + Sources Optional[int64] `json:"sources,omitempty"` + WithoutDocument Optional[int64] `json:"without_document,omitempty"` + Replaced Optional[int64] `json:"replaced,omitempty"` + Pending Optional[int64] `json:"pending,omitempty"` + Processing Optional[int64] `json:"processing,omitempty"` + Stalled Optional[int64] `json:"stalled,omitempty"` + Ready Optional[int64] `json:"ready,omitempty"` + Partial Optional[int64] `json:"partial,omitempty"` + Failed Optional[int64] `json:"failed,omitempty"` + Cancelled Optional[int64] `json:"cancelled,omitempty"` + OldestOpenQueuedAt Optional[string] `json:"oldest_open_queued_at,omitempty"` + WorkerEnabled bool `json:"worker_enabled"` + ExtractorConfigured Optional[bool] `json:"extractor_configured,omitempty"` + WithoutDocumentListed *[]SourceJobs `json:"without_document_listed,omitempty"` +} + +// InsightsCatalogInput is the request to insights.catalog. +type InsightsCatalogInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// InsightsCatalogOutput is the response from insights.catalog. +type InsightsCatalogOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Tables []CatalogTable `json:"tables"` + MaxResultRows int64 `json:"max_result_rows"` + MaxExecutionS float64 `json:"max_execution_s"` + MaxRowsToRead int64 `json:"max_rows_to_read"` +} + +// InsightsQueryInput is the request to insights.query. +type InsightsQueryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SQL string `json:"sql"` + Limit *int64 `json:"limit,omitempty"` +} + +// InsightsQueryOutput is the response from insights.query. +type InsightsQueryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Columns *[]AnalysisColumn `json:"columns,omitempty"` + Rows *[][]json.RawMessage `json:"rows,omitempty"` + RowCount *int64 `json:"row_count,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + SQLDigest *string `json:"sql_digest,omitempty"` +} + +// InspectActivity is a model used by Loom operations. +type InspectActivity struct { + WindowSeconds int64 `json:"window_seconds"` + Calls *[]InspectCall `json:"calls,omitempty"` + FirstAt Optional[string] `json:"first_at,omitempty"` + LastAt Optional[string] `json:"last_at,omitempty"` + Gap *string `json:"gap,omitempty"` +} + +// InspectCall is a model used by Loom operations. +type InspectCall struct { + Operation string `json:"operation"` + Calls int64 `json:"calls"` + Succeeded int64 `json:"succeeded"` +} + +// InspectCount is a model used by Loom operations. +type InspectCount struct { + Name string `json:"name"` + Rows int64 `json:"rows"` +} + +// InspectDocument is a model used by Loom operations. +type InspectDocument struct { + SourceURI string `json:"source_uri"` + Title string `json:"title"` + Format string `json:"format"` + SourceScheme string `json:"source_scheme"` + Version int64 `json:"version"` + Revision int64 `json:"revision"` + IngestionID *string `json:"ingestion_id,omitempty"` + IngestedAt string `json:"ingested_at"` + RetiredVersions Optional[int64] `json:"retired_versions,omitempty"` + Chunks Optional[DocumentChunks] `json:"chunks,omitempty"` + Decisions Optional[DocumentDecisions] `json:"decisions,omitempty"` + Extraction Optional[ExtractionCoverage] `json:"extraction,omitempty"` + Jobs Optional[SourceJobs] `json:"jobs,omitempty"` +} + +// InspectRow is a model used by Loom operations. +type InspectRow struct { + MemoryKey string `json:"memory_key"` + MemoryID string `json:"memory_id"` + Version int64 `json:"version"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + MemoryType string `json:"memory_type"` + Status string `json:"status"` + SourceClass string `json:"source_class"` + Agent string `json:"agent"` + UserID string `json:"user_id"` + SessionID string `json:"session_id"` + Actor string `json:"actor"` + UpdatedAt string `json:"updated_at"` + Sensitivity string `json:"sensitivity"` + Versions *int64 `json:"versions,omitempty"` + Excerpt *string `json:"excerpt,omitempty"` +} + +// InspectSettings is a model used by Loom operations. +type InspectSettings struct { + GuideRevision *int64 `json:"guide_revision,omitempty"` + GuideSummary *string `json:"guide_summary,omitempty"` + CategoriesRegistered *int64 `json:"categories_registered,omitempty"` + ExtractionPolicy Optional[string] `json:"extraction_policy,omitempty"` + ExtractionPolicyUnavailable *string `json:"extraction_policy_unavailable,omitempty"` + ExtractionInstructions *string `json:"extraction_instructions,omitempty"` + ExtractionInstructionsRefs *[]string `json:"extraction_instructions_refs,omitempty"` +} + +// InspectView is a model used by Loom operations. +type InspectView struct { + Definition string `json:"definition"` + Refs *[]string `json:"refs,omitempty"` + LiveRows *int64 `json:"live_rows,omitempty"` + ByType *[]InspectCount `json:"by_type,omitempty"` + ByStatus *[]InspectCount `json:"by_status,omitempty"` + BySourceClass *[]InspectCount `json:"by_source_class,omitempty"` + TopTags *[]InspectCount `json:"top_tags,omitempty"` + Categories *[]InspectCount `json:"categories,omitempty"` + FirstUpdatedAt Optional[string] `json:"first_updated_at,omitempty"` + LastUpdatedAt Optional[string] `json:"last_updated_at,omitempty"` + Newest *[]InspectRow `json:"newest,omitempty"` + Complete *bool `json:"complete,omitempty"` +} + +// InventoryCapability is a model used by Loom operations. +type InventoryCapability struct { + Name string `json:"name"` + Enabled bool `json:"enabled"` +} + +// InventoryIdentity is a model used by Loom operations. +type InventoryIdentity struct { + Name string `json:"name"` + Rows int64 `json:"rows"` +} + +// InventoryPopulation is a model used by Loom operations. +type InventoryPopulation struct { + Population string `json:"population"` + Total *int64 `json:"total"` + Top *[]InventoryIdentity `json:"top,omitempty"` + Complete bool `json:"complete"` + Reason *string `json:"reason,omitempty"` +} + +// InventoryScope is a model used by Loom operations. +type InventoryScope struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + ReadScope string `json:"read_scope"` + UserID *string `json:"user_id"` + SessionID *string `json:"session_id"` +} + +// InventorySection is a model used by Loom operations. +type InventorySection struct { + Plane string `json:"plane"` + Count *int64 `json:"count"` + LatestAt *string `json:"latest_at"` + Complete bool `json:"complete"` + Reason *string `json:"reason,omitempty"` +} + +// KnowledgeAddInput is the request to knowledge.add. +type KnowledgeAddInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SourceURI string `json:"source_uri"` + Content string `json:"content"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + OriginalBytesB64 Optional[string] `json:"original_bytes_b64,omitempty"` + OriginalFilename *string `json:"original_filename,omitempty"` + BlobContentType *string `json:"blob_content_type,omitempty"` + Agent *string `json:"agent,omitempty"` + SessionID *string `json:"session_id,omitempty"` + SourceClass Optional[string] `json:"source_class,omitempty"` +} + +// KnowledgeAddOutput is the response from knowledge.add. +type KnowledgeAddOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + DocID string `json:"doc_id"` + ChunksCreated int64 `json:"chunks_created"` + EmbeddingModel string `json:"embedding_model"` + EmbeddingDim int64 `json:"embedding_dim"` + Namespace *string `json:"namespace,omitempty"` + SourceURI *string `json:"source_uri,omitempty"` +} + +// KnowledgeBulkAddInput is the request to knowledge.bulk_add. +type KnowledgeBulkAddInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Entries []KnowledgeBulkEntry `json:"entries"` + Agent *string `json:"agent,omitempty"` + SessionID *string `json:"session_id,omitempty"` + SourceClass Optional[string] `json:"source_class,omitempty"` +} + +// KnowledgeBulkAddOutput is the response from knowledge.bulk_add. +type KnowledgeBulkAddOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Written []KnowledgeBulkEntryResult `json:"written"` + EmbeddingModel string `json:"embedding_model"` + EmbeddingDim int64 `json:"embedding_dim"` +} + +// KnowledgeBulkDeleteInput is the request to knowledge.bulk_delete. +type KnowledgeBulkDeleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SourceUris []string `json:"source_uris"` +} + +// KnowledgeBulkDeleteOutput is the response from knowledge.bulk_delete. +type KnowledgeBulkDeleteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Deleted []KnowledgeBulkDeleteResult `json:"deleted"` + TotalChunksTombstoned int64 `json:"total_chunks_tombstoned"` +} + +// KnowledgeBulkDeleteResult is a model used by Loom operations. +type KnowledgeBulkDeleteResult struct { + SourceURI string `json:"source_uri"` + ChunksTombstoned int64 `json:"chunks_tombstoned"` +} + +// KnowledgeBulkEntry is a model used by Loom operations. +type KnowledgeBulkEntry struct { + Content string `json:"content"` + SourceURI string `json:"source_uri"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` +} + +// KnowledgeBulkEntryResult is a model used by Loom operations. +type KnowledgeBulkEntryResult struct { + SourceURI string `json:"source_uri"` + DocID string `json:"doc_id"` + ChunksCreated int64 `json:"chunks_created"` +} + +// KnowledgeChunkCluster is a model used by Loom operations. +type KnowledgeChunkCluster struct { + ContentSHA256 string `json:"content_sha256"` + ChunkCount int64 `json:"chunk_count"` + URICount int64 `json:"uri_count"` + Samples *[]map[string]json.RawMessage `json:"samples,omitempty"` +} + +// KnowledgeDatasetApproveInput is the request to knowledge.dataset_approve. +type KnowledgeDatasetApproveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SourceURI string `json:"source_uri"` + DatasetID string `json:"dataset_id"` + SnapshotID string `json:"snapshot_id"` + Columns *map[string]string `json:"columns,omitempty"` +} + +// KnowledgeDatasetApproveOutput is the response from knowledge.dataset_approve. +type KnowledgeDatasetApproveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + Dataset Optional[DatasetOut] `json:"dataset,omitempty"` + Retyped *bool `json:"retyped,omitempty"` +} + +// KnowledgeDatasetGetInput is the request to knowledge.dataset_get. +type KnowledgeDatasetGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SourceURI string `json:"source_uri"` + DatasetID *string `json:"dataset_id,omitempty"` + SampleRows *int64 `json:"sample_rows,omitempty"` +} + +// KnowledgeDatasetGetOutput is the response from knowledge.dataset_get. +type KnowledgeDatasetGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + Revision *int64 `json:"revision,omitempty"` + Datasets *[]DatasetOut `json:"datasets,omitempty"` +} + +// KnowledgeDedupListInput is the request to knowledge.dedup_list. +type KnowledgeDedupListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` + IncludeChunkClusters *bool `json:"include_chunk_clusters,omitempty"` +} + +// KnowledgeDedupListOutput is the response from knowledge.dedup_list. +type KnowledgeDedupListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + DocClusters *[]KnowledgeDocCluster `json:"doc_clusters,omitempty"` + ChunkClusters *[]KnowledgeChunkCluster `json:"chunk_clusters,omitempty"` +} + +// KnowledgeDedupResolveInput is the request to knowledge.dedup_resolve. +type KnowledgeDedupResolveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + CanonicalURI string `json:"canonical_uri"` + DuplicateURI string `json:"duplicate_uri"` + Decision string `json:"decision"` + ConfirmDuplicateURI string `json:"confirm_duplicate_uri"` +} + +// KnowledgeDedupResolveOutput is the response from knowledge.dedup_resolve. +type KnowledgeDedupResolveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + CanonicalURI string `json:"canonical_uri"` + DuplicateURI string `json:"duplicate_uri"` + Decision string `json:"decision"` + SupersededURI *string `json:"superseded_uri,omitempty"` +} + +// KnowledgeDeleteInput is the request to knowledge.delete. +type KnowledgeDeleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SourceURI string `json:"source_uri"` +} + +// KnowledgeDeleteOutput is the response from knowledge.delete. +type KnowledgeDeleteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Deleted bool `json:"deleted"` + ChunksTombstoned int64 `json:"chunks_tombstoned"` +} + +// KnowledgeDocCluster is a model used by Loom operations. +type KnowledgeDocCluster struct { + ContentSHA256 string `json:"content_sha256"` + DocCount int64 `json:"doc_count"` + Docs *[]map[string]json.RawMessage `json:"docs,omitempty"` +} + +// KnowledgeFormat is a model used by Loom operations. +type KnowledgeFormat struct { + Format string `json:"format"` + Extensions *[]string `json:"extensions,omitempty"` + MediaTypes *[]string `json:"media_types,omitempty"` + Available Optional[bool] `json:"available,omitempty"` +} + +// KnowledgeFormatsInput is the request to knowledge.formats. +type KnowledgeFormatsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// KnowledgeFormatsOutput is the response from knowledge.formats. +type KnowledgeFormatsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Formats *[]KnowledgeFormat `json:"formats,omitempty"` + MaxUploadBytes *int64 `json:"max_upload_bytes,omitempty"` + RefusedExtensions *[]string `json:"refused_extensions,omitempty"` + DefaultFormat *string `json:"default_format,omitempty"` +} + +// KnowledgeGap is a model used by Loom operations. +type KnowledgeGap struct { + GapID string `json:"gap_id"` + Head string `json:"head"` + Samples *[]string `json:"samples,omitempty"` + Askers int64 `json:"askers"` + Asks int64 `json:"asks"` + LastAt string `json:"last_at"` +} + +// KnowledgeGapsDraftInput is the request to knowledge.gaps.draft. +type KnowledgeGapsDraftInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + GapID string `json:"gap_id"` +} + +// KnowledgeGapsDraftOutput is the response from knowledge.gaps.draft. +type KnowledgeGapsDraftOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + CandidateID string `json:"candidate_id"` +} + +// KnowledgeGapsListInput is the request to knowledge.gaps.list. +type KnowledgeGapsListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` +} + +// KnowledgeGapsListOutput is the response from knowledge.gaps.list. +type KnowledgeGapsListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Gaps *[]KnowledgeGap `json:"gaps,omitempty"` + BuiltAt Optional[string] `json:"built_at,omitempty"` + Capturing Optional[bool] `json:"capturing,omitempty"` + Enabled *bool `json:"enabled,omitempty"` +} + +// KnowledgeGetInput is the request to knowledge.get. +type KnowledgeGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SourceURI string `json:"source_uri"` + IncludeSuperseded *bool `json:"include_superseded,omitempty"` +} + +// KnowledgeGetOutput is the response from knowledge.get. +type KnowledgeGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + SourceURI string `json:"source_uri"` + Title Optional[string] `json:"title,omitempty"` + Content Optional[string] `json:"content,omitempty"` + Tags Optional[[]string] `json:"tags,omitempty"` + Metadata Optional[map[string]json.RawMessage] `json:"metadata,omitempty"` + IngestedAt Optional[string] `json:"ingested_at,omitempty"` + Superseded Optional[bool] `json:"superseded,omitempty"` + DocID Optional[string] `json:"doc_id,omitempty"` + Revision Optional[int64] `json:"revision,omitempty"` + Format Optional[string] `json:"format,omitempty"` + Parser Optional[string] `json:"parser,omitempty"` + Coverage Optional[map[string]json.RawMessage] `json:"coverage,omitempty"` +} + +// KnowledgeIngestCancelInput is the request to knowledge.ingest_cancel. +type KnowledgeIngestCancelInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + IngestionID string `json:"ingestion_id"` +} + +// KnowledgeIngestCancelOutput is the response from knowledge.ingest_cancel. +type KnowledgeIngestCancelOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + State *string `json:"state,omitempty"` + Cancelled *bool `json:"cancelled,omitempty"` +} + +// KnowledgeIngestInput is the request to knowledge.ingest. +type KnowledgeIngestInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + UploadID string `json:"upload_id"` + SourceURI string `json:"source_uri"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + ExpectedRevision Optional[int64] `json:"expected_revision,omitempty"` + AllowPartial *bool `json:"allow_partial,omitempty"` + Options *KnowledgeIngestOptions `json:"options,omitempty"` + Agent *string `json:"agent,omitempty"` + SessionID *string `json:"session_id,omitempty"` + SourceClass Optional[string] `json:"source_class,omitempty"` +} + +// KnowledgeIngestOptions is a model used by Loom operations. +type KnowledgeIngestOptions struct { + Format *string `json:"format,omitempty"` + Encoding *string `json:"encoding,omitempty"` + SQLDialect *string `json:"sql_dialect,omitempty"` +} + +// KnowledgeIngestOutput is the response from knowledge.ingest. +type KnowledgeIngestOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + IngestionID string `json:"ingestion_id"` + State string `json:"state"` + SourceURI string `json:"source_uri"` + Namespace *string `json:"namespace,omitempty"` +} + +// KnowledgeIngestStatusInput is the request to knowledge.ingest_status. +type KnowledgeIngestStatusInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + IngestionID string `json:"ingestion_id"` +} + +// KnowledgeIngestStatusOutput is the response from knowledge.ingest_status. +type KnowledgeIngestStatusOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + IngestionID string `json:"ingestion_id"` + SourceURI *string `json:"source_uri,omitempty"` + State *string `json:"state,omitempty"` + Stage *string `json:"stage,omitempty"` + Attempts *int64 `json:"attempts,omitempty"` + ErrorCode *string `json:"error_code,omitempty"` + ErrorMessage *string `json:"error_message,omitempty"` + Format *string `json:"format,omitempty"` + Coverage Optional[map[string]json.RawMessage] `json:"coverage,omitempty"` + Warnings *[]string `json:"warnings,omitempty"` + Chunks *int64 `json:"chunks,omitempty"` + Revision *int64 `json:"revision,omitempty"` + ExpectedRevision Optional[int64] `json:"expected_revision,omitempty"` + Filename *string `json:"filename,omitempty"` + Retrieval *string `json:"retrieval,omitempty"` + CancelRequested *bool `json:"cancel_requested,omitempty"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` +} + +// KnowledgeInspectInput is the request to knowledge.inspect. +type KnowledgeInspectInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SampleLimit *int64 `json:"sample_limit,omitempty"` +} + +// KnowledgeInspectOutput is the response from knowledge.inspect. +type KnowledgeInspectOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + ComputedAt string `json:"computed_at"` + Documents DocumentTotals `json:"documents"` + Chunks ChunkTotals `json:"chunks"` + Decisions DecisionTotals `json:"decisions"` + Listed *[]InspectDocument `json:"listed,omitempty"` + ListedComplete *bool `json:"listed_complete,omitempty"` + Findings *[]DocumentFinding `json:"findings,omitempty"` + Coverage ReportCoverage `json:"coverage"` + Ingestions IngestionTotals `json:"ingestions"` + Extraction ExtractionTotals `json:"extraction"` + IngestFindings *[]IngestFinding `json:"ingest_findings,omitempty"` + MemoryFindings *[]MemoryFindingRef `json:"memory_findings,omitempty"` + Skipped *[]string `json:"skipped,omitempty"` +} + +// KnowledgeListEntry is a model used by Loom operations. +type KnowledgeListEntry struct { + Namespace *string `json:"namespace,omitempty"` + SourceURI *string `json:"source_uri,omitempty"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Tags *[]string `json:"tags,omitempty"` + IngestedAt *string `json:"ingested_at,omitempty"` + ChunkCount *int64 `json:"chunk_count,omitempty"` + Superseded *bool `json:"superseded,omitempty"` + HasBlob *bool `json:"has_blob,omitempty"` + BlobSize *int64 `json:"blob_size,omitempty"` + BlobContentType *string `json:"blob_content_type,omitempty"` + OriginalFilename *string `json:"original_filename,omitempty"` + ContentPreview *string `json:"content_preview,omitempty"` +} + +// KnowledgeListInput is the request to knowledge.list. +type KnowledgeListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Namespaces *[]string `json:"namespaces,omitempty"` + Tags *[]string `json:"tags,omitempty"` + TagsEvery *bool `json:"tags_every,omitempty"` + URIPrefix *[]string `json:"uri_prefix,omitempty"` + IncludeSuperseded *bool `json:"include_superseded,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Cursor Optional[string] `json:"cursor,omitempty"` + Fields Optional[[]string] `json:"fields,omitempty"` +} + +// KnowledgeListOutput is the response from knowledge.list. +type KnowledgeListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []KnowledgeListEntry `json:"rows"` + NextCursor Optional[string] `json:"next_cursor,omitempty"` +} + +// KnowledgeMoveInput is the request to knowledge.move. +type KnowledgeMoveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + ToNamespace string `json:"to_namespace"` + SourceUris []string `json:"source_uris"` +} + +// KnowledgeMoveOutput is the response from knowledge.move. +type KnowledgeMoveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + ToNamespace *string `json:"to_namespace,omitempty"` + Results *[]KnowledgeMoveResult `json:"results,omitempty"` +} + +// KnowledgeMoveResult is a model used by Loom operations. +type KnowledgeMoveResult struct { + SourceURI string `json:"source_uri"` + Moved *bool `json:"moved,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// KnowledgeOutlineInput is the request to knowledge.outline. +type KnowledgeOutlineInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SourceURI string `json:"source_uri"` + SectionPath *[]string `json:"section_path,omitempty"` + IncludeChildren *bool `json:"include_children,omitempty"` +} + +// KnowledgeOutlineOutput is the response from knowledge.outline. +type KnowledgeOutlineOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + SourceURI string `json:"source_uri"` + Title *string `json:"title,omitempty"` + Structured *bool `json:"structured,omitempty"` + ChunkCount *int64 `json:"chunk_count,omitempty"` + Sections *[]OutlineEntry `json:"sections,omitempty"` + SectionContent Optional[string] `json:"section_content,omitempty"` + SectionChunkIdxs *[]int64 `json:"section_chunk_idxs,omitempty"` +} + +// KnowledgeQueryHistoryAddInput is the request to knowledge.query_history.add. +type KnowledgeQueryHistoryAddInput = QueryHistoryAddInput + +// KnowledgeQueryHistoryAddOutput is the response from knowledge.query_history.add. +type KnowledgeQueryHistoryAddOutput = QueryHistorySourceHTTPResponse + +// KnowledgeQueryHistoryListInput is the request to knowledge.query_history.list. +type KnowledgeQueryHistoryListInput = QueryHistoryListInput + +// KnowledgeQueryHistoryListOutput is the response from knowledge.query_history.list. +type KnowledgeQueryHistoryListOutput = QueryHistoryListOutput + +// KnowledgeQueryHistoryRemoveInput is the request to knowledge.query_history.remove. +type KnowledgeQueryHistoryRemoveInput = QueryHistoryRemoveInput + +// KnowledgeQueryHistoryRemoveOutput is the response from knowledge.query_history.remove. +type KnowledgeQueryHistoryRemoveOutput = QueryHistoryRemoveOutput + +// KnowledgeQueryInput is the request to knowledge.query. +type KnowledgeQueryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Datasets []QueryDataset `json:"datasets"` + Where *[]QueryFilter `json:"where,omitempty"` + Joins *[]QueryJoin `json:"joins,omitempty"` + GroupBy *[]QueryGroup `json:"group_by,omitempty"` + Aggregates *[]QueryAggregate `json:"aggregates,omitempty"` + Select *[]QueryColumn `json:"select,omitempty"` + OrderBy *[]QueryOrder `json:"order_by,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// KnowledgeQueryOutput is the response from knowledge.query. +type KnowledgeQueryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Columns []QueryResultColumn `json:"columns"` + Rows [][]json.RawMessage `json:"rows"` + RowIds *[][]int64 `json:"row_ids,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Complete bool `json:"complete"` + Incomplete *[]string `json:"incomplete,omitempty"` + Receipt QueryReceipt `json:"receipt"` +} + +// KnowledgeReadsInput is the request to knowledge.reads. +type KnowledgeReadsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Days *int64 `json:"days,omitempty"` + SourceUris *[]string `json:"source_uris,omitempty"` +} + +// KnowledgeReadsOutput is the response from knowledge.reads. +type KnowledgeReadsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + WindowDays int64 `json:"window_days"` + Reads *[]map[string]json.RawMessage `json:"reads,omitempty"` +} + +// KnowledgeRestoreInput is the request to knowledge.restore. +type KnowledgeRestoreInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SourceURI string `json:"source_uri"` + IfRevision Optional[int64] `json:"if_revision,omitempty"` +} + +// KnowledgeRestoreOutput is the response from knowledge.restore. +type KnowledgeRestoreOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Restored bool `json:"restored"` + Reason *string `json:"reason,omitempty"` + DocID *string `json:"doc_id,omitempty"` + Revision Optional[int64] `json:"revision,omitempty"` + ChunksRestored *int64 `json:"chunks_restored,omitempty"` + Original *string `json:"original,omitempty"` +} + +// KnowledgeSearchInput is the request to knowledge.search. +type KnowledgeSearchInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Query string `json:"query"` + Tags *[]string `json:"tags,omitempty"` + SinceSeconds Optional[int64] `json:"since_seconds,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + NamespaceScope *string `json:"namespace_scope,omitempty"` + Namespaces *[]string `json:"namespaces,omitempty"` + SearchMode *string `json:"search_mode,omitempty"` + LexicalWeight *float64 `json:"lexical_weight,omitempty"` + NarrowSpans *bool `json:"narrow_spans,omitempty"` + CollapseSections *bool `json:"collapse_sections,omitempty"` + URIPrefix *[]string `json:"uri_prefix,omitempty"` + SessionIds *[]string `json:"session_ids,omitempty"` + SourceClasses *[]string `json:"source_classes,omitempty"` + Formats *[]string `json:"formats,omitempty"` + BlockTypes *[]string `json:"block_types,omitempty"` + Rerank *string `json:"rerank,omitempty"` +} + +// KnowledgeSearchOutput is the response from knowledge.search. +type KnowledgeSearchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Results []SearchHit `json:"results"` + RerankedBy *string `json:"reranked_by,omitempty"` + EmbeddingModel string `json:"embedding_model"` + NamespacesSkipped *[]string `json:"namespaces_skipped,omitempty"` + StaleDropped *int64 `json:"stale_dropped,omitempty"` +} + +// KnowledgeSourceAddInput is the request to knowledge.source.add. +type KnowledgeSourceAddInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Kind string `json:"kind"` + Items Optional[[]map[string]json.RawMessage] `json:"items,omitempty"` + Links Optional[[]string] `json:"links,omitempty"` + Config Optional[map[string]json.RawMessage] `json:"config,omitempty"` + Include Optional[[]string] `json:"include,omitempty"` + CredentialMode *string `json:"credential_mode,omitempty"` + Credential *string `json:"credential,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` +} + +// KnowledgeSourceAddOutput is the response from knowledge.source.add. +type KnowledgeSourceAddOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Kind string `json:"kind"` + Namespace string `json:"namespace"` + Items *[]map[string]json.RawMessage `json:"items,omitempty"` + Include *[]string `json:"include,omitempty"` + Config *map[string]json.RawMessage `json:"config,omitempty"` + Probe *KnowledgeSourceProbe `json:"probe,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` +} + +// KnowledgeSourceCheckInput is the request to knowledge.source.check. +type KnowledgeSourceCheckInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +// KnowledgeSourceCheckOutput is the response from knowledge.source.check. +type KnowledgeSourceCheckOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Reachable *bool `json:"reachable,omitempty"` + Documents *int64 `json:"documents,omitempty"` + More *bool `json:"more,omitempty"` + Sample *[]string `json:"sample,omitempty"` + Checked *int64 `json:"checked,omitempty"` + Sampled *bool `json:"sampled,omitempty"` + Summary *string `json:"summary,omitempty"` + CheckedAt *string `json:"checked_at,omitempty"` +} + +// KnowledgeSourceDocument is a model used by Loom operations. +type KnowledgeSourceDocument struct { + SourceURI string `json:"source_uri"` + Title *string `json:"title,omitempty"` + SourceRevision *string `json:"source_revision,omitempty"` + IngestedAt *string `json:"ingested_at,omitempty"` +} + +// KnowledgeSourceEntry is a model used by Loom operations. +type KnowledgeSourceEntry struct { + Name string `json:"name"` + Kind string `json:"kind"` + CredentialMode *string `json:"credential_mode,omitempty"` + Access *string `json:"access,omitempty"` + OwnerSubject *string `json:"owner_subject,omitempty"` + Items *[]map[string]json.RawMessage `json:"items,omitempty"` + Include *[]string `json:"include,omitempty"` + Config *map[string]json.RawMessage `json:"config,omitempty"` + CreatedBy *string `json:"created_by,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Sync *KnowledgeSourceSync `json:"sync,omitempty"` +} + +// KnowledgeSourceInspectInput is the request to knowledge.source.inspect. +type KnowledgeSourceInspectInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +// KnowledgeSourceInspectOutput is the response from knowledge.source.inspect. +type KnowledgeSourceInspectOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Kind string `json:"kind"` + CredentialMode *string `json:"credential_mode,omitempty"` + Access *string `json:"access,omitempty"` + OwnerSubject *string `json:"owner_subject,omitempty"` + Items *[]map[string]json.RawMessage `json:"items,omitempty"` + Include *[]string `json:"include,omitempty"` + Config *map[string]json.RawMessage `json:"config,omitempty"` + CreatedBy *string `json:"created_by,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Sync *KnowledgeSourceSync `json:"sync,omitempty"` + Documents *[]KnowledgeSourceDocument `json:"documents,omitempty"` +} + +// KnowledgeSourceListInput is the request to knowledge.source.list. +type KnowledgeSourceListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// KnowledgeSourceListOutput is the response from knowledge.source.list. +type KnowledgeSourceListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Sources *[]KnowledgeSourceEntry `json:"sources,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + AcceptsSources *bool `json:"accepts_sources,omitempty"` +} + +// KnowledgeSourceParseLinksInput is the request to knowledge.source.parse_links. +type KnowledgeSourceParseLinksInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Links []string `json:"links"` +} + +// KnowledgeSourceParseLinksOutput is the response from knowledge.source.parse_links. +type KnowledgeSourceParseLinksOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Links *[]KnowledgeSourceParsedLink `json:"links,omitempty"` +} + +// KnowledgeSourceParsedLink is a model used by Loom operations. +type KnowledgeSourceParsedLink struct { + Link string `json:"link"` + Kind *string `json:"kind,omitempty"` + Item *map[string]json.RawMessage `json:"item,omitempty"` + Unreadable *string `json:"unreadable,omitempty"` +} + +// KnowledgeSourceProbe is a model used by Loom operations. +type KnowledgeSourceProbe struct { + Documents *int64 `json:"documents,omitempty"` + More *bool `json:"more,omitempty"` + Sample *[]string `json:"sample,omitempty"` + Checked *int64 `json:"checked,omitempty"` + Sampled *bool `json:"sampled,omitempty"` +} + +// KnowledgeSourcePushConfigureInput is the request to knowledge.source.push_configure. +type KnowledgeSourcePushConfigureInput = PushConfigureInput + +// KnowledgeSourcePushConfigureOutput is the response from knowledge.source.push_configure. +type KnowledgeSourcePushConfigureOutput = PushStatusOutput + +// KnowledgeSourcePushConfirmInput is the request to knowledge.source.push_confirm. +type KnowledgeSourcePushConfirmInput = PushConfirmInput + +// KnowledgeSourcePushConfirmOutput is the response from knowledge.source.push_confirm. +type KnowledgeSourcePushConfirmOutput = PushStatusOutput + +// KnowledgeSourcePushStatusInput is the request to knowledge.source.push_status. +type KnowledgeSourcePushStatusInput = PushStatusInput + +// KnowledgeSourcePushStatusOutput is the response from knowledge.source.push_status. +type KnowledgeSourcePushStatusOutput = PushStatusOutput + +// KnowledgeSourceRemoveInput is the request to knowledge.source.remove. +type KnowledgeSourceRemoveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Confirm string `json:"confirm"` + DeleteDocuments *bool `json:"delete_documents,omitempty"` +} + +// KnowledgeSourceRemoveOutput is the response from knowledge.source.remove. +type KnowledgeSourceRemoveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + DocumentsPending *int64 `json:"documents_pending,omitempty"` +} + +// KnowledgeSourceRotateInput is the request to knowledge.source.rotate. +type KnowledgeSourceRotateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Credential string `json:"credential"` +} + +// KnowledgeSourceRotateOutput is the response from knowledge.source.rotate. +type KnowledgeSourceRotateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Probe *KnowledgeSourceProbe `json:"probe,omitempty"` + RotatedAt *string `json:"rotated_at,omitempty"` +} + +// KnowledgeSourceSync is a model used by Loom operations. +type KnowledgeSourceSync struct { + RequestedAt *string `json:"requested_at,omitempty"` + LastSyncedAt *string `json:"last_synced_at,omitempty"` + Status *string `json:"status,omitempty"` + DocumentsSeen *int64 `json:"documents_seen,omitempty"` + Changed *int64 `json:"changed,omitempty"` + Removed *int64 `json:"removed,omitempty"` + Unconverted *int64 `json:"unconverted,omitempty"` + UnconvertedReasons *map[string]int64 `json:"unconverted_reasons,omitempty"` + Skipped *int64 `json:"skipped,omitempty"` + Error *string `json:"error,omitempty"` + PendingExtract *int64 `json:"pending_extract,omitempty"` + LastExtractedAt *string `json:"last_extracted_at,omitempty"` + Extracted *int64 `json:"extracted,omitempty"` + FlaggedPinned *int64 `json:"flagged_pinned,omitempty"` + Unextracted *int64 `json:"unextracted,omitempty"` + ExtractError *string `json:"extract_error,omitempty"` +} + +// KnowledgeSourceSyncNowInput is the request to knowledge.source.sync_now. +type KnowledgeSourceSyncNowInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Full *bool `json:"full,omitempty"` +} + +// KnowledgeSourceSyncNowOutput is the response from knowledge.source.sync_now. +type KnowledgeSourceSyncNowOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` +} + +// KnowledgeSourceUpdateInput is the request to knowledge.source.update. +type KnowledgeSourceUpdateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + AddItems *[]map[string]json.RawMessage `json:"add_items,omitempty"` + AddLinks *[]string `json:"add_links,omitempty"` + RemoveItems *[]map[string]json.RawMessage `json:"remove_items,omitempty"` + RemoveLinks *[]string `json:"remove_links,omitempty"` + Include Optional[[]string] `json:"include,omitempty"` +} + +// KnowledgeSourceUpdateOutput is the response from knowledge.source.update. +type KnowledgeSourceUpdateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Items *[]map[string]json.RawMessage `json:"items,omitempty"` + Include *[]string `json:"include,omitempty"` + Config *map[string]json.RawMessage `json:"config,omitempty"` + Added *[]map[string]json.RawMessage `json:"added,omitempty"` + Removed *[]map[string]json.RawMessage `json:"removed,omitempty"` + Probe *KnowledgeSourceProbe `json:"probe,omitempty"` +} + +// KnowledgeSynthesizeInput is the request to knowledge.synthesize. +type KnowledgeSynthesizeInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + UserID *string `json:"user_id,omitempty"` + SourceUris *[]string `json:"source_uris,omitempty"` + Datasets *[]QueryDataset `json:"datasets,omitempty"` + Task string `json:"task"` + WindowChars *int64 `json:"window_chars,omitempty"` + MaxAnswerChars *int64 `json:"max_answer_chars,omitempty"` + MaxWindows *int64 `json:"max_windows,omitempty"` +} + +// KnowledgeSynthesizeOutput is the response from knowledge.synthesize. +type KnowledgeSynthesizeOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Answer string `json:"answer"` + Windows int64 `json:"windows"` + ChunksRead int64 `json:"chunks_read"` + Documents int64 `json:"documents"` + ReduceRounds int64 `json:"reduce_rounds"` + Citations *[]string `json:"citations,omitempty"` + CitedChunks *[]CitedChunk `json:"cited_chunks,omitempty"` + UnsupportedCitations *[]string `json:"unsupported_citations,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Abstain *bool `json:"abstain,omitempty"` + AbstainReason *string `json:"abstain_reason,omitempty"` + Clarification *string `json:"clarification,omitempty"` + Calculations *[]SynthesizeCalculation `json:"calculations,omitempty"` + Model *string `json:"model,omitempty"` +} + +// KnowledgeUpdateMetadataInput is the request to knowledge.update_metadata. +type KnowledgeUpdateMetadataInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SourceURI string `json:"source_uri"` + Title Optional[string] `json:"title,omitempty"` + Description Optional[string] `json:"description,omitempty"` + Tags Optional[[]string] `json:"tags,omitempty"` + Reindex *bool `json:"reindex,omitempty"` +} + +// KnowledgeUpdateMetadataOutput is the response from knowledge.update_metadata. +type KnowledgeUpdateMetadataOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Updated bool `json:"updated"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Tags *[]string `json:"tags,omitempty"` + ChunksReindexed *int64 `json:"chunks_reindexed,omitempty"` +} + +// KnowledgeUpsertInput is the request to knowledge.upsert. +type KnowledgeUpsertInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SourceURI string `json:"source_uri"` + Content string `json:"content"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + OriginalBytesB64 Optional[string] `json:"original_bytes_b64,omitempty"` + OriginalFilename *string `json:"original_filename,omitempty"` + BlobContentType *string `json:"blob_content_type,omitempty"` + Agent *string `json:"agent,omitempty"` + SessionID *string `json:"session_id,omitempty"` + SourceClass Optional[string] `json:"source_class,omitempty"` +} + +// KnowledgeUpsertOutput is the response from knowledge.upsert. +type KnowledgeUpsertOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + DocID string `json:"doc_id"` + ChunksCreated int64 `json:"chunks_created"` + ChunksSuperseded int64 `json:"chunks_superseded"` + EmbeddingModel string `json:"embedding_model"` + EmbeddingDim int64 `json:"embedding_dim"` + DuplicateOfURI *string `json:"duplicate_of_uri,omitempty"` + DuplicateChunkCount *int64 `json:"duplicate_chunk_count,omitempty"` + Namespace *string `json:"namespace,omitempty"` + SourceURI *string `json:"source_uri,omitempty"` +} + +// LearningEntry is a model used by Loom operations. +type LearningEntry struct { + CandidateID string `json:"candidate_id"` + MemoryKey string `json:"memory_key"` + MemoryType string `json:"memory_type"` + ProposedValue json.RawMessage `json:"proposed_value"` + SupporterCount int64 `json:"supporter_count"` + SupporterSessions *int64 `json:"supporter_sessions,omitempty"` + SupporterWriters *int64 `json:"supporter_writers,omitempty"` + ConfidenceAvg float64 `json:"confidence_avg"` + Supporters []string `json:"supporters"` + Rationale string `json:"rationale"` + SourceKind *string `json:"source_kind,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + Agent *string `json:"agent,omitempty"` + Status string `json:"status"` + ProposedAt string `json:"proposed_at"` + DecidedAt Optional[string] `json:"decided_at,omitempty"` + DecidedBy *string `json:"decided_by,omitempty"` + DecisionReason *string `json:"decision_reason,omitempty"` +} + +// LearningsListInput is the request to learnings.list. +type LearningsListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Status Optional[string] `json:"status,omitempty"` + Limit *int64 `json:"limit,omitempty"` + SourceKind Optional[string] `json:"source_kind,omitempty"` +} + +// LearningsListOutput is the response from learnings.list. +type LearningsListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []LearningEntry `json:"rows"` +} + +// LearningsQualityInput is the request to learnings.quality. +type LearningsQualityInput struct { + Org string `json:"org"` + Namespace Optional[string] `json:"namespace,omitempty"` + SourceKind Optional[string] `json:"source_kind,omitempty"` +} + +// LearningsQualityOutput is the response from learnings.quality. +type LearningsQualityOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []LearningsQualityRow `json:"rows"` +} + +// LearningsQualityRow is a model used by Loom operations. +type LearningsQualityRow struct { + Namespace string `json:"namespace"` + Pending int64 `json:"pending"` + Promoted int64 `json:"promoted"` + Rejected int64 `json:"rejected"` + ApproveRatio float64 `json:"approve_ratio"` +} + +// LearningsReviewInput is the request to learnings.review. +type LearningsReviewInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + CandidateID string `json:"candidate_id"` + Decision string `json:"decision"` + Reason *string `json:"reason,omitempty"` + Destination Optional[string] `json:"destination,omitempty"` + Approver *string `json:"approver,omitempty"` +} + +// LearningsReviewOutput is the response from learnings.review. +type LearningsReviewOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + CandidateID string `json:"candidate_id"` + NewStatus string `json:"new_status"` + PromotedToShared *bool `json:"promoted_to_shared,omitempty"` + PromotedToKnowledge *bool `json:"promoted_to_knowledge,omitempty"` + KnowledgeSourceURI *string `json:"knowledge_source_uri,omitempty"` + DecidedAt string `json:"decided_at"` +} + +// LineageAuditEvent is a model used by Loom operations. +type LineageAuditEvent struct { + Ts string `json:"ts"` + EventType string `json:"event_type"` + Actor string `json:"actor"` + RequestID string `json:"request_id"` +} + +// LineageCandidate is a model used by Loom operations. +type LineageCandidate struct { + CandidateID string `json:"candidate_id"` + SourceKind string `json:"source_kind"` + SupporterCount int64 `json:"supporter_count"` + Rationale string `json:"rationale"` + DecidedAt string `json:"decided_at"` + DecidedBy string `json:"decided_by"` + MatchConfidence string `json:"match_confidence"` + SeededFromThreadID *string `json:"seeded_from_thread_id,omitempty"` + SeededFromMsgID *string `json:"seeded_from_msg_id,omitempty"` +} + +// LineageSupporter is a model used by Loom operations. +type LineageSupporter struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID string `json:"user_id"` + SessionID string `json:"session_id"` + MemoryKey string `json:"memory_key"` +} + +// LiveSearchHit is a model used by Loom operations. +type LiveSearchHit struct { + ID string `json:"id"` + Title string `json:"title"` + URL string `json:"url"` + Provider string `json:"provider"` + Content *string `json:"content,omitempty"` + Live *bool `json:"live,omitempty"` +} + +// LiveSearchResults is a model used by Loom operations. +type LiveSearchResults struct { + Live *bool `json:"live,omitempty"` + Results *[]LiveSearchHit `json:"results,omitempty"` +} + +// LostName is a model used by Loom operations. +type LostName struct { + Name string `json:"name"` + Winner string `json:"winner"` +} + +// MemoryAgentsListInput is the request to memory.agents_list. +type MemoryAgentsListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` +} + +// MemoryAgentsListOutput is the response from memory.agents_list. +type MemoryAgentsListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Agents []string `json:"agents"` +} + +// MemoryAggregateInput is the request to memory.aggregate. +type MemoryAggregateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + AggFunc *string `json:"agg_func,omitempty"` + AggField *string `json:"agg_field,omitempty"` + GroupBy *[]string `json:"group_by,omitempty"` + Filter *map[string]string `json:"filter,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryAggregateOutput is the response from memory.aggregate. +type MemoryAggregateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows *[]AggregateRow `json:"rows,omitempty"` + SQLExecuted *string `json:"sql_executed,omitempty"` +} + +// MemoryAppendBatchInput is the request to memory.append_batch. +type MemoryAppendBatchInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Entries []AppendBatchEntry `json:"entries"` +} + +// MemoryAppendBatchOutput is the response from memory.append_batch. +type MemoryAppendBatchOutput = MemoryBulkSetOutput + +// MemoryApplyInput is the request to memory.apply. +type MemoryApplyInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Target ApplyTarget `json:"target"` + Action string `json:"action"` + Reason string `json:"reason"` + Limit Optional[int64] `json:"limit,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + Expire Optional[ApplyExpire] `json:"expire,omitempty"` + Lock Optional[ApplyLock] `json:"lock,omitempty"` + Label Optional[ApplyLabel] `json:"label,omitempty"` + Demote Optional[ApplyDemote] `json:"demote,omitempty"` +} + +// MemoryApplyOutput is the response from memory.apply. +type MemoryApplyOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Action string `json:"action"` + DryRun bool `json:"dry_run"` + Target string `json:"target"` + Matched *int64 `json:"matched,omitempty"` + Applied *int64 `json:"applied,omitempty"` + WouldApply *int64 `json:"would_apply,omitempty"` + Refused *int64 `json:"refused,omitempty"` + Noop *int64 `json:"noop,omitempty"` + Failed *int64 `json:"failed,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Rows *[]ApplyRow `json:"rows,omitempty"` +} + +// MemoryAskInput is the request to memory.ask. +type MemoryAskInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Query string `json:"query"` + MemoryType Optional[string] `json:"memory_type,omitempty"` + Tags *[]string `json:"tags,omitempty"` + TagsSoft *bool `json:"tags_soft,omitempty"` + TagBoost Optional[float64] `json:"tag_boost,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + Bodies Optional[string] `json:"bodies,omitempty"` + BodyBudgetTokens Optional[int64] `json:"body_budget_tokens,omitempty"` + SourceSpanChars *int64 `json:"source_span_chars,omitempty"` + AllowSynthesis *bool `json:"allow_synthesis,omitempty"` + Reinforce *bool `json:"reinforce,omitempty"` + ReinforcementWeight Optional[float64] `json:"reinforcement_weight,omitempty"` + MaxAnswerChars *int64 `json:"max_answer_chars,omitempty"` + NamespaceScope Optional[string] `json:"namespace_scope,omitempty"` + SearchMode *string `json:"search_mode,omitempty"` + ReadScope *string `json:"read_scope,omitempty"` + SensitivityPenalty Optional[float64] `json:"sensitivity_penalty,omitempty"` + SummaryCap Optional[int64] `json:"summary_cap,omitempty"` + RrfAdaptiveLexical Optional[bool] `json:"rrf_adaptive_lexical,omitempty"` + Personalization *string `json:"personalization,omitempty"` + AsOf Optional[string] `json:"as_of,omitempty"` + AsOfBasis *string `json:"as_of_basis,omitempty"` + IncludeSuperseded *bool `json:"include_superseded,omitempty"` + Precedents Optional[bool] `json:"precedents,omitempty"` + LLMCache Optional[bool] `json:"llm_cache,omitempty"` + Depth *string `json:"depth,omitempty"` + DeepSelect Optional[string] `json:"deep_select,omitempty"` + DeepFirst Optional[bool] `json:"deep_first,omitempty"` + Recount Optional[bool] `json:"recount,omitempty"` + TokenBudget Optional[int64] `json:"token_budget,omitempty"` + Personalize Optional[bool] `json:"personalize,omitempty"` + WindowRelFloor Optional[float64] `json:"window_rel_floor,omitempty"` + Decompose *string `json:"decompose,omitempty"` + WorldKnowledge *string `json:"world_knowledge,omitempty"` + Consistency *string `json:"consistency,omitempty"` + RoutePrior *string `json:"route_prior,omitempty"` + RoutePriorMaxCheap Optional[float64] `json:"route_prior_max_cheap,omitempty"` + MidModel *string `json:"mid_model,omitempty"` + MidRoutes *string `json:"mid_routes,omitempty"` + DefaultAnswerChars Optional[int64] `json:"default_answer_chars,omitempty"` + DigestDescent Optional[bool] `json:"digest_descent,omitempty"` + PresuppositionRule Optional[bool] `json:"presupposition_rule,omitempty"` + SetWindow Optional[int64] `json:"set_window,omitempty"` + Knowledge Optional[bool] `json:"knowledge,omitempty"` + RecentMessages *[]RecentMessage `json:"recent_messages,omitempty"` + ObservationDate *string `json:"observation_date,omitempty"` + GhItemsFallback Optional[bool] `json:"gh_items_fallback,omitempty"` +} + +// MemoryAskOutput is the response from memory.ask. +type MemoryAskOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Answer *string `json:"answer,omitempty"` + Source *string `json:"source,omitempty"` + Abstain *bool `json:"abstain,omitempty"` + AbstainReason *string `json:"abstain_reason,omitempty"` + MemoryKeys *[]string `json:"memory_keys,omitempty"` + Results *[]MemorySearchHit `json:"results,omitempty"` + CitedSessions *[]string `json:"cited_sessions,omitempty"` + Next *string `json:"next,omitempty"` + SynthModel *string `json:"synth_model,omitempty"` + RouteTier *string `json:"route_tier,omitempty"` + RouteReason *string `json:"route_reason,omitempty"` + LLMCacheHits *int64 `json:"llm_cache_hits,omitempty"` + LLMCacheMisses *int64 `json:"llm_cache_misses,omitempty"` + LLMCache *bool `json:"llm_cache,omitempty"` + LLMCacheSavedUsd *float64 `json:"llm_cache_saved_usd,omitempty"` + TemporalConsistency Optional[float64] `json:"temporal_consistency,omitempty"` + CitationConcentration Optional[float64] `json:"citation_concentration,omitempty"` + Escalated *bool `json:"escalated,omitempty"` + GateMode *string `json:"gate_mode,omitempty"` + GateKept *int64 `json:"gate_kept,omitempty"` + GateDropped *int64 `json:"gate_dropped,omitempty"` + PendingExtraction *int64 `json:"pending_extraction,omitempty"` + PendingEvidence *int64 `json:"pending_evidence,omitempty"` + RetrievalQuery *string `json:"retrieval_query,omitempty"` + Facets *[]string `json:"facets,omitempty"` + FacetMemoriesAdded *int64 `json:"facet_memories_added,omitempty"` + Consistency *string `json:"consistency,omitempty"` + ConsistencyScore *float64 `json:"consistency_score,omitempty"` + ConsistencyNote *string `json:"consistency_note,omitempty"` + IdentifierChaseHops *int64 `json:"identifier_chase_hops,omitempty"` + IdentifierChaseAdded *int64 `json:"identifier_chase_added,omitempty"` + PremiseConflict *string `json:"premise_conflict,omitempty"` + PremiseNote *string `json:"premise_note,omitempty"` + PremiseVerdict *string `json:"premise_verdict,omitempty"` + AttributionNote *string `json:"attribution_note,omitempty"` + Depth *string `json:"depth,omitempty"` + DeepFired *bool `json:"deep_fired,omitempty"` + Decomposed *[]string `json:"decomposed,omitempty"` + DecomposedParts *int64 `json:"decomposed_parts,omitempty"` + SupersededDropped *int64 `json:"superseded_dropped,omitempty"` + StaleSentencesMasked *int64 `json:"stale_sentences_masked,omitempty"` + EntityFollowed *[]string `json:"entity_followed,omitempty"` + WhenEvidenceTurns *int64 `json:"when_evidence_turns,omitempty"` + DecomposeFailed *int64 `json:"decompose_failed,omitempty"` + PoolK *int64 `json:"pool_k,omitempty"` + Grounding *string `json:"grounding,omitempty"` + DeepReason *string `json:"deep_reason,omitempty"` + DeepKeys *[]string `json:"deep_keys,omitempty"` + DeepChars *int64 `json:"deep_chars,omitempty"` + CodeHits *int64 `json:"code_hits,omitempty"` + PoolFacts *int64 `json:"pool_facts,omitempty"` + PoolChunks *int64 `json:"pool_chunks,omitempty"` + PromptBlocks *map[string]int64 `json:"prompt_blocks,omitempty"` + DeepSelector *string `json:"deep_selector,omitempty"` + DeepFirst *string `json:"deep_first,omitempty"` + SynthCalls *int64 `json:"synth_calls,omitempty"` + SynthInputTokens *int64 `json:"synth_input_tokens,omitempty"` + SynthCachedInputTokens *int64 `json:"synth_cached_input_tokens,omitempty"` + SynthCacheWriteTokens *int64 `json:"synth_cache_write_tokens,omitempty"` + SynthCostUsd *float64 `json:"synth_cost_usd,omitempty"` + ContextTokensEst *int64 `json:"context_tokens_est,omitempty"` + ContextTrimmed *int64 `json:"context_trimmed,omitempty"` + SummaryHits *int64 `json:"summary_hits,omitempty"` + KnowledgeHits *int64 `json:"knowledge_hits,omitempty"` + TimelineRows *int64 `json:"timeline_rows,omitempty"` + CountRecomputed *bool `json:"count_recomputed,omitempty"` +} + +// MemoryAssignCategoryInput is the request to memory.assign_category. +type MemoryAssignCategoryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryKey string `json:"memory_key"` + CategoryName string `json:"category_name"` + Tombstone *bool `json:"tombstone,omitempty"` +} + +// MemoryAssignCategoryOutput is the response from memory.assign_category. +type MemoryAssignCategoryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Assigned bool `json:"assigned"` + CategoryID string `json:"category_id"` +} + +// MemoryAutoRetirement is a model used by Loom operations. +type MemoryAutoRetirement struct { + Ts string `json:"ts"` + Reason string `json:"reason"` + MemoryID string `json:"memory_id"` + MemoryKey string `json:"memory_key"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + SupersededBy *string `json:"superseded_by,omitempty"` + SupersededByKey *string `json:"superseded_by_key,omitempty"` + Label *string `json:"label,omitempty"` + Unconfirmed *bool `json:"unconfirmed,omitempty"` + JudgeVerdict *string `json:"judge_verdict,omitempty"` + JudgeConfidence Optional[float64] `json:"judge_confidence,omitempty"` + JudgeModel *string `json:"judge_model,omitempty"` + JudgePromptVersion *string `json:"judge_prompt_version,omitempty"` +} + +// MemoryAutoRetirementsInput is the request to memory.auto_retirements. +type MemoryAutoRetirementsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Since Optional[string] `json:"since,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Cursor Optional[string] `json:"cursor,omitempty"` +} + +// MemoryAutoRetirementsOutput is the response from memory.auto_retirements. +type MemoryAutoRetirementsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows *[]MemoryAutoRetirement `json:"rows,omitempty"` + NextCursor Optional[string] `json:"next_cursor,omitempty"` +} + +// MemoryBacklinksInput is the request to memory.backlinks. +type MemoryBacklinksInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryBacklinksOutput is the response from memory.backlinks. +type MemoryBacklinksOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MemoryKey string `json:"memory_key"` + Found *bool `json:"found,omitempty"` + Versions *[]BacklinkVersion `json:"versions,omitempty"` + Digests *[]BacklinkDigest `json:"digests,omitempty"` + LinksIn *[]BacklinkEdge `json:"links_in,omitempty"` + LinksOut *[]BacklinkEdge `json:"links_out,omitempty"` + EvidenceCount *int64 `json:"evidence_count,omitempty"` + Related *[]BacklinkRelated `json:"related,omitempty"` +} + +// MemoryBriefInput is the request to memory.brief. +type MemoryBriefInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Query string `json:"query"` + TopK *int64 `json:"top_k,omitempty"` + Tags *[]string `json:"tags,omitempty"` +} + +// MemoryBriefOutput is the response from memory.brief. +type MemoryBriefOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Query *string `json:"query,omitempty"` + Answer *string `json:"answer,omitempty"` + Abstained *bool `json:"abstained,omitempty"` + Grounding *string `json:"grounding,omitempty"` + Evidence *[]BriefEvidence `json:"evidence,omitempty"` + Unknowns *[]string `json:"unknowns,omitempty"` + NextReads *[]string `json:"next_reads,omitempty"` +} + +// MemoryBulkGetInput is the request to memory.bulk_get. +type MemoryBulkGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKeys []string `json:"memory_keys"` + Fields *[]string `json:"fields,omitempty"` +} + +// MemoryBulkGetOutput is the response from memory.bulk_get. +type MemoryBulkGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Results *map[string]ModelMemoryGetOutput `json:"results,omitempty"` + Missing *[]string `json:"missing,omitempty"` +} + +// MemoryBulkSetInput is the request to memory.bulk_set. +type MemoryBulkSetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Entries []BulkSetEntry `json:"entries"` + Contextualize *bool `json:"contextualize,omitempty"` + DetectUpdates Optional[bool] `json:"detect_updates,omitempty"` +} + +// MemoryBulkSetOutput is the response from memory.bulk_set. +type MemoryBulkSetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Written []BulkSetResult `json:"written"` + SkippedPinned *[]string `json:"skipped_pinned,omitempty"` + SkippedLocked *[]string `json:"skipped_locked,omitempty"` + SkippedBlacklisted *[]string `json:"skipped_blacklisted,omitempty"` + Merged *[]string `json:"merged,omitempty"` + ValueUpdatesLinked *int64 `json:"value_updates_linked,omitempty"` + RejectedPinned *[]string `json:"rejected_pinned,omitempty"` + Duplicates *[]string `json:"duplicates,omitempty"` + Conflicted *[]string `json:"conflicted,omitempty"` + Unchecked *int64 `json:"unchecked,omitempty"` + Retyped *[]string `json:"retyped,omitempty"` + IdentityDuplicates *map[string]string `json:"identity_duplicates,omitempty"` + StageMs *map[string]float64 `json:"stage_ms,omitempty"` +} + +// MemoryClearInput is the request to memory.clear. +type MemoryClearInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + UserID Optional[string] `json:"user_id,omitempty"` + Agent Optional[string] `json:"agent,omitempty"` + ConfirmSubject string `json:"confirm_subject"` +} + +// MemoryClearOutput is the response from memory.clear. +type MemoryClearOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ClearedAt string `json:"cleared_at"` + RowsAffected map[string]int64 `json:"rows_affected"` + Total int64 `json:"total"` + LockedSkipped *int64 `json:"locked_skipped,omitempty"` +} + +// MemoryConsolidateInput is the request to memory.consolidate. +type MemoryConsolidateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Limit *int64 `json:"limit,omitempty"` + SimilarityThreshold *float64 `json:"similarity_threshold,omitempty"` + MinAgeSeconds *int64 `json:"min_age_seconds,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` +} + +// MemoryConsolidateOutput is the response from memory.consolidate. +type MemoryConsolidateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Consolidated *[]MemoryConsolidateResult `json:"consolidated,omitempty"` + Examined *int64 `json:"examined,omitempty"` + ClustersFound *int64 `json:"clusters_found,omitempty"` + ClustersFailed *int64 `json:"clusters_failed,omitempty"` + ClustersRefusedLossy *int64 `json:"clusters_refused_lossy,omitempty"` + SkippedInFlight *int64 `json:"skipped_in_flight,omitempty"` + TokensIn *int64 `json:"tokens_in,omitempty"` + TokensOut *int64 `json:"tokens_out,omitempty"` +} + +// MemoryConsolidateResult is a model used by Loom operations. +type MemoryConsolidateResult struct { + CanonicalKey string `json:"canonical_key"` + CanonicalValue string `json:"canonical_value"` + MergedKeys []string `json:"merged_keys"` + ClusterSize int64 `json:"cluster_size"` +} + +// MemoryCopyToInput is the request to memory.copy_to. +type MemoryCopyToInput struct { + FromOrg string `json:"from_org"` + FromNamespace string `json:"from_namespace"` + MemoryKey string `json:"memory_key"` + FromAgent *string `json:"from_agent,omitempty"` + FromUserID *string `json:"from_user_id,omitempty"` + FromSessionID *string `json:"from_session_id,omitempty"` + ToNamespace string `json:"to_namespace"` + TargetKey Optional[string] `json:"target_key,omitempty"` + TargetAgent *string `json:"target_agent,omitempty"` + Rationale *string `json:"rationale,omitempty"` +} + +// MemoryCopyToOutput is the response from memory.copy_to. +type MemoryCopyToOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Copied bool `json:"copied"` + TargetMemoryID *string `json:"target_memory_id,omitempty"` + TargetNamespace string `json:"target_namespace"` + TargetKey string `json:"target_key"` +} + +// MemoryCrossPromoteInput is the request to memory.cross_promote. +type MemoryCrossPromoteInput struct { + FromOrg string `json:"from_org"` + FromNamespace string `json:"from_namespace"` + FromMemoryID string `json:"from_memory_id"` + ToNamespace string `json:"to_namespace"` + TargetKey Optional[string] `json:"target_key,omitempty"` + TargetAgent *string `json:"target_agent,omitempty"` + Rationale *string `json:"rationale,omitempty"` +} + +// MemoryCrossPromoteOutput is the response from memory.cross_promote. +type MemoryCrossPromoteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Promoted bool `json:"promoted"` + TargetMemoryID *string `json:"target_memory_id,omitempty"` + TargetNamespace string `json:"target_namespace"` + TargetKey string `json:"target_key"` + CrossPromotedFromMemoryID *string `json:"cross_promoted_from_memory_id,omitempty"` +} + +// MemoryDedupCollapseInput is the request to memory.dedup_collapse. +type MemoryDedupCollapseInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Prefix *string `json:"prefix,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Sample *int64 `json:"sample,omitempty"` +} + +// MemoryDedupCollapseOutput is the response from memory.dedup_collapse. +type MemoryDedupCollapseOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Namespace string `json:"namespace"` + Prefix *string `json:"prefix,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + Pairs *int64 `json:"pairs,omitempty"` + CanonicalLive *int64 `json:"canonical_live,omitempty"` + Orphans *int64 `json:"orphans,omitempty"` + MirrorStale *int64 `json:"mirror_stale,omitempty"` + Restamped *int64 `json:"restamped,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Sample *[]DedupCollapsePair `json:"sample,omitempty"` +} + +// MemoryDedupListInput is the request to memory.dedup_list. +type MemoryDedupListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryDedupListOutput is the response from memory.dedup_list. +type MemoryDedupListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Clusters []DedupCluster `json:"clusters"` +} + +// MemoryDedupResolveInput is the request to memory.dedup_resolve. +type MemoryDedupResolveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + CanonicalID string `json:"canonical_id"` + DuplicateID string `json:"duplicate_id"` + Decision string `json:"decision"` + ConfirmCanonicalKey string `json:"confirm_canonical_key"` + CanonicalKey *string `json:"canonical_key,omitempty"` + DuplicateKey *string `json:"duplicate_key,omitempty"` +} + +// MemoryDedupResolveOutput is the response from memory.dedup_resolve. +type MemoryDedupResolveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + CanonicalKey string `json:"canonical_key"` + DuplicateKey string `json:"duplicate_key"` + Decision string `json:"decision"` + CanonicalTombstoned *bool `json:"canonical_tombstoned,omitempty"` + DuplicateTombstoned *bool `json:"duplicate_tombstoned,omitempty"` +} + +// MemoryDefinitionsListInput is the request to memory.definitions.list. +type MemoryDefinitionsListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// MemoryDefinitionsListOutput is the response from memory.definitions.list. +type MemoryDefinitionsListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Count int64 `json:"count"` + Ceiling int64 `json:"ceiling"` + Definitions []DefinitionEntry `json:"definitions"` +} + +// MemoryDeleteInput is the request to memory.delete. +type MemoryDeleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` +} + +// MemoryDeleteOutput is the response from memory.delete. +type MemoryDeleteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Tombstoned bool `json:"tombstoned"` + Version int64 `json:"version"` + Found *bool `json:"found,omitempty"` + DependentsTombstoned *int64 `json:"dependents_tombstoned,omitempty"` + DependentsDowngraded *int64 `json:"dependents_downgraded,omitempty"` +} + +// MemoryDeleteVersionInput is the request to memory.delete_version. +type MemoryDeleteVersionInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + Version json.RawMessage `json:"version"` +} + +// MemoryDeleteVersionOutput is the response from memory.delete_version. +type MemoryDeleteVersionOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Tombstoned bool `json:"tombstoned"` + Version *int64 `json:"version,omitempty"` + Found *bool `json:"found,omitempty"` + Reason *string `json:"reason,omitempty"` + DependentsTombstoned *int64 `json:"dependents_tombstoned,omitempty"` + DependentsDowngraded *int64 `json:"dependents_downgraded,omitempty"` +} + +// MemoryDemonstrateInput is the request to memory.demonstrate. +type MemoryDemonstrateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Query string `json:"query"` + K *int64 `json:"k,omitempty"` + ExampleTag *string `json:"example_tag,omitempty"` + LabelPrefix *string `json:"label_prefix,omitempty"` + NamespaceScope *string `json:"namespace_scope,omitempty"` + MinMargin *float64 `json:"min_margin,omitempty"` + MaxBlockChars *int64 `json:"max_block_chars,omitempty"` +} + +// MemoryDemonstrateOutput is the response from memory.demonstrate. +type MemoryDemonstrateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Query string `json:"query"` + Demonstrations []DemonstrationRow `json:"demonstrations"` + Votes *map[string]float64 `json:"votes,omitempty"` + PredictedLabel *string `json:"predicted_label,omitempty"` + Margin *float64 `json:"margin,omitempty"` + Abstain *bool `json:"abstain,omitempty"` + AbstainReason *string `json:"abstain_reason,omitempty"` + FewShotBlock *string `json:"few_shot_block,omitempty"` + Examined *int64 `json:"examined,omitempty"` + Labelled *int64 `json:"labelled,omitempty"` +} + +// MemoryDemoteInput is the request to memory.demote. +type MemoryDemoteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryKey string `json:"memory_key"` + Rationale *string `json:"rationale,omitempty"` +} + +// MemoryDemoteOutput is the response from memory.demote. +type MemoryDemoteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Demoted bool `json:"demoted"` + WasReversible bool `json:"was_reversible"` + TombstonedAt Optional[string] `json:"tombstoned_at,omitempty"` +} + +// MemoryDigestsInput is the request to memory.digests. +type MemoryDigestsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryDigestsOutput is the response from memory.digests. +type MemoryDigestsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []DigestRow `json:"rows"` + Truncated *bool `json:"truncated,omitempty"` +} + +// MemoryEvidenceInput is the request to memory.evidence. +type MemoryEvidenceInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryEvidenceItem is a model used by Loom operations. +type MemoryEvidenceItem struct { + EvidenceID string `json:"evidence_id"` + SupportType string `json:"support_type"` + Scope string `json:"scope"` + Role *string `json:"role,omitempty"` + ObservedAt Optional[string] `json:"observed_at,omitempty"` + Content *string `json:"content,omitempty"` + CharStart *int64 `json:"char_start,omitempty"` + CharEnd *int64 `json:"char_end,omitempty"` + Span *string `json:"span,omitempty"` +} + +// MemoryEvidenceOutput is the response from memory.evidence. +type MemoryEvidenceOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + MemoryKey *string `json:"memory_key,omitempty"` + MemoryID *string `json:"memory_id,omitempty"` + Value *string `json:"value,omitempty"` + Items *[]MemoryEvidenceItem `json:"items,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Cited *int64 `json:"cited,omitempty"` + Lexical *int64 `json:"lexical,omitempty"` + Window *int64 `json:"window,omitempty"` + Derived *int64 `json:"derived,omitempty"` +} + +// MemoryExportEvidenceInput is the request to memory.export_evidence. +type MemoryExportEvidenceInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Kind *string `json:"kind,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Cursor *string `json:"cursor,omitempty"` + IncludeHigh *bool `json:"include_high,omitempty"` +} + +// MemoryExportEvidenceOutput is the response from memory.export_evidence. +type MemoryExportEvidenceOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Chunks *[]EvidenceChunk `json:"chunks,omitempty"` + Digests *[]EvidenceDigest `json:"digests,omitempty"` + Edges *[]EvidenceEdge `json:"edges,omitempty"` + HasMore *bool `json:"has_more,omitempty"` + NextCursor *string `json:"next_cursor,omitempty"` + HeldHigh *int64 `json:"held_high,omitempty"` +} + +// MemoryExposureSummaryInput is the request to memory.exposure_summary. +type MemoryExposureSummaryInput = ExposureSummaryInput + +// MemoryExposureSummaryOutput is the response from memory.exposure_summary. +type MemoryExposureSummaryOutput = ExposureSummaryOutput + +// MemoryExtractionRetryMineInput is the request to memory.extraction_retry_mine. +type MemoryExtractionRetryMineInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + QueueIds []string `json:"queue_ids"` +} + +// MemoryExtractionRetryMineOutput is the response from memory.extraction_retry_mine. +type MemoryExtractionRetryMineOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Requeued *[]string `json:"requeued,omitempty"` + NotFailed *[]string `json:"not_failed,omitempty"` + ModelCallsOff *[]string `json:"model_calls_off,omitempty"` + Expired *[]string `json:"expired,omitempty"` + Unknown *[]string `json:"unknown,omitempty"` +} + +// MemoryExtractionStatusInput is the request to memory.extraction_status. +type MemoryExtractionStatusInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + QueueID *string `json:"queue_id,omitempty"` + Status *string `json:"status,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryExtractionStatusMineInput is the request to memory.extraction_status_mine. +type MemoryExtractionStatusMineInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + QueueIds []string `json:"queue_ids"` +} + +// MemoryExtractionStatusMineOutput is the response from memory.extraction_status_mine. +type MemoryExtractionStatusMineOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Batches *[]ExtractionQueueRow `json:"batches,omitempty"` + Unknown *[]string `json:"unknown,omitempty"` + Pending *int64 `json:"pending,omitempty"` + Failed *int64 `json:"failed,omitempty"` +} + +// MemoryExtractionStatusOutput is the response from memory.extraction_status. +type MemoryExtractionStatusOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Batches *[]ExtractionQueueRow `json:"batches,omitempty"` + Pending *int64 `json:"pending,omitempty"` + Failed *int64 `json:"failed,omitempty"` +} + +// MemoryFindingRef is a model used by Loom operations. +type MemoryFindingRef struct { + Code string `json:"code"` + Kind string `json:"kind"` + Severity string `json:"severity"` + RuleVersion int64 `json:"rule_version"` + SourceOp string `json:"source_op"` + Count int64 `json:"count"` + Share float64 `json:"share"` + Detail string `json:"detail"` + Remedy string `json:"remedy"` +} + +// MemoryForFileHit is a model used by Loom operations. +type MemoryForFileHit struct { + MemoryKey string `json:"memory_key"` + MemoryType string `json:"memory_type"` + Value string `json:"value"` + ValueTruncated *bool `json:"value_truncated,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Pinned *bool `json:"pinned,omitempty"` + Status *string `json:"status,omitempty"` + Agent *string `json:"agent,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Actor *string `json:"actor,omitempty"` + SupersedesKey *string `json:"supersedes_key,omitempty"` + Supersedes *string `json:"supersedes,omitempty"` + SupersedesKind *string `json:"supersedes_kind,omitempty"` + MatchedFiles *[]string `json:"matched_files,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + Verification *string `json:"verification,omitempty"` + CodeState json.RawMessage `json:"code_state,omitempty"` + CodeMoved *[]CodeLink `json:"code_moved,omitempty"` +} + +// MemoryForFileInput is the request to memory.for_file. +type MemoryForFileInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Path string `json:"path"` + Tags *[]string `json:"tags,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` + IncludeConflicted *bool `json:"include_conflicted,omitempty"` + ExtraNamespaces *[]string `json:"extra_namespaces,omitempty"` +} + +// MemoryForFileOutput is the response from memory.for_file. +type MemoryForFileOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Path string `json:"path"` + Total int64 `json:"total"` + Hits []MemoryForFileHit `json:"hits"` + Rendered *string `json:"rendered,omitempty"` + TokensEstimate *int64 `json:"tokens_estimate,omitempty"` + Truncated *bool `json:"truncated,omitempty"` +} + +// MemoryGetByIDInput is the request to memory.get_by_id. +type MemoryGetByIDInput struct { + Org string `json:"org"` + MemoryID string `json:"memory_id"` + AsOf Optional[string] `json:"as_of,omitempty"` + OmitHighValue *bool `json:"omit_high_value,omitempty"` +} + +// MemoryGetByIDOutput is the response from memory.get_by_id. +type MemoryGetByIDOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + MemoryID *string `json:"memory_id,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + MemoryKey *string `json:"memory_key,omitempty"` + MemoryType Optional[string] `json:"memory_type,omitempty"` + Value json.RawMessage `json:"value,omitempty"` + Confidence Optional[float64] `json:"confidence,omitempty"` + Version Optional[int64] `json:"version,omitempty"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + ExpiresAt Optional[string] `json:"expires_at,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + ValidTo Optional[string] `json:"valid_to,omitempty"` + Pinned *bool `json:"pinned,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + VerifiedBy *string `json:"verified_by,omitempty"` + VerifiedAt Optional[string] `json:"verified_at,omitempty"` + Verification *string `json:"verification,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` + Actor *string `json:"actor,omitempty"` + SourceClass *string `json:"source_class,omitempty"` + LockMode *string `json:"lock_mode,omitempty"` + LockReason *string `json:"lock_reason,omitempty"` + LockUntil Optional[string] `json:"lock_until,omitempty"` + LockedBy *string `json:"locked_by,omitempty"` + OnExpire *string `json:"on_expire,omitempty"` + ExpireReason *string `json:"expire_reason,omitempty"` +} + +// MemoryGetInput is the request to memory.get. +type MemoryGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + IfVersion Optional[int64] `json:"if_version,omitempty"` + IncludeRecallBreakdown *bool `json:"include_recall_breakdown,omitempty"` + AsOf Optional[string] `json:"as_of,omitempty"` + Fields *[]string `json:"fields,omitempty"` + Follow *bool `json:"follow,omitempty"` +} + +// MemoryGetOutput is the response from memory.get. +type MemoryGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found *bool `json:"found,omitempty"` + Unchanged *bool `json:"unchanged,omitempty"` + MemoryID *string `json:"memory_id,omitempty"` + Value json.RawMessage `json:"value,omitempty"` + MemoryType Optional[string] `json:"memory_type,omitempty"` + Confidence Optional[float64] `json:"confidence,omitempty"` + Version Optional[int64] `json:"version,omitempty"` + VersionText Optional[string] `json:"version_text,omitempty"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + ExpiresAt Optional[string] `json:"expires_at,omitempty"` + OnExpire *string `json:"on_expire,omitempty"` + ExpireReason *string `json:"expire_reason,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + ValidTo Optional[string] `json:"valid_to,omitempty"` + TemporalAnchor Optional[string] `json:"temporal_anchor,omitempty"` + TemporalConfidence *float64 `json:"temporal_confidence,omitempty"` + Pinned *bool `json:"pinned,omitempty"` + Actor *string `json:"actor,omitempty"` + SourceClass *string `json:"source_class,omitempty"` + SourceTrace *string `json:"source_trace,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Status Optional[string] `json:"status,omitempty"` + Code *[]CodeLink `json:"code,omitempty"` + SupersededBy *string `json:"superseded_by,omitempty"` + DuplicateOf *string `json:"duplicate_of,omitempty"` + ConflictVerdict *string `json:"conflict_verdict,omitempty"` + CanonicalKey Optional[string] `json:"canonical_key,omitempty"` + ResolvedFrom Optional[string] `json:"resolved_from,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Entities *[]string `json:"entities,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + CharLimit Optional[int64] `json:"char_limit,omitempty"` + RecallCount *int64 `json:"recall_count,omitempty"` + LastRecalledAt Optional[string] `json:"last_recalled_at,omitempty"` + ServedCount Optional[int64] `json:"served_count,omitempty"` + LastServedAt Optional[string] `json:"last_served_at,omitempty"` + VerifiedBy *string `json:"verified_by,omitempty"` + VerifiedAt Optional[string] `json:"verified_at,omitempty"` + Verification *string `json:"verification,omitempty"` + LockMode *string `json:"lock_mode,omitempty"` + LockReason *string `json:"lock_reason,omitempty"` + LockUntil Optional[string] `json:"lock_until,omitempty"` + LockedBy *string `json:"locked_by,omitempty"` + RecallByAgent *[]RecallByAgent `json:"recall_by_agent,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` +} + +// MemoryHealthFootprint is a model used by Loom operations. +type MemoryHealthFootprint struct { + ValueChars *int64 `json:"value_chars,omitempty"` + ValueTokensEst *int64 `json:"value_tokens_est,omitempty"` + TokensPerRowEst *float64 `json:"tokens_per_row_est,omitempty"` +} + +// MemoryHealthInput is the request to memory.health. +type MemoryHealthInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + SilentAfterDays *int64 `json:"silent_after_days,omitempty"` + TopK *int64 `json:"top_k,omitempty"` +} + +// MemoryHealthOutput is the response from memory.health. +type MemoryHealthOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Live int64 `json:"live"` + RecalledEver int64 `json:"recalled_ever"` + UsedEver int64 `json:"used_ever"` + HarmedEver *int64 `json:"harmed_ever,omitempty"` + Silent int64 `json:"silent"` + SilentOlder int64 `json:"silent_older"` + SilentShare float64 `json:"silent_share"` + SilentAfterDays int64 `json:"silent_after_days"` + ByType *[]MemoryHealthTypeRow `json:"by_type,omitempty"` + TopRecalled *[]MemoryHealthTopRow `json:"top_recalled,omitempty"` + Staleness *MemoryHealthStaleness `json:"staleness,omitempty"` + Footprint *MemoryHealthFootprint `json:"footprint,omitempty"` +} + +// MemoryHealthStaleness is a model used by Loom operations. +type MemoryHealthStaleness struct { + ByAge *map[string]int64 `json:"by_age,omitempty"` + WithValidityEnd *int64 `json:"with_validity_end,omitempty"` + WithValidityEndShare *float64 `json:"with_validity_end_share,omitempty"` + WithExpiry *int64 `json:"with_expiry,omitempty"` + Expiring7D *int64 `json:"expiring_7d,omitempty"` + Pinned *int64 `json:"pinned,omitempty"` + DaysSinceReinforcedP50 *int64 `json:"days_since_reinforced_p50,omitempty"` + DaysSinceReinforcedP90 *int64 `json:"days_since_reinforced_p90,omitempty"` +} + +// MemoryHealthTopRow is a model used by Loom operations. +type MemoryHealthTopRow struct { + MemoryKey string `json:"memory_key"` + MemoryType string `json:"memory_type"` + RecallCount int64 `json:"recall_count"` + UsedCount int64 `json:"used_count"` + HarmCount *int64 `json:"harm_count,omitempty"` + LastRecalledAt Optional[string] `json:"last_recalled_at,omitempty"` +} + +// MemoryHealthTypeRow is a model used by Loom operations. +type MemoryHealthTypeRow struct { + MemoryType string `json:"memory_type"` + Live int64 `json:"live"` + Recalled int64 `json:"recalled"` +} + +// MemoryHistoryInput is the request to memory.history. +type MemoryHistoryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryHistoryOutput is the response from memory.history. +type MemoryHistoryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []MemoryHistoryRow `json:"rows"` +} + +// MemoryHistoryRow is a model used by Loom operations. +type MemoryHistoryRow struct { + MemoryID string `json:"memory_id"` + Version int64 `json:"version"` + VersionText *string `json:"version_text,omitempty"` + Value json.RawMessage `json:"value,omitempty"` + Confidence float64 `json:"confidence"` + SourceTrace *string `json:"source_trace,omitempty"` + Pinned *bool `json:"pinned,omitempty"` + CreatedAt string `json:"created_at"` + ExpiresAt Optional[string] `json:"expires_at,omitempty"` + TombstonedAt Optional[string] `json:"tombstoned_at,omitempty"` + RedactedAt Optional[string] `json:"redacted_at,omitempty"` + RedactionReason *string `json:"redaction_reason,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + Actor *string `json:"actor,omitempty"` + SourceClass *string `json:"source_class,omitempty"` + Agent *string `json:"agent,omitempty"` + WrittenAt Optional[string] `json:"written_at,omitempty"` + Status *string `json:"status,omitempty"` + ConflictWith *[]string `json:"conflict_with,omitempty"` + Tags *[]string `json:"tags,omitempty"` + VerifiedAt Optional[string] `json:"verified_at,omitempty"` + VerifiedBy *string `json:"verified_by,omitempty"` + VerifiedSHA256 *string `json:"verified_sha256,omitempty"` + LockMode *string `json:"lock_mode,omitempty"` + LockReason *string `json:"lock_reason,omitempty"` + LockUntil Optional[string] `json:"lock_until,omitempty"` +} + +// MemoryImportCuratedInput is the request to memory.import_curated. +type MemoryImportCuratedInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Content string `json:"content"` + SourceURI *string `json:"source_uri,omitempty"` + HeadingLevel *int64 `json:"heading_level,omitempty"` + ExtraTags *[]string `json:"extra_tags,omitempty"` +} + +// MemoryImportCuratedOutput is the response from memory.import_curated. +type MemoryImportCuratedOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []MemoryImportCuratedRow `json:"rows"` + Written int64 `json:"written"` + Merged int64 `json:"merged"` + Rejected int64 `json:"rejected"` + Skipped int64 `json:"skipped"` +} + +// MemoryImportCuratedRow is a model used by Loom operations. +type MemoryImportCuratedRow struct { + MemoryKey string `json:"memory_key"` + SectionHeading string `json:"section_heading"` + BytesWritten int64 `json:"bytes_written"` + Verdict string `json:"verdict"` + RejectionReason *string `json:"rejection_reason,omitempty"` + PinnedBlockerID Optional[string] `json:"pinned_blocker_id,omitempty"` +} + +// MemoryImportEntry is a model used by Loom operations. +type MemoryImportEntry struct { + Value string `json:"value"` + Tags *[]string `json:"tags,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + SourceTrace *string `json:"source_trace,omitempty"` + Category *string `json:"category,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` +} + +// MemoryImportEvidenceInput is the request to memory.import_evidence. +type MemoryImportEvidenceInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + Chunks *[]EvidenceChunk `json:"chunks,omitempty"` + Digests *[]EvidenceDigest `json:"digests,omitempty"` + SourceTrace *string `json:"source_trace,omitempty"` +} + +// MemoryImportEvidenceOutput is the response from memory.import_evidence. +type MemoryImportEvidenceOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ChunksWritten *int64 `json:"chunks_written,omitempty"` + LinksWritten *int64 `json:"links_written,omitempty"` + DigestsWritten *int64 `json:"digests_written,omitempty"` + EmbeddingModel *string `json:"embedding_model,omitempty"` + EmbeddingDim *int64 `json:"embedding_dim,omitempty"` + Edited *[]string `json:"edited,omitempty"` + Skipped *int64 `json:"skipped,omitempty"` + Unchecked *int64 `json:"unchecked,omitempty"` +} + +// MemoryImportInput is the request to memory.import. +type MemoryImportInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Entries []MemoryImportEntry `json:"entries"` + DryRun *bool `json:"dry_run,omitempty"` +} + +// MemoryImportOutput is the response from memory.import. +type MemoryImportOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Totals MemoryImportTotals `json:"totals"` + Results []MemoryImportResult `json:"results"` + DryRun *bool `json:"dry_run,omitempty"` +} + +// MemoryImportResult is a model used by Loom operations. +type MemoryImportResult struct { + Index int64 `json:"index"` + Key string `json:"key"` + Outcome string `json:"outcome"` + Reason *string `json:"reason,omitempty"` + HeldBy *string `json:"held_by,omitempty"` + Note *string `json:"note,omitempty"` +} + +// MemoryImportTotals is a model used by Loom operations. +type MemoryImportTotals struct { + Written *int64 `json:"written,omitempty"` + Held *int64 `json:"held,omitempty"` + Skipped *int64 `json:"skipped,omitempty"` + Refused *int64 `json:"refused,omitempty"` +} + +// MemoryInspectInput is the request to memory.inspect. +type MemoryInspectInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Subject string `json:"subject"` + ID string `json:"id"` + SampleLimit *int64 `json:"sample_limit,omitempty"` + WindowSeconds *int64 `json:"window_seconds,omitempty"` +} + +// MemoryInspectOutput is the response from memory.inspect. +type MemoryInspectOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Subject string `json:"subject"` + ID string `json:"id"` + ComputedAt string `json:"computed_at"` + Own InspectView `json:"own"` + Others InspectView `json:"others"` + Activity InspectActivity `json:"activity"` + Settings InspectSettings `json:"settings"` + Skipped *[]string `json:"skipped,omitempty"` +} + +// MemoryKeyRef is a model used by Loom operations. +type MemoryKeyRef struct { + Agent string `json:"agent"` + UserID string `json:"user_id"` + SessionID string `json:"session_id"` + MemoryKey string `json:"memory_key"` +} + +// MemoryKeysInput is the request to memory.keys. +type MemoryKeysInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryKeysOutput is the response from memory.keys. +type MemoryKeysOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Keys []MemoryKeyRef `json:"keys"` + Truncated *bool `json:"truncated,omitempty"` +} + +// MemoryLineageInput is the request to memory.lineage. +type MemoryLineageInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + Scope *string `json:"scope,omitempty"` + CandidateMatchWindowS *int64 `json:"candidate_match_window_s,omitempty"` +} + +// MemoryLineageOutput is the response from memory.lineage. +type MemoryLineageOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + MemoryKey string `json:"memory_key"` + PromotionEvent *string `json:"promotion_event,omitempty"` + PromotedBy *string `json:"promoted_by,omitempty"` + PromotedAt Optional[string] `json:"promoted_at,omitempty"` + Rationale *string `json:"rationale,omitempty"` + SourceTrace *string `json:"source_trace,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + Mechanism *string `json:"mechanism,omitempty"` + Supporters *[]LineageSupporter `json:"supporters,omitempty"` + Candidate Optional[LineageCandidate] `json:"candidate,omitempty"` + AuditChain *[]LineageAuditEvent `json:"audit_chain,omitempty"` +} + +// MemoryLinkInput is the request to memory.link. +type MemoryLinkInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + FromKey string `json:"from_key"` + ToKey string `json:"to_key"` + Relation *string `json:"relation,omitempty"` + Label *string `json:"label,omitempty"` + Explanation *string `json:"explanation,omitempty"` + Evidence *[]string `json:"evidence,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + RunID *string `json:"run_id,omitempty"` + Weight *float64 `json:"weight,omitempty"` + Tombstone *bool `json:"tombstone,omitempty"` +} + +// MemoryLinkOutput is the response from memory.link. +type MemoryLinkOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Linked bool `json:"linked"` + FromKey string `json:"from_key"` + ToKey string `json:"to_key"` + Relation string `json:"relation"` + Confidence *float64 `json:"confidence,omitempty"` + ConflictOpened *bool `json:"conflict_opened,omitempty"` + RelationDefaulted *bool `json:"relation_defaulted,omitempty"` +} + +// MemoryListEntry is a model used by Loom operations. +type MemoryListEntry struct { + MemoryKey *string `json:"memory_key,omitempty"` + MemoryType *string `json:"memory_type,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Version *int64 `json:"version,omitempty"` + VersionText *string `json:"version_text,omitempty"` + SourceTrace *string `json:"source_trace,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + ExpiresAt Optional[string] `json:"expires_at,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + TombstonedAt Optional[string] `json:"tombstoned_at,omitempty"` + Status *string `json:"status,omitempty"` + Pinned *bool `json:"pinned,omitempty"` + VerifiedBy *string `json:"verified_by,omitempty"` + Verification *string `json:"verification,omitempty"` + EvidenceCount *int64 `json:"evidence_count,omitempty"` + RecallCount *int64 `json:"recall_count,omitempty"` + LastRecalledAt Optional[string] `json:"last_recalled_at,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Entities *[]string `json:"entities,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Value json.RawMessage `json:"value,omitempty"` + ValueTruncated *bool `json:"value_truncated,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + CharLimit Optional[int64] `json:"char_limit,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` +} + +// MemoryListInput is the request to memory.list. +type MemoryListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Prefix Optional[string] `json:"prefix,omitempty"` + MemoryType Optional[string] `json:"memory_type,omitempty"` + SourceTrace Optional[string] `json:"source_trace,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Offset *int64 `json:"offset,omitempty"` + CountOnly *bool `json:"count_only,omitempty"` + PreviewChars *int64 `json:"preview_chars,omitempty"` + SortBy *string `json:"sort_by,omitempty"` + Quotas Optional[map[string]int64] `json:"quotas,omitempty"` + IncludeTombstoned *bool `json:"include_tombstoned,omitempty"` + IncludeDuplicates *bool `json:"include_duplicates,omitempty"` + IncludeSuperseded *bool `json:"include_superseded,omitempty"` + IncludeProposed *bool `json:"include_proposed,omitempty"` + AsOf Optional[string] `json:"as_of,omitempty"` + Tags *[]string `json:"tags,omitempty"` + TagsEvery *bool `json:"tags_every,omitempty"` + Contains Optional[string] `json:"contains,omitempty"` + PinnedOnly *bool `json:"pinned_only,omitempty"` + ConflictedOnly *bool `json:"conflicted_only,omitempty"` + Fields *[]string `json:"fields,omitempty"` + KnownVersion json.RawMessage `json:"known_version,omitempty"` +} + +// MemoryListOutput is the response from memory.list. +type MemoryListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Entries []MemoryListEntry `json:"entries"` + Truncated bool `json:"truncated"` + Total *int64 `json:"total,omitempty"` + Today *int64 `json:"today,omitempty"` + NamespaceVersion *string `json:"namespace_version,omitempty"` + Unchanged *bool `json:"unchanged,omitempty"` + Hidden *int64 `json:"hidden,omitempty"` + HiddenHint *string `json:"hidden_hint,omitempty"` +} + +// MemoryLockInput is the request to memory.lock. +type MemoryLockInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + Mode *string `json:"mode,omitempty"` + Reason string `json:"reason"` + Until Optional[string] `json:"until,omitempty"` + TTLSeconds Optional[int64] `json:"ttl_seconds,omitempty"` + LockedBy *string `json:"locked_by,omitempty"` +} + +// MemoryLockOutput is the response from memory.lock. +type MemoryLockOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Locked bool `json:"locked"` + Reason *string `json:"reason,omitempty"` + MemoryID *string `json:"memory_id,omitempty"` + Version Optional[int64] `json:"version,omitempty"` + LockMode *string `json:"lock_mode,omitempty"` + LockUntil Optional[string] `json:"lock_until,omitempty"` + LockedBy *string `json:"locked_by,omitempty"` + PreviousMode *string `json:"previous_mode,omitempty"` +} + +// MemoryMoveInput is the request to memory.move. +type MemoryMoveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + FromKey string `json:"from_key"` + ToKey string `json:"to_key"` + Value json.RawMessage `json:"value,omitempty"` + MemoryType Optional[string] `json:"memory_type,omitempty"` + Tags Optional[[]string] `json:"tags,omitempty"` + Entities Optional[[]string] `json:"entities,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + KeepRedirect *bool `json:"keep_redirect,omitempty"` + IfMatchSHA256 *string `json:"if_match_sha256,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` +} + +// MemoryMoveOutput is the response from memory.move. +type MemoryMoveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + FromKey string `json:"from_key"` + ToKey string `json:"to_key"` + Redirected bool `json:"redirected"` + MemoryID *string `json:"memory_id,omitempty"` + Version *int64 `json:"version,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + Advisories *[]string `json:"advisories,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + MemoryType *string `json:"memory_type,omitempty"` + ValuePreview *string `json:"value_preview,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` +} + +// MemoryOutcomeInput is the request to memory.outcome. +type MemoryOutcomeInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryID *string `json:"memory_id,omitempty"` + MemoryKey *string `json:"memory_key,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Outcome string `json:"outcome"` + Weight *int64 `json:"weight,omitempty"` + Source *string `json:"source,omitempty"` +} + +// MemoryOutcomeOutput is the response from memory.outcome. +type MemoryOutcomeOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Recorded bool `json:"recorded"` + EvidenceCountAfter int64 `json:"evidence_count_after"` + Quarantined *bool `json:"quarantined,omitempty"` +} + +// MemoryOutcomeRunInput is the request to memory.outcome_run. +type MemoryOutcomeRunInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Outcome string `json:"outcome"` + MemoryKeys *[]string `json:"memory_keys,omitempty"` + RunID *string `json:"run_id,omitempty"` + Weight *int64 `json:"weight,omitempty"` + Source *string `json:"source,omitempty"` + MaxKeys *int64 `json:"max_keys,omitempty"` +} + +// MemoryOutcomeRunOutput is the response from memory.outcome_run. +type MemoryOutcomeRunOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Applied int64 `json:"applied"` + KeysMatched int64 `json:"keys_matched"` + RunID string `json:"run_id"` +} + +// MemoryOutlineInput is the request to memory.outline. +type MemoryOutlineInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + SessionsLimit *int64 `json:"sessions_limit,omitempty"` + HubsLimit *int64 `json:"hubs_limit,omitempty"` + CommunitiesLimit *int64 `json:"communities_limit,omitempty"` +} + +// MemoryOutlineOutput is the response from memory.outline. +type MemoryOutlineOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + RowsByType *map[string]int64 `json:"rows_by_type,omitempty"` + Sessions *[]OutlineSession `json:"sessions,omitempty"` + SessionsTotal *int64 `json:"sessions_total,omitempty"` + Hubs *[]OutlineHub `json:"hubs,omitempty"` + Communities *[]OutlineCommunity `json:"communities,omitempty"` + ProfileChars *int64 `json:"profile_chars,omitempty"` +} + +// MemoryOwnerReportInput is the request to memory.owner_report. +type MemoryOwnerReportInput struct { + Org string `json:"org"` + UserID Optional[string] `json:"user_id,omitempty"` + Namespace Optional[string] `json:"namespace,omitempty"` + SinceHours *int64 `json:"since_hours,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryOwnerReportOutput is the response from memory.owner_report. +type MemoryOwnerReportOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + UserID string `json:"user_id"` + SinceHours int64 `json:"since_hours"` + LiveRows int64 `json:"live_rows"` + Rows []OwnerRowsRow `json:"rows"` + Reads []OwnerReadsRow `json:"reads"` + Usage []OwnerUsageRow `json:"usage"` +} + +// MemoryPinInput is the request to memory.pin. +type MemoryPinInput = MemorySetInput + +// MemoryPinOutput is the response from memory.pin. +type MemoryPinOutput = MemorySetOutput + +// MemoryPromoteInput is the request to memory.promote. +type MemoryPromoteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + MemoryKey string `json:"memory_key"` + TargetKey Optional[string] `json:"target_key,omitempty"` + Rationale *string `json:"rationale,omitempty"` + Approver Optional[string] `json:"approver,omitempty"` + ReversibleForDays *int64 `json:"reversible_for_days,omitempty"` + PromotedFromCandidateID Optional[string] `json:"promoted_from_candidate_id,omitempty"` + ApprovedSHA256 Optional[string] `json:"approved_sha256,omitempty"` +} + +// MemoryPromoteOutput is the response from memory.promote. +type MemoryPromoteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + SharedMemoryKey string `json:"shared_memory_key"` + PromotionEvent string `json:"promotion_event"` + ReversibleUntil string `json:"reversible_until"` +} + +// MemoryProposal is a model used by Loom operations. +type MemoryProposal struct { + MemoryKey string `json:"memory_key"` + MemoryID string `json:"memory_id"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + Agent *string `json:"agent,omitempty"` + MemoryType *string `json:"memory_type,omitempty"` + ValuePreview *string `json:"value_preview,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` + Tags *[]string `json:"tags,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + GradedPasses *int64 `json:"graded_passes,omitempty"` + GradedFails *int64 `json:"graded_fails,omitempty"` + LastGradedAt *string `json:"last_graded_at,omitempty"` + UsedCount *int64 `json:"used_count,omitempty"` + HarmCount *int64 `json:"harm_count,omitempty"` + Ready *string `json:"ready,omitempty"` + ConflictWith *[]string `json:"conflict_with,omitempty"` +} + +// MemoryProposalDecideInput is the request to memory.proposal_decide. +type MemoryProposalDecideInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryKeys []string `json:"memory_keys"` + Decision string `json:"decision"` + ApprovedSHA256 *map[string]string `json:"approved_sha256,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// MemoryProposalDecideOutput is the response from memory.proposal_decide. +type MemoryProposalDecideOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Decided *int64 `json:"decided,omitempty"` + Results *[]MemoryProposalDecision `json:"results,omitempty"` +} + +// MemoryProposalDecision is a model used by Loom operations. +type MemoryProposalDecision struct { + MemoryKey string `json:"memory_key"` + Decided bool `json:"decided"` + Status *string `json:"status,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// MemoryProposalsInput is the request to memory.proposals. +type MemoryProposalsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Prefix *string `json:"prefix,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Only *string `json:"only,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryProposalsOutput is the response from memory.proposals. +type MemoryProposalsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Proposals *[]MemoryProposal `json:"proposals,omitempty"` + Total *int64 `json:"total,omitempty"` + Policy *ProposalPolicy `json:"policy,omitempty"` +} + +// MemoryProvenanceInput is the request to memory.provenance. +type MemoryProvenanceInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` +} + +// MemoryProvenanceLink is a model used by Loom operations. +type MemoryProvenanceLink struct { + Direction string `json:"direction"` + MemoryKey string `json:"memory_key"` + Relation *string `json:"relation,omitempty"` + Label *string `json:"label,omitempty"` + Explanation *string `json:"explanation,omitempty"` + Evidence *[]string `json:"evidence,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Author *string `json:"author,omitempty"` + RunID *string `json:"run_id,omitempty"` +} + +// MemoryProvenanceOutput is the response from memory.provenance. +type MemoryProvenanceOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + SourceTrace *string `json:"source_trace,omitempty"` + SourceKind *string `json:"source_kind,omitempty"` + Actor *string `json:"actor,omitempty"` + SourceClass *string `json:"source_class,omitempty"` + SourceLabel *string `json:"source_label,omitempty"` + ThreadID *string `json:"thread_id,omitempty"` + ThreadExists *bool `json:"thread_exists,omitempty"` + ThreadTitle *string `json:"thread_title,omitempty"` + Agent *string `json:"agent,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + WrittenAt *string `json:"written_at,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + Links *[]MemoryProvenanceLink `json:"links,omitempty"` +} + +// MemoryRecallInput is the request to memory.recall. +type MemoryRecallInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Query *string `json:"query,omitempty"` + Since Optional[string] `json:"since,omitempty"` + Until Optional[string] `json:"until,omitempty"` + Thread *string `json:"thread,omitempty"` + Role *string `json:"role,omitempty"` + Match *string `json:"match,omitempty"` + Order *string `json:"order,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + Cursor *string `json:"cursor,omitempty"` + Offset *int64 `json:"offset,omitempty"` + MaxChars *int64 `json:"max_chars,omitempty"` + ReadScope *string `json:"read_scope,omitempty"` +} + +// MemoryRecallOutput is the response from memory.recall. +type MemoryRecallOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Turns []RecallTurn `json:"turns"` + TotalMatched *int64 `json:"total_matched,omitempty"` + Returned *int64 `json:"returned,omitempty"` + HasMore *bool `json:"has_more,omitempty"` + NextCursor *string `json:"next_cursor,omitempty"` + NextOffset *int64 `json:"next_offset,omitempty"` + Order *string `json:"order,omitempty"` + QueryTokens *[]string `json:"query_tokens,omitempty"` + TokensReturned *int64 `json:"tokens_returned,omitempty"` +} + +// MemoryRecordConflictRow is a model used by Loom operations. +type MemoryRecordConflictRow struct { + SchemaName string `json:"schema_name"` + MemoryKey string `json:"memory_key"` + FieldName string `json:"field_name"` + PriorValue json.RawMessage `json:"prior_value,omitempty"` + IncomingValue json.RawMessage `json:"incoming_value,omitempty"` + PriorRecordID string `json:"prior_record_id"` + IncomingRecordID string `json:"incoming_record_id"` + PriorMemoryID *string `json:"prior_memory_id,omitempty"` + IncomingMemoryID *string `json:"incoming_memory_id,omitempty"` + DetectedAt Optional[string] `json:"detected_at,omitempty"` + ResolvedAt Optional[string] `json:"resolved_at,omitempty"` +} + +// MemoryRecordConflictsInput is the request to memory.record.conflicts. +type MemoryRecordConflictsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SchemaName *string `json:"schema_name,omitempty"` + MemoryKey *string `json:"memory_key,omitempty"` + OpenOnly *bool `json:"open_only,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryRecordConflictsOutput is the response from memory.record.conflicts. +type MemoryRecordConflictsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []MemoryRecordConflictRow `json:"rows"` + Truncated *bool `json:"truncated,omitempty"` +} + +// MemoryRecordHistoryInput is the request to memory.record.history. +type MemoryRecordHistoryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + RecordID string `json:"record_id"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryRecordHistoryOutput is the response from memory.record.history. +type MemoryRecordHistoryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []MemoryRecordRow `json:"rows"` +} + +// MemoryRecordQueryInput is the request to memory.record.query. +type MemoryRecordQueryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SchemaName string `json:"schema_name"` + Filters *map[string]string `json:"filters,omitempty"` + Predicates *[]RecordPredicate `json:"predicates,omitempty"` + AsOf Optional[string] `json:"as_of,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemoryRecordQueryOutput is the response from memory.record.query. +type MemoryRecordQueryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []MemoryRecordRow `json:"rows"` + Truncated *bool `json:"truncated,omitempty"` +} + +// MemoryRecordRow is a model used by Loom operations. +type MemoryRecordRow struct { + RecordID string `json:"record_id"` + MemoryKey *string `json:"memory_key,omitempty"` + MemoryID *string `json:"memory_id,omitempty"` + Record *map[string]json.RawMessage `json:"record,omitempty"` + FieldStates *map[string]string `json:"field_states,omitempty"` + Status *string `json:"status,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + ValidTo Optional[string] `json:"valid_to,omitempty"` +} + +// MemoryRecordWriteInput is the request to memory.record.write. +type MemoryRecordWriteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SchemaName string `json:"schema_name"` + MemoryKey *string `json:"memory_key,omitempty"` + MemoryID Optional[string] `json:"memory_id,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Fields map[string]RecordFieldInput `json:"fields"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + ValidTo Optional[string] `json:"valid_to,omitempty"` +} + +// MemoryRecordWriteOutput is the response from memory.record.write. +type MemoryRecordWriteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + RecordID string `json:"record_id"` + FieldCount int64 `json:"field_count"` + MemoryKey *string `json:"memory_key,omitempty"` + KeySource *string `json:"key_source,omitempty"` + Fold *map[string]json.RawMessage `json:"fold,omitempty"` + SupersededRecordID *string `json:"superseded_record_id,omitempty"` + Conflicts *int64 `json:"conflicts,omitempty"` +} + +// MemoryRedactInput is the request to memory.redact. +type MemoryRedactInput struct { + Org string `json:"org"` + MemoryID string `json:"memory_id"` + Version json.RawMessage `json:"version"` + Reason *string `json:"reason,omitempty"` + RedactedBy *string `json:"redacted_by,omitempty"` +} + +// MemoryRedactOutput is the response from memory.redact. +type MemoryRedactOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Redacted bool `json:"redacted"` + RefusedHead *bool `json:"refused_head,omitempty"` + RedactedAt Optional[string] `json:"redacted_at,omitempty"` + CacheRowsDeleted *int64 `json:"cache_rows_deleted,omitempty"` + PrecedentRowsDeleted *int64 `json:"precedent_rows_deleted,omitempty"` +} + +// MemoryReindexInput is the request to memory.reindex. +type MemoryReindexInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` + Force *bool `json:"force,omitempty"` +} + +// MemoryReindexOutput is the response from memory.reindex. +type MemoryReindexOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Processed int64 `json:"processed"` + SkippedAlreadyCurrent int64 `json:"skipped_already_current"` + TargetModel string `json:"target_model"` + TargetDim int64 `json:"target_dim"` +} + +// MemoryRejectInput is the request to memory.reject. +type MemoryRejectInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + RejectionReason *string `json:"rejection_reason,omitempty"` +} + +// MemoryRejectOutput is the response from memory.reject. +type MemoryRejectOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rejected bool `json:"rejected"` + RejectedAt Optional[string] `json:"rejected_at,omitempty"` +} + +// MemoryRelatedHit is a model used by Loom operations. +type MemoryRelatedHit struct { + MemoryKey string `json:"memory_key"` + MemoryType string `json:"memory_type"` + ContentExcerpt string `json:"content_excerpt"` + OverlapCount int64 `json:"overlap_count"` + SharedEntities []string `json:"shared_entities"` +} + +// MemoryRelatedInput is the request to memory.related. +type MemoryRelatedInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + TopK *int64 `json:"top_k,omitempty"` + MinOverlap *int64 `json:"min_overlap,omitempty"` +} + +// MemoryRelatedOutput is the response from memory.related. +type MemoryRelatedOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Results []MemoryRelatedHit `json:"results"` + SourceEntities []string `json:"source_entities"` + Reason *string `json:"reason,omitempty"` +} + +// MemoryResolveOrphanDuplicatesInput is the request to memory.resolve_orphan_duplicates. +type MemoryResolveOrphanDuplicatesInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` +} + +// MemoryResolveOrphanDuplicatesOutput is the response from memory.resolve_orphan_duplicates. +type MemoryResolveOrphanDuplicatesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Candidates *int64 `json:"candidates,omitempty"` + Reactivated *int64 `json:"reactivated,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + MemoryIds *[]string `json:"memory_ids,omitempty"` +} + +// MemoryRestoreInput is the request to memory.restore. +type MemoryRestoreInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + IfSupersededBy *string `json:"if_superseded_by,omitempty"` + OnlyIfSuperseded *bool `json:"only_if_superseded,omitempty"` +} + +// MemoryRestoreOutput is the response from memory.restore. +type MemoryRestoreOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Restored bool `json:"restored"` + MemoryID Optional[string] `json:"memory_id,omitempty"` + Version Optional[int64] `json:"version,omitempty"` + Expired *bool `json:"expired,omitempty"` + Redacted *bool `json:"redacted,omitempty"` + FromStatus *string `json:"from_status,omitempty"` +} + +// MemorySchemaApproveInput is the request to memory_schema.approve. +type MemorySchemaApproveInput = MemorySchemaDecisionInput + +// MemorySchemaApproveOutput is the response from memory_schema.approve. +type MemorySchemaApproveOutput = MemorySchemaDecisionOutput + +// MemorySchemaDecisionInput is a model used by Loom operations. +type MemorySchemaDecisionInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Decision string `json:"decision"` + ReviewedBy *string `json:"reviewed_by,omitempty"` +} + +// MemorySchemaDecisionOutput is a model used by Loom operations. +type MemorySchemaDecisionOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Status string `json:"status"` + Updated bool `json:"updated"` +} + +// MemorySchemaListInput is the request to memory_schema.list. +type MemorySchemaListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + IncludeProposed *bool `json:"include_proposed,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// MemorySchemaListOutput is the response from memory_schema.list. +type MemorySchemaListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Schemas []MemorySchemaSummary `json:"schemas"` +} + +// MemorySchemaProposeInput is the request to memory_schema.propose. +type MemorySchemaProposeInput = MemorySchemaRegisterInput + +// MemorySchemaProposeOutput is the response from memory_schema.propose. +type MemorySchemaProposeOutput = MemorySchemaRegisterOutput + +// MemorySchemaRegisterInput is the request to memory_schema.register. +type MemorySchemaRegisterInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Fields []SchemaFieldInput `json:"fields"` + CreatedBy *string `json:"created_by,omitempty"` + Status *string `json:"status,omitempty"` +} + +// MemorySchemaRegisterOutput is the response from memory_schema.register. +type MemorySchemaRegisterOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + SchemaID string `json:"schema_id"` + Name string `json:"name"` + FieldCount int64 `json:"field_count"` + Status string `json:"status"` +} + +// MemorySchemaSummary is a model used by Loom operations. +type MemorySchemaSummary struct { + SchemaID string `json:"schema_id"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Status *string `json:"status,omitempty"` + Fields *[]SchemaFieldOutput `json:"fields,omitempty"` +} + +// MemorySearchHit is a model used by Loom operations. +type MemorySearchHit struct { + MemoryKey string `json:"memory_key"` + MemoryType string `json:"memory_type"` + ContentExcerpt string `json:"content_excerpt"` + Distance float64 `json:"distance"` + Similarity float64 `json:"similarity"` + BelowThreshold Optional[bool] `json:"below_threshold,omitempty"` + Governed Optional[bool] `json:"governed,omitempty"` + Tags Optional[[]string] `json:"tags,omitempty"` + ReinforcementCount Optional[int64] `json:"reinforcement_count,omitempty"` + UsedCount Optional[int64] `json:"used_count,omitempty"` + UsedCitedCount Optional[int64] `json:"used_cited_count,omitempty"` + HarmCount Optional[int64] `json:"harm_count,omitempty"` + EvidenceCount Optional[int64] `json:"evidence_count,omitempty"` + ActedCount Optional[int64] `json:"acted_count,omitempty"` + Pinned Optional[bool] `json:"pinned,omitempty"` + RankScore *float64 `json:"rank_score,omitempty"` + TemporalAnchor *string `json:"temporal_anchor,omitempty"` + TemporalConfidence *float64 `json:"temporal_confidence,omitempty"` + ValidAt *string `json:"valid_at,omitempty"` + ViaPath *[]string `json:"via_path,omitempty"` + Entities *[]string `json:"entities,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + Source *string `json:"source,omitempty"` + ParentMemoryKey *string `json:"parent_memory_key,omitempty"` + Status *string `json:"status,omitempty"` + SupersededBy Optional[string] `json:"superseded_by,omitempty"` + SupersededAt Optional[string] `json:"superseded_at,omitempty"` + Version *int64 `json:"version,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Namespace *string `json:"namespace,omitempty"` + CodeState json.RawMessage `json:"code_state,omitempty"` + CodeChangedSince *string `json:"code_changed_since,omitempty"` + CodeRev *string `json:"code_rev,omitempty"` + CodeMoved *[]CodeLink `json:"code_moved,omitempty"` + BodyTruncated *bool `json:"body_truncated,omitempty"` + Next *string `json:"next,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + SourceClass *string `json:"source_class,omitempty"` + Verified *bool `json:"verified,omitempty"` + Explanation *string `json:"explanation,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Speaker *string `json:"speaker,omitempty"` + AboutOther *bool `json:"about_other,omitempty"` + DerivedFrom *[]string `json:"derived_from,omitempty"` + ScoreComponents *map[string]float64 `json:"score_components,omitempty"` + ResolvedFrom Optional[string] `json:"resolved_from,omitempty"` +} + +// MemorySearchInput is the request to memory.search. +type MemorySearchInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Render *string `json:"render,omitempty"` + Query string `json:"query"` + MemoryType Optional[string] `json:"memory_type,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Scope *string `json:"scope,omitempty"` + NamespaceScope Optional[string] `json:"namespace_scope,omitempty"` + SearchMode *string `json:"search_mode,omitempty"` + Recipe *string `json:"recipe,omitempty"` + Alpha *float64 `json:"alpha,omitempty"` + IncludeTopNUnmatched *int64 `json:"include_top_n_unmatched,omitempty"` + IncludeTags *bool `json:"include_tags,omitempty"` + IncludeUsage *bool `json:"include_usage,omitempty"` + IncludeDuplicates *bool `json:"include_duplicates,omitempty"` + IncludeSuperseded *bool `json:"include_superseded,omitempty"` + IncludeProposed *bool `json:"include_proposed,omitempty"` + Explain Optional[bool] `json:"explain,omitempty"` + Legs Optional[[]string] `json:"legs,omitempty"` + AutoTouch *bool `json:"auto_touch,omitempty"` + UserID Optional[string] `json:"user_id,omitempty"` + RunID Optional[string] `json:"run_id,omitempty"` + SessionID Optional[string] `json:"session_id,omitempty"` + SessionIds *[]string `json:"session_ids,omitempty"` + ExcludeKeys *[]string `json:"exclude_keys,omitempty"` + QualityFilter *bool `json:"quality_filter,omitempty"` + ReadScope *string `json:"read_scope,omitempty"` + EntityFilter *[]string `json:"entity_filter,omitempty"` + Category *string `json:"category,omitempty"` + TagsSoft *bool `json:"tags_soft,omitempty"` + TagBoost *float64 `json:"tag_boost,omitempty"` + CategorySoft *bool `json:"category_soft,omitempty"` + CategoryBoost *float64 `json:"category_boost,omitempty"` + ConfidenceWeight *float64 `json:"confidence_weight,omitempty"` + PriorCap Optional[float64] `json:"prior_cap,omitempty"` + SensitivityPenalty Optional[float64] `json:"sensitivity_penalty,omitempty"` + RrfAdaptiveLexical Optional[bool] `json:"rrf_adaptive_lexical,omitempty"` + DemoteTags *[]string `json:"demote_tags,omitempty"` + ReinforcementWeight Optional[float64] `json:"reinforcement_weight,omitempty"` + RecencyPoolWeight Optional[float64] `json:"recency_pool_weight,omitempty"` + ReinforcementHalfLifeDays Optional[float64] `json:"reinforcement_half_life_days,omitempty"` + MentionBoost Optional[float64] `json:"mention_boost,omitempty"` + GroundRelativeDates Optional[bool] `json:"ground_relative_dates,omitempty"` + ReinforcementHalfLifeUseScale Optional[float64] `json:"reinforcement_half_life_use_scale,omitempty"` + KeyMatch Optional[bool] `json:"key_match,omitempty"` + KeyMatchMode Optional[string] `json:"key_match_mode,omitempty"` + DigestDescent Optional[bool] `json:"digest_descent,omitempty"` + Role *string `json:"role,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + KeyAxis Optional[bool] `json:"key_axis,omitempty"` + Bodies *string `json:"bodies,omitempty"` + BodyBudgetTokens *int64 `json:"body_budget_tokens,omitempty"` + SourceSpanChars *int64 `json:"source_span_chars,omitempty"` + Paging Optional[bool] `json:"paging,omitempty"` + Page *string `json:"page,omitempty"` + RecentFirst *int64 `json:"recent_first,omitempty"` + AnchorFirst *int64 `json:"anchor_first,omitempty"` + PerSpeakerQuota Optional[int64] `json:"per_speaker_quota,omitempty"` + MinBodyChars *int64 `json:"min_body_chars,omitempty"` + GraphSeed *string `json:"graph_seed,omitempty"` + Diversify *string `json:"diversify,omitempty"` + DiversifySessionCap Optional[int64] `json:"diversify_session_cap,omitempty"` + SummaryCap Optional[int64] `json:"summary_cap,omitempty"` + ChunkCapShare Optional[float64] `json:"chunk_cap_share,omitempty"` + FloorMode Optional[string] `json:"floor_mode,omitempty"` + MinSimilarity Optional[float64] `json:"min_similarity,omitempty"` + ChunkMaxShare Optional[float64] `json:"chunk_max_share,omitempty"` + Personalization *string `json:"personalization,omitempty"` + ObservationDate *string `json:"observation_date,omitempty"` + Rerank *string `json:"rerank,omitempty"` + RetrievalBudget *string `json:"retrieval_budget,omitempty"` + Hyde *bool `json:"hyde,omitempty"` + AsOf Optional[string] `json:"as_of,omitempty"` + AsOfBasis *string `json:"as_of_basis,omitempty"` +} + +// MemorySearchOutput is the response from memory.search. +type MemorySearchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Results []MemorySearchHit `json:"results"` + CodeNote *string `json:"code_note,omitempty"` + ReaderBlock *string `json:"reader_block,omitempty"` + ReaderInstructions *string `json:"reader_instructions,omitempty"` + BodiesReturned *int64 `json:"bodies_returned,omitempty"` + BodiesElided *int64 `json:"bodies_elided,omitempty"` + TokensReturned *int64 `json:"tokens_returned,omitempty"` + NamespacesSearched *[]string `json:"namespaces_searched,omitempty"` + NamespacesSkipped *[]string `json:"namespaces_skipped,omitempty"` + CandidatesTotal *int64 `json:"candidates_total,omitempty"` + StaleDropped *int64 `json:"stale_dropped,omitempty"` + NextPage *string `json:"next_page,omitempty"` + PageOffset *int64 `json:"page_offset,omitempty"` + ChunkShare *float64 `json:"chunk_share,omitempty"` + EmbeddingModel string `json:"embedding_model"` + Next *string `json:"next,omitempty"` + Scratchpad *string `json:"scratchpad,omitempty"` + ScratchpadBlocks *int64 `json:"scratchpad_blocks,omitempty"` + Reinforcement Optional[string] `json:"reinforcement,omitempty"` + GraphSeeds *int64 `json:"graph_seeds,omitempty"` + GraphNeighborsAdded *int64 `json:"graph_neighbors_added,omitempty"` + TriplesExtractedFromQuery *int64 `json:"triples_extracted_from_query,omitempty"` + TriplesMatched *int64 `json:"triples_matched,omitempty"` + SetExpansionPhrases *int64 `json:"set_expansion_phrases,omitempty"` + TopKCeiling *int64 `json:"top_k_ceiling,omitempty"` + Abstain *bool `json:"abstain,omitempty"` + AbstainReason *string `json:"abstain_reason,omitempty"` + AbstainCode *string `json:"abstain_code,omitempty"` + Degraded *[]string `json:"degraded,omitempty"` + Recipe *string `json:"recipe,omitempty"` + ScoreExplanation *string `json:"score_explanation,omitempty"` + RetrievalConfidence *float64 `json:"retrieval_confidence,omitempty"` + RetrievalRisk *string `json:"retrieval_risk,omitempty"` + TermLeg *string `json:"term_leg,omitempty"` + RouteAgreement *float64 `json:"route_agreement,omitempty"` + CalibrationExplanation *string `json:"calibration_explanation,omitempty"` + FallbackRoundsUsed *int64 `json:"fallback_rounds_used,omitempty"` + FallbackBudgetExhausted *bool `json:"fallback_budget_exhausted,omitempty"` + FallbackElapsedMs *int64 `json:"fallback_elapsed_ms,omitempty"` + RetrievalPlan *string `json:"retrieval_plan,omitempty"` + RetrievalCostEstimate *map[string]json.RawMessage `json:"retrieval_cost_estimate,omitempty"` + RetrievalWork *map[string]json.RawMessage `json:"retrieval_work,omitempty"` + PendingExtraction *int64 `json:"pending_extraction,omitempty"` + DerivedAggregate Optional[map[string]json.RawMessage] `json:"derived_aggregate,omitempty"` +} + +// MemorySearchTraceInput is the request to memory.search_trace. +type MemorySearchTraceInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Render *string `json:"render,omitempty"` + Query string `json:"query"` + MemoryType Optional[string] `json:"memory_type,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Scope *string `json:"scope,omitempty"` + NamespaceScope Optional[string] `json:"namespace_scope,omitempty"` + SearchMode *string `json:"search_mode,omitempty"` + Recipe *string `json:"recipe,omitempty"` + Alpha *float64 `json:"alpha,omitempty"` + IncludeTopNUnmatched *int64 `json:"include_top_n_unmatched,omitempty"` + IncludeTags *bool `json:"include_tags,omitempty"` + IncludeUsage *bool `json:"include_usage,omitempty"` + IncludeDuplicates *bool `json:"include_duplicates,omitempty"` + IncludeSuperseded *bool `json:"include_superseded,omitempty"` + IncludeProposed *bool `json:"include_proposed,omitempty"` + Explain Optional[bool] `json:"explain,omitempty"` + Legs Optional[[]string] `json:"legs,omitempty"` + AutoTouch *bool `json:"auto_touch,omitempty"` + UserID Optional[string] `json:"user_id,omitempty"` + RunID Optional[string] `json:"run_id,omitempty"` + SessionID Optional[string] `json:"session_id,omitempty"` + SessionIds *[]string `json:"session_ids,omitempty"` + ExcludeKeys *[]string `json:"exclude_keys,omitempty"` + QualityFilter *bool `json:"quality_filter,omitempty"` + ReadScope *string `json:"read_scope,omitempty"` + EntityFilter *[]string `json:"entity_filter,omitempty"` + Category *string `json:"category,omitempty"` + TagsSoft *bool `json:"tags_soft,omitempty"` + TagBoost *float64 `json:"tag_boost,omitempty"` + CategorySoft *bool `json:"category_soft,omitempty"` + CategoryBoost *float64 `json:"category_boost,omitempty"` + ConfidenceWeight *float64 `json:"confidence_weight,omitempty"` + PriorCap Optional[float64] `json:"prior_cap,omitempty"` + SensitivityPenalty Optional[float64] `json:"sensitivity_penalty,omitempty"` + RrfAdaptiveLexical Optional[bool] `json:"rrf_adaptive_lexical,omitempty"` + DemoteTags *[]string `json:"demote_tags,omitempty"` + ReinforcementWeight Optional[float64] `json:"reinforcement_weight,omitempty"` + RecencyPoolWeight Optional[float64] `json:"recency_pool_weight,omitempty"` + ReinforcementHalfLifeDays Optional[float64] `json:"reinforcement_half_life_days,omitempty"` + MentionBoost Optional[float64] `json:"mention_boost,omitempty"` + GroundRelativeDates Optional[bool] `json:"ground_relative_dates,omitempty"` + ReinforcementHalfLifeUseScale Optional[float64] `json:"reinforcement_half_life_use_scale,omitempty"` + KeyMatch Optional[bool] `json:"key_match,omitempty"` + KeyMatchMode Optional[string] `json:"key_match_mode,omitempty"` + DigestDescent Optional[bool] `json:"digest_descent,omitempty"` + Role *string `json:"role,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + KeyAxis Optional[bool] `json:"key_axis,omitempty"` + Bodies *string `json:"bodies,omitempty"` + BodyBudgetTokens *int64 `json:"body_budget_tokens,omitempty"` + SourceSpanChars *int64 `json:"source_span_chars,omitempty"` + Paging Optional[bool] `json:"paging,omitempty"` + Page *string `json:"page,omitempty"` + RecentFirst *int64 `json:"recent_first,omitempty"` + AnchorFirst *int64 `json:"anchor_first,omitempty"` + PerSpeakerQuota Optional[int64] `json:"per_speaker_quota,omitempty"` + MinBodyChars *int64 `json:"min_body_chars,omitempty"` + GraphSeed *string `json:"graph_seed,omitempty"` + Diversify *string `json:"diversify,omitempty"` + DiversifySessionCap Optional[int64] `json:"diversify_session_cap,omitempty"` + SummaryCap Optional[int64] `json:"summary_cap,omitempty"` + ChunkCapShare Optional[float64] `json:"chunk_cap_share,omitempty"` + FloorMode Optional[string] `json:"floor_mode,omitempty"` + MinSimilarity Optional[float64] `json:"min_similarity,omitempty"` + ChunkMaxShare Optional[float64] `json:"chunk_max_share,omitempty"` + Personalization *string `json:"personalization,omitempty"` + ObservationDate *string `json:"observation_date,omitempty"` + Rerank *string `json:"rerank,omitempty"` + RetrievalBudget *string `json:"retrieval_budget,omitempty"` + Hyde *bool `json:"hyde,omitempty"` + AsOf Optional[string] `json:"as_of,omitempty"` + AsOfBasis *string `json:"as_of_basis,omitempty"` +} + +// MemorySearchTraceLogInput is the request to memory.search_trace_log. +type MemorySearchTraceLogInput = SearchTraceLogInput + +// MemorySearchTraceLogOutput is the response from memory.search_trace_log. +type MemorySearchTraceLogOutput = SearchTraceLogOutput + +// MemorySearchTraceOutput is the response from memory.search_trace. +type MemorySearchTraceOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Results []SearchTraceHit `json:"results"` + EmbeddingModel string `json:"embedding_model"` + EntityFilter []string `json:"entity_filter"` + QuerySpellings *map[string]string `json:"query_spellings,omitempty"` + QuerySpellingsSkipped *bool `json:"query_spellings_skipped,omitempty"` + StaleDropped *int64 `json:"stale_dropped,omitempty"` +} + +// MemorySetFromMessagesInput is the request to memory.set_from_messages. +type MemorySetFromMessagesInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Messages []Message `json:"messages"` + ExtraTags *[]string `json:"extra_tags,omitempty"` + RecalledKeys *[]string `json:"recalled_keys,omitempty"` + SessionValues *[]string `json:"session_values,omitempty"` + ChangedFiles Optional[[]ChangedFile] `json:"changed_files,omitempty"` + MaxTokens *int64 `json:"max_tokens,omitempty"` + JudgeExtraction *bool `json:"judge_extraction,omitempty"` + RecordSchema Optional[map[string]json.RawMessage] `json:"record_schema,omitempty"` + MemoryKey Optional[string] `json:"memory_key,omitempty"` + ObservationDate *string `json:"observation_date,omitempty"` + LLMCache Optional[bool] `json:"llm_cache,omitempty"` + DetectUpdates Optional[bool] `json:"detect_updates,omitempty"` + LastMessages *[]Message `json:"last_messages,omitempty"` + ExtractionInstructions *string `json:"extraction_instructions,omitempty"` + CoverageSweep Optional[bool] `json:"coverage_sweep,omitempty"` + AgentLearnings Optional[bool] `json:"agent_learnings,omitempty"` + PipelineSteps *[]map[string]json.RawMessage `json:"pipeline_steps,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + Defer *bool `json:"defer,omitempty"` +} + +// MemorySetFromMessagesOutput is the response from memory.set_from_messages. +type MemorySetFromMessagesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Written *[]BulkSetResult `json:"written,omitempty"` + Refused *[]RefusedFact `json:"refused,omitempty"` + TokensIn *int64 `json:"tokens_in,omitempty"` + TokensOut *int64 `json:"tokens_out,omitempty"` + LLMProvider *string `json:"llm_provider,omitempty"` + LLMModel *string `json:"llm_model,omitempty"` + Segments *int64 `json:"segments,omitempty"` + Foresight *int64 `json:"foresight,omitempty"` + Forgotten *int64 `json:"forgotten,omitempty"` + ForgottenKeys *[]string `json:"forgotten_keys,omitempty"` + ForgetRequests *int64 `json:"forget_requests,omitempty"` + AboutOther *int64 `json:"about_other,omitempty"` + PremiseFacts *int64 `json:"premise_facts,omitempty"` + LearningCandidates *int64 `json:"learning_candidates,omitempty"` + Segmenter *string `json:"segmenter,omitempty"` + CachedTokensIn *int64 `json:"cached_tokens_in,omitempty"` + OntologyWarnings *[]string `json:"ontology_warnings,omitempty"` + EvidenceIds *[]string `json:"evidence_ids,omitempty"` + BeliefSourceLinks *int64 `json:"belief_source_links,omitempty"` + PipelineErrors *[]string `json:"pipeline_errors,omitempty"` + ValueUpdatesLinked *int64 `json:"value_updates_linked,omitempty"` + StubbedFields *[]string `json:"stubbed_fields,omitempty"` + Degraded *[]string `json:"degraded,omitempty"` + Deferred *bool `json:"deferred,omitempty"` + QueueID *string `json:"queue_id,omitempty"` + DeferredBy *string `json:"deferred_by,omitempty"` + StageMs *map[string]float64 `json:"stage_ms,omitempty"` + ObservationDateSource *string `json:"observation_date_source,omitempty"` + UnderOperatorPolicy *bool `json:"under_operator_policy,omitempty"` + ExtractPromptKeys *[]string `json:"extract_prompt_keys,omitempty"` + LLMCacheHits *int64 `json:"llm_cache_hits,omitempty"` + LLMCacheMisses *int64 `json:"llm_cache_misses,omitempty"` +} + +// MemorySetInput is the request to memory.set. +type MemorySetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + MemoryType *string `json:"memory_type,omitempty"` + Value json.RawMessage `json:"value"` + Tags *[]string `json:"tags,omitempty"` + Entities *[]string `json:"entities,omitempty"` + Relations *[][3]string `json:"relations,omitempty"` + Files Optional[[]string] `json:"files,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + SourceTrace *string `json:"source_trace,omitempty"` + SourceClass Optional[string] `json:"source_class,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + TTLSeconds Optional[int64] `json:"ttl_seconds,omitempty"` + ClearExpiry *bool `json:"clear_expiry,omitempty"` + OnExpire *string `json:"on_expire,omitempty"` + ExpireReason *string `json:"expire_reason,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + ValidTo Optional[string] `json:"valid_to,omitempty"` + Pinned *bool `json:"pinned,omitempty"` + Classify *bool `json:"classify,omitempty"` + IfMatchSHA256 *string `json:"if_match_sha256,omitempty"` + CharLimit Optional[int64] `json:"char_limit,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + Proposed *bool `json:"proposed,omitempty"` +} + +// MemorySetOutput is the response from memory.set. +type MemorySetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Version int64 `json:"version"` + Pinned *bool `json:"pinned,omitempty"` + MemoryID *string `json:"memory_id,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + Status *string `json:"status,omitempty"` + DuplicateOf *string `json:"duplicate_of,omitempty"` + Namespace *string `json:"namespace,omitempty"` + MemoryKey *string `json:"memory_key,omitempty"` + MergedIntoKey *string `json:"merged_into_key,omitempty"` + Degraded *[]string `json:"degraded,omitempty"` + RetypedFrom *string `json:"retyped_from,omitempty"` + ConflictVerdict *string `json:"conflict_verdict,omitempty"` + Peers *[]MemorySetPeer `json:"peers,omitempty"` + Next *string `json:"next,omitempty"` + Noop *bool `json:"noop,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + Advisories *[]string `json:"advisories,omitempty"` + ChunksWritten *int64 `json:"chunks_written,omitempty"` +} + +// MemorySetPeer is a model used by Loom operations. +type MemorySetPeer struct { + MemoryID *string `json:"memory_id,omitempty"` + MemoryKey *string `json:"memory_key,omitempty"` + Excerpt *string `json:"excerpt,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + Similarity *float64 `json:"similarity,omitempty"` +} + +// MemoryStackInput is the request to memory.stack. +type MemoryStackInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + TokenBudget *int64 `json:"token_budget,omitempty"` + PinnedLimit *int64 `json:"pinned_limit,omitempty"` + RecentLimit *int64 `json:"recent_limit,omitempty"` + IncludeKnowledge *bool `json:"include_knowledge,omitempty"` + KnowledgeTopK *int64 `json:"knowledge_top_k,omitempty"` + SeedQuery *string `json:"seed_query,omitempty"` + ProcedureLimit *int64 `json:"procedure_limit,omitempty"` +} + +// MemoryStackOutput is the response from memory.stack. +type MemoryStackOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Entries []StackEntry `json:"entries"` + TokensUsed int64 `json:"tokens_used"` + TokensBudget int64 `json:"tokens_budget"` + Truncated bool `json:"truncated"` + SectionCounts map[string]int64 `json:"section_counts"` +} + +// MemoryStatus is a model used by Loom operations. +type MemoryStatus struct { + MemoryID string `json:"memory_id"` + Status string `json:"status"` + SupersededBy *string `json:"superseded_by,omitempty"` +} + +// MemoryStatusesInput is the request to memory.statuses. +type MemoryStatusesInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryIds []string `json:"memory_ids"` +} + +// MemoryStatusesOutput is the response from memory.statuses. +type MemoryStatusesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows *[]MemoryStatus `json:"rows,omitempty"` +} + +// MemorySweepExpiredInput is the request to memory.sweep_expired. +type MemorySweepExpiredInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` +} + +// MemorySweepExpiredOutput is the response from memory.sweep_expired. +type MemorySweepExpiredOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Scanned *int64 `json:"scanned,omitempty"` + Tombstoned *int64 `json:"tombstoned,omitempty"` + Demoted *int64 `json:"demoted,omitempty"` + Anonymized *int64 `json:"anonymized,omitempty"` + LockedSkipped *int64 `json:"locked_skipped,omitempty"` + MovedSkipped *int64 `json:"moved_skipped,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + Sample *[]map[string]json.RawMessage `json:"sample,omitempty"` + Failures *[]string `json:"failures,omitempty"` +} + +// MemoryTimelineEntry is a model used by Loom operations. +type MemoryTimelineEntry struct { + MemoryKey string `json:"memory_key"` + MemoryType string `json:"memory_type"` + ContentExcerpt string `json:"content_excerpt"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + CreatedAt string `json:"created_at"` + Namespace *string `json:"namespace,omitempty"` +} + +// MemoryTimelineInput is the request to memory.timeline. +type MemoryTimelineInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Entity *string `json:"entity,omitempty"` + Tags *[]string `json:"tags,omitempty"` + MemoryKeyPrefix *string `json:"memory_key_prefix,omitempty"` + Since Optional[string] `json:"since,omitempty"` + Until Optional[string] `json:"until,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + Order *string `json:"order,omitempty"` +} + +// MemoryTimelineOutput is the response from memory.timeline. +type MemoryTimelineOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Events []MemoryTimelineEntry `json:"events"` + TotalMatching *int64 `json:"total_matching,omitempty"` +} + +// MemoryTouchInput is the request to memory.touch. +type MemoryTouchInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey *string `json:"memory_key,omitempty"` + MemoryKeys *[]string `json:"memory_keys,omitempty"` + TTLSeconds Optional[int64] `json:"ttl_seconds,omitempty"` + ClearExpiry *bool `json:"clear_expiry,omitempty"` + OnExpire *string `json:"on_expire,omitempty"` + ExpireReason *string `json:"expire_reason,omitempty"` +} + +// MemoryTouchOutput is the response from memory.touch. +type MemoryTouchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Touched bool `json:"touched"` + Version Optional[int64] `json:"version,omitempty"` + ExpiresAt Optional[string] `json:"expires_at,omitempty"` + Results *[]MemoryTouchResult `json:"results,omitempty"` + TouchedCount *int64 `json:"touched_count,omitempty"` +} + +// MemoryTouchResult is a model used by Loom operations. +type MemoryTouchResult struct { + MemoryKey string `json:"memory_key"` + Touched bool `json:"touched"` + Version Optional[int64] `json:"version,omitempty"` + ExpiresAt Optional[string] `json:"expires_at,omitempty"` +} + +// MemoryUnlockInput is the request to memory.unlock. +type MemoryUnlockInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` + UnlockedBy *string `json:"unlocked_by,omitempty"` +} + +// MemoryUnlockOutput is the response from memory.unlock. +type MemoryUnlockOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Unlocked bool `json:"unlocked"` + Reason *string `json:"reason,omitempty"` + MemoryID *string `json:"memory_id,omitempty"` + Version Optional[int64] `json:"version,omitempty"` + PreviousMode *string `json:"previous_mode,omitempty"` + UnlockedBy *string `json:"unlocked_by,omitempty"` +} + +// MemoryUnpinInput is the request to memory.unpin. +type MemoryUnpinInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + MemoryKey string `json:"memory_key"` +} + +// MemoryUnpinOutput is the response from memory.unpin. +type MemoryUnpinOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Unpinned bool `json:"unpinned"` + Reason *string `json:"reason,omitempty"` + MemoryID *string `json:"memory_id,omitempty"` + Version Optional[int64] `json:"version,omitempty"` +} + +// MemoryUpdateByIDInput is the request to memory.update_by_id. +type MemoryUpdateByIDInput struct { + Org string `json:"org"` + MemoryID string `json:"memory_id"` + Value json.RawMessage `json:"value,omitempty"` + Tags Optional[[]string] `json:"tags,omitempty"` + Concepts Optional[[]string] `json:"concepts,omitempty"` + IfMatchSHA256 *string `json:"if_match_sha256,omitempty"` + CharLimit Optional[int64] `json:"char_limit,omitempty"` + Revive *bool `json:"revive,omitempty"` + Relations *[][3]string `json:"relations,omitempty"` +} + +// MemoryUpdateByIDOutput is the response from memory.update_by_id. +type MemoryUpdateByIDOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Updated bool `json:"updated"` + NewVersion *int64 `json:"new_version,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + ConflictVerdict *string `json:"conflict_verdict,omitempty"` + ConflictPeers *int64 `json:"conflict_peers,omitempty"` + DuplicateOf *string `json:"duplicate_of,omitempty"` +} + +// MemoryUpdateCandidate is a model used by Loom operations. +type MemoryUpdateCandidate struct { + MemoryID string `json:"memory_id"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Version *int64 `json:"version,omitempty"` + Status *string `json:"status,omitempty"` +} + +// MemoryUpdateInput is the request to memory.update. +type MemoryUpdateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + MemoryKey string `json:"memory_key"` + Value json.RawMessage `json:"value,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Tags Optional[[]string] `json:"tags,omitempty"` + Concepts Optional[[]string] `json:"concepts,omitempty"` + Confidence Optional[float64] `json:"confidence,omitempty"` + Reason *string `json:"reason,omitempty"` + IfMatchSHA256 *string `json:"if_match_sha256,omitempty"` + CharLimit Optional[int64] `json:"char_limit,omitempty"` + Revive *bool `json:"revive,omitempty"` + Relations *[][3]string `json:"relations,omitempty"` +} + +// MemoryUpdateOutput is the response from memory.update. +type MemoryUpdateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Updated bool `json:"updated"` + MemoryID *string `json:"memory_id,omitempty"` + MemoryKey *string `json:"memory_key,omitempty"` + NewVersion *int64 `json:"new_version,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + Reason *string `json:"reason,omitempty"` + Candidates *[]MemoryUpdateCandidate `json:"candidates,omitempty"` + ConflictVerdict *string `json:"conflict_verdict,omitempty"` + ConflictPeers *int64 `json:"conflict_peers,omitempty"` + DuplicateOf *string `json:"duplicate_of,omitempty"` +} + +// MemoryVerifyInput is the request to memory.verify. +type MemoryVerifyInput struct { + Org string `json:"org"` + MemoryID *string `json:"memory_id,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + MemoryKey *string `json:"memory_key,omitempty"` + Revoke *bool `json:"revoke,omitempty"` + Actor *string `json:"actor,omitempty"` +} + +// MemoryVerifyOutput is the response from memory.verify. +type MemoryVerifyOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + Changed *bool `json:"changed,omitempty"` + MemoryID *string `json:"memory_id,omitempty"` + MemoryKey *string `json:"memory_key,omitempty"` + Namespace *string `json:"namespace,omitempty"` + VerifiedBy *string `json:"verified_by,omitempty"` + VerifiedAt Optional[string] `json:"verified_at,omitempty"` + Verification *string `json:"verification,omitempty"` + Version *int64 `json:"version,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` +} + +// MentorAdoption is a model used by Loom operations. +type MentorAdoption struct { + Code string `json:"code"` + ShownSessions *int64 `json:"shown_sessions,omitempty"` + FollowedSessions *int64 `json:"followed_sessions,omitempty"` +} + +// MentorBriefInput is the request to mentor.brief. +type MentorBriefInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + WindowSeconds *int64 `json:"window_seconds,omitempty"` +} + +// MentorBriefOutput is the response from mentor.brief. +type MentorBriefOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + WindowSeconds int64 `json:"window_seconds"` + ComputedAt string `json:"computed_at"` + Sessions int64 `json:"sessions"` + Usage *map[string]int64 `json:"usage,omitempty"` + Planes *[]MentorPlane `json:"planes,omitempty"` + Hints *[]MentorHint `json:"hints,omitempty"` + Adoption *[]MentorAdoption `json:"adoption,omitempty"` + UsageEvidence *[]UsageRung `json:"usage_evidence,omitempty"` + LedgerFrom Optional[string] `json:"ledger_from,omitempty"` + LedgerRetentionDays Optional[int64] `json:"ledger_retention_days,omitempty"` + Agents *[]string `json:"agents,omitempty"` + AgentDefaulted *bool `json:"agent_defaulted,omitempty"` + Skipped *[]string `json:"skipped,omitempty"` + Healthy *bool `json:"healthy,omitempty"` +} + +// MentorGuideInput is the request to mentor.guide. +type MentorGuideInput struct { + Org *string `json:"org,omitempty"` + Part *string `json:"part,omitempty"` +} + +// MentorGuideOutput is the response from mentor.guide. +type MentorGuideOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Version string `json:"version"` + Part string `json:"part"` + Text string `json:"text"` +} + +// MentorHint is a model used by Loom operations. +type MentorHint struct { + Code string `json:"code"` + Severity string `json:"severity"` + Text string `json:"text"` + Ops *[]string `json:"ops,omitempty"` + Evidence *map[string]json.RawMessage `json:"evidence,omitempty"` + Plane Optional[string] `json:"plane,omitempty"` +} + +// MentorPlane is a model used by Loom operations. +type MentorPlane struct { + Plane string `json:"plane"` + Calls *int64 `json:"calls,omitempty"` + Available Optional[bool] `json:"available,omitempty"` + When *string `json:"when,omitempty"` + Mentored *bool `json:"mentored,omitempty"` +} + +// Message is a model used by Loom operations. +type Message struct { + Role *string `json:"role,omitempty"` + Content string `json:"content"` + Timestamp Optional[string] `json:"timestamp,omitempty"` + Name *string `json:"name,omitempty"` +} + +// MineEntry is a model used by Loom operations. +type MineEntry struct { + Namespace string `json:"namespace"` + Role string `json:"role"` + Status *string `json:"status,omitempty"` + PendingRole Optional[string] `json:"pending_role,omitempty"` + PendingSince Optional[string] `json:"pending_since,omitempty"` + PendingAdmins *[]string `json:"pending_admins,omitempty"` + Visibility *string `json:"visibility,omitempty"` + Kind *string `json:"kind,omitempty"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + JoinedAt Optional[string] `json:"joined_at,omitempty"` + IsNew *bool `json:"is_new,omitempty"` + Inherited *bool `json:"inherited,omitempty"` +} + +// ModelMemoryGetOutput is a model used by Loom operations. +type ModelMemoryGetOutput struct { + Found *bool `json:"found,omitempty"` + Unchanged *bool `json:"unchanged,omitempty"` + MemoryID *string `json:"memory_id,omitempty"` + Value json.RawMessage `json:"value,omitempty"` + MemoryType Optional[string] `json:"memory_type,omitempty"` + Confidence Optional[float64] `json:"confidence,omitempty"` + Version Optional[int64] `json:"version,omitempty"` + VersionText Optional[string] `json:"version_text,omitempty"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + ExpiresAt Optional[string] `json:"expires_at,omitempty"` + OnExpire *string `json:"on_expire,omitempty"` + ExpireReason *string `json:"expire_reason,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + ValidTo Optional[string] `json:"valid_to,omitempty"` + TemporalAnchor Optional[string] `json:"temporal_anchor,omitempty"` + TemporalConfidence *float64 `json:"temporal_confidence,omitempty"` + Pinned *bool `json:"pinned,omitempty"` + Actor *string `json:"actor,omitempty"` + SourceClass *string `json:"source_class,omitempty"` + SourceTrace *string `json:"source_trace,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Status Optional[string] `json:"status,omitempty"` + Code *[]CodeLink `json:"code,omitempty"` + SupersededBy *string `json:"superseded_by,omitempty"` + DuplicateOf *string `json:"duplicate_of,omitempty"` + ConflictVerdict *string `json:"conflict_verdict,omitempty"` + CanonicalKey Optional[string] `json:"canonical_key,omitempty"` + ResolvedFrom Optional[string] `json:"resolved_from,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Entities *[]string `json:"entities,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + CharLimit Optional[int64] `json:"char_limit,omitempty"` + RecallCount *int64 `json:"recall_count,omitempty"` + LastRecalledAt Optional[string] `json:"last_recalled_at,omitempty"` + ServedCount Optional[int64] `json:"served_count,omitempty"` + LastServedAt Optional[string] `json:"last_served_at,omitempty"` + VerifiedBy *string `json:"verified_by,omitempty"` + VerifiedAt Optional[string] `json:"verified_at,omitempty"` + Verification *string `json:"verification,omitempty"` + LockMode *string `json:"lock_mode,omitempty"` + LockReason *string `json:"lock_reason,omitempty"` + LockUntil Optional[string] `json:"lock_until,omitempty"` + LockedBy *string `json:"locked_by,omitempty"` + RecallByAgent *[]RecallByAgent `json:"recall_by_agent,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` +} + +// ModelNamespaceGuideGetOutput is a model used by Loom operations. +type ModelNamespaceGuideGetOutput struct { + Found bool `json:"found"` + Revision *int64 `json:"revision,omitempty"` + Content *string `json:"content,omitempty"` + Summary *string `json:"summary,omitempty"` + Note *string `json:"note,omitempty"` + UpdatedBy *string `json:"updated_by,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` +} + +// NamespaceAuditFinding is a model used by Loom operations. +type NamespaceAuditFinding struct { + Kind string `json:"kind"` + RuleVersion int64 `json:"rule_version"` + SourceOp string `json:"source_op"` + WindowSeconds Optional[int64] `json:"window_seconds,omitempty"` + Population Optional[int64] `json:"population,omitempty"` + SampleLimit int64 `json:"sample_limit"` + SamplesComplete bool `json:"samples_complete"` + Evidence *[]FindingEvidence `json:"evidence,omitempty"` + Exceptions *string `json:"exceptions,omitempty"` + Uncertainty *string `json:"uncertainty,omitempty"` + Code string `json:"code"` + Severity string `json:"severity"` + Count int64 `json:"count"` + Share float64 `json:"share"` + Bytes *int64 `json:"bytes,omitempty"` + Samples *[]map[string]json.RawMessage `json:"samples,omitempty"` + Detail string `json:"detail"` + Remedy string `json:"remedy"` +} + +// NamespaceAuditInput is the request to namespace.audit. +type NamespaceAuditInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + WindowSeconds *int64 `json:"window_seconds,omitempty"` + SampleLimit *int64 `json:"sample_limit,omitempty"` +} + +// NamespaceAuditOutput is the response from namespace.audit. +type NamespaceAuditOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + ComputedAt string `json:"computed_at"` + WindowSeconds int64 `json:"window_seconds"` + Summary NamespaceAuditSummary `json:"summary"` + Findings []NamespaceAuditFinding `json:"findings"` + Skipped *[]string `json:"skipped,omitempty"` + Coverage ReportCoverage `json:"coverage"` + Healthy bool `json:"healthy"` + Criticals int64 `json:"criticals"` + Warnings int64 `json:"warnings"` + Infos int64 `json:"infos"` +} + +// NamespaceAuditSummary is a model used by Loom operations. +type NamespaceAuditSummary struct { + LiveRows *int64 `json:"live_rows,omitempty"` + LiveBytes *int64 `json:"live_bytes,omitempty"` + ExcerptBytes *int64 `json:"excerpt_bytes,omitempty"` + VersionRows *int64 `json:"version_rows,omitempty"` + VersionBytes *int64 `json:"version_bytes,omitempty"` + UnembeddedRows *int64 `json:"unembedded_rows,omitempty"` + Gets *int64 `json:"gets,omitempty"` + Searches *int64 `json:"searches,omitempty"` + Sets *int64 `json:"sets,omitempty"` + GetSearchRatio *float64 `json:"get_search_ratio,omitempty"` + InspectorCalls *int64 `json:"inspector_calls,omitempty"` + TypedGets *int64 `json:"typed_gets,omitempty"` + WrittenInWindow *int64 `json:"written_in_window,omitempty"` + LedgerCalls *int64 `json:"ledger_calls,omitempty"` +} + +// NamespaceBrowseInput is the request to namespace.browse. +type NamespaceBrowseInput struct { + Org string `json:"org"` + Query *string `json:"query,omitempty"` + Limit *int64 `json:"limit,omitempty"` + IncludeClosed *bool `json:"include_closed,omitempty"` + Kinds *[]string `json:"kinds,omitempty"` +} + +// NamespaceBrowseOutput is the response from namespace.browse. +type NamespaceBrowseOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []BrowseEntry `json:"rows"` +} + +// NamespaceCancelRequestInput is the request to namespace.cancel_request. +type NamespaceCancelRequestInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Subject Optional[string] `json:"subject,omitempty"` +} + +// NamespaceCancelRequestOutput is the response from namespace.cancel_request. +type NamespaceCancelRequestOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Cancelled bool `json:"cancelled"` + Namespace string `json:"namespace"` + ClearedRole Optional[string] `json:"cleared_role,omitempty"` + CancelledAt Optional[string] `json:"cancelled_at,omitempty"` +} + +// NamespaceDeleteInput is the request to namespace.delete. +type NamespaceDeleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// NamespaceDeleteOutput is the response from namespace.delete. +type NamespaceDeleteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Deleted bool `json:"deleted"` + Namespace string `json:"namespace"` + UpdatedAt string `json:"updated_at"` + SourcesRetired *[]string `json:"sources_retired,omitempty"` +} + +// NamespaceEntry is a model used by Loom operations. +type NamespaceEntry struct { + Namespace string `json:"namespace"` + Kind *string `json:"kind,omitempty"` + OwnerEmail string `json:"owner_email"` + Description string `json:"description"` + Tags []string `json:"tags"` + Active bool `json:"active"` + ConsolidationEnabled *bool `json:"consolidation_enabled,omitempty"` + DailyCostCapUsd *float64 `json:"daily_cost_cap_usd,omitempty"` + DailyUserCostCapUsd *float64 `json:"daily_user_cost_cap_usd,omitempty"` + BudgetAlertInbox *string `json:"budget_alert_inbox,omitempty"` + ConflictThreshold Optional[float64] `json:"conflict_threshold,omitempty"` + RetentionDays *int64 `json:"retention_days,omitempty"` + WarmDays *int64 `json:"warm_days,omitempty"` + Visibility *string `json:"visibility,omitempty"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` +} + +// NamespaceGetInput is the request to namespace.get. +type NamespaceGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// NamespaceGetOutput is the response from namespace.get. +type NamespaceGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + Namespace string `json:"namespace"` + Kind Optional[string] `json:"kind,omitempty"` + OwnerEmail Optional[string] `json:"owner_email,omitempty"` + Description Optional[string] `json:"description,omitempty"` + Tags Optional[[]string] `json:"tags,omitempty"` + Active Optional[bool] `json:"active,omitempty"` + ConversationLoggingEnabled Optional[bool] `json:"conversation_logging_enabled,omitempty"` + CaptureGenerationIo Optional[bool] `json:"capture_generation_io,omitempty"` + CoverageSweep Optional[bool] `json:"coverage_sweep,omitempty"` + ConsolidationEnabled Optional[bool] `json:"consolidation_enabled,omitempty"` + DailyCostCapUsd Optional[float64] `json:"daily_cost_cap_usd,omitempty"` + DailyUserCostCapUsd Optional[float64] `json:"daily_user_cost_cap_usd,omitempty"` + BudgetAlertInbox Optional[string] `json:"budget_alert_inbox,omitempty"` + ConflictThreshold Optional[float64] `json:"conflict_threshold,omitempty"` + RetentionDays Optional[int64] `json:"retention_days,omitempty"` + WarmDays Optional[int64] `json:"warm_days,omitempty"` + Visibility Optional[string] `json:"visibility,omitempty"` + RequiresApproval Optional[bool] `json:"requires_approval,omitempty"` + JoinPolicy Optional[string] `json:"join_policy,omitempty"` + EffectiveJoinPolicy Optional[string] `json:"effective_join_policy,omitempty"` + RetrievalDefaults Optional[map[string]json.RawMessage] `json:"retrieval_defaults,omitempty"` + RerankEndpoint Optional[string] `json:"rerank_endpoint,omitempty"` + ClassifyEndpoint Optional[string] `json:"classify_endpoint,omitempty"` + DefaultConflictPolicy Optional[string] `json:"default_conflict_policy,omitempty"` + ProposalPolicy Optional[ProposalPolicy] `json:"proposal_policy,omitempty"` + CodeChangePolicy Optional[string] `json:"code_change_policy,omitempty"` + TagRegistry Optional[[]map[string]json.RawMessage] `json:"tag_registry,omitempty"` + Classification Optional[string] `json:"classification,omitempty"` + GuideRevision Optional[int64] `json:"guide_revision,omitempty"` + GuideSummary Optional[string] `json:"guide_summary,omitempty"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` +} + +// NamespaceGuideGetInput is the request to namespace.guide_get. +type NamespaceGuideGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Revision *int64 `json:"revision,omitempty"` +} + +// NamespaceGuideGetOutput is the response from namespace.guide_get. +type NamespaceGuideGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + Revision *int64 `json:"revision,omitempty"` + Content *string `json:"content,omitempty"` + Summary *string `json:"summary,omitempty"` + Note *string `json:"note,omitempty"` + UpdatedBy *string `json:"updated_by,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` +} + +// NamespaceGuideHistoryInput is the request to namespace.guide_history. +type NamespaceGuideHistoryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` +} + +// NamespaceGuideHistoryOutput is the response from namespace.guide_history. +type NamespaceGuideHistoryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Revisions []GuideRevision `json:"revisions"` +} + +// NamespaceGuideSetInput is the request to namespace.guide_set. +type NamespaceGuideSetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Content string `json:"content"` + Summary Optional[string] `json:"summary,omitempty"` + ExpectedRevision int64 `json:"expected_revision"` + Note *string `json:"note,omitempty"` +} + +// NamespaceGuideSetOutput is the response from namespace.guide_set. +type NamespaceGuideSetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Written bool `json:"written"` + Conflict *bool `json:"conflict,omitempty"` + Revision int64 `json:"revision"` + Current Optional[ModelNamespaceGuideGetOutput] `json:"current,omitempty"` +} + +// NamespaceInventoryInput is the request to namespace.inventory. +type NamespaceInventoryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + ReadScope *string `json:"read_scope,omitempty"` + UserID Optional[string] `json:"user_id,omitempty"` + SessionID Optional[string] `json:"session_id,omitempty"` + PopulationLimit *int64 `json:"population_limit,omitempty"` +} + +// NamespaceInventoryOutput is the response from namespace.inventory. +type NamespaceInventoryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Scope InventoryScope `json:"scope"` + Sections []InventorySection `json:"sections"` + Populations []InventoryPopulation `json:"populations"` + Capabilities []InventoryCapability `json:"capabilities"` + ComputedAt string `json:"computed_at"` +} + +// NamespaceJoinInput is the request to namespace.join. +type NamespaceJoinInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Role *string `json:"role,omitempty"` + Subject Optional[string] `json:"subject,omitempty"` +} + +// NamespaceJoinOutput is the response from namespace.join. +type NamespaceJoinOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Joined bool `json:"joined"` + Namespace string `json:"namespace"` + Role string `json:"role"` + Status *string `json:"status,omitempty"` + RequestedRole Optional[string] `json:"requested_role,omitempty"` + PendingAdmins *[]string `json:"pending_admins,omitempty"` + JoinedAt string `json:"joined_at"` +} + +// NamespaceLeaveInput is the request to namespace.leave. +type NamespaceLeaveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Subject Optional[string] `json:"subject,omitempty"` +} + +// NamespaceLeaveOutput is the response from namespace.leave. +type NamespaceLeaveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Left bool `json:"left"` + Namespace string `json:"namespace"` + LeftAt Optional[string] `json:"left_at,omitempty"` +} + +// NamespaceListCategoriesInput is the request to namespace.list_categories. +type NamespaceListCategoriesInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// NamespaceListCategoriesOutput is the response from namespace.list_categories. +type NamespaceListCategoriesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Categories []CategoryEntry `json:"categories"` +} + +// NamespaceListInput is the request to namespace.list. +type NamespaceListInput struct { + Org string `json:"org"` + ActiveOnly *bool `json:"active_only,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// NamespaceListMineInput is the request to namespace.list_mine. +type NamespaceListMineInput struct { + Org string `json:"org"` + Subject Optional[string] `json:"subject,omitempty"` +} + +// NamespaceListMineOutput is the response from namespace.list_mine. +type NamespaceListMineOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []MineEntry `json:"rows"` +} + +// NamespaceListOntologyInput is the request to namespace.list_ontology. +type NamespaceListOntologyInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Kind Optional[string] `json:"kind,omitempty"` + Status Optional[string] `json:"status,omitempty"` +} + +// NamespaceListOntologyOutput is the response from namespace.list_ontology. +type NamespaceListOntologyOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Entries []OntologyEntry `json:"entries"` + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// NamespaceListOutput is the response from namespace.list. +type NamespaceListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []NamespaceEntry `json:"rows"` +} + +// NamespaceMarkSeenInput is the request to namespace.mark_seen. +type NamespaceMarkSeenInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Subject Optional[string] `json:"subject,omitempty"` +} + +// NamespaceMarkSeenOutput is the response from namespace.mark_seen. +type NamespaceMarkSeenOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Namespace string `json:"namespace"` + SeenAt string `json:"seen_at"` +} + +// NamespacePolicy is a model used by Loom operations. +type NamespacePolicy struct { + Namespace string `json:"namespace"` + UpdatedBy *string `json:"updated_by,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` +} + +// NamespaceRegisterCategoryInput is the request to namespace.register_category. +type NamespaceRegisterCategoryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Summary *string `json:"summary,omitempty"` +} + +// NamespaceRegisterCategoryOutput is the response from namespace.register_category. +type NamespaceRegisterCategoryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + CategoryID string `json:"category_id"` + Embedded bool `json:"embedded"` +} + +// NamespaceRegisterInput is the request to namespace.register. +type NamespaceRegisterInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + OwnerEmail string `json:"owner_email"` + Description Optional[string] `json:"description,omitempty"` + Kind Optional[string] `json:"kind,omitempty"` + Tags *[]string `json:"tags,omitempty"` + TrafficClass Optional[string] `json:"traffic_class,omitempty"` + Active Optional[bool] `json:"active,omitempty"` + ConversationLoggingEnabled Optional[bool] `json:"conversation_logging_enabled,omitempty"` + CaptureGenerationIo Optional[bool] `json:"capture_generation_io,omitempty"` + CoverageSweep Optional[bool] `json:"coverage_sweep,omitempty"` + ConsolidationEnabled Optional[bool] `json:"consolidation_enabled,omitempty"` + DailyCostCapUsd Optional[float64] `json:"daily_cost_cap_usd,omitempty"` + DailyUserCostCapUsd Optional[float64] `json:"daily_user_cost_cap_usd,omitempty"` + BudgetAlertInbox Optional[string] `json:"budget_alert_inbox,omitempty"` + ConflictThreshold Optional[float64] `json:"conflict_threshold,omitempty"` + RetentionDays Optional[int64] `json:"retention_days,omitempty"` + WarmDays Optional[int64] `json:"warm_days,omitempty"` + Visibility Optional[string] `json:"visibility,omitempty"` + RequiresApproval Optional[bool] `json:"requires_approval,omitempty"` + JoinPolicy Optional[string] `json:"join_policy,omitempty"` + RetrievalDefaults Optional[NamespaceRetrievalDefaults] `json:"retrieval_defaults,omitempty"` + RerankEndpoint Optional[string] `json:"rerank_endpoint,omitempty"` + RerankPromptTemplate Optional[string] `json:"rerank_prompt_template,omitempty"` + ClassifyEndpoint Optional[string] `json:"classify_endpoint,omitempty"` + ClassifyPromptTemplate Optional[string] `json:"classify_prompt_template,omitempty"` + TagRegistry *[]NamespaceTypeConfig `json:"tag_registry,omitempty"` + DefaultConflictPolicy Optional[string] `json:"default_conflict_policy,omitempty"` + ProposalPolicy Optional[ProposalPolicy] `json:"proposal_policy,omitempty"` + CodeChangePolicy Optional[string] `json:"code_change_policy,omitempty"` +} + +// NamespaceRegisterOntologyInput is the request to namespace.register_ontology. +type NamespaceRegisterOntologyInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Kind string `json:"kind"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Status *string `json:"status,omitempty"` + Cardinality *string `json:"cardinality,omitempty"` +} + +// NamespaceRegisterOntologyOutput is the response from namespace.register_ontology. +type NamespaceRegisterOntologyOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Registered bool `json:"registered"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Kind string `json:"kind"` + Name string `json:"name"` + Status string `json:"status"` +} + +// NamespaceRegisterOutput is the response from namespace.register. +type NamespaceRegisterOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Registered bool `json:"registered"` + Namespace string `json:"namespace"` + UpdatedAt string `json:"updated_at"` + Visibility *string `json:"visibility,omitempty"` +} + +// NamespaceRestoreInput is the request to namespace.restore. +type NamespaceRestoreInput struct { + Org string `json:"org"` + TargetNamespace string `json:"target_namespace"` + Payload NamespaceSnapshotPayload `json:"payload"` + RebindAgent Optional[string] `json:"rebind_agent,omitempty"` +} + +// NamespaceRestoreOutput is the response from namespace.restore. +type NamespaceRestoreOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Restored bool `json:"restored"` + PublicationPending *bool `json:"publication_pending,omitempty"` + TargetNamespace string `json:"target_namespace"` + SnapshotID string `json:"snapshot_id"` + Counts map[string]int64 `json:"counts"` +} + +// NamespaceRetrievalDefaults is a model used by Loom operations. +type NamespaceRetrievalDefaults struct { + SearchMode Optional[string] `json:"search_mode,omitempty"` + TopK Optional[int64] `json:"top_k,omitempty"` + AutoTouch Optional[bool] `json:"auto_touch,omitempty"` + IncludeTags Optional[bool] `json:"include_tags,omitempty"` + Bodies Optional[string] `json:"bodies,omitempty"` + ReinforcementWeight Optional[float64] `json:"reinforcement_weight,omitempty"` + RecencyPoolWeight Optional[float64] `json:"recency_pool_weight,omitempty"` + MinSimilarity Optional[float64] `json:"min_similarity,omitempty"` + FloorMode Optional[string] `json:"floor_mode,omitempty"` + ChunkMaxShare Optional[float64] `json:"chunk_max_share,omitempty"` +} + +// NamespaceRollbackInput is the request to namespace.rollback. +type NamespaceRollbackInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + AsOf string `json:"as_of"` + DryRun *bool `json:"dry_run,omitempty"` + MemoryKeys Optional[[]string] `json:"memory_keys,omitempty"` + MaxKeys *int64 `json:"max_keys,omitempty"` +} + +// NamespaceRollbackOutput is the response from namespace.rollback. +type NamespaceRollbackOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + DryRun bool `json:"dry_run"` + AsOf string `json:"as_of"` + VersionAt int64 `json:"version_at"` + Reinstate int64 `json:"reinstate"` + Remove int64 `json:"remove"` + SkippedNoHead *int64 `json:"skipped_no_head,omitempty"` + SkippedAlreadyGone *int64 `json:"skipped_already_gone,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Sample *[]map[string]json.RawMessage `json:"sample,omitempty"` + AppliedAt Optional[string] `json:"applied_at,omitempty"` +} + +// NamespaceSearchCategoriesInput is the request to namespace.search_categories. +type NamespaceSearchCategoriesInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Query string `json:"query"` + TopK *int64 `json:"top_k,omitempty"` +} + +// NamespaceSearchCategoriesOutput is the response from namespace.search_categories. +type NamespaceSearchCategoriesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Results []CategoryHit `json:"results"` +} + +// NamespaceSnapshotInput is the request to namespace.snapshot. +type NamespaceSnapshotInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + IncludeEmbeddings *bool `json:"include_embeddings,omitempty"` + IncludeAuditTailN *int64 `json:"include_audit_tail_n,omitempty"` +} + +// NamespaceSnapshotOutput is the response from namespace.snapshot. +type NamespaceSnapshotOutput struct { + NamespaceSnapshotPayload + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` +} + +// NamespaceSnapshotPayload is a model used by Loom operations. +type NamespaceSnapshotPayload struct { + SnapshotID string `json:"snapshot_id"` + Org string `json:"org"` + SourceNamespace string `json:"source_namespace"` + CreatedAt string `json:"created_at"` + MemoryCount int64 `json:"memory_count"` + TypeCount int64 `json:"type_count"` + GrantCount int64 `json:"grant_count"` + AuditTailCount int64 `json:"audit_tail_count"` + IncludeEmbeddings bool `json:"include_embeddings"` + Memories []SnapshotMemoryRow `json:"memories"` + Types []SnapshotTypeRow `json:"types"` + Grants []SnapshotGrantRow `json:"grants"` + AuditTail []SnapshotAuditRow `json:"audit_tail"` +} + +// NamespaceSummaryInput is the request to namespace.summary. +type NamespaceSummaryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + TopEntitiesLimit *int64 `json:"top_entities_limit,omitempty"` + ActivitySeconds *int64 `json:"activity_seconds,omitempty"` +} + +// NamespaceSummaryOutput is the response from namespace.summary. +type NamespaceSummaryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + TotalMemories int64 `json:"total_memories"` + TypeCounts []NamespaceTypeCount `json:"type_counts"` + TopEntities []NamespaceTopEntity `json:"top_entities"` + RecentWrites int64 `json:"recent_writes"` + RecentRecalls int64 `json:"recent_recalls"` + DistinctAgents int64 `json:"distinct_agents"` + LastActivityAt *string `json:"last_activity_at"` +} + +// NamespaceTaxonomyInput is the request to namespace.taxonomy. +type NamespaceTaxonomyInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + TopNTags *int64 `json:"top_n_tags,omitempty"` + TopNEntities *int64 `json:"top_n_entities,omitempty"` + TopNCommunities *int64 `json:"top_n_communities,omitempty"` +} + +// NamespaceTaxonomyOutput is the response from namespace.taxonomy. +type NamespaceTaxonomyOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Tags []TaxonomyEntry `json:"tags"` + Entities []TaxonomyEntry `json:"entities"` + MemoryCount int64 `json:"memory_count"` + MemoryTypes []TaxonomyEntry `json:"memory_types"` + Communities *[]TaxonomyCommunity `json:"communities,omitempty"` + CommunitiesComputedAt *string `json:"communities_computed_at,omitempty"` +} + +// NamespaceTopEntity is a model used by Loom operations. +type NamespaceTopEntity struct { + Entity string `json:"entity"` + Degree int64 `json:"degree"` +} + +// NamespaceTuneInput is the request to namespace.tune. +type NamespaceTuneInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + WindowSeconds *int64 `json:"window_seconds,omitempty"` + SampleLimit *int64 `json:"sample_limit,omitempty"` + MinRows *int64 `json:"min_rows,omitempty"` + MaxCategoryProposals *int64 `json:"max_category_proposals,omitempty"` +} + +// NamespaceTuneOutput is the response from namespace.tune. +type NamespaceTuneOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + ComputedAt string `json:"computed_at"` + Proposals *[]TuneProposal `json:"proposals,omitempty"` + GuideRevision Optional[int64] `json:"guide_revision,omitempty"` + CategoriesRegistered Optional[int64] `json:"categories_registered,omitempty"` + ExtractionPolicy Optional[string] `json:"extraction_policy,omitempty"` + ExtractionPolicyUnavailable *string `json:"extraction_policy_unavailable,omitempty"` + Chunking Optional[ChunkingSample] `json:"chunking,omitempty"` + Skipped *[]string `json:"skipped,omitempty"` + ModelUsed *bool `json:"model_used,omitempty"` +} + +// NamespaceTypeConfig is a model used by Loom operations. +type NamespaceTypeConfig struct { + MemoryType string `json:"memory_type"` + RetentionDays *int64 `json:"retention_days,omitempty"` + DedupThreshold Optional[float64] `json:"dedup_threshold,omitempty"` + HotQuota *int64 `json:"hot_quota,omitempty"` + ConflictPolicy Optional[string] `json:"conflict_policy,omitempty"` +} + +// NamespaceTypeCount is a model used by Loom operations. +type NamespaceTypeCount struct { + MemoryType string `json:"memory_type"` + N int64 `json:"n"` +} + +// NamespaceValidateFinding is a model used by Loom operations. +type NamespaceValidateFinding struct { + Kind string `json:"kind"` + RuleVersion int64 `json:"rule_version"` + SourceOp string `json:"source_op"` + WindowSeconds Optional[int64] `json:"window_seconds,omitempty"` + Population Optional[int64] `json:"population,omitempty"` + SampleLimit int64 `json:"sample_limit"` + SamplesComplete bool `json:"samples_complete"` + Evidence *[]FindingEvidence `json:"evidence,omitempty"` + Exceptions *string `json:"exceptions,omitempty"` + Uncertainty *string `json:"uncertainty,omitempty"` + Check string `json:"check"` + Severity string `json:"severity"` + Count int64 `json:"count"` + Samples *[]map[string]json.RawMessage `json:"samples,omitempty"` + Detail string `json:"detail"` + Totals *map[string]int64 `json:"totals,omitempty"` +} + +// NamespaceValidateInput is the request to namespace.validate. +type NamespaceValidateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SampleLimit *int64 `json:"sample_limit,omitempty"` + ConflictAgeSeconds *int64 `json:"conflict_age_seconds,omitempty"` + ConfidenceFloor *float64 `json:"confidence_floor,omitempty"` + EmbedGraceSeconds *int64 `json:"embed_grace_seconds,omitempty"` + Strict *bool `json:"strict,omitempty"` + Keys *[]string `json:"keys,omitempty"` +} + +// NamespaceValidateOutput is the response from namespace.validate. +type NamespaceValidateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Healthy bool `json:"healthy"` + Errors int64 `json:"errors"` + Warnings int64 `json:"warnings"` + Infos int64 `json:"infos"` + Findings []NamespaceValidateFinding `json:"findings"` + Skipped *[]string `json:"skipped,omitempty"` + KeysScoped *int64 `json:"keys_scoped,omitempty"` + Coverage ReportCoverage `json:"coverage"` + CheckedAt string `json:"checked_at"` +} + +// ObserveCrystallizeInput is the request to observe.crystallize. +type ObserveCrystallizeInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + MaxObservations *int64 `json:"max_observations,omitempty"` +} + +// ObserveCrystallizeOutput is the response from observe.crystallize. +type ObserveCrystallizeOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Enqueued *int64 `json:"enqueued,omitempty"` + SessionID *string `json:"session_id,omitempty"` +} + +// ObserveRecordInput is the request to observe.record. +type ObserveRecordInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + ToolName string `json:"tool_name"` + ToolInput json.RawMessage `json:"tool_input,omitempty"` + ToolOutput json.RawMessage `json:"tool_output,omitempty"` + FilePaths *[]string `json:"file_paths,omitempty"` + Error Optional[string] `json:"error,omitempty"` + Tags *[]string `json:"tags,omitempty"` + ObservationDate *string `json:"observation_date,omitempty"` + ActionType *string `json:"action_type,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + ObservedAt *string `json:"observed_at,omitempty"` +} + +// ObserveRecordOutput is the response from observe.record. +type ObserveRecordOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MemoryKey string `json:"memory_key"` + MemoryID *string `json:"memory_id,omitempty"` + Kind *string `json:"kind,omitempty"` + Tags *[]string `json:"tags,omitempty"` + FilePaths *[]string `json:"file_paths,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + ToolName *string `json:"tool_name,omitempty"` + HasError *bool `json:"has_error,omitempty"` + NarrativeChars *int64 `json:"narrative_chars,omitempty"` + SkippedReason *string `json:"skipped_reason,omitempty"` +} + +// OntologyEntry is a model used by Loom operations. +type OntologyEntry struct { + Kind string `json:"kind"` + Name string `json:"name"` + Status string `json:"status"` + Description string `json:"description"` + Cardinality *string `json:"cardinality,omitempty"` + CreatedBy string `json:"created_by"` + UpdatedAt string `json:"updated_at"` +} + +// OpCapability is a model used by Loom operations. +type OpCapability struct { + Name string `json:"name"` + Path string `json:"path"` + MCPTool string `json:"mcp_tool"` + MCPTier string `json:"mcp_tier"` + RequiredRole string `json:"required_role"` + BudgetP99Ms int64 `json:"budget_p99_ms"` + Idempotent bool `json:"idempotent"` + Audit bool `json:"audit"` + RequestFields *[]string `json:"request_fields,omitempty"` + ResponseFields *[]string `json:"response_fields,omitempty"` + Toolsets *[]string `json:"toolsets,omitempty"` +} + +// OpsCapabilitiesInput is the request to ops.capabilities. +type OpsCapabilitiesInput struct { + Org *string `json:"org,omitempty"` + Consumer *string `json:"consumer,omitempty"` +} + +// OpsCapabilitiesOutput is the response from ops.capabilities. +type OpsCapabilitiesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + BuildCommit *string `json:"build_commit,omitempty"` + SchemaVersion *string `json:"schema_version,omitempty"` + Ops *[]OpCapability `json:"ops,omitempty"` + ConsumerField *string `json:"consumer_field,omitempty"` +} + +// OpsHealthCheck is a model used by Loom operations. +type OpsHealthCheck struct { + Name string `json:"name"` + Status string `json:"status"` + Detail *string `json:"detail,omitempty"` + Data *map[string]json.RawMessage `json:"data,omitempty"` + Repair *string `json:"repair,omitempty"` +} + +// OpsHealthInput is the request to ops.health. +type OpsHealthInput struct { + Org string `json:"org"` + Namespace Optional[string] `json:"namespace,omitempty"` +} + +// OpsHealthOutput is the response from ops.health. +type OpsHealthOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Checks []OpsHealthCheck `json:"checks"` + WorkerStatus *map[string]map[string]json.RawMessage `json:"worker_status,omitempty"` + Overall string `json:"overall"` +} + +// OpsProjectionFailuresListInput is the request to ops.projection_failures.list. +type OpsProjectionFailuresListInput = ProjectionFailureListInput + +// OpsProjectionFailuresListOutput is the response from ops.projection_failures.list. +type OpsProjectionFailuresListOutput = ProjectionFailureListOutput + +// OpsProjectionFailuresResolveInput is the request to ops.projection_failures.resolve. +type OpsProjectionFailuresResolveInput = ProjectionFailureResolveInput + +// OpsProjectionFailuresResolveOutput is the response from ops.projection_failures.resolve. +type OpsProjectionFailuresResolveOutput = ProjectionFailureResolveOutput + +// OpsProjectionFailuresRetryInput is the request to ops.projection_failures.retry. +type OpsProjectionFailuresRetryInput = ProjectionFailureRetryInput + +// OpsProjectionFailuresRetryOutput is the response from ops.projection_failures.retry. +type OpsProjectionFailuresRetryOutput = ProjectionFailureRetryOutput + +// OrgModelCallsInput is the request to org.model_calls. +type OrgModelCallsInput struct { + Org string `json:"org"` +} + +// OrgModelCallsOutput is the response from org.model_calls. +type OrgModelCallsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Enabled bool `json:"enabled"` + Reason *string `json:"reason,omitempty"` + UpdatedBy *string `json:"updated_by,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + Locked *bool `json:"locked,omitempty"` + LockedBy *string `json:"locked_by,omitempty"` +} + +// OrgSetModelCallsInput is the request to org.set_model_calls. +type OrgSetModelCallsInput struct { + Org string `json:"org"` + Enabled bool `json:"enabled"` + Reason *string `json:"reason,omitempty"` + Locked Optional[bool] `json:"locked,omitempty"` +} + +// OrgSetModelCallsOutput is the response from org.set_model_calls. +type OrgSetModelCallsOutput = OrgModelCallsOutput + +// OutlineCommunity is a model used by Loom operations. +type OutlineCommunity struct { + CommunityID int64 `json:"community_id"` + Label *string `json:"label,omitempty"` + Size *int64 `json:"size,omitempty"` + ComputedAt *string `json:"computed_at,omitempty"` +} + +// OutlineEntry is a model used by Loom operations. +type OutlineEntry struct { + Path []string `json:"path"` + Title string `json:"title"` + Depth int64 `json:"depth"` + ChunkIdxs []int64 `json:"chunk_idxs"` + Chars int64 `json:"chars"` +} + +// OutlineHub is a model used by Loom operations. +type OutlineHub struct { + Entity string `json:"entity"` + Degree *int64 `json:"degree,omitempty"` +} + +// OutlineSession is a model used by Loom operations. +type OutlineSession struct { + SessionID string `json:"session_id"` + Date *string `json:"date,omitempty"` + Headline *string `json:"headline,omitempty"` + KeyFacts *int64 `json:"key_facts,omitempty"` + Rows *int64 `json:"rows,omitempty"` +} + +// OwnerReadsRow is a model used by Loom operations. +type OwnerReadsRow struct { + Namespace string `json:"namespace"` + Agent string `json:"agent"` + Actor string `json:"actor"` + Calls int64 `json:"calls"` + DistinctKeys int64 `json:"distinct_keys"` + LastRead string `json:"last_read"` +} + +// OwnerRowsRow is a model used by Loom operations. +type OwnerRowsRow struct { + Namespace string `json:"namespace"` + MemoryType string `json:"memory_type"` + N int64 `json:"n"` +} + +// OwnerUsageRow is a model used by Loom operations. +type OwnerUsageRow struct { + Namespace string `json:"namespace"` + Recalls int64 `json:"recalls"` + Used int64 `json:"used"` + Harm int64 `json:"harm"` + LastRecalled Optional[string] `json:"last_recalled,omitempty"` +} + +// PathEdge is a model used by Loom operations. +type PathEdge struct { + EntityA string `json:"entity_a"` + EntityB string `json:"entity_b"` + Relation *string `json:"relation,omitempty"` + Direction *string `json:"direction,omitempty"` + CoOccur int64 `json:"co_occur"` + ValidFrom Optional[string] `json:"valid_from,omitempty"` + ValidTo Optional[string] `json:"valid_to,omitempty"` +} + +// PendingForMeEntry is a model used by Loom operations. +type PendingForMeEntry struct { + Namespace string `json:"namespace"` + Kind *string `json:"kind,omitempty"` + Subject string `json:"subject"` + CurrentRole string `json:"current_role"` + RequestedRole string `json:"requested_role"` + PendingSince Optional[string] `json:"pending_since,omitempty"` +} + +// PolicyCheckInput is the request to policy.check. +type PolicyCheckInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Operation string `json:"operation"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Args *map[string]json.RawMessage `json:"args,omitempty"` + At Optional[string] `json:"at,omitempty"` + Rules Optional[[]map[string]json.RawMessage] `json:"rules,omitempty"` +} + +// PolicyCheckOutput is the response from policy.check. +type PolicyCheckOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Decision string `json:"decision"` + WouldEnforce bool `json:"would_enforce"` + Mode string `json:"mode"` + WriteShaped *bool `json:"write_shaped"` + DeterminingRules []string `json:"determining_rules"` + Errors []string `json:"errors"` + Rules []map[string]json.RawMessage `json:"rules"` + LatencyMs int64 `json:"latency_ms"` +} + +// PolicyDecisionRow is a model used by Loom operations. +type PolicyDecisionRow struct { + Ts string `json:"ts"` + Agent string `json:"agent"` + UserID string `json:"user_id"` + SessionID string `json:"session_id"` + Operation string `json:"operation"` + RequestID string `json:"request_id"` + Mode string `json:"mode"` + Decision string `json:"decision"` + Enforced bool `json:"enforced"` + DeterminingRules []string `json:"determining_rules"` + Errors []string `json:"errors"` + LatencyMs int64 `json:"latency_ms"` +} + +// PolicyDecisionsInput is the request to policy.decisions. +type PolicyDecisionsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Decision Optional[string] `json:"decision,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// PolicyDecisionsOutput is the response from policy.decisions. +type PolicyDecisionsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []PolicyDecisionRow `json:"rows"` +} + +// PolicyDeleteInput is the request to policy.delete. +type PolicyDeleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + PolicyID string `json:"policy_id"` + RemovedBy *string `json:"removed_by,omitempty"` +} + +// PolicyDeleteOutput is the response from policy.delete. +type PolicyDeleteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Removed bool `json:"removed"` + Widening *bool `json:"widening,omitempty"` +} + +// PolicyListInput is the request to policy.list. +type PolicyListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + IncludeDisabled *bool `json:"include_disabled,omitempty"` +} + +// PolicyListOutput is the response from policy.list. +type PolicyListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rules []PolicyRuleOut `json:"rules"` + Mode string `json:"mode"` +} + +// PolicyPayload is a model used by Loom operations. +type PolicyPayload struct { + Org string `json:"org"` + Inbox string `json:"inbox"` + Poster string `json:"poster"` + Kind string `json:"kind"` + Mode string `json:"mode"` + RequireEvidence *[]string `json:"require_evidence,omitempty"` + SetBy *string `json:"set_by,omitempty"` + SetAt string `json:"set_at"` + Version int64 `json:"version"` +} + +// PolicyRuleOut is a model used by Loom operations. +type PolicyRuleOut struct { + PolicyID string `json:"policy_id"` + Effect string `json:"effect"` + Actions []string `json:"actions"` + Condition map[string]json.RawMessage `json:"condition"` + Description string `json:"description"` + Enabled bool `json:"enabled"` + Mode *string `json:"mode,omitempty"` + CreatedBy string `json:"created_by"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` +} + +// PolicySetInput is the request to policy.set. +type PolicySetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + PolicyID string `json:"policy_id"` + Effect string `json:"effect"` + Actions []string `json:"actions"` + Condition map[string]json.RawMessage `json:"condition"` + Description *string `json:"description,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Mode *string `json:"mode,omitempty"` + CreatedBy *string `json:"created_by,omitempty"` +} + +// PolicySetOutput is the response from policy.set. +type PolicySetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rule PolicyRuleOut `json:"rule"` + LeafCount int64 `json:"leaf_count"` + Widening *bool `json:"widening,omitempty"` + Change *[]string `json:"change,omitempty"` +} + +// Principal is a model used by Loom operations. +type Principal struct { + Subject string `json:"subject"` + Label string `json:"label"` + Kind string `json:"kind"` + Namespaces *[]string `json:"namespaces,omitempty"` + Roles *[]string `json:"roles,omitempty"` + LastSeen Optional[string] `json:"last_seen,omitempty"` + CanAlreadyPost *bool `json:"can_already_post,omitempty"` + Listed *bool `json:"listed,omitempty"` +} + +// ProcedureAddInput is the request to procedure.add. +type ProcedureAddInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Name string `json:"name"` + Situation string `json:"situation"` + Steps []string `json:"steps"` + Tags *[]string `json:"tags,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + Graph Optional[map[string]json.RawMessage] `json:"graph,omitempty"` +} + +// ProcedureAddOutput is the response from procedure.add. +type ProcedureAddOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MemoryKey string `json:"memory_key"` + MemoryID string `json:"memory_id"` + Version int64 `json:"version"` +} + +// ProcedureEvolveInput is the request to procedure.evolve. +type ProcedureEvolveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + MemoryKey string `json:"memory_key"` + MinRuns *int64 `json:"min_runs,omitempty"` + GateMode *string `json:"gate_mode,omitempty"` + GateMinRuns *int64 `json:"gate_min_runs,omitempty"` + GateMargin *float64 `json:"gate_margin,omitempty"` + GateMinDrop *float64 `json:"gate_min_drop,omitempty"` + GateAlpha *float64 `json:"gate_alpha,omitempty"` + GateBeta *float64 `json:"gate_beta,omitempty"` + GateMaxRuns *int64 `json:"gate_max_runs,omitempty"` + StrikeLimit Optional[int64] `json:"strike_limit,omitempty"` + GateCostTolerance *float64 `json:"gate_cost_tolerance,omitempty"` + GateCostMinSamples Optional[int64] `json:"gate_cost_min_samples,omitempty"` +} + +// ProcedureEvolveOutput is the response from procedure.evolve. +type ProcedureEvolveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MemoryKey string `json:"memory_key"` + Version int64 `json:"version"` + Revision int64 `json:"revision"` + Changed bool `json:"changed"` + Template bool `json:"template"` + FoldedRuns *int64 `json:"folded_runs,omitempty"` + Gate *string `json:"gate,omitempty"` + GateMode *string `json:"gate_mode,omitempty"` + GateLlr *float64 `json:"gate_llr,omitempty"` + GateBefore *map[string]int64 `json:"gate_before,omitempty"` + GateAfter *map[string]int64 `json:"gate_after,omitempty"` + GateCostBefore *map[string]float64 `json:"gate_cost_before,omitempty"` + GateCostAfter *map[string]float64 `json:"gate_cost_after,omitempty"` + GateReason *string `json:"gate_reason,omitempty"` + DeadEndSteps *[]string `json:"dead_end_steps,omitempty"` + FailProneSteps *[]string `json:"fail_prone_steps,omitempty"` + FailProneTransitions *[]string `json:"fail_prone_transitions,omitempty"` + RunStats *map[string]int64 `json:"run_stats,omitempty"` + Strikes *int64 `json:"strikes,omitempty"` + Quarantined *bool `json:"quarantined,omitempty"` + Retention *map[string]float64 `json:"retention,omitempty"` +} + +// ProcedureForkInput is the request to procedure.fork. +type ProcedureForkInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + FromNamespace string `json:"from_namespace"` + FromOrg *string `json:"from_org,omitempty"` + MemoryKey string `json:"memory_key"` + NewName *string `json:"new_name,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// ProcedureForkOutput is the response from procedure.fork. +type ProcedureForkOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MemoryKey string `json:"memory_key"` + Version int64 `json:"version"` + Name string `json:"name"` + Steps *[]string `json:"steps,omitempty"` + ForkedFrom *map[string]json.RawMessage `json:"forked_from,omitempty"` +} + +// ProcedureListInput is the request to procedure.list. +type ProcedureListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Prefix *string `json:"prefix,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// ProcedureListOutput is the response from procedure.list. +type ProcedureListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Procedures []ProcedureSummary `json:"procedures"` +} + +// ProcedureLocateInput is the request to procedure.locate. +type ProcedureLocateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + MemoryKey string `json:"memory_key"` + At *string `json:"at,omitempty"` + RecentPath *[]string `json:"recent_path,omitempty"` + Hops *int64 `json:"hops,omitempty"` + IncludeNotes *bool `json:"include_notes,omitempty"` + MaxNotes *int64 `json:"max_notes,omitempty"` +} + +// ProcedureLocateOutput is the response from procedure.locate. +type ProcedureLocateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MemoryKey string `json:"memory_key"` + Name *string `json:"name,omitempty"` + Status *string `json:"status,omitempty"` + Matched bool `json:"matched"` + Active Optional[map[string]json.RawMessage] `json:"active,omitempty"` + Hops *[][]map[string]json.RawMessage `json:"hops,omitempty"` + EntryNodes *[]string `json:"entry_nodes,omitempty"` + DominantNext *[]string `json:"dominant_next,omitempty"` + Revisits *map[string]int64 `json:"revisits,omitempty"` + Looping *bool `json:"looping,omitempty"` + Exits *[]string `json:"exits,omitempty"` + FailureNotes *[]map[string]json.RawMessage `json:"failure_notes,omitempty"` + Rendered *string `json:"rendered,omitempty"` + RunStats *map[string]int64 `json:"run_stats,omitempty"` + ForAgent *map[string]int64 `json:"for_agent,omitempty"` +} + +// ProcedureMatch is a model used by Loom operations. +type ProcedureMatch struct { + Name string `json:"name"` + Situation string `json:"situation"` + Steps []string `json:"steps"` + Tags *[]string `json:"tags,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + Similarity float64 `json:"similarity"` + MemoryKey string `json:"memory_key"` + Namespace string `json:"namespace"` + Graph Optional[map[string]json.RawMessage] `json:"graph,omitempty"` + Template *bool `json:"template,omitempty"` + RunStats *map[string]int64 `json:"run_stats,omitempty"` + Status *string `json:"status,omitempty"` + Quarantined Optional[map[string]json.RawMessage] `json:"quarantined,omitempty"` + FailProneSteps *[]string `json:"fail_prone_steps,omitempty"` + Revision *int64 `json:"revision,omitempty"` + RejectedRevisions *[]map[string]json.RawMessage `json:"rejected_revisions,omitempty"` + ToolOverlap *float64 `json:"tool_overlap,omitempty"` + Score *float64 `json:"score,omitempty"` + Utility *float64 `json:"utility,omitempty"` + GoalSimilarity Optional[float64] `json:"goal_similarity,omitempty"` + ForAgent *map[string]int64 `json:"for_agent,omitempty"` + RunStatsByAgent *map[string]map[string]int64 `json:"run_stats_by_agent,omitempty"` + Actor *string `json:"actor,omitempty"` +} + +// ProcedureMatchInput is the request to procedure.match. +type ProcedureMatchInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Situation string `json:"situation"` + TopK *int64 `json:"top_k,omitempty"` + Tags *[]string `json:"tags,omitempty"` + NamespaceScope *string `json:"namespace_scope,omitempty"` + TemplatesOnly *bool `json:"templates_only,omitempty"` + IncludeCandidates *bool `json:"include_candidates,omitempty"` + IncludeQuarantined *bool `json:"include_quarantined,omitempty"` + RecentTools *[]string `json:"recent_tools,omitempty"` + ToolBoost *float64 `json:"tool_boost,omitempty"` + UtilityWeight Optional[float64] `json:"utility_weight,omitempty"` + Goal Optional[string] `json:"goal,omitempty"` +} + +// ProcedureMatchOutput is the response from procedure.match. +type ProcedureMatchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Matches []ProcedureMatch `json:"matches"` + Matched *int64 `json:"matched,omitempty"` + ProcedureKey *string `json:"procedure_key,omitempty"` + Score *float64 `json:"score,omitempty"` +} + +// ProcedureRecordRunInput is the request to procedure.record_run. +type ProcedureRecordRunInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + MemoryKey string `json:"memory_key"` + Path *[]string `json:"path,omitempty"` + Ok *bool `json:"ok,omitempty"` + Note *string `json:"note,omitempty"` + Ts *string `json:"ts,omitempty"` + StepsTaken Optional[int64] `json:"steps_taken,omitempty"` + DurationMs *int64 `json:"duration_ms,omitempty"` + Tokens *int64 `json:"tokens,omitempty"` +} + +// ProcedureRecordRunOutput is the response from procedure.record_run. +type ProcedureRecordRunOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MemoryKey string `json:"memory_key"` + Version int64 `json:"version"` + RunStats map[string]int64 `json:"run_stats"` +} + +// ProcedureReviseInput is the request to procedure.revise. +type ProcedureReviseInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + MemoryKey string `json:"memory_key"` + Graph map[string]json.RawMessage `json:"graph"` + Reason *string `json:"reason,omitempty"` + Force *bool `json:"force,omitempty"` +} + +// ProcedureReviseOutput is the response from procedure.revise. +type ProcedureReviseOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + MemoryKey string `json:"memory_key"` + Version int64 `json:"version"` + Revision int64 `json:"revision"` + PriorRevision int64 `json:"prior_revision"` + Digest string `json:"digest"` + Steps *[]string `json:"steps,omitempty"` +} + +// ProcedureSummary is a model used by Loom operations. +type ProcedureSummary struct { + Name string `json:"name"` + Situation string `json:"situation"` + Tags []string `json:"tags"` + MemoryKey string `json:"memory_key"` + CreatedAt string `json:"created_at"` +} + +// ProfileActivityEntry is a model used by Loom operations. +type ProfileActivityEntry struct { + Agent string `json:"agent"` + LastActivatedAt string `json:"last_activated_at"` + EventCount int64 `json:"event_count"` + Operations *[]string `json:"operations,omitempty"` +} + +// ProfileActivityInput is the request to profile.activity. +type ProfileActivityInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + LookbackDays *int64 `json:"lookback_days,omitempty"` +} + +// ProfileActivityOutput is the response from profile.activity. +type ProfileActivityOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Entries *[]ProfileActivityEntry `json:"entries,omitempty"` +} + +// ProfileAppendInput is the request to profile.append. +type ProfileAppendInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Label string `json:"label"` + Addition string `json:"addition"` + Separator *string `json:"separator,omitempty"` +} + +// ProfileAppendOutput is the response from profile.append. +type ProfileAppendOutput = ProfileMutationOutput + +// ProfileMutationOutput is a model used by Loom operations. +type ProfileMutationOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Version int64 `json:"version"` + MemoryID *string `json:"memory_id,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Label *string `json:"label,omitempty"` + CharLimit Optional[int64] `json:"char_limit,omitempty"` + ValueLength *int64 `json:"value_length,omitempty"` +} + +// ProfileRenderInput is the request to profile.render. +type ProfileRenderInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Format *string `json:"format,omitempty"` + Labels Optional[[]string] `json:"labels,omitempty"` + Scope *string `json:"scope,omitempty"` + ReadScope *string `json:"read_scope,omitempty"` +} + +// ProfileRenderOutput is the response from profile.render. +type ProfileRenderOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rendered string `json:"rendered"` + SectionCount int64 `json:"section_count"` + TotalChars int64 `json:"total_chars"` + Labels *[]string `json:"labels,omitempty"` +} + +// ProfileReplaceInput is the request to profile.replace. +type ProfileReplaceInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Label string `json:"label"` + Old string `json:"old"` + New string `json:"new"` +} + +// ProfileReplaceOutput is the response from profile.replace. +type ProfileReplaceOutput = ProfileMutationOutput + +// ProfileSchemaClearInput is the request to profile_schema.clear. +type ProfileSchemaClearInput = ProfileSchemaInput + +// ProfileSchemaClearOutput is the response from profile_schema.clear. +type ProfileSchemaClearOutput = ProfileSchemaOutput + +// ProfileSchemaGetInput is the request to profile_schema.get. +type ProfileSchemaGetInput = ProfileSchemaInput + +// ProfileSchemaGetOutput is the response from profile_schema.get. +type ProfileSchemaGetOutput = ProfileSchemaOutput + +// ProfileSchemaInput is a model used by Loom operations. +type ProfileSchemaInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// ProfileSchemaOutput is a model used by Loom operations. +type ProfileSchemaOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + JSONSchema *map[string]json.RawMessage `json:"json_schema,omitempty"` + SchemaSHA256 *string `json:"schema_sha256,omitempty"` + UpdatedBy *string `json:"updated_by,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` +} + +// ProfileSchemaSetInput is the request to profile_schema.set. +type ProfileSchemaSetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + JSONSchema map[string]json.RawMessage `json:"json_schema"` +} + +// ProfileSchemaSetOutput is the response from profile_schema.set. +type ProfileSchemaSetOutput = ProfileSchemaOutput + +// ProfileSetInput is the request to profile.set. +type ProfileSetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Label string `json:"label"` + Value string `json:"value"` + CharLimit *int64 `json:"char_limit,omitempty"` + SourceTrace *string `json:"source_trace,omitempty"` + IfMatchSHA256 *string `json:"if_match_sha256,omitempty"` +} + +// ProfileSetOutput is the response from profile.set. +type ProfileSetOutput = ProfileMutationOutput + +// ProfileStructuredInput is the request to profile.structured. +type ProfileStructuredInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + ReadScope *string `json:"read_scope,omitempty"` +} + +// ProfileStructuredOutput is the response from profile.structured. +type ProfileStructuredOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Status string `json:"status"` + Profile *map[string]json.RawMessage `json:"profile,omitempty"` + BuiltAt Optional[string] `json:"built_at,omitempty"` + MemoryID *string `json:"memory_id,omitempty"` + Version *int64 `json:"version,omitempty"` + VersionText *string `json:"version_text,omitempty"` + SchemaSHA256 *string `json:"schema_sha256,omitempty"` +} + +// ProjectionFailureListInput is a model used by Loom operations. +type ProjectionFailureListInput struct { + Org string `json:"org"` + Namespace Optional[string] `json:"namespace,omitempty"` + Projection *string `json:"projection,omitempty"` + Status *string `json:"status,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// ProjectionFailureListOutput is a model used by Loom operations. +type ProjectionFailureListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []ProjectionFailureRow `json:"rows"` + Total int64 `json:"total"` +} + +// ProjectionFailureResolveInput is a model used by Loom operations. +type ProjectionFailureResolveInput struct { + Org string `json:"org"` + FailureIds []string `json:"failure_ids"` +} + +// ProjectionFailureResolveOutput is a model used by Loom operations. +type ProjectionFailureResolveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Resolved int64 `json:"resolved"` +} + +// ProjectionFailureRetryInput is a model used by Loom operations. +type ProjectionFailureRetryInput struct { + Org string `json:"org"` + Namespace Optional[string] `json:"namespace,omitempty"` + Projection *string `json:"projection,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// ProjectionFailureRetryOutput is a model used by Loom operations. +type ProjectionFailureRetryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Results *[]ProjectionFailureRetryRow `json:"results,omitempty"` + Retried int64 `json:"retried"` + Resolved int64 `json:"resolved"` + Abandoned *int64 `json:"abandoned,omitempty"` +} + +// ProjectionFailureRetryRow is a model used by Loom operations. +type ProjectionFailureRetryRow struct { + FailureID string `json:"failure_id"` + Projection string `json:"projection"` + Retried bool `json:"retried"` + Resolved bool `json:"resolved"` + Abandoned *bool `json:"abandoned,omitempty"` + Reason *string `json:"reason,omitempty"` + Error *string `json:"error,omitempty"` +} + +// ProjectionFailureRow is a model used by Loom operations. +type ProjectionFailureRow struct { + FailureID string `json:"failure_id"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Projection string `json:"projection"` + SourceOperation *string `json:"source_operation,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + MemoryKeys *[]string `json:"memory_keys,omitempty"` + ErrorType *string `json:"error_type,omitempty"` + ErrorMessage *string `json:"error_message,omitempty"` + Payload *map[string]json.RawMessage `json:"payload,omitempty"` + Status *string `json:"status,omitempty"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + ResolvedAt Optional[string] `json:"resolved_at,omitempty"` +} + +// ProposalPolicy is a model used by Loom operations. +type ProposalPolicy struct { + Mode *string `json:"mode,omitempty"` + MinPasses *int64 `json:"min_passes,omitempty"` + MaxFails *int64 `json:"max_fails,omitempty"` + RejectAfterFails *int64 `json:"reject_after_fails,omitempty"` +} + +// PushConfigureInput is a model used by Loom operations. +type PushConfigureInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` +} + +// PushConfirmInput is a model used by Loom operations. +type PushConfirmInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Generation string `json:"generation"` + ChallengeFingerprint *string `json:"challenge_fingerprint,omitempty"` + SigningSecret *string `json:"signing_secret,omitempty"` +} + +// PushStatusInput is a model used by Loom operations. +type PushStatusInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + RevealChallenge *bool `json:"reveal_challenge,omitempty"` +} + +// PushStatusOutput is a model used by Loom operations. +type PushStatusOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Status *string `json:"status,omitempty"` + Provider *string `json:"provider,omitempty"` + Generation *string `json:"generation,omitempty"` + CallbackURL *string `json:"callback_url,omitempty"` + ProviderID *string `json:"provider_id,omitempty"` + ChallengeFingerprint *string `json:"challenge_fingerprint,omitempty"` + VerificationToken *string `json:"verification_token,omitempty"` + Channels *int64 `json:"channels,omitempty"` + ExpiresAt *float64 `json:"expires_at,omitempty"` +} + +// QueryAggregate is a model used by Loom operations. +type QueryAggregate struct { + Fn string `json:"fn"` + Column Optional[QueryColumn] `json:"column,omitempty"` + Name string `json:"name"` +} + +// QueryColumn is a model used by Loom operations. +type QueryColumn struct { + Dataset *string `json:"dataset,omitempty"` + Column string `json:"column"` +} + +// QueryDataset is a model used by Loom operations. +type QueryDataset struct { + Alias *string `json:"alias,omitempty"` + SourceURI string `json:"source_uri"` + DatasetID string `json:"dataset_id"` +} + +// QueryFilter is a model used by Loom operations. +type QueryFilter struct { + Column QueryColumn `json:"column"` + Op string `json:"op"` + Value json.RawMessage `json:"value,omitempty"` + Values *[]json.RawMessage `json:"values,omitempty"` +} + +// QueryGroup is a model used by Loom operations. +type QueryGroup struct { + Column QueryColumn `json:"column"` + Bucket *string `json:"bucket,omitempty"` + Name *string `json:"name,omitempty"` +} + +// QueryHistoryAddInput is a model used by Loom operations. +type QueryHistoryAddInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Host string `json:"host"` + Port *int64 `json:"port,omitempty"` + Secure *bool `json:"secure,omitempty"` + User string `json:"user"` + Password string `json:"password"` + Databases []string `json:"databases"` + Cluster *string `json:"cluster,omitempty"` +} + +// QueryHistoryListInput is a model used by Loom operations. +type QueryHistoryListInput struct { + Fields Optional[[]string] `json:"fields,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Limit *int64 `json:"limit,omitempty"` +} + +// QueryHistoryListOutput is a model used by Loom operations. +type QueryHistoryListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Sources *[]QueryHistorySource `json:"sources,omitempty"` +} + +// QueryHistoryRemoveInput is a model used by Loom operations. +type QueryHistoryRemoveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Name string `json:"name"` +} + +// QueryHistoryRemoveOutput is a model used by Loom operations. +type QueryHistoryRemoveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Removed bool `json:"removed"` +} + +// QueryHistorySource is a model used by Loom operations. +type QueryHistorySource struct { + Name *string `json:"name,omitempty"` + SourceID *string `json:"source_id,omitempty"` + Kind *string `json:"kind,omitempty"` + Host *string `json:"host,omitempty"` + Port *int64 `json:"port,omitempty"` + Secure *bool `json:"secure,omitempty"` + User *string `json:"user,omitempty"` + Databases *[]string `json:"databases,omitempty"` + Cluster *string `json:"cluster,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` +} + +// QueryHistorySourceHTTPResponse is a model used by Loom operations. +type QueryHistorySourceHTTPResponse struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name *string `json:"name,omitempty"` + SourceID *string `json:"source_id,omitempty"` + Kind *string `json:"kind,omitempty"` + Host *string `json:"host,omitempty"` + Port *int64 `json:"port,omitempty"` + Secure *bool `json:"secure,omitempty"` + User *string `json:"user,omitempty"` + Databases *[]string `json:"databases,omitempty"` + Cluster *string `json:"cluster,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` +} + +// QueryJoin is a model used by Loom operations. +type QueryJoin struct { + Left QueryColumn `json:"left"` + Right QueryColumn `json:"right"` +} + +// QueryOrder is a model used by Loom operations. +type QueryOrder struct { + By string `json:"by"` + Desc *bool `json:"desc,omitempty"` +} + +// QueryReceipt is a model used by Loom operations. +type QueryReceipt struct { + Snapshots []QuerySnapshot `json:"snapshots"` + Plan map[string]json.RawMessage `json:"plan"` + SQL string `json:"sql"` + Params map[string]string `json:"params"` +} + +// QueryResultColumn is a model used by Loom operations. +type QueryResultColumn struct { + Name string `json:"name"` + Type string `json:"type"` +} + +// QuerySnapshot is a model used by Loom operations. +type QuerySnapshot struct { + Alias string `json:"alias"` + SourceURI string `json:"source_uri"` + DatasetID string `json:"dataset_id"` + Revision int64 `json:"revision"` + SnapshotID string `json:"snapshot_id"` + RowCount int64 `json:"row_count"` + RejectedRows int64 `json:"rejected_rows"` + Complete bool `json:"complete"` + SchemaState string `json:"schema_state"` +} + +// RecallByAgent is a model used by Loom operations. +type RecallByAgent struct { + Agent string `json:"agent"` + Count int64 `json:"count"` + LastAt Optional[string] `json:"last_at,omitempty"` +} + +// RecallTurn is a model used by Loom operations. +type RecallTurn struct { + EvidenceID string `json:"evidence_id"` + SessionID string `json:"session_id"` + Role *string `json:"role,omitempty"` + Actor *string `json:"actor,omitempty"` + ObservedAt *string `json:"observed_at,omitempty"` + Content *string `json:"content,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + MatchedTokens *int64 `json:"matched_tokens,omitempty"` +} + +// RecentMessage is a model used by Loom operations. +type RecentMessage struct { + Role *string `json:"role,omitempty"` + Content string `json:"content"` + Name *string `json:"name,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +// RecordFieldInput is a model used by Loom operations. +type RecordFieldInput struct { + Value json.RawMessage `json:"value,omitempty"` + State *string `json:"state,omitempty"` + EvidenceID Optional[string] `json:"evidence_id,omitempty"` +} + +// RecordPredicate is a model used by Loom operations. +type RecordPredicate struct { + Field string `json:"field"` + Op *string `json:"op,omitempty"` + Number Optional[float64] `json:"number,omitempty"` + Boolean Optional[bool] `json:"boolean,omitempty"` + String Optional[string] `json:"string,omitempty"` + ValueState Optional[string] `json:"value_state,omitempty"` +} + +// RefusedFact is a model used by Loom operations. +type RefusedFact struct { + MemoryKey string `json:"memory_key"` + Verdict string `json:"verdict"` +} + +// RelatedEntity is a model used by Loom operations. +type RelatedEntity struct { + Entity string `json:"entity"` + CoOccur int64 `json:"co_occur"` + Role string `json:"role"` +} + +// RelatedGrepEvidence is a model used by Loom operations. +type RelatedGrepEvidence struct { + Pattern string `json:"pattern"` + Matches []map[string]json.RawMessage `json:"matches"` + Contexts *[]map[string]json.RawMessage `json:"contexts,omitempty"` + ContextsPartial *bool `json:"contexts_partial,omitempty"` + Definitions *[]map[string]json.RawMessage `json:"definitions,omitempty"` + DefinitionsPartial *bool `json:"definitions_partial,omitempty"` + DefinitionsNote *string `json:"definitions_note,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Dependencies *[]GrepDependency `json:"dependencies,omitempty"` +} + +// ReportCoverage is a model used by Loom operations. +type ReportCoverage struct { + RulesRun *[]string `json:"rules_run,omitempty"` + RulesSkipped *[]string `json:"rules_skipped,omitempty"` + Complete bool `json:"complete"` +} + +// RunBeginInput is the request to run.begin. +type RunBeginInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Goal string `json:"goal"` + UserRequest *string `json:"user_request,omitempty"` + ExpectedOutcome *string `json:"expected_outcome,omitempty"` + Environment *string `json:"environment,omitempty"` + Model *string `json:"model,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Role *string `json:"role,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + BudgetUsd *float64 `json:"budget_usd,omitempty"` + BudgetSeconds *int64 `json:"budget_seconds,omitempty"` +} + +// RunBeginOutput is the response from run.begin. +type RunBeginOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + RunID string `json:"run_id"` + Status *string `json:"status,omitempty"` + StartedAt string `json:"started_at"` + Next *string `json:"next,omitempty"` +} + +// RunCompleteInput is the request to run.complete. +type RunCompleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID string `json:"run_id"` + Status string `json:"status"` + FinalResponse *string `json:"final_response,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + MemoriesUsed *[]string `json:"memories_used,omitempty"` + RecalledKeys *[]string `json:"recalled_keys,omitempty"` + Outcome *string `json:"outcome,omitempty"` + Weight *int64 `json:"weight,omitempty"` + DurationMs *int64 `json:"duration_ms,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + Reflection Optional[RunReflection] `json:"reflection,omitempty"` + Retain *string `json:"retain,omitempty"` +} + +// RunCompleteOutput is the response from run.complete. +type RunCompleteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + RunID string `json:"run_id"` + Status string `json:"status"` + DurationMs int64 `json:"duration_ms"` + UsedApplied *int64 `json:"used_applied,omitempty"` + EvidenceApplied *int64 `json:"evidence_applied,omitempty"` + HarmApplied *int64 `json:"harm_applied,omitempty"` + MemoriesWritten *[]string `json:"memories_written,omitempty"` + Recalled *int64 `json:"recalled,omitempty"` + Observations *int64 `json:"observations,omitempty"` + ProcedureRunsRecorded *int64 `json:"procedure_runs_recorded,omitempty"` + ReflectionKey *string `json:"reflection_key,omitempty"` + Retain *string `json:"retain,omitempty"` + Retained *int64 `json:"retained,omitempty"` + Demoted *int64 `json:"demoted,omitempty"` + Expiring *int64 `json:"expiring,omitempty"` +} + +// RunGetInput is the request to run.get. +type RunGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + RunID string `json:"run_id"` +} + +// RunGetOutput is the response from run.get. +type RunGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + Run Optional[RunRow] `json:"run,omitempty"` + Recalled *int64 `json:"recalled,omitempty"` + RecalledKeys *[]string `json:"recalled_keys,omitempty"` + MemoriesWritten *[]string `json:"memories_written,omitempty"` + Observations *int64 `json:"observations,omitempty"` + Turns *int64 `json:"turns,omitempty"` + UnpricedTurns *int64 `json:"unpriced_turns,omitempty"` + CostUsd *float64 `json:"cost_usd,omitempty"` + ElapsedSeconds *int64 `json:"elapsed_seconds,omitempty"` + OverBudget *[]string `json:"over_budget,omitempty"` +} + +// RunGradeInput is the request to run.grade. +type RunGradeInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + RunID *string `json:"run_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Grade string `json:"grade"` + Source *string `json:"source,omitempty"` + Reason *string `json:"reason,omitempty"` + Ref *string `json:"ref,omitempty"` +} + +// RunGradeOutput is the response from run.grade. +type RunGradeOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Graded *int64 `json:"graded,omitempty"` + RunIds *[]string `json:"run_ids,omitempty"` + SkippedActive *int64 `json:"skipped_active,omitempty"` + Unchanged *int64 `json:"unchanged,omitempty"` + MemoriesCounted *int64 `json:"memories_counted,omitempty"` + ProposalsDecided *[]RunGradeProposal `json:"proposals_decided,omitempty"` +} + +// RunGradeProposal is a model used by Loom operations. +type RunGradeProposal struct { + MemoryKey string `json:"memory_key"` + Decision string `json:"decision"` + Passes int64 `json:"passes"` + Fails int64 `json:"fails"` +} + +// RunListInput is the request to run.list. +type RunListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Status *string `json:"status,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Offset *int64 `json:"offset,omitempty"` + OrderBy *string `json:"order_by,omitempty"` + Q *string `json:"q,omitempty"` + MemoryActivity *string `json:"memory_activity,omitempty"` + Grade *string `json:"grade,omitempty"` + Fields Optional[[]string] `json:"fields,omitempty"` +} + +// RunListOutput is the response from run.list. +type RunListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Runs []RunRow `json:"runs"` + Total Optional[int64] `json:"total,omitempty"` +} + +// RunReflection is a model used by Loom operations. +type RunReflection struct { + WhatWorked *[]string `json:"what_worked,omitempty"` + WhatFailed *[]string `json:"what_failed,omitempty"` + Assumptions *[]string `json:"assumptions,omitempty"` + Lessons *[]string `json:"lessons,omitempty"` + Improvements *[]string `json:"improvements,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Evidence *[]string `json:"evidence,omitempty"` + ExpiresInDays *int64 `json:"expires_in_days,omitempty"` +} + +// RunRow is a model used by Loom operations. +type RunRow struct { + RunID *string `json:"run_id,omitempty"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + Goal *string `json:"goal,omitempty"` + UserRequest *string `json:"user_request,omitempty"` + ExpectedOutcome *string `json:"expected_outcome,omitempty"` + Environment *string `json:"environment,omitempty"` + Model *string `json:"model,omitempty"` + Consumer *string `json:"consumer,omitempty"` + Status *string `json:"status,omitempty"` + StartedAt *string `json:"started_at,omitempty"` + CompletedAt *string `json:"completed_at,omitempty"` + DurationMs *int64 `json:"duration_ms,omitempty"` + FinalResponse *string `json:"final_response,omitempty"` + Confidence *float64 `json:"confidence,omitempty"` + Grade *string `json:"grade,omitempty"` + GradeSource *string `json:"grade_source,omitempty"` + GradeReason *string `json:"grade_reason,omitempty"` + GradeRef *string `json:"grade_ref,omitempty"` + GradedAt *string `json:"graded_at,omitempty"` + MemoriesUsed *[]string `json:"memories_used,omitempty"` + MemoriesWritten *[]string `json:"memories_written,omitempty"` + Metadata *map[string]json.RawMessage `json:"metadata,omitempty"` + BudgetUsd *float64 `json:"budget_usd,omitempty"` + BudgetSeconds *int64 `json:"budget_seconds,omitempty"` +} + +// SavedMessageHit is a model used by Loom operations. +type SavedMessageHit struct { + ConversationID *string `json:"conversation_id,omitempty"` + MessageID *string `json:"message_id,omitempty"` + Role *string `json:"role,omitempty"` + ContentExcerpt *string `json:"content_excerpt,omitempty"` + Ts *string `json:"ts,omitempty"` +} + +// SchemaFieldInput is a model used by Loom operations. +type SchemaFieldInput struct { + Name string `json:"name"` + Type *string `json:"type,omitempty"` + Required *bool `json:"required,omitempty"` + Identity *bool `json:"identity,omitempty"` + EnumValues *[]string `json:"enum_values,omitempty"` + Pattern *string `json:"pattern,omitempty"` + MinLength Optional[int64] `json:"min_length,omitempty"` + MaxLength Optional[int64] `json:"max_length,omitempty"` + MinValue Optional[float64] `json:"min_value,omitempty"` + MaxValue Optional[float64] `json:"max_value,omitempty"` + Description *string `json:"description,omitempty"` +} + +// SchemaFieldOutput is a model used by Loom operations. +type SchemaFieldOutput struct { + Name string `json:"name"` + Type string `json:"type"` + Required bool `json:"required"` + Identity *bool `json:"identity,omitempty"` + EnumValues *[]string `json:"enum_values,omitempty"` + Constraints *map[string]json.RawMessage `json:"constraints,omitempty"` + Description *string `json:"description,omitempty"` +} + +// SearchHit is a model used by Loom operations. +type SearchHit struct { + SourceURI string `json:"source_uri"` + ChunkIdx int64 `json:"chunk_idx"` + Content string `json:"content"` + Tags []string `json:"tags"` + Distance float64 `json:"distance"` + Similarity float64 `json:"similarity"` + Namespace *string `json:"namespace,omitempty"` + IngestedAt Optional[string] `json:"ingested_at,omitempty"` + SectionPath *[]string `json:"section_path,omitempty"` + Section *string `json:"section,omitempty"` + LexicalScore *float64 `json:"lexical_score,omitempty"` + Score *float64 `json:"score,omitempty"` + Source *string `json:"source,omitempty"` + Span *string `json:"span,omitempty"` + SpanStart *int64 `json:"span_start,omitempty"` + SpanEnd *int64 `json:"span_end,omitempty"` + SpanSimilarity *float64 `json:"span_similarity,omitempty"` + SiblingsFolded *int64 `json:"siblings_folded,omitempty"` + Agent *string `json:"agent,omitempty"` + SessionID *string `json:"session_id,omitempty"` + SourceClass *string `json:"source_class,omitempty"` + Revision *int64 `json:"revision,omitempty"` + Format *string `json:"format,omitempty"` + BlockType *string `json:"block_type,omitempty"` + Locator Optional[map[string]json.RawMessage] `json:"locator,omitempty"` + KeysMatched *[]string `json:"keys_matched,omitempty"` + Noise *bool `json:"noise,omitempty"` +} + +// SearchInput is a model used by Loom operations. +type SearchInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Query string `json:"query"` + TopK *int64 `json:"top_k,omitempty"` + Tags *[]string `json:"tags,omitempty"` + NamespaceScope *string `json:"namespace_scope,omitempty"` + Recipe *string `json:"recipe,omitempty"` + Bodies *string `json:"bodies,omitempty"` + Explain *bool `json:"explain,omitempty"` + Live *bool `json:"live,omitempty"` + Page *string `json:"page,omitempty"` +} + +// SearchOutput is a model used by Loom operations. +type SearchOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Tracker Optional[map[string]json.RawMessage] `json:"tracker,omitempty"` + Live Optional[LiveSearchResults] `json:"live,omitempty"` + Memory *map[string]json.RawMessage `json:"memory,omitempty"` + Knowledge *map[string]json.RawMessage `json:"knowledge,omitempty"` + Profile *map[string]json.RawMessage `json:"profile,omitempty"` + Conversations *map[string]json.RawMessage `json:"conversations,omitempty"` + Withheld Optional[map[string]json.RawMessage] `json:"withheld,omitempty"` + NamespacesSkipped *[]string `json:"namespaces_skipped,omitempty"` +} + +// SearchQueryInput is the request to search.query. +type SearchQueryInput = SearchInput + +// SearchQueryOutput is the response from search.query. +type SearchQueryOutput = SearchOutput + +// SearchTraceHit is a model used by Loom operations. +type SearchTraceHit struct { + MemoryKey string `json:"memory_key"` + MemoryType string `json:"memory_type"` + ContentExcerpt string `json:"content_excerpt"` + Distance float64 `json:"distance"` + Similarity float64 `json:"similarity"` + EntityBoost *float64 `json:"entity_boost,omitempty"` + RankScore float64 `json:"rank_score"` + Rank int64 `json:"rank"` + Source *string `json:"source,omitempty"` + ParentMemoryKey *string `json:"parent_memory_key,omitempty"` +} + +// SearchTraceLogInput is a model used by Loom operations. +type SearchTraceLogInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + SinceHours *int64 `json:"since_hours,omitempty"` + Agent *string `json:"agent,omitempty"` + RunID *string `json:"run_id,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// SearchTraceLogOutput is a model used by Loom operations. +type SearchTraceLogOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []SearchTraceLogRow `json:"rows"` +} + +// SearchTraceLogRow is a model used by Loom operations. +type SearchTraceLogRow struct { + Ts string `json:"ts"` + Agent string `json:"agent"` + Query string `json:"query"` + ReturnedKeys []string `json:"returned_keys"` + ReturnedScores []float64 `json:"returned_scores"` + TopK int64 `json:"top_k"` + ResultCount int64 `json:"result_count"` + Abstain bool `json:"abstain"` + RetrievalRisk string `json:"retrieval_risk"` + EmbeddingModel string `json:"embedding_model"` + LatencyMs int64 `json:"latency_ms"` + RunID string `json:"run_id"` + Operation *string `json:"operation,omitempty"` +} + +// SessionBriefDeleteInput is the request to session.brief_delete. +type SessionBriefDeleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + BriefKey string `json:"brief_key"` +} + +// SessionBriefDeleteOutput is the response from session.brief_delete. +type SessionBriefDeleteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Deleted bool `json:"deleted"` + BriefKey string `json:"brief_key"` + Revision *int64 `json:"revision,omitempty"` +} + +// SessionBriefGetInput is the request to session.brief_get. +type SessionBriefGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + BriefKey *string `json:"brief_key,omitempty"` + FromSession *string `json:"from_session,omitempty"` + Project *string `json:"project,omitempty"` + Revision *int64 `json:"revision,omitempty"` + SnapshotID *string `json:"snapshot_id,omitempty"` + IncludeSections *bool `json:"include_sections,omitempty"` + Full *bool `json:"full,omitempty"` +} + +// SessionBriefGetOutput is the response from session.brief_get. +type SessionBriefGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + BriefKey *string `json:"brief_key,omitempty"` + Revision *int64 `json:"revision,omitempty"` + SnapshotID *string `json:"snapshot_id,omitempty"` + SnapshotKey *string `json:"snapshot_key,omitempty"` + Rendered *string `json:"rendered,omitempty"` + Sections Optional[BriefSections] `json:"sections,omitempty"` + Project *string `json:"project,omitempty"` + Branch *string `json:"branch,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + Author *string `json:"author,omitempty"` + Trigger *string `json:"trigger,omitempty"` + Actor *string `json:"actor,omitempty"` + SourceSessions *[]string `json:"source_sessions,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + AgeSeconds *int64 `json:"age_seconds,omitempty"` + Revisions *int64 `json:"revisions,omitempty"` + EventsTotal *int64 `json:"events_total,omitempty"` + SourceChars *int64 `json:"source_chars,omitempty"` + BriefChars *int64 `json:"brief_chars,omitempty"` + Deleted *bool `json:"deleted,omitempty"` +} + +// SessionBriefListInput is the request to session.brief_list. +type SessionBriefListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Project *string `json:"project,omitempty"` + MineOnly *bool `json:"mine_only,omitempty"` + FromSession *string `json:"from_session,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// SessionBriefListOutput is the response from session.brief_list. +type SessionBriefListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Briefs *[]SessionBriefSummary `json:"briefs,omitempty"` + Rendered *string `json:"rendered,omitempty"` +} + +// SessionBriefSaveInput is the request to session.brief_save. +type SessionBriefSaveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + BriefKey *string `json:"brief_key,omitempty"` + Project *string `json:"project,omitempty"` + Repo *string `json:"repo,omitempty"` + Branch *string `json:"branch,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + Checkout Optional[BriefCheckout] `json:"checkout,omitempty"` + Trigger *string `json:"trigger,omitempty"` + Events *[]BriefEvent `json:"events,omitempty"` + Sections Optional[BriefSections] `json:"sections,omitempty"` + EventCursor *string `json:"event_cursor,omitempty"` + IfRevision Optional[int64] `json:"if_revision,omitempty"` + UseLLM Optional[bool] `json:"use_llm,omitempty"` +} + +// SessionBriefSaveOutput is the response from session.brief_save. +type SessionBriefSaveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + BriefKey string `json:"brief_key"` + Revision int64 `json:"revision"` + Changed bool `json:"changed"` + Author *string `json:"author,omitempty"` + Reason *string `json:"reason,omitempty"` + Rendered *string `json:"rendered,omitempty"` + Stats *SessionBriefStats `json:"stats,omitempty"` +} + +// SessionBriefStats is a model used by Loom operations. +type SessionBriefStats struct { + EventsIn *int64 `json:"events_in,omitempty"` + Windows *int64 `json:"windows,omitempty"` + EventsTotal *int64 `json:"events_total,omitempty"` + SourceChars *int64 `json:"source_chars,omitempty"` + BriefChars *int64 `json:"brief_chars,omitempty"` + CompressionRatio *float64 `json:"compression_ratio,omitempty"` + DroppedUngrounded *int64 `json:"dropped_ungrounded,omitempty"` + TokensIn *int64 `json:"tokens_in,omitempty"` + TokensOut *int64 `json:"tokens_out,omitempty"` + LLMModel *string `json:"llm_model,omitempty"` +} + +// SessionBriefSummary is a model used by Loom operations. +type SessionBriefSummary struct { + BriefKey string `json:"brief_key"` + Revision int64 `json:"revision"` + Project *string `json:"project,omitempty"` + Branch *string `json:"branch,omitempty"` + Agent *string `json:"agent,omitempty"` + Goal *string `json:"goal,omitempty"` + Status *string `json:"status,omitempty"` + Author *string `json:"author,omitempty"` + Actor *string `json:"actor,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + AgeSeconds *int64 `json:"age_seconds,omitempty"` + BriefChars *int64 `json:"brief_chars,omitempty"` +} + +// SnapshotAuditRow is a model used by Loom operations. +type SnapshotAuditRow struct { + Ts string `json:"ts"` + EventType string `json:"event_type"` + Actor string `json:"actor"` + SubjectJSON string `json:"subject_json"` +} + +// SnapshotGrantRow is a model used by Loom operations. +type SnapshotGrantRow struct { + Subject string `json:"subject"` + Role string `json:"role"` + GrantedBy string `json:"granted_by"` +} + +// SnapshotMemoryRow is a model used by Loom operations. +type SnapshotMemoryRow struct { + MemoryID string `json:"memory_id"` + Agent string `json:"agent"` + UserID string `json:"user_id"` + SessionID string `json:"session_id"` + RunID string `json:"run_id"` + MemoryKey string `json:"memory_key"` + MemoryType string `json:"memory_type"` + Value string `json:"value"` + Confidence float64 `json:"confidence"` + SourceTrace string `json:"source_trace"` + Pinned bool `json:"pinned"` + ExpiresAt Optional[string] `json:"expires_at,omitempty"` + Entities *[]string `json:"entities,omitempty"` + Version *int64 `json:"version,omitempty"` + ContentSHA256 *string `json:"content_sha256,omitempty"` + Actor *string `json:"actor,omitempty"` + SourceClass *string `json:"source_class,omitempty"` + SourceResourceID *string `json:"source_resource_id,omitempty"` + VerifiedBy *string `json:"verified_by,omitempty"` + VerifiedAt Optional[string] `json:"verified_at,omitempty"` + VerifiedSHA256 *string `json:"verified_sha256,omitempty"` + Grounding *string `json:"grounding,omitempty"` + Evidence *string `json:"evidence,omitempty"` + Tags *[]string `json:"tags,omitempty"` + ValidAt Optional[string] `json:"valid_at,omitempty"` + ValidTo Optional[string] `json:"valid_to,omitempty"` + CreatedAt Optional[string] `json:"created_at,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + ValueJSON *string `json:"value_json,omitempty"` + Status *string `json:"status,omitempty"` + RequiresReview Optional[bool] `json:"requires_review,omitempty"` + ConflictWith *[]string `json:"conflict_with,omitempty"` + DuplicateOf *string `json:"duplicate_of,omitempty"` + EvidenceCount *int64 `json:"evidence_count,omitempty"` + RecallCount *int64 `json:"recall_count,omitempty"` + LastRecalledAt Optional[string] `json:"last_recalled_at,omitempty"` + CrossPromotedFromMemoryID *string `json:"cross_promoted_from_memory_id,omitempty"` + CrossPromotedFromNamespace *string `json:"cross_promoted_from_namespace,omitempty"` + SupersededBy *string `json:"superseded_by,omitempty"` + RejectionReason *string `json:"rejection_reason,omitempty"` + TemporalAnchor Optional[string] `json:"temporal_anchor,omitempty"` + TemporalConfidence *float64 `json:"temporal_confidence,omitempty"` + InvalidAt Optional[string] `json:"invalid_at,omitempty"` + CharLimit Optional[int64] `json:"char_limit,omitempty"` + ReinforcementCount *int64 `json:"reinforcement_count,omitempty"` + LastReinforcedAt Optional[string] `json:"last_reinforced_at,omitempty"` + MentionedAt Optional[string] `json:"mentioned_at,omitempty"` + Sensitivity *string `json:"sensitivity,omitempty"` + RedactedAt Optional[string] `json:"redacted_at,omitempty"` + RedactionReason *string `json:"redaction_reason,omitempty"` + LockMode *string `json:"lock_mode,omitempty"` + LockReason *string `json:"lock_reason,omitempty"` + LockUntil Optional[string] `json:"lock_until,omitempty"` + LockedBy *string `json:"locked_by,omitempty"` + LockedAt Optional[string] `json:"locked_at,omitempty"` + OnExpire *string `json:"on_expire,omitempty"` + ExpireReason *string `json:"expire_reason,omitempty"` + Files *[]string `json:"files,omitempty"` + Concepts *[]string `json:"concepts,omitempty"` +} + +// SnapshotTypeRow is a model used by Loom operations. +type SnapshotTypeRow struct { + MemoryType string `json:"memory_type"` + RetentionDays int64 `json:"retention_days"` + DedupThreshold Optional[float64] `json:"dedup_threshold,omitempty"` + HotQuota *int64 `json:"hot_quota,omitempty"` + ConflictPolicy *string `json:"conflict_policy,omitempty"` +} + +// SourceJobs is a model used by Loom operations. +type SourceJobs struct { + SourceURI string `json:"source_uri"` + Jobs int64 `json:"jobs"` + OpenJobs int64 `json:"open_jobs"` + OpenIngestionID *string `json:"open_ingestion_id,omitempty"` + Latest IngestJob `json:"latest"` + Current IngestJob `json:"current"` + Replaced *bool `json:"replaced,omitempty"` +} + +// SourceRef is a model used by Loom operations. +type SourceRef struct { + MemoryKey string `json:"memory_key"` + Status string `json:"status"` +} + +// StackEntry is a model used by Loom operations. +type StackEntry struct { + Section string `json:"section"` + MemoryKey *string `json:"memory_key,omitempty"` + MemoryType *string `json:"memory_type,omitempty"` + Value *string `json:"value,omitempty"` + Tokens int64 `json:"tokens"` + Pinned *bool `json:"pinned,omitempty"` + RecallCount *int64 `json:"recall_count,omitempty"` + LastRecalledAt Optional[string] `json:"last_recalled_at,omitempty"` + Actor *string `json:"actor,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +// SynthesizeCalculation is a model used by Loom operations. +type SynthesizeCalculation struct { + Columns []QueryResultColumn `json:"columns"` + Rows [][]json.RawMessage `json:"rows"` + RowIds *[][]int64 `json:"row_ids,omitempty"` + Truncated *bool `json:"truncated,omitempty"` + Complete bool `json:"complete"` + Incomplete *[]string `json:"incomplete,omitempty"` + Receipt QueryReceipt `json:"receipt"` + Citation string `json:"citation"` +} + +// TaskAcceptInput is the request to task.accept. +type TaskAcceptInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Priority Optional[int64] `json:"priority,omitempty"` + Constraints Optional[string] `json:"constraints,omitempty"` + Note *string `json:"note,omitempty"` +} + +// TaskAcceptOutput is the response from task.accept. +type TaskAcceptOutput = TaskOutput + +// TaskBlockInput is the request to task.block. +type TaskBlockInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Fence int64 `json:"fence"` + Reason string `json:"reason"` + BlockedOn *string `json:"blocked_on,omitempty"` +} + +// TaskBlockOutput is the response from task.block. +type TaskBlockOutput = TaskOutput + +// TaskCancelInput is the request to task.cancel. +type TaskCancelInput = TaskReasonInput + +// TaskCancelOutput is the response from task.cancel. +type TaskCancelOutput = TaskOutput + +// TaskClaimInput is the request to task.claim. +type TaskClaimInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + LeaseSeconds Optional[int64] `json:"lease_seconds,omitempty"` +} + +// TaskClaimOutput is the response from task.claim. +type TaskClaimOutput = TaskOutput + +// TaskCompleteInput is the request to task.complete. +type TaskCompleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Fence int64 `json:"fence"` + Outcome *map[string]json.RawMessage `json:"outcome,omitempty"` + Note *string `json:"note,omitempty"` +} + +// TaskCompleteOutput is the response from task.complete. +type TaskCompleteOutput = TaskOutput + +// TaskCountsInput is the request to task.counts. +type TaskCountsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Inbox Optional[string] `json:"inbox,omitempty"` +} + +// TaskCountsOutput is the response from task.counts. +type TaskCountsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Counts []InboxCount `json:"counts"` +} + +// TaskCreateInput is the request to task.create. +type TaskCreateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Inbox string `json:"inbox"` + Kind string `json:"kind"` + Title string `json:"title"` + Brief *map[string]json.RawMessage `json:"brief,omitempty"` + Priority *int64 `json:"priority,omitempty"` + Disclosure *string `json:"disclosure,omitempty"` + NotBefore Optional[string] `json:"not_before,omitempty"` + Deadline Optional[string] `json:"deadline,omitempty"` + Origin *string `json:"origin,omitempty"` + ParentTaskID Optional[string] `json:"parent_task_id,omitempty"` + IdempotencyKey *string `json:"idempotency_key,omitempty"` + FromSubject *string `json:"from_subject,omitempty"` +} + +// TaskCreateOutput is the response from task.create. +type TaskCreateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Task TaskPayload `json:"task"` + Created bool `json:"created"` + Seq int64 `json:"seq"` + Next *string `json:"next,omitempty"` +} + +// TaskDeferInput is the request to task.defer. +type TaskDeferInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Fence int64 `json:"fence"` + Reason string `json:"reason"` + ResumeAt Optional[string] `json:"resume_at,omitempty"` +} + +// TaskDeferOutput is the response from task.defer. +type TaskDeferOutput = TaskOutput + +// TaskEventPayload is a model used by Loom operations. +type TaskEventPayload struct { + Seq int64 `json:"seq"` + TaskID string `json:"task_id"` + Inbox string `json:"inbox"` + Event string `json:"event"` + FromStatus *string `json:"from_status,omitempty"` + ToStatus *string `json:"to_status,omitempty"` + Actor *string `json:"actor,omitempty"` + Agent *string `json:"agent,omitempty"` + Fence *int64 `json:"fence,omitempty"` + Version *int64 `json:"version,omitempty"` + Reason *string `json:"reason,omitempty"` + Patch *map[string]json.RawMessage `json:"patch,omitempty"` + Note *string `json:"note,omitempty"` + Ts string `json:"ts"` +} + +// TaskFailInput is the request to task.fail. +type TaskFailInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Fence int64 `json:"fence"` + Reason string `json:"reason"` + Outcome *map[string]json.RawMessage `json:"outcome,omitempty"` +} + +// TaskFailOutput is the response from task.fail. +type TaskFailOutput = TaskOutput + +// TaskGetInput is the request to task.get. +type TaskGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` +} + +// TaskGetOutput is the response from task.get. +type TaskGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + Task Optional[TaskPayload] `json:"task,omitempty"` +} + +// TaskHeartbeatInput is the request to task.heartbeat. +type TaskHeartbeatInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Fence int64 `json:"fence"` + LeaseSeconds Optional[int64] `json:"lease_seconds,omitempty"` +} + +// TaskHeartbeatOutput is the response from task.heartbeat. +type TaskHeartbeatOutput = TaskOutput + +// TaskHistoryInput is the request to task.history. +type TaskHistoryInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Limit *int64 `json:"limit,omitempty"` +} + +// TaskHistoryOutput is the response from task.history. +type TaskHistoryOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + Events []TaskEventPayload `json:"events"` +} + +// TaskListInput is the request to task.list. +type TaskListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Inbox Optional[string] `json:"inbox,omitempty"` + PostedByMe *bool `json:"posted_by_me,omitempty"` + PostedBy Optional[string] `json:"posted_by,omitempty"` + Statuses *[]string `json:"statuses,omitempty"` + Kinds *[]string `json:"kinds,omitempty"` + Owner Optional[string] `json:"owner,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Fields *[]string `json:"fields,omitempty"` + NewestFirst *bool `json:"newest_first,omitempty"` +} + +// TaskListOutput is the response from task.list. +type TaskListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Tasks []map[string]json.RawMessage `json:"tasks"` + Truncated bool `json:"truncated"` +} + +// TaskOutput is a model used by Loom operations. +type TaskOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Task TaskPayload `json:"task"` + Seq *int64 `json:"seq,omitempty"` +} + +// TaskPayload is a model used by Loom operations. +type TaskPayload struct { + TaskID string `json:"task_id"` + Org string `json:"org"` + Inbox string `json:"inbox"` + Namespace string `json:"namespace"` + Kind string `json:"kind"` + Priority int64 `json:"priority"` + Disclosure string `json:"disclosure"` + Status string `json:"status"` + Reason *string `json:"reason,omitempty"` + BlockedOn *string `json:"blocked_on,omitempty"` + NotBefore Optional[string] `json:"not_before,omitempty"` + ResumeAt Optional[string] `json:"resume_at,omitempty"` + Deadline Optional[string] `json:"deadline,omitempty"` + DeferCount *int64 `json:"defer_count,omitempty"` + Title string `json:"title"` + Brief *map[string]json.RawMessage `json:"brief,omitempty"` + FromAgent string `json:"from_agent"` + FromSubject *string `json:"from_subject,omitempty"` + Origin *string `json:"origin,omitempty"` + ParentTaskID Optional[string] `json:"parent_task_id,omitempty"` + Owner *string `json:"owner,omitempty"` + Attempt *int64 `json:"attempt,omitempty"` + Fence *int64 `json:"fence,omitempty"` + LeaseUntil Optional[string] `json:"lease_until,omitempty"` + Outcome *map[string]json.RawMessage `json:"outcome,omitempty"` + LastActor *string `json:"last_actor,omitempty"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + Version int64 `json:"version"` +} + +// TaskProgressInput is the request to task.progress. +type TaskProgressInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Fence int64 `json:"fence"` + Note string `json:"note"` +} + +// TaskProgressOutput is the response from task.progress. +type TaskProgressOutput = TaskOutput + +// TaskPullInput is the request to task.pull. +type TaskPullInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Inbox string `json:"inbox"` + Kinds *[]string `json:"kinds,omitempty"` + Limit *int64 `json:"limit,omitempty"` + WaitSeconds *int64 `json:"wait_seconds,omitempty"` + LeaseSeconds Optional[int64] `json:"lease_seconds,omitempty"` + Status *string `json:"status,omitempty"` +} + +// TaskPullOutput is the response from task.pull. +type TaskPullOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Tasks []TaskPayload `json:"tasks"` + WaitedMs int64 `json:"waited_ms"` + Backend string `json:"backend"` + Note *string `json:"note,omitempty"` +} + +// TaskReasonInput is a model used by Loom operations. +type TaskReasonInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Reason string `json:"reason"` + Fence Optional[int64] `json:"fence,omitempty"` +} + +// TaskReassignInput is the request to task.reassign. +type TaskReassignInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + ToInbox string `json:"to_inbox"` + Reason string `json:"reason"` +} + +// TaskReassignOutput is the response from task.reassign. +type TaskReassignOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Task TaskPayload `json:"task"` + Replacement TaskPayload `json:"replacement"` +} + +// TaskReopenInput is the request to task.reopen. +type TaskReopenInput = TaskReasonInput + +// TaskReopenOutput is the response from task.reopen. +type TaskReopenOutput = TaskOutput + +// TaskResumeInput is the request to task.resume. +type TaskResumeInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Note *string `json:"note,omitempty"` +} + +// TaskResumeOutput is the response from task.resume. +type TaskResumeOutput = TaskOutput + +// TaskUnblockInput is the request to task.unblock. +type TaskUnblockInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + Note *string `json:"note,omitempty"` +} + +// TaskUnblockOutput is the response from task.unblock. +type TaskUnblockOutput = TaskOutput + +// TaskUpdateInput is the request to task.update. +type TaskUpdateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + TaskID string `json:"task_id"` + IfMatchVersion int64 `json:"if_match_version"` + Title Optional[string] `json:"title,omitempty"` + Brief Optional[map[string]json.RawMessage] `json:"brief,omitempty"` + Priority Optional[int64] `json:"priority,omitempty"` + Deadline Optional[string] `json:"deadline,omitempty"` + NotBefore Optional[string] `json:"not_before,omitempty"` + ClearDeadline *bool `json:"clear_deadline,omitempty"` + ClearNotBefore *bool `json:"clear_not_before,omitempty"` + Note *string `json:"note,omitempty"` +} + +// TaskUpdateOutput is the response from task.update. +type TaskUpdateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Task TaskPayload `json:"task"` + Seq int64 `json:"seq"` + Conflict *bool `json:"conflict,omitempty"` +} + +// TaskUpdatesInput is the request to task.updates. +type TaskUpdatesInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + SinceSeq *int64 `json:"since_seq,omitempty"` + Inbox Optional[string] `json:"inbox,omitempty"` + Limit *int64 `json:"limit,omitempty"` + WaitSeconds *int64 `json:"wait_seconds,omitempty"` + FromSubject *string `json:"from_subject,omitempty"` +} + +// TaskUpdatesOutput is the response from task.updates. +type TaskUpdatesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Events []TaskEventPayload `json:"events"` + NextSeq int64 `json:"next_seq"` + WaitedMs int64 `json:"waited_ms"` +} + +// TaskWontDoInput is the request to task.wont_do. +type TaskWontDoInput = TaskReasonInput + +// TaskWontDoOutput is the response from task.wont_do. +type TaskWontDoOutput = TaskOutput + +// TaxonomyCommunity is a model used by Loom operations. +type TaxonomyCommunity struct { + CommunityID int64 `json:"community_id"` + Label string `json:"label"` + Size int64 `json:"size"` + TopEntities *[]string `json:"top_entities,omitempty"` +} + +// TaxonomyEntry is a model used by Loom operations. +type TaxonomyEntry struct { + Value string `json:"value"` + Count int64 `json:"count"` +} + +// TrackerAnswerInput is the request to tracker.answer. +type TrackerAnswerInput struct { + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` + Question *string `json:"question,omitempty"` + Anchors *map[string]json.RawMessage `json:"anchors,omitempty"` + Limit *int64 `json:"limit,omitempty"` + ExplainOnly *bool `json:"explain_only,omitempty"` +} + +// TrackerAnswerOutput is the response from tracker.answer. +type TrackerAnswerOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Intent *string `json:"intent,omitempty"` + Anchors *map[string]json.RawMessage `json:"anchors,omitempty"` + Sections *[]map[string]json.RawMessage `json:"sections,omitempty"` + Searched *[]string `json:"searched,omitempty"` + Lines *[]string `json:"lines,omitempty"` + Restricted *bool `json:"restricted,omitempty"` + Verdict *string `json:"verdict,omitempty"` +} + +// TrackerBindingInput is the request to tracker.binding. +type TrackerBindingInput struct { + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` +} + +// TrackerBindingOutput is the response from tracker.binding. +type TrackerBindingOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + TrackerNamespace *string `json:"tracker_namespace,omitempty"` + TrackerNamespaces *[]string `json:"tracker_namespaces,omitempty"` + Restricted *bool `json:"restricted,omitempty"` + Kind *string `json:"kind,omitempty"` + Authorized *bool `json:"authorized,omitempty"` + Templates *[]string `json:"templates,omitempty"` +} + +// TrackerComponentInput is the request to tracker.component. +type TrackerComponentInput struct { + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` + Component string `json:"component"` + Limit *int64 `json:"limit,omitempty"` +} + +// TrackerComponentOutput is the response from tracker.component. +type TrackerComponentOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Component string `json:"component"` + Risk *map[string]json.RawMessage `json:"risk,omitempty"` + OpenIssues *[]map[string]json.RawMessage `json:"open_issues,omitempty"` + Known *bool `json:"known,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` +} + +// TrackerContractInput is the request to tracker.contract. +type TrackerContractInput struct { + Org string `json:"org"` + Database *string `json:"database,omitempty"` +} + +// TrackerContractOutput is the response from tracker.contract. +type TrackerContractOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Database string `json:"database"` + Tables *[]map[string]json.RawMessage `json:"tables,omitempty"` + Templates *map[string]string `json:"templates,omitempty"` +} + +// TrackerDuplicateCheckInput is the request to tracker.duplicate_check. +type TrackerDuplicateCheckInput struct { + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` + Title *string `json:"title,omitempty"` + Body *string `json:"body,omitempty"` + Frames *[]string `json:"frames,omitempty"` + Component *string `json:"component,omitempty"` + Version *string `json:"version,omitempty"` + Mentions *[]int64 `json:"mentions,omitempty"` + Paths *[]string `json:"paths,omitempty"` + Symbols *[]string `json:"symbols,omitempty"` + IssueNumber *int64 `json:"issue_number,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + AsOf *string `json:"as_of,omitempty"` + Namespaces *[]string `json:"namespaces,omitempty"` + RelatedPrs *bool `json:"related_prs,omitempty"` + Rerank *bool `json:"rerank,omitempty"` +} + +// TrackerDuplicateCheckOutput is the response from tracker.duplicate_check. +type TrackerDuplicateCheckOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Items *[]map[string]json.RawMessage `json:"items,omitempty"` + Undecided *bool `json:"undecided,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Thresholds *map[string]float64 `json:"thresholds,omitempty"` + Judge *map[string]json.RawMessage `json:"judge,omitempty"` + FitAt *string `json:"fit_at,omitempty"` + Fit *map[string]json.RawMessage `json:"fit,omitempty"` + Query *map[string]json.RawMessage `json:"query,omitempty"` + Legs *map[string]string `json:"legs,omitempty"` + LegStatus *[]TrackerLegStatus `json:"leg_status,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` + Namespaces *[]string `json:"namespaces,omitempty"` + ByNamespace *map[string]map[string]json.RawMessage `json:"by_namespace,omitempty"` + Closest *[]map[string]json.RawMessage `json:"closest,omitempty"` + Needs *[]map[string]string `json:"needs,omitempty"` + ClosestNote *string `json:"closest_note,omitempty"` + Nearest *[]map[string]json.RawMessage `json:"nearest,omitempty"` + Rerank *map[string]json.RawMessage `json:"rerank,omitempty"` + Answer *string `json:"answer,omitempty"` + RelatedPrs *[]map[string]json.RawMessage `json:"related_prs,omitempty"` +} + +// TrackerFlakyInput is the request to tracker.flaky. +type TrackerFlakyInput struct { + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` + TestName string `json:"test_name"` + Limit *int64 `json:"limit,omitempty"` + IncludeSignal *bool `json:"include_signal,omitempty"` + WindowDays *int64 `json:"window_days,omitempty"` +} + +// TrackerFlakyOutput is the response from tracker.flaky. +type TrackerFlakyOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + TestName string `json:"test_name"` + KnownFlaky *bool `json:"known_flaky,omitempty"` + OpenIssues *int64 `json:"open_issues,omitempty"` + Issues *[]map[string]json.RawMessage `json:"issues,omitempty"` + Verdict *string `json:"verdict,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` + Signal Optional[map[string]json.RawMessage] `json:"signal,omitempty"` +} + +// TrackerItemInput is the request to tracker.item. +type TrackerItemInput struct { + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` + Numbers []int64 `json:"numbers"` +} + +// TrackerItemOutput is the response from tracker.item. +type TrackerItemOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Items []map[string]json.RawMessage `json:"items"` + Unknown *[]int64 `json:"unknown,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` +} + +// TrackerLegStatus is a model used by Loom operations. +type TrackerLegStatus struct { + Name string `json:"name"` + Status *string `json:"status,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` + Retried *bool `json:"retried,omitempty"` + Ms *int64 `json:"ms,omitempty"` + Cause *string `json:"cause,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +// TrackerLinksInput is the request to tracker.links. +type TrackerLinksInput struct { + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` + IssueNumber *int64 `json:"issue_number,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + Limit *int64 `json:"limit,omitempty"` + IncludeRecord *bool `json:"include_record,omitempty"` +} + +// TrackerLinksOutput is the response from tracker.links. +type TrackerLinksOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Subject *map[string]json.RawMessage `json:"subject,omitempty"` + Verdict *string `json:"verdict,omitempty"` + Items *[]map[string]json.RawMessage `json:"items,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + Record *map[string]json.RawMessage `json:"record,omitempty"` + ComputedAt *string `json:"computed_at,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` +} + +// TrackerReleaseInput is the request to tracker.release. +type TrackerReleaseInput struct { + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` + Version string `json:"version"` +} + +// TrackerReleaseOutput is the response from tracker.release. +type TrackerReleaseOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Version string `json:"version"` + Blockers []map[string]json.RawMessage `json:"blockers"` + ActiveBlockers *int64 `json:"active_blockers,omitempty"` + Health *map[string]json.RawMessage `json:"health,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` +} + +// TrackerSimilarInput is the request to tracker.similar. +type TrackerSimilarInput struct { + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` + Text *string `json:"text,omitempty"` + IssueNumber *int64 `json:"issue_number,omitempty"` + Frames *[]string `json:"frames,omitempty"` + Kinds *[]string `json:"kinds,omitempty"` + TopK *int64 `json:"top_k,omitempty"` + Legs *[]string `json:"legs,omitempty"` +} + +// TrackerSimilarOutput is the response from tracker.similar. +type TrackerSimilarOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Items *[]map[string]json.RawMessage `json:"items,omitempty"` + Query *map[string]json.RawMessage `json:"query,omitempty"` + Legs *map[string]string `json:"legs,omitempty"` + Epistemic *string `json:"epistemic,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` + Namespaces *[]string `json:"namespaces,omitempty"` +} + +// TrackerSourceAddInput is the request to tracker.source.add. +type TrackerSourceAddInput struct { + Org string `json:"org"` + Name string `json:"name"` + Host string `json:"host"` + Port *int64 `json:"port,omitempty"` + Secure *bool `json:"secure,omitempty"` + Database string `json:"database"` + User string `json:"user"` + Password string `json:"password"` + Namespaces []TrackerSourceNamespaceSpec `json:"namespaces"` + Mapping Optional[map[string]json.RawMessage] `json:"mapping,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` +} + +// TrackerSourceAddOutput is the response from tracker.source.add. +type TrackerSourceAddOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Host string `json:"host"` + Database string `json:"database"` + Namespaces *[]map[string]json.RawMessage `json:"namespaces,omitempty"` + Contract *map[string]json.RawMessage `json:"contract,omitempty"` + Roles *[]string `json:"roles,omitempty"` + MyRole *string `json:"my_role,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + Written *bool `json:"written,omitempty"` + ViewTemplates *map[string]string `json:"view_templates,omitempty"` +} + +// TrackerSourceCheckInput is the request to tracker.source.check. +type TrackerSourceCheckInput struct { + Org string `json:"org"` + Name string `json:"name"` +} + +// TrackerSourceCheckOutput is the response from tracker.source.check. +type TrackerSourceCheckOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Database *string `json:"database,omitempty"` + Reachable *bool `json:"reachable,omitempty"` + Contract *map[string]json.RawMessage `json:"contract,omitempty"` + ViewTemplates *map[string]string `json:"view_templates,omitempty"` +} + +// TrackerSourceInspectInput is the request to tracker.source.inspect. +type TrackerSourceInspectInput struct { + Org string `json:"org"` + Name *string `json:"name,omitempty"` + Host *string `json:"host,omitempty"` + Port *int64 `json:"port,omitempty"` + Secure *bool `json:"secure,omitempty"` + Database *string `json:"database,omitempty"` + User *string `json:"user,omitempty"` + Password *string `json:"password,omitempty"` + Repos *[]string `json:"repos,omitempty"` +} + +// TrackerSourceInspectOutput is the response from tracker.source.inspect. +type TrackerSourceInspectOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Host string `json:"host"` + Database string `json:"database"` + Tables *[]map[string]json.RawMessage `json:"tables,omitempty"` + Roles *[]string `json:"roles,omitempty"` + Proposal *map[string]json.RawMessage `json:"proposal,omitempty"` +} + +// TrackerSourceListInput is the request to tracker.source.list. +type TrackerSourceListInput struct { + Org string `json:"org"` + Fresh *bool `json:"fresh,omitempty"` +} + +// TrackerSourceListOutput is the response from tracker.source.list. +type TrackerSourceListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Sources *[]map[string]json.RawMessage `json:"sources,omitempty"` + SelfService *bool `json:"self_service,omitempty"` +} + +// TrackerSourceNamespaceSpec is a model used by Loom operations. +type TrackerSourceNamespaceSpec struct { + Namespace string `json:"namespace"` + Repos *[]string `json:"repos,omitempty"` + Restricted *bool `json:"restricted,omitempty"` + JoinPolicy Optional[string] `json:"join_policy,omitempty"` +} + +// TrackerSourceRemoveInput is the request to tracker.source.remove. +type TrackerSourceRemoveInput struct { + Org string `json:"org"` + Name string `json:"name"` + Confirm string `json:"confirm"` +} + +// TrackerSourceRemoveOutput is the response from tracker.source.remove. +type TrackerSourceRemoveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Deactivated *bool `json:"deactivated,omitempty"` + NamespacesRetired *[]string `json:"namespaces_retired,omitempty"` +} + +// TrackerSourceRotateInput is the request to tracker.source.rotate. +type TrackerSourceRotateInput struct { + Org string `json:"org"` + Name string `json:"name"` + User string `json:"user"` + Password string `json:"password"` +} + +// TrackerSourceRotateOutput is the response from tracker.source.rotate. +type TrackerSourceRotateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Contract *map[string]json.RawMessage `json:"contract,omitempty"` + RotatedAt *string `json:"rotated_at,omitempty"` +} + +// TrackerSourceSetMappingInput is the request to tracker.source.set_mapping. +type TrackerSourceSetMappingInput struct { + Org string `json:"org"` + Name string `json:"name"` + Mapping Optional[map[string]json.RawMessage] `json:"mapping,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` +} + +// TrackerSourceSetMappingOutput is the response from tracker.source.set_mapping. +type TrackerSourceSetMappingOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Name string `json:"name"` + Contract *map[string]json.RawMessage `json:"contract,omitempty"` + DryRun *bool `json:"dry_run,omitempty"` + Written *bool `json:"written,omitempty"` +} + +// TrackerTestSignalInput is the request to tracker.test_signal. +type TrackerTestSignalInput struct { + Org *string `json:"org,omitempty"` + Namespace string `json:"namespace"` + TestName string `json:"test_name"` + WindowDays *int64 `json:"window_days,omitempty"` + CodeNamespace *string `json:"code_namespace,omitempty"` + IncludeChurn *bool `json:"include_churn,omitempty"` + PrNumber *int64 `json:"pr_number,omitempty"` + IncludeSmells *bool `json:"include_smells,omitempty"` +} + +// TrackerTestSignalOutput is the response from tracker.test_signal. +type TrackerTestSignalOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + TestName string `json:"test_name"` + Verdict *string `json:"verdict,omitempty"` + Why *[]string `json:"why,omitempty"` + LowerBound *float64 `json:"lower_bound,omitempty"` + WindowDays *int64 `json:"window_days,omitempty"` + Since *string `json:"since,omitempty"` + Features *map[string]json.RawMessage `json:"features,omitempty"` + Infra *map[string]json.RawMessage `json:"infra,omitempty"` + Churn *map[string]json.RawMessage `json:"churn,omitempty"` + Thresholds *map[string]json.RawMessage `json:"thresholds,omitempty"` + Source *string `json:"source,omitempty"` + TimingsMs *map[string]int64 `json:"timings_ms,omitempty"` + TrackerUnavailable *bool `json:"tracker_unavailable,omitempty"` + Rollup *map[string]json.RawMessage `json:"rollup,omitempty"` + Streak *map[string]json.RawMessage `json:"streak,omitempty"` + Smells *map[string]json.RawMessage `json:"smells,omitempty"` + Prior *map[string]json.RawMessage `json:"prior,omitempty"` + UnavailableReason *string `json:"unavailable_reason,omitempty"` + Candidates *[]map[string]json.RawMessage `json:"candidates,omitempty"` + CandidateMatches *int64 `json:"candidate_matches,omitempty"` + ResolvedFrom *string `json:"resolved_from,omitempty"` +} + +// TraversalNode is a model used by Loom operations. +type TraversalNode struct { + Entity string `json:"entity"` + Hop int64 `json:"hop"` + CumulativeWeight float64 `json:"cumulative_weight"` + ViaCoOccur int64 `json:"via_co_occur"` + Hub *bool `json:"hub,omitempty"` + Degree *int64 `json:"degree,omitempty"` + ViaRelation *string `json:"via_relation,omitempty"` + ViaDirection *string `json:"via_direction,omitempty"` + ViaProvenance *string `json:"via_provenance,omitempty"` + ValidFrom *string `json:"valid_from,omitempty"` + ValidTo *string `json:"valid_to,omitempty"` + CommunityID Optional[int64] `json:"community_id,omitempty"` + Path *[]string `json:"path,omitempty"` +} + +// TuneApply is a model used by Loom operations. +type TuneApply struct { + Op string `json:"op"` + Via *string `json:"via,omitempty"` + Args map[string]json.RawMessage `json:"args"` + ArgsComplete *bool `json:"args_complete,omitempty"` + RequiredRole string `json:"required_role"` + Guard string `json:"guard"` +} + +// TuneEvidence is a model used by Loom operations. +type TuneEvidence struct { + FindingCodes *[]string `json:"finding_codes,omitempty"` + SupportingCount *int64 `json:"supporting_count,omitempty"` + Supporting *[]FindingEvidence `json:"supporting,omitempty"` + CounterCount Optional[int64] `json:"counter_count,omitempty"` + Documents *[]string `json:"documents,omitempty"` +} + +// TuneProposal is a model used by Loom operations. +type TuneProposal struct { + ID string `json:"id"` + Target string `json:"target"` + Scope string `json:"scope"` + Title string `json:"title"` + Rationale string `json:"rationale"` + Current string `json:"current"` + CurrentRevision Optional[int64] `json:"current_revision,omitempty"` + Proposed string `json:"proposed"` + Evidence TuneEvidence `json:"evidence"` + AffectedAgents *[]string `json:"affected_agents,omitempty"` + AffectedAgentsTotal Optional[int64] `json:"affected_agents_total,omitempty"` + Effect *string `json:"effect,omitempty"` + Historical string `json:"historical"` + Apply TuneApply `json:"apply"` + ApplyAlso *[]TuneApply `json:"apply_also,omitempty"` + Preview Optional[ChunkingPreview] `json:"preview,omitempty"` + Limits *string `json:"limits,omitempty"` + Refs *[]string `json:"refs,omitempty"` +} + +// TurnUsage is a model used by Loom operations. +type TurnUsage struct { + MessageID string `json:"message_id"` + Model string `json:"model"` + InputTokens *int64 `json:"input_tokens,omitempty"` + CacheReadTokens *int64 `json:"cache_read_tokens,omitempty"` + CacheCreation5MTokens *int64 `json:"cache_creation_5m_tokens,omitempty"` + CacheCreation1HTokens *int64 `json:"cache_creation_1h_tokens,omitempty"` + OutputTokens *int64 `json:"output_tokens,omitempty"` + TurnAt *string `json:"turn_at,omitempty"` +} + +// UIVitalsInput is the request to ui.vitals. +type UIVitalsInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + Route string `json:"route"` + LcpMs Optional[int64] `json:"lcp_ms,omitempty"` + LongTaskMs *int64 `json:"long_task_ms,omitempty"` + InpMs Optional[int64] `json:"inp_ms,omitempty"` + DomNodes *int64 `json:"dom_nodes,omitempty"` + APICalls *int64 `json:"api_calls,omitempty"` + APIMs *int64 `json:"api_ms,omitempty"` + Build *string `json:"build,omitempty"` + Cold *bool `json:"cold,omitempty"` +} + +// UIVitalsOutput is the response from ui.vitals. +type UIVitalsOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Recorded *bool `json:"recorded,omitempty"` + Route *string `json:"route,omitempty"` +} + +// UsageRung is a model used by Loom operations. +type UsageRung struct { + Rung string `json:"rung"` + Count Optional[int64] `json:"count,omitempty"` + Source string `json:"source"` + Meaning string `json:"meaning"` +} + +// UserNamespaceGrant is a model used by Loom operations. +type UserNamespaceGrant struct { + Namespace string `json:"namespace"` + Role string `json:"role"` + IsOwner bool `json:"is_owner"` + GrantedAt Optional[string] `json:"granted_at,omitempty"` + PendingRole Optional[string] `json:"pending_role,omitempty"` +} + +// UserSummary is a model used by Loom operations. +type UserSummary struct { + Subject string `json:"subject"` + ContactEmail string `json:"contact_email"` + Grants []UserNamespaceGrant `json:"grants"` + IsPlatformAdmin bool `json:"is_platform_admin"` + LastActive Optional[string] `json:"last_active,omitempty"` + HasPasswordAuth *bool `json:"has_password_auth,omitempty"` +} + +// WebhookDeliveriesInput is the request to webhook.deliveries. +type WebhookDeliveriesInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + WebhookID *string `json:"webhook_id,omitempty"` + Status Optional[string] `json:"status,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// WebhookDeliveriesOutput is the response from webhook.deliveries. +type WebhookDeliveriesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Deliveries *[]WebhookDelivery `json:"deliveries,omitempty"` +} + +// WebhookDelivery is a model used by Loom operations. +type WebhookDelivery struct { + EventID string `json:"event_id"` + WebhookID string `json:"webhook_id"` + EventType string `json:"event_type"` + MemoryKey string `json:"memory_key"` + MemoryID string `json:"memory_id"` + Version int64 `json:"version"` + OccurredAt string `json:"occurred_at"` + Status string `json:"status"` + Attempts int64 `json:"attempts"` + NextAttemptAt string `json:"next_attempt_at"` + LastStatus int64 `json:"last_status"` + LastError string `json:"last_error"` +} + +// WebhookInfo is a model used by Loom operations. +type WebhookInfo struct { + WebhookID string `json:"webhook_id"` + URL string `json:"url"` + SecretRef string `json:"secret_ref"` + Events []string `json:"events"` + CreatedAt string `json:"created_at"` + SecretPresent *bool `json:"secret_present,omitempty"` +} + +// WebhookListInput is the request to webhook.list. +type WebhookListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// WebhookListOutput is the response from webhook.list. +type WebhookListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Webhooks *[]WebhookInfo `json:"webhooks,omitempty"` +} + +// WebhookRegisterInput is the request to webhook.register. +type WebhookRegisterInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + URL string `json:"url"` + SecretRef string `json:"secret_ref"` + Events *[]string `json:"events,omitempty"` +} + +// WebhookRegisterOutput is the response from webhook.register. +type WebhookRegisterOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Webhook WebhookInfo `json:"webhook"` +} + +// WebhookRemoveInput is the request to webhook.remove. +type WebhookRemoveInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + WebhookID string `json:"webhook_id"` +} + +// WebhookRemoveOutput is the response from webhook.remove. +type WebhookRemoveOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Removed bool `json:"removed"` +} + +// WorkingMemoryAppendInput is the request to working_memory.append. +type WorkingMemoryAppendInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + BlockKey *string `json:"block_key,omitempty"` + Addition string `json:"addition"` + Separator *string `json:"separator,omitempty"` +} + +// WorkingMemoryAppendOutput is the response from working_memory.append. +type WorkingMemoryAppendOutput = WorkingMemoryMutationOutput + +// WorkingMemoryBlock is a model used by Loom operations. +type WorkingMemoryBlock struct { + BlockKey string `json:"block_key"` + Content string `json:"content"` + CharLimit int64 `json:"char_limit"` + Version int64 `json:"version"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` +} + +// WorkingMemoryDeleteInput is the request to working_memory.delete. +type WorkingMemoryDeleteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + BlockKey *string `json:"block_key,omitempty"` +} + +// WorkingMemoryDeleteOutput is the response from working_memory.delete. +type WorkingMemoryDeleteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Deleted bool `json:"deleted"` + BlockKey string `json:"block_key"` +} + +// WorkingMemoryGetInput is the request to working_memory.get. +type WorkingMemoryGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + BlockKey *string `json:"block_key,omitempty"` +} + +// WorkingMemoryGetOutput is the response from working_memory.get. +type WorkingMemoryGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + BlockKey string `json:"block_key"` + Content *string `json:"content,omitempty"` + CharLimit *int64 `json:"char_limit,omitempty"` + Version *int64 `json:"version,omitempty"` + UpdatedAt Optional[string] `json:"updated_at,omitempty"` + FillRatio *float64 `json:"fill_ratio,omitempty"` +} + +// WorkingMemoryMutationOutput is a model used by Loom operations. +type WorkingMemoryMutationOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + BlockKey string `json:"block_key"` + Version int64 `json:"version"` + CharLimit int64 `json:"char_limit"` + ValueLength int64 `json:"value_length"` + FillRatio *float64 `json:"fill_ratio,omitempty"` +} + +// WorkingMemoryRenderInput is the request to working_memory.render. +type WorkingMemoryRenderInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + BlockKeys *[]string `json:"block_keys,omitempty"` + Format *string `json:"format,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// WorkingMemoryRenderOutput is the response from working_memory.render. +type WorkingMemoryRenderOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rendered string `json:"rendered"` + Blocks *[]WorkingMemoryBlock `json:"blocks,omitempty"` + BlockCount int64 `json:"block_count"` + TotalChars int64 `json:"total_chars"` +} + +// WorkingMemoryReplaceInput is the request to working_memory.replace. +type WorkingMemoryReplaceInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + BlockKey *string `json:"block_key,omitempty"` + Old string `json:"old"` + New *string `json:"new,omitempty"` +} + +// WorkingMemoryReplaceOutput is the response from working_memory.replace. +type WorkingMemoryReplaceOutput = WorkingMemoryMutationOutput + +// WorkingMemorySetInput is the request to working_memory.set. +type WorkingMemorySetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + BlockKey *string `json:"block_key,omitempty"` + Content *string `json:"content,omitempty"` + CharLimit *int64 `json:"char_limit,omitempty"` +} + +// WorkingMemorySetOutput is the response from working_memory.set. +type WorkingMemorySetOutput = WorkingMemoryMutationOutput diff --git a/sdk/go/wire/models_test.go b/sdk/go/wire/models_test.go new file mode 100644 index 00000000000..b907b7b213c --- /dev/null +++ b/sdk/go/wire/models_test.go @@ -0,0 +1,159 @@ +package wire_test + +import ( + "encoding/json" + "testing" + + "github.com/ClickHouse/loom/sdk/go/wire" +) + +func TestMemorySetRequestJSON(t *testing.T) { + off := false + tags := []string{} + relations := [][3]string{{"job", "uses", "queue"}} + input := wire.MemorySetInput{ + Org: "org", + Namespace: "ns", + Agent: "agent", + MemoryKey: "key", + Value: json.RawMessage(`{"sequence":9007199254740993}`), + Tags: &tags, + Relations: &relations, + Pinned: &off, + } + fields := jsonFields(t, input) + for key, want := range map[string]string{ + "memory_key": `"key"`, + "value": `{"sequence":9007199254740993}`, + "tags": `[]`, + "relations": `[["job","uses","queue"]]`, + "pinned": `false`, + } { + if got := string(fields[key]); got != want { + t.Errorf("field %s = %q, want %s", key, got, want) + } + } + if _, ok := fields["ttl_seconds"]; ok { + t.Fatal("unset ttl_seconds was sent") + } +} + +func TestMemorySetDistinguishesNullAndZeroTTL(t *testing.T) { + input := wire.MemorySetInput{TTLSeconds: wire.Null[int64]()} + if got := string(jsonFields(t, input)["ttl_seconds"]); got != "null" { + t.Fatalf("explicit null sent %q, want null", got) + } + input.TTLSeconds = wire.Some(int64(0)) + if got := string(jsonFields(t, input)["ttl_seconds"]); got != "0" { + t.Fatalf("zero inner value sent %q, want 0", got) + } +} + +func TestNamespaceRegisterKeepsCoverageSweepOnJSONRoundTrip(t *testing.T) { + for _, tc := range []struct{ name, member, want string }{ + {"omitted", "", ""}, + {"inherit", `,"coverage_sweep":null`, "null"}, + {"disabled", `,"coverage_sweep":false`, "false"}, + {"enabled", `,"coverage_sweep":true`, "true"}, + } { + t.Run(tc.name, func(t *testing.T) { + body := `{"org":"org","namespace":"ns","owner_email":"owner"` + tc.member + `}` + var request wire.NamespaceRegisterInput + if err := json.Unmarshal([]byte(body), &request); err != nil { + t.Fatal(err) + } + if got := string(jsonFields(t, request)["coverage_sweep"]); got != tc.want { + t.Fatalf("round-trip coverage_sweep = %q, want %q", got, tc.want) + } + }) + } +} + +func TestDecodeProjectedMemoryGet(t *testing.T) { + // The projection keeps found/unchanged and the requested version and value. + const body = `{"found":true,"unchanged":false,"version":9007199254740993,"value":[null,1]}` + var out wire.MemoryGetOutput + if err := json.Unmarshal([]byte(body), &out); err != nil { + t.Fatal(err) + } + if out.Found == nil || !*out.Found || out.MemoryID != nil { + t.Fatalf("projected fields decoded incorrectly: found=%v, memory_id=%v", out.Found, out.MemoryID) + } + if version, ok := out.Version.Get(); !ok || version != 9007199254740993 { + t.Fatal("projected version was lost or rounded") + } + if got := string(out.Value); got != "[null,1]" { + t.Errorf("value = %q, want [null,1]", got) + } +} + +func TestDecodeProjectedMemoryGetDistinguishesNullAndOmitted(t *testing.T) { + var out wire.MemoryGetOutput + if err := json.Unmarshal([]byte(`{"found":true,"expires_at":null}`), &out); err != nil { + t.Fatal(err) + } + if !out.ExpiresAt.IsNull() || out.ValidTo.IsNull() { + t.Fatal("explicit null and omitted date are indistinguishable") + } + if _, ok := out.ExpiresAt.Get(); ok { + t.Fatal("null expiry has a concrete value") + } + fields := jsonFields(t, out) + if string(fields["expires_at"]) != "null" || fields["valid_to"] != nil { + t.Fatalf("projection changed on encode: %v", fields) + } +} + +func TestOptionalRejectsInvalidValues(t *testing.T) { + field := wire.Some(true) + if err := json.Unmarshal([]byte(`"true"`), &field); err == nil { + t.Fatal("accepted a JSON string as a bool") + } + if value, ok := field.Get(); !ok || !value { + t.Fatal("failed decode discarded the prior value") + } + if _, err := json.Marshal(append(field, field...)); err == nil { + t.Fatal("accepted an optional field containing multiple values") + } + var unset wire.Optional[bool] + if got, err := json.Marshal(unset); err != nil || string(got) != "null" { + t.Fatalf("standalone unset optional = %s, error = %v; want null", got, err) + } +} + +func TestDecodeHTTPResponseFeedback(t *testing.T) { + const body = `{"found":false,"ignored_args":["memory_keey"],"did_you_mean":{"memory_keey":"memory_key"},"mirrored":true}` + var out wire.MemoryGetOutput + if err := json.Unmarshal([]byte(body), &out); err != nil { + t.Fatal(err) + } + if out.IgnoredArgs == nil || len(*out.IgnoredArgs) != 1 || (*out.IgnoredArgs)[0] != "memory_keey" { + t.Fatalf("missing ignored argument: %v", out.IgnoredArgs) + } + if out.DidYouMean == nil || (*out.DidYouMean)["memory_keey"] != "memory_key" { + t.Fatalf("missing spelling suggestion: %v", out.DidYouMean) + } + if out.Mirrored == nil || !*out.Mirrored { + t.Fatal("missing mirror flag") + } +} + +func TestRequiredZeroIsEncoded(t *testing.T) { + out := wire.MemoryUpdateByIDOutput{} + if got := string(jsonFields(t, out)["updated"]); got != "false" { + t.Fatalf("required updated field = %q, want false", got) + } +} + +func jsonFields(t *testing.T, value any) map[string]json.RawMessage { + t.Helper() + body, err := json.Marshal(value) + if err != nil { + t.Fatal(err) + } + var fields map[string]json.RawMessage + if err := json.Unmarshal(body, &fields); err != nil { + t.Fatal(err) + } + return fields +} diff --git a/sdk/go/wire/optional.go b/sdk/go/wire/optional.go new file mode 100644 index 00000000000..4408aaa3c68 --- /dev/null +++ b/sdk/go/wire/optional.go @@ -0,0 +1,50 @@ +package wire + +import ( + "encoding/json" + "errors" +) + +// Optional distinguishes an absent JSON field, null, and a value. +// Use the zero value, Null, or Some to construct it. Its slice representation +// lets encoding/json omit the zero value with omitempty on Go 1.22. +type Optional[T any] []*T + +// Null returns an explicitly null value. +func Null[T any]() Optional[T] { return Optional[T]{nil} } + +// Some returns a present value, including a scalar zero value. +func Some[T any](value T) Optional[T] { return Optional[T]{&value} } + +// Get returns the value and true when it is present and non-null. +func (o Optional[T]) Get() (value T, ok bool) { + if len(o) == 1 && o[0] != nil { + return *o[0], true + } + return value, false +} + +// IsNull reports whether the field explicitly contains null. +func (o Optional[T]) IsNull() bool { return len(o) == 1 && o[0] == nil } + +// MarshalJSON encodes the value. A struct field tagged omitempty skips an unset value. +func (o Optional[T]) MarshalJSON() ([]byte, error) { + switch len(o) { + case 0: + return []byte("null"), nil + case 1: + return json.Marshal(o[0]) + default: + return nil, errors.New("wire.Optional must contain at most one value") + } +} + +// UnmarshalJSON records presence even when the field contains null. +func (o *Optional[T]) UnmarshalJSON(data []byte) error { + var value *T + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *o = Optional[T]{value} + return nil +} diff --git a/tests/unit/test_sdk_go_codegen.py b/tests/unit/test_sdk_go_codegen.py new file mode 100644 index 00000000000..6524b0725d9 --- /dev/null +++ b/tests/unit/test_sdk_go_codegen.py @@ -0,0 +1,118 @@ +import re +from pathlib import Path + +import pytest +from pydantic import BaseModel, ConfigDict, Field, field_serializer +from pydantic.json_schema import models_json_schema + +from scripts.codegen import sdk_go_gen +from scripts.codegen.common import GeneratedFile +from scripts.codegen.sdk_go_gen import WireSchema, build_source, build_sources +from server.memory.api.models_crud import MemoryGetOutput +from server.operations.registry import OPERATIONS_BY_NAME +from server.tracker.api.models import TrackerSimilarInput +from server.transport.arg_check import response_body + + +class _NestedOutput(BaseModel): + model_config = ConfigDict(serialize_by_alias=True) + + amount: int = Field(serialization_alias="wire_amount") + + @field_serializer("amount", when_used="json") + def _amount_text(self, value: int) -> str: + return str(value) + + +class _DirectionalModel(BaseModel): + value: int = Field(validation_alias="accepted", serialization_alias="unused") + nested: _NestedOutput + + +def test_schema_follows_http_input_and_output_aliases() -> None: + roots, schema = models_json_schema( + [(_DirectionalModel, "validation"), (_DirectionalModel, "serialization")], + schema_generator=WireSchema, + ) + model = _DirectionalModel.model_validate({"accepted": 1, "nested": {"amount": 2}}) + defs = schema["$defs"] + request = defs[roots[_DirectionalModel, "validation"]["$ref"].split("/")[-1]] + response = defs[roots[_DirectionalModel, "serialization"]["$ref"].split("/")[-1]] + nested = defs[response["properties"]["nested"]["$ref"].split("/")[-1]] + + assert request["required"] == ["accepted", "nested"] + dumped = model.model_dump(mode="json") + assert response["properties"].keys() == dumped.keys() + assert nested["properties"].keys() == dumped["nested"].keys() + assert nested["properties"]["wire_amount"]["type"] == "string" + + +def test_projected_output_keeps_declared_fields_that_may_be_absent() -> None: + roots, schema = models_json_schema( + [(MemoryGetOutput, "serialization")], schema_generator=WireSchema + ) + name = roots[MemoryGetOutput, "serialization"]["$ref"].split("/")[-1] + output = schema["$defs"][name] + + assert output["properties"]["found"]["type"] == "boolean" + assert "memory_id" in output["properties"] + assert "memory_id" not in output.get("required", []) + + +def test_generated_response_retains_http_argument_feedback() -> None: + body = response_body( + OPERATIONS_BY_NAME["memory.get"], + {"memory_keey": "key"}, + MemoryGetOutput(found=False), + ) + assert body["ignored_args"] == ["memory_keey"] + assert body["did_you_mean"] == {"memory_keey": "memory_key"} + + generated = build_source() + output = generated.split("type MemoryGetOutput struct {", 1)[1].split("\n}", 1)[0] + for key in ("ignored_args", "did_you_mean"): + assert f'json:"{key},omitempty"' in output + row = generated.split("type MemoryBulkGetOutput struct {", 1)[1].split("\n}", 1)[0] + nested = re.search(r'map\[string\](\w+) `json:"results', row) + assert nested is not None, row + row_fields = generated.split(f"type {nested[1]} struct {{", 1)[1].split("\n}", 1)[0] + assert 'json:"did_you_mean' not in row_fields + + +def test_static_factory_default_change_changes_generated_bytes(monkeypatch) -> None: + before = build_source() + field = TrackerSimilarInput.model_fields["kinds"] + request = {"org": "org", "namespace": "ns", "text": "a report"} + assert TrackerSimilarInput.model_validate(request).kinds == ["issue", "pr"] + try: + with monkeypatch.context() as patch: + patch.setattr(field, "default_factory", lambda: ["issue"]) + TrackerSimilarInput.model_rebuild(force=True) + assert TrackerSimilarInput.model_validate(request).kinds == ["issue"] + after = build_source() + finally: + TrackerSimilarInput.model_rebuild(force=True) + assert before != after + + +def test_generated_client_binds_each_registered_operation_once() -> None: + _, client = build_sources() + routes = re.findall(r'callOperation\[\w+\]\(s\.client, ctx, "([^"]+)", in\)', client) + assert sorted(routes) == sorted(OPERATIONS_BY_NAME) + + +def test_check_reports_stale_client_without_rewriting( + monkeypatch: pytest.MonkeyPatch, tmp_path: Path +) -> None: + wire = tmp_path / "models.gen.go" + client = tmp_path / "client.gen.go" + monkeypatch.setattr(sdk_go_gen, "TARGET", GeneratedFile(wire, sdk_go_gen.COMMAND)) + monkeypatch.setattr(sdk_go_gen, "CLIENT_TARGET", GeneratedFile(client, sdk_go_gen.COMMAND)) + monkeypatch.setattr(sdk_go_gen, "_format", lambda source: source) + assert sdk_go_gen.main([]) == 0 + wire_bytes = wire.read_bytes() + stale_client = client.read_bytes() + b"// stale\n" + client.write_bytes(stale_client) + assert sdk_go_gen.main(["--check"]) == 1 + assert wire.read_bytes() == wire_bytes + assert client.read_bytes() == stale_client