HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.
Python agent-apiagent-frameworkagent-harnessai-agentsai-infrastructurecoding-agentconformance-testingdeepseek-harnessharness-engineeringhermesllmopen-protocolopen-sourceopen-standardpi-coding-agentself-hosteduhpunified-apiunified-harness-protocolunified-interface
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://unifiedharnessprotocol.org/schema/uhp-2026-10-19.schema.json",
"title": "Unified Harness Protocol",
"description": "Object definitions for UHP 2026-10-19. Generated from uhp-2026-10-19.openapi.yaml by build.py — do not edit by hand.",
"$defs": {
"Discovery": {
"type": "object",
"required": [
"object",
"protocol",
"versions",
"default_version",
"conformance_class",
"capabilities"
],
"properties": {
"object": {
"type": "string",
"const": "uhp.discovery"
},
"protocol": {
"type": "string",
"const": "uhp"
},
"versions": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
},
"default_version": {
"type": "string"
},
"conformance_class": {
"type": "string",
"enum": [
"core",
"extended",
"full"
]
},
"capabilities": {
"$ref": "#/$defs/Capabilities"
},
"plugin_schemas": {
"type": "array",
"items": {
"type": "string",
"format": "uri"
},
"description": "The Agent Plugins manifest schema identifiers this server installs. Present and non-empty\nwhen `capabilities.plugins` is true.\n",
"examples": [
[
"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"
]
]
},
"implementation": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
}
},
"additionalProperties": true
}
},
"additionalProperties": true
},
"Capabilities": {
"type": "object",
"description": "Named booleans. A server reports `false` for a capability it does not implement rather than\nomitting it, so a client can distinguish \"not supported\" from \"server predates this field\".\nA client treats an absent key as `false`.\n",
"properties": {
"streaming": {
"type": "boolean"
},
"sessions": {
"type": "boolean"
},
"cancellation": {
"type": "boolean"
},
"files_input": {
"type": "boolean"
},
"files_output": {
"type": "boolean"
},
"session_listing": {
"type": "boolean"
},
"harness_management": {
"type": "boolean"
},
"harness_retirement": {
"type": "boolean",
"description": "Retiring a harness retires its sessions and responses with it, restorable until a time\nthe delete response states (`restorableUntil`) and removed after it. `false`, or absent:\nthey are kept. See Harnesses §5.3.\n"
},
"session_sharing": {
"type": "boolean"
},
"idempotency": {
"type": "boolean"
},
"plugins": {
"type": "boolean",
"description": "The server installs Agent Plugins packages into harnesses, serves their files, and exports\na harness as a package. Optional at every class.\n"
},
"environments": {
"type": "boolean",
"description": "The server holds environments: a project's files and installed dependencies, built once,\nread-only at a fixed path in every session that names one. Optional at every class.\n"
},
"memories": {
"type": "boolean",
"description": "The server holds memories: a tree of memories with access granted per node, records kept\nby a connected provider, and tools a harness's agent reaches them with. Optional at every class.\n"
},
"input_history": {
"type": "boolean",
"description": "A request that starts a session may carry earlier turns: `user` and `assistant` messages\nbefore the last `user` message, given to the harness as the conversation so far and kept as\nthe session's first turns, marked `imported` in its turns. See Tasks §2.1. Optional at every class.\n"
}
},
"additionalProperties": {
"type": "boolean"
}
},
"Harness": {
"type": "object",
"required": [
"id",
"name",
"base"
],
"properties": {
"id": {
"type": "string",
"pattern": "^chrn_"
},
"object": {
"type": "string",
"const": "harness"
},
"name": {
"type": "string"
},
"base": {
"type": "string",
"description": "Opaque. Not enumerated by this specification — a client must treat it as a string, or the\nprotocol would need revising every time a harness is released.\n",
"examples": [
"codex",
"claude-code",
"hermes"
]
},
"baseLabel": {
"type": "string"
},
"defaultModel": {
"type": "string"
},
"systemPrompt": {
"type": "string"
},
"mcpServers": {
"type": "array",
"items": {
"$ref": "#/$defs/McpServer"
}
},
"skills": {
"type": "array",
"items": {
"$ref": "#/$defs/Skill"
}
},
"plugins": {
"type": "array",
"items": {
"$ref": "#/$defs/Plugin"
},
"description": "Installed plugins. Their servers and skills join the harness's own for every turn;\n`mcpServers` and `skills` above report only what was written to them directly.\n"
},
"environment": {
"type": "string",
"description": "The environment (`henv_`) this harness's tasks read, mounted read-only at its `mount`;\nempty when none. A task may name another with its own `environment` field.\n"
},
"disabledTools": {
"type": "array",
"items": {
"type": "string"
}
},
"maxStep": {
"type": [
"integer",
"null"
]
},
"timeoutSeconds": {
"type": [
"integer",
"null"
]
},
"createdAt": {
"type": "integer",
"description": "Unix milliseconds"
}
},
"additionalProperties": true
},
"McpServer": {
"type": "object",
"required": [
"name",
"url"
],
"description": "A remote MCP server attached to a harness. Only enabled entries are connected for a turn; a\ndisabled entry must not be contacted at all. An unreachable server must not fail the task.\nUnchanged from 2026-08-11: a process (stdio) server is declared inside a plugin, see\nPluginMcpServer.\n",
"properties": {
"name": {
"type": "string",
"description": "Sanitised to a CLI-safe identifier by the server."
},
"url": {
"type": "string",
"format": "uri"
},
"transport": {
"type": "string",
"enum": [
"http",
"sse"
],
"default": "http"
},
"enabled": {
"type": "boolean",
"default": true
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"auth": {
"type": "string",
"description": "Bearer token, or a server-side reference the server resolves. A server must never return\na resolved credential to a client.\n"
}
},
"additionalProperties": true
},
"PluginMcpServer": {
"type": "object",
"required": [
"name"
],
"description": "An MCP server a plugin's mcp.json declares, derived by the server. The harness MCP server\nobject plus the `stdio` transport: `url` is required for `http` and `sse`, `command` for\n`stdio`. Placeholders are reported unexpanded; `enabled` is always true, the plugin's own\n`enabled` governs.\n",
"properties": {
"name": {
"type": "string"
},
"transport": {
"type": "string",
"enum": [
"http",
"sse",
"stdio"
],
"default": "http",
"description": "`http` is Streamable HTTP (`streamable-http` in mcp.json); `sse` the older HTTP+SSE\ntransport; `stdio` a process the server launches inside the agent's sandbox.\n"
},
"url": {
"type": "string",
"format": "uri",
"description": "Endpoint (`http` and `sse`)."
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Fixed request headers (`http` and `sse`). Never subject to placeholder expansion."
},
"command": {
"type": "string",
"description": "One executable token (`stdio`): a bare name resolved on the sandbox's search path, or a\nplugin-relative path beginning with `./`. Never a shell string, never expanded.\n"
},
"args": {
"type": "array",
"items": {
"type": "string"
},
"description": "Arguments (`stdio`). `${PLUGIN_ROOT}` and `${PLUGIN_DATA}` expand at run time."
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Environment overlay (`stdio`). Must not name PLUGIN_ROOT or PLUGIN_DATA; the server sets\nthose. Values expand at run time.\n"
},
"cwd": {
"type": "string",
"description": "Working directory (`stdio`). Defaults to the plugin root; must stay within the plugin\nroot or PLUGIN_DATA.\n"
},
"enabled": {
"type": "boolean",
"default": true
}
},
"allOf": [
{
"if": {
"properties": {
"transport": {
"const": "stdio"
}
},
"required": [
"transport"
]
},
"then": {
"required": [
"command"
]
},
"else": {
"required": [
"url"
]
}
}
],
"additionalProperties": true
},
"Skill": {
"type": "object",
"required": [
"name"
],
"description": "A skill is a FOLDER, not a file. A server must materialise the whole folder where the agent\ncan read it — materialising only SKILL.md breaks every skill carrying references, scripts or\ndata. Round-tripping a harness through GET and PUT must not lose skill contents.\n",
"properties": {
"name": {
"type": "string"
},
"enabled": {
"type": "boolean",
"default": true,
"description": "false suppresses the skill, including one inherited from the base."
},
"files": {
"type": "array",
"items": {
"$ref": "#/$defs/SkillFile"
},
"description": "The bundle. Must contain a SKILL.md."
},
"content": {
"type": "string",
"description": "Shorthand for a single-file bundle whose only member is SKILL.md."
},
"blob": {
"type": "string",
"description": "Server-assigned handle for a bundle stored out of line. A client receives it, passes it\nback unchanged, and reads the files from the skill files endpoint.\n"
}
},
"additionalProperties": true
},
"SkillFile": {
"type": "object",
"required": [
"path"
],
"description": "One file of a skill folder or of a plugin package.",
"properties": {
"path": {
"type": "string",
"description": "Relative to the skill's own folder, or to the plugin root; nested directories are\nsupported. A server must reject a path that escapes the folder.\n",
"examples": [
"SKILL.md",
"references/codes.md",
"assets/logo.png"
]
},
"content": {
"type": "string",
"description": "Text content."
},
"content_b64": {
"type": "string",
"description": "Base64 for binary content; preserved byte-for-byte."
}
},
"additionalProperties": true
},
"FileList": {
"type": "object",
"required": [
"files"
],
"properties": {
"files": {
"type": "array",
"items": {
"$ref": "#/$defs/SkillFile"
}
}
}
},
"Plugin": {
"type": "object",
"required": [
"name"
],
"description": "An Agent Plugins package installed into a harness: `plugin.json` at the root, MCP servers in\n`mcp.json`, skills under `skills/`. A client writes `files` (or passes back `blob`) and\noptionally `name` and `enabled`; the server derives `manifest`, `mcpServers`, `skills` and\n`skipped` from the package on every write and ignores those fields on input. A refused\npackage leaves the harness unchanged.\n",
"properties": {
"name": {
"type": "string",
"pattern": "^(?!.*(--|\\.\\.))[a-z0-9]([a-z0-9.-]*[a-z0-9])?$",
"maxLength": 64,
"description": "The manifest's `name`. Optional on write; if sent it must equal the manifest's."
},
"enabled": {
"type": "boolean",
"default": true,
"description": "false keeps the plugin installed and inert; nothing in it is materialised or contacted."
},
"files": {
"type": "array",
"items": {
"$ref": "#/$defs/SkillFile"
},
"description": "The package. Must contain `plugin.json` at its root."
},
"blob": {
"type": "string",
"description": "Server-assigned handle for a package stored out of line. A client passes it back unchanged\nand reads the files from the plugin files endpoint.\n"
},
"manifest": {
"$ref": "#/$defs/PluginManifest"
},
"mcpServers": {
"type": "array",
"items": {
"$ref": "#/$defs/PluginMcpServer"
},
"description": "Derived from `mcp.json`. Placeholders are reported unexpanded; `enabled` is always true,\nthe plugin's own `enabled` governs.\n"
},
"skills": {
"type": "array",
"items": {
"$ref": "#/$defs/PluginSkill"
},
"description": "Derived from `skills/`, one entry per immediate child directory with a SKILL.md."
},
"skipped": {
"type": "array",
"items": {
"$ref": "#/$defs/PluginSkipped"
},
"description": "What the server found and could not load. Present on every plugin object the server\nreturns, empty when nothing was skipped.\n"
}
},
"additionalProperties": true
},
"PluginManifest": {
"type": "object",
"required": [
"$schema",
"name"
],
"description": "`plugin.json`, parsed. Mirrors the Agent Plugins 1.0.0 manifest schema\n(https://agent-plugins.org/schemas/1.0.0/plugin.schema.json, Apache-2.0) field for field, and\npermits additional properties because a UHP client ignores fields it does not know. The\nschema a manifest's own `$schema` names is authoritative; a server validates against that.\n",
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^(?!.*(--|\\.\\.))[a-z0-9]([a-z0-9.-]*[a-z0-9])?$"
},
"version": {
"type": "string"
},
"description": {
"type": "string"
},
"author": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string"
},
"url": {
"type": "string"
}
},
"additionalProperties": true
},
"homepage": {
"type": "string"
},
"repository": {
"type": "string"
},
"license": {
"type": "string"
},
"keywords": {
"type": "array",
"items": {
"type": "string"
}
},
"extensions": {
"type": "object",
"description": "Client-specific data keyed by reverse-domain namespace, per Agent Plugins §8.",
"additionalProperties": {
"type": "object"
}
}
},
"additionalProperties": true
},
"PluginSkill": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The SKILL.md frontmatter name",
"equal to the directory name.": null
},
"description": {
"type": "string"
}
},
"additionalProperties": true
},
"PluginSkipped": {
"type": "object",
"required": [
"path",
"reason"
],
"properties": {
"path": {
"type": "string",
"description": "Where in the package, e.g. `skills/broken`, `mcp.json#/mcpServers/redline`, `plugin.json#/vendorField`.",
"examples": [
"skills/broken",
"mcp.json#/mcpServers/redline"
]
},
"reason": {
"type": "string",
"description": "One sentence."
}
},
"additionalProperties": true
},
"HarnessCreate": {
"type": "object",
"required": [
"base"
],
"properties": {
"name": {
"type": "string"
},
"base": {
"type": "string"
},
"default_model": {
"type": "string"
},
"system_prompt": {
"type": "string"
},
"mcp_servers": {
"type": "array",
"items": {
"$ref": "#/$defs/McpServer"
}
},
"skills": {
"type": "array",
"items": {
"$ref": "#/$defs/Skill"
}
},
"plugins": {
"type": "array",
"items": {
"$ref": "#/$defs/Plugin"
},
"description": "Requires the `plugins` capability. Each item needs `files` or `blob`."
},
"environment": {
"type": "string",
"description": "An environment id of the caller's scope",
"or empty. Requires the `environments` capability.": null
},
"disabled_tools": {
"type": "array",
"items": {
"type": "string"
}
},
"max_step": {
"type": [
"integer",
"null"
]
},
"timeout_seconds": {
"type": [
"integer",
"null"
]
}
},
"additionalProperties": true
},
"ModelCatalog": {
"type": "object",
"required": [
"backends"
],
"properties": {
"backends": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"default",
"models"
],
"properties": {
"default": {
"type": "string"
},
"models": {
"type": "array",
"items": {
"$ref": "#/$defs/Model"
}
}
}
}
}
}
},
"HarnessModels": {
"type": "object",
"required": [
"models"
],
"properties": {
"harness_id": {
"type": "string"
},
"backend": {
"type": "string"
},
"default": {
"type": "string"
},
"fallback": {
"type": "string",
"deprecated": true,
"description": "Deprecated, and removed no earlier than the second version after 2026-10-19. The model a\nserver would run in place of one it cannot serve, which Tasks §1.3 makes the harness's\n`default`, so it only ever repeats `default`; a server that refuses an unavailable model\n(`model_unavailable`) runs none in its place. Read `default` and each model's\n`available` instead.\n"
},
"models": {
"type": "array",
"items": {
"$ref": "#/$defs/Model"
}
}
}
},
"Model": {
"type": "object",
"required": [
"id",
"available"
],
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"backend": {
"type": "string"
},
"available": {
"type": "boolean",
"description": "Computed, not asserted: true means the server can serve this model for this harness right\nnow. Listing a model as available and then failing the task is the worst outcome for a\nclient, because a user has already chosen it.\n"
},
"default": {
"type": "boolean"
}
},
"additionalProperties": true
},
"CreateResponseRequest": {
"type": "object",
"required": [
"input"
],
"properties": {
"input": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
],
"description": "A bare string is shorthand for one user message. Without `previous_response_id`, on a\nserver with `input_history`, `user` and `assistant` messages before the last `user` message\nare the conversation so far, kept as the session's first turns, marked imported (Tasks §2.1).\n"
},
"model": {
"type": "string",
"description": "Canonical model id. Omitted means the harness default."
},
"metadata": {
"type": "object",
"description": "Client metadata, the extension point of the Responses surface. `harness_id` selects the\nconfigured harness; `environment` names the environment this task reads, overriding the\nharness's (capability `environments`), refused with `environment_not_found` or\n`environment_not_ready` before the task starts.\n",
"properties": {
"harness_id": {
"type": "string"
},
"environment": {
"type": "string"
}
},
"additionalProperties": true
},
"stream": {
"type": "boolean",
"default": false
},
"previous_response_id": {
"type": [
"string",
"null"
]
},
"instructions": {
"type": "string"
},
"store": {
"type": "boolean",
"default": true
},
"max_output_tokens": {
"type": [
"integer",
"null"
]
},
"max_step": {
"type": [
"integer",
"null"
],
"description": "Agent step (tool-call round) budget"
},
"timeout_seconds": {
"type": [
"integer",
"null"
],
"description": "Wall-clock budget"
},
"tools": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in\n`metadata.ignored_fields` on the response. A UHP harness invokes and executes tools\nitself and reports them in `output`; there is no input path for a tool result, so the\nclient-executed tool loop this field implies cannot be completed by a conformant server.\nConfigure tools on the harness instead — see Harnesses §4.1. Tasks §1.4.\n"
},
"include": {
"type": "array",
"items": {
"type": "string"
},
"description": "Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in\n`metadata.ignored_fields` on the response. No values are enumerated, so any string a\nserver recognised would be one it named itself. Tasks §1.4.\n"
},
"background": {
"type": "boolean",
"default": false
}
},
"additionalProperties": true
},
"Response": {
"type": "object",
"required": [
"id",
"object",
"created_at",
"status",
"output",
"model"
],
"properties": {
"id": {
"type": "string",
"pattern": "^resp_"
},
"object": {
"type": "string",
"const": "response"
},
"created_at": {
"type": "integer",
"description": "Unix seconds"
},
"status": {
"$ref": "#/$defs/ResponseStatus"
},
"error": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/Error"
}
],
"description": "Non-null only when status is `failed`."
},
"incomplete_details": {
"type": [
"object",
"null"
],
"additionalProperties": true
},
"previous_response_id": {
"type": [
"string",
"null"
]
},
"model": {
"type": "string",
"description": "The model that actually ran."
},
"output": {
"type": "array",
"items": {
"$ref": "#/$defs/OutputItem"
}
},
"store": {
"type": "boolean"
},
"usage": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/Usage"
}
],
"description": "null when the server cannot account for usage. A fabricated zero would be worse than an\nhonest absence, because a client cannot tell it from a free task.\n"
},
"metadata": {
"type": "object",
"properties": {
"session_id": {
"type": "string"
},
"environment": {
"type": "string",
"description": "The environment the task read, when it read one (capability `environments`)."
},
"requested_model": {
"type": "string",
"description": "Present when the server ran a different model than was requested."
},
"model_fallback": {
"type": "boolean"
},
"model_fallback_reason": {
"type": "string"
},
"ignored_fields": {
"type": "array",
"items": {
"type": "string"
},
"description": "Request fields the server did not act on, by name, in any order. Required when the\nrequest carried `tools` or `include`, which are reserved and ignored. A silently\nignored field is indistinguishable from an honoured one. Tasks §1.1 and §1.4.\n"
}
},
"additionalProperties": true
}
},
"additionalProperties": true
},
"ResponseStatus": {
"type": "string",
"enum": [
"in_progress",
"completed",
"failed",
"incomplete",
"cancelled"
],
"description": "`incomplete` means a budget stopped the work and is usually worth continuing.\n`failed` means it could not be done. `cancelled` means the client asked for a stop, and must\nnever be reported as `failed`.\n"
},
"OutputItem": {
"type": "object",
"required": [
"type"
],
"description": "A client must tolerate item types it does not recognise. A client that renders only `message`\nitems and ignores the rest is a valid client.\n",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"examples": [
"message",
"reasoning",
"function_call",
"function_call_output"
]
},
"status": {
"type": "string"
},
"role": {
"type": "string"
},
"content": {
"type": "array",
"items": {
"$ref": "#/$defs/ContentPart"
}
},
"summary": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"call_id": {
"type": "string"
},
"name": {
"type": "string"
},
"arguments": {
"type": "string",
"description": "JSON",
"as a string": null
},
"output": {
"type": "string"
}
},
"additionalProperties": true
},
"ContentPart": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"examples": [
"output_text"
]
},
"text": {
"type": "string"
},
"annotations": {
"type": "array",
"items": {
"$ref": "#/$defs/Annotation"
}
}
},
"additionalProperties": true
},
"Annotation": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"const": "container_file_citation"
},
"container_id": {
"type": "string"
},
"file_id": {
"type": "string"
},
"filename": {
"type": "string"
},
"download_url": {
"type": "string",
"format": "uri"
},
"start_index": {
"type": "integer"
},
"end_index": {
"type": "integer"
}
},
"additionalProperties": true
},
"Usage": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer",
"minimum": 0
},
"output_tokens": {
"type": "integer",
"minimum": 0
},
"total_tokens": {
"type": "integer",
"minimum": 0
},
"cache_read_tokens": {
"type": "integer",
"minimum": 0
},
"cache_write_tokens": {
"type": "integer",
"minimum": 0
}
},
"additionalProperties": true
},
"SessionShare": {
"type": "object",
"description": "A published read-only view of a session (Sessions §5). `url` may be relative, resolving\nagainst the base URL the caller is already using — a server behind a proxy cannot know its\npublic origin, and a base-relative path survives every fronting. The share's id MUST NOT\nfunction as a credential for the rest of the API.\n",
"required": [
"id",
"url"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
},
"object": {
"type": "string",
"description": "SHOULD be \"session.share\""
},
"enabled": {
"type": "boolean"
}
},
"additionalProperties": true
},
"TurnItem": {
"type": "object",
"description": "One turn of a session's history (Sessions §3). Previously an object with no stated shape,\nwhich kept every conformance check at \"the endpoint answered 200\" and made transcript\nrebuilding an exercise in one implementation's habits.\n",
"required": [
"id",
"status"
],
"properties": {
"id": {
"type": "string",
"description": "The response id, usable with GET /v1/responses/{id}"
},
"status": {
"type": "string"
},
"user": {
"type": "string"
},
"assistant": {
"type": "string"
},
"tools": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"files": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"imported": {
"type": "boolean",
"description": "A turn the session was started with (Tasks §2.1, capability `input_history`): completed,\nno model ran and nothing was spent. `false`, or absent, for a turn that ran.\n"
},
"created_at": {
"type": "integer",
"description": "When the turn began, in Unix seconds, as the Response's `created_at`. An imported turn\ncarries the time it was imported.\n"
},
"completed_at": {
"type": [
"integer",
"null"
],
"description": "When the turn ended, in Unix seconds. `null` while the turn is running, and when the\nserver does not know when it ended. An imported turn carries the time it was imported.\n"
}
},
"additionalProperties": true
},
"Environment": {
"type": "object",
"required": [
"id",
"name",
"slug",
"status",
"mount"
],
"properties": {
"id": {
"type": "string",
"pattern": "^henv_"
},
"object": {
"type": "string",
"const": "environment"
},
"name": {
"type": "string"
},
"slug": {
"type": "string",
"description": "The path segment sessions see; derived from the name at creation and fixed after."
},
"description": {
"type": "string"
},
"entry": {
"type": "string",
"description": "How the project is run, in the owner's words; repeated to the agent."
},
"status": {
"type": "string",
"enum": [
"empty",
"building",
"ready",
"failed"
],
"description": "`ready` means a built version is active and tasks may read it. `empty` means nothing\nwas built yet; `building` and `failed` describe the latest build.\n"
},
"mount": {
"type": "string",
"description": "Where a session finds the environment, read-only. `/env/<slug>` on the reference server."
},
"version": {
"type": [
"integer",
"null"
],
"description": "The active build",
"the one sessions read; null until one is ready.": null
},
"latestVersion": {
"type": [
"integer",
"null"
]
},
"files": {
"type": "object",
"description": "The source's size (what the owner put in, before any build).",
"properties": {
"count": {
"type": "integer",
"minimum": 0
},
"bytes": {
"type": "integer",
"minimum": 0
}
}
},
"packages": {
"type": "array",
"description": "What the active build installed, as the package managers report it.",
"items": {
"$ref": "#/$defs/EnvironmentPackage"
}
},
"declared": {
"type": "object",
"description": "What the owner declared, per manager, as the build installs it beside the project's own\nmanifests: `pip` (`name==1.0`), `npm` (`[email protected]`), `apt` (`name`). Each entry carries\nthe spec as written and its parsed name and version.\n",
"properties": {
"pip": {
"type": "array",
"items": {
"$ref": "#/$defs/DeclaredPackage"
}
},
"npm": {
"type": "array",
"items": {
"$ref": "#/$defs/DeclaredPackage"
}
},
"apt": {
"type": "array",
"items": {
"$ref": "#/$defs/DeclaredPackage"
}
}
}
},
"runtime": {
"type": "object",
"description": "The interpreter a build makes the virtual environment with; empty means the server's default.",
"properties": {
"python": {
"type": "string",
"examples": [
"3.12"
]
}
}
},
"versions": {
"type": "array",
"items": {
"$ref": "#/$defs/EnvironmentVersion"
}
},
"build": {
"description": "The latest build's status, or null before the first.",
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/$defs/EnvironmentVersion"
}
]
},
"createdAt": {
"type": "integer",
"description": "Unix milliseconds"
},
"updatedAt": {
"type": "integer",
"description": "Unix milliseconds"
}
},
"additionalProperties": true
},
"DeclaredPackage": {
"type": "object",
"required": [
"spec"
],
"properties": {
"spec": {
"type": "string",
"description": "As written: moviepy==2.1.1, [email protected], ffmpeg"
},
"name": {
"type": "string"
},
"version": {
"type": "string"
}
},
"additionalProperties": true
},
"EnvironmentPackageCheck": {
"type": "object",
"required": [
"manager",
"name",
"spec",
"exists"
],
"description": "What the manager's registry says about a spec, before any build.",
"properties": {
"object": {
"type": "string",
"const": "environment.package"
},
"manager": {
"type": "string",
"enum": [
"pip",
"npm",
"apt"
]
},
"name": {
"type": "string"
},
"spec": {
"type": "string"
},
"exists": {
"type": [
"boolean",
"null"
],
"description": "null when the registry could not be asked"
},
"latest": {
"type": "string"
},
"version": {
"type": "string",
"description": "The exact pin when it is published; empty otherwise"
},
"error": {
"type": "string",
"description": "In words: why the spec was refused, or why the registry could not be asked"
}
},
"additionalProperties": true
},
"EnvironmentRuntimes": {
"type": "object",
"description": "What a build can be made with on this server, and nothing that is not there.",
"properties": {
"python": {
"type": "array",
"items": {
"type": "string"
},
"examples": [
[
"3.12",
"3.13"
]
]
},
"node": {
"type": "array",
"items": {
"type": "string"
},
"examples": [
[
"22"
]
]
},
"os": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"apt": {
"type": "boolean",
"description": "Whether apt packages can be declared here."
}
},
"additionalProperties": true
},
"EnvironmentPackage": {
"type": "object",
"required": [
"manager",
"name"
],
"properties": {
"manager": {
"type": "string",
"examples": [
"pip",
"npm"
]
},
"name": {
"type": "string"
},
"version": {
"type": "string"
}
},
"additionalProperties": true
},
"EnvironmentVersion": {
"type": "object",
"required": [
"version",
"status"
],
"properties": {
"version": {
"type": "integer",
"minimum": 1
},
"status": {
"type": "string",
"enum": [
"building",
"ready",
"failed",
"unknown"
]
},
"started_at": {
"type": [
"integer",
"null"
]
},
"finished_at": {
"type": [
"integer",
"null"
]
},
"error": {
"type": "string"
},
"files": {
"type": "integer"
},
"bytes": {
"type": "integer"
},
"packages": {
"type": "integer",
"description": "How many packages the build installed."
}
},
"additionalProperties": true
},
"EnvironmentBuild": {
"type": "object",
"required": [
"id",
"version",
"status"
],
"description": "A build's record; the log is the installers' own output, capped by the server.",
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string",
"const": "environment.build"
},
"version": {
"type": "integer"
},
"status": {
"type": "string",
"enum": [
"building",
"ready",
"failed"
]
},
"started_at": {
"type": [
"integer",
"null"
]
},
"finished_at": {
"type": [
"integer",
"null"
]
},
"error": {
"type": "string"
},
"stage": {
"type": "string",
"description": "The step a running build is on; empty once it ended"
},
"log": {
"type": "string"
},
"packages": {
"type": "array",
"items": {
"$ref": "#/$defs/EnvironmentPackage"
}
},
"files": {
"type": "integer"
},
"bytes": {
"type": "integer"
}
},
"additionalProperties": true
},
"EnvironmentCreate": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "Must start with a letter or digit; the slug derives from it."
},
"description": {
"type": "string"
},
"entry": {
"type": "string"
},
"packages": {
"type": "object",
"description": "Declared packages per manager, as spec strings; omitted on update means unchanged.",
"properties": {
"pip": {
"type": "array",
"items": {
"type": "string"
}
},
"npm": {
"type": "array",
"items": {
"type": "string"
}
},
"apt": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"runtime": {
"type": "object",
"properties": {
"python": {
"type": "string"
}
}
}
},
"additionalProperties": true
},
"EnvironmentList": {
"type": "object",
"required": [
"environments"
],
"properties": {
"environments": {
"type": "array",
"items": {
"$ref": "#/$defs/Environment"
}
}
},
"additionalProperties": true
},
"EnvironmentFileEntry": {
"type": "object",
"required": [
"path",
"dir"
],
"properties": {
"path": {
"type": "string",
"description": "Relative to the environment's root."
},
"dir": {
"type": "boolean"
},
"bytes": {
"type": "integer",
"minimum": 0
},
"mtime": {
"type": "integer",
"description": "Unix seconds."
}
},
"additionalProperties": true
},
"EnvironmentFileList": {
"type": "object",
"required": [
"entries"
],
"properties": {
"entries": {
"type": "array",
"items": {
"$ref": "#/$defs/EnvironmentFileEntry"
}
},
"count": {
"type": "integer",
"description": "Files",
"not directories.": null
},
"bytes": {
"type": "integer"
}
},
"additionalProperties": true
},
"EnvironmentImport": {
"type": "object",
"description": "The JSON form of an import: a git repository. The other form is the archive itself as the\nrequest body (a zip or a tar, any content type but `application/json`).\n",
"properties": {
"git": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string"
},
"ref": {
"type": "string",
"description": "A branch or tag; the default branch when omitted."
}
}
},
"replace": {
"type": "boolean",
"default": false,
"description": "Clear the source before importing."
}
},
"additionalProperties": true
},
"EnvironmentImportResult": {
"type": "object",
"properties": {
"written": {
"type": "integer"
},
"skipped": {
"type": "integer",
"description": "Members that must not land (links",
"escapes) and were dropped.": null
},
"count": {
"type": "integer"
},
"bytes": {
"type": "integer"
}
},
"additionalProperties": true
},
"Session": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string",
"const": "session"
},
"harness_id": {
"type": "string"
},
"environment": {
"type": "string",
"description": "The environment the session's turns read",
"when one did.": null
},
"title": {
"type": "string"
},
"status": {
"type": "string"
},
"created_at": {
"type": "integer"
},
"updated_at": {
"type": "integer"
}
},
"additionalProperties": true
},
"SessionList": {
"type": "object",
"required": [
"sessions"
],
"properties": {
"sessions": {
"type": "array",
"items": {
"$ref": "#/$defs/Session"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "null on the last page. A client must not be required to detect the end by receiving fewer\nitems than requested — that heuristic is wrong whenever a page is exactly full.\n"
}
},
"additionalProperties": true
},
"File": {
"type": "object",
"required": [
"id",
"filename"
],
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string",
"const": "file"
},
"container_id": {
"type": "string"
},
"filename": {
"type": "string"
},
"bytes": {
"type": "integer",
"minimum": 0
},
"created_at": {
"type": "integer"
}
},
"additionalProperties": true
},
"ErrorEnvelope": {
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"$ref": "#/$defs/Error"
},
"detail": {
"type": "string",
"deprecated": true,
"description": "A human-readable alias of `error.message`, retained for clients written against\nimplementations that predate this envelope. Carries no information not in `error`.\n"
}
},
"additionalProperties": true
},
"Error": {
"type": "object",
"required": [
"type",
"code",
"message"
],
"properties": {
"type": {
"type": "string",
"enum": [
"invalid_request_error",
"authentication_error",
"permission_error",
"rate_limit_error",
"harness_error",
"server_error"
]
},
"code": {
"type": "string",
"description": "Specific and machine-readable. Servers may define additional codes for conditions this\nspecification does not cover, and must namespace them with a vendor prefix so a future\nversion cannot collide with them.\n",
"examples": [
"unsupported_protocol_version",
"invalid_input",
"harness_not_found",
"response_not_found",
"session_not_found",
"plugin_not_found",
"file_not_found",
"session_expired",
"harness_mismatch",
"session_busy",
"harness_busy",
"plugin_conflict",
"file_too_large",
"model_unavailable",
"model_not_available",
"unsupported_base",
"plugin_invalid",
"unsupported_plugin_schema",
"environment_not_found",
"environment_not_ready",
"environment_busy",
"environment_exists",
"environment_invalid",
"environment_unavailable",
"unsupported_transport",
"missing_credential",
"invalid_credential",
"insufficient_scope",
"rate_limited",
"quota_exhausted",
"harness_error",
"harness_unavailable",
"provider_error",
"timeout",
"cancelled",
"preview_unavailable",
"preview_failed"
]
},
"message": {
"type": "string",
"description": "One sentence, safe to show a user. Must not contain credentials, internal hostnames, file\npaths, or stack traces.\n"
},
"param": {
"type": [
"string",
"null"
],
"description": "Dotted path to the offending field."
},
"detail": {
"type": [
"object",
"null"
],
"additionalProperties": true
}
},
"additionalProperties": true
},
"Event": {
"type": "object",
"required": [
"type",
"sequence_number"
],
"description": "One streamed event. `sequence_number` starts at 0 and increases by exactly 1 per event, so a\nclient can detect a dropped event rather than silently rendering a gap.\n",
"properties": {
"type": {
"type": "string",
"examples": [
"response.created",
"response.in_progress",
"response.output_item.added",
"response.output_item.done",
"response.content_part.added",
"response.content_part.done",
"response.output_text.delta",
"response.output_text.done",
"response.output_text.annotation.added",
"response.reasoning_summary_part.added",
"response.reasoning_summary_text.delta",
"response.reasoning_summary_part.done",
"response.function_call_arguments.delta",
"response.function_call_arguments.done",
"response.completed",
"response.incomplete",
"response.failed",
"error"
]
},
"sequence_number": {
"type": "integer",
"minimum": 0
},
"response": {
"$ref": "#/$defs/Response"
},
"item": {
"$ref": "#/$defs/OutputItem"
},
"part": {
"$ref": "#/$defs/ContentPart"
},
"annotation": {
"$ref": "#/$defs/Annotation"
},
"delta": {
"type": "string"
},
"text": {
"type": "string"
},
"arguments": {
"type": "string"
},
"item_id": {
"type": "string"
},
"output_index": {
"type": "integer",
"minimum": 0
},
"content_index": {
"type": "integer",
"minimum": 0
},
"summary_index": {
"type": "integer",
"minimum": 0
},
"annotation_index": {
"type": "integer",
"minimum": 0
},
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
}
},
"additionalProperties": true
},
"Memory": {
"type": "object",
"required": [
"id",
"name",
"privileges"
],
"properties": {
"id": {
"type": "string",
"description": "Opaque to a client. A server that maps a tree it already has keeps that tree's own ids."
},
"object": {
"type": "string",
"const": "memory"
},
"name": {
"type": "string"
},
"description": {
"type": "string",
"description": "What this memory holds; an agent reads it to decide whether to look inside."
},
"parent_id": {
"type": [
"string",
"null"
]
},
"ancestors": {
"type": "array",
"items": {
"type": "string"
},
"description": "Ids from the root down to the parent, as far up as the caller may see."
},
"restricted": {
"type": "boolean",
"description": "When true, grants on ancestors stop here."
},
"provider": {
"type": "string"
},
"privileges": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryPrivilege"
},
"description": "The effective privileges of the caller on this memory."
},
"records": {
"type": "object",
"properties": {
"count": {
"type": [
"integer",
"null"
]
}
}
},
"children": {
"type": "object",
"properties": {
"count": {
"type": "integer"
}
}
},
"createdAt": {
"type": "integer"
},
"updatedAt": {
"type": "integer"
}
},
"additionalProperties": true
},
"MemoryPrivilege": {
"type": "string",
"enum": [
"read",
"write",
"create",
"delete"
]
},
"MemoryCreate": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"parent_id": {
"type": [
"string",
"null"
]
},
"restricted": {
"type": "boolean"
},
"provider": {
"type": "string",
"description": "A connected provider; inherited from the parent when omitted."
}
}
},
"MemoryUpdate": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"restricted": {
"type": "boolean"
},
"parent_id": {
"type": [
"string",
"null"
]
}
}
},
"MemoryList": {
"type": "object",
"properties": {
"object": {
"type": "string",
"const": "list"
},
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/Memory"
}
}
}
},
"MemoryDeleted": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"deleted": {
"type": "boolean"
},
"memories": {
"type": "array",
"items": {
"type": "string"
},
"description": "Every memory removed: the named one and its descendants."
}
}
},
"Deleted": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"deleted": {
"type": "boolean"
}
},
"additionalProperties": true
},
"FreeObject": {
"type": "object",
"additionalProperties": true
},
"MemoryNeighbour": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"records": {
"type": "object"
},
"children": {
"type": "object"
},
"privileges": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryPrivilege"
}
}
}
},
"MemoryGrant": {
"type": "object",
"required": [
"id",
"memory_id",
"principal",
"privileges"
],
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string",
"const": "memory.grant"
},
"memory_id": {
"type": "string"
},
"principal": {
"type": "string",
"pattern": "^(member|group|x\\.[a-z0-9_.-]+):.+",
"description": "Who holds the grant, `<kind>:<id>`: a `member` (a person or an agent), a `group`, or a kind of the server's own, `x.`-prefixed."
},
"privileges": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryPrivilege"
}
},
"inherited": {
"type": "boolean",
"description": "True when the grant sits on an ancestor."
}
}
},
"MemoryGrantCreate": {
"type": "object",
"required": [
"principal",
"privileges"
],
"properties": {
"principal": {
"type": "string"
},
"privileges": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryPrivilege"
}
}
}
},
"MemoryGrantList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryGrant"
}
}
}
},
"MemoryReference": {
"type": "object",
"required": [
"record_id"
],
"properties": {
"rel": {
"type": "string"
},
"memory_id": {
"type": "string"
},
"record_id": {
"type": "string"
},
"available": {
"type": "boolean",
"description": "False when the reader may not read the target; nothing else of it is returned."
}
}
},
"MemoryRecord": {
"type": "object",
"required": [
"id",
"memory_id",
"type",
"trust"
],
"properties": {
"id": {
"type": "string",
"description": "Assigned by the provider and opaque to a client."
},
"object": {
"type": "string",
"const": "memory.record"
},
"memory_id": {
"type": "string"
},
"type": {
"type": "string",
"description": "episode, fact, note, procedure, link, entity, or an extension type."
},
"title": {
"type": "string",
"maxLength": 300,
"description": "One line that names the record. Optional; a search matches it with the content."
},
"content": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryContentPart"
},
"description": "An ordered list of parts. Always a list on a read."
},
"attributes": {
"type": "object",
"additionalProperties": true
},
"version": {
"type": "integer"
},
"status": {
"type": "string",
"enum": [
"active",
"superseded",
"forgotten"
]
},
"supersedes": {
"type": [
"integer",
"null"
],
"description": "The number of the version this one replaced; null on the first."
},
"time": {
"type": "object",
"properties": {
"valid_from": {
"type": [
"string",
"null"
]
},
"valid_to": {
"type": [
"string",
"null"
]
},
"written_at": {
"type": [
"string",
"null"
]
},
"invalidated_at": {
"type": [
"string",
"null"
]
}
}
},
"written_by": {
"$ref": "#/$defs/MemoryWriter"
},
"references": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryReference"
}
},
"follows": {
"type": "object",
"description": "Present only on a record the server derives from a source it keeps outside the memory (a section of a document). Such a record is not revised or forgotten through the memory.",
"properties": {
"kind": {
"type": "string",
"description": "What the source is, in a word: `document`."
},
"id": {
"type": "string"
},
"name": {
"type": "string",
"description": "What a person calls the source."
}
},
"additionalProperties": true
},
"trust": {
"type": "string",
"const": "untrusted"
},
"closed": {
"type": "array",
"items": {
"type": "string"
},
"description": "Only on the answer to remembering a fact whose `holds` is `one`: the records it ended. Never stored."
},
"conflicts": {
"type": "array",
"items": {
"type": "string"
},
"description": "Only on the answer to remembering a fact whose `holds` is `one`: the records it was linked to with `contradicts`. Never stored."
}
},
"additionalProperties": true
},
"MemoryContentPart": {
"type": "object",
"required": [
"type"
],
"description": "One part of the content of a record. `text` and `file` are defined; any other kind is `x.`-prefixed and carried unchanged.",
"properties": {
"type": {
"type": "string"
},
"text": {
"type": "string",
"description": "The words of a text part, or the words that stand for a file."
},
"text_source": {
"type": "string",
"enum": [
"stated",
"derived"
]
},
"role": {
"type": "string",
"enum": [
"user",
"assistant",
"system",
"tool"
]
},
"name": {
"type": "string",
"description": "Who said it, when the role alone does not: two people in one conversation are both `user`."
},
"file": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"media_type": {
"type": "string"
},
"bytes": {
"type": "integer"
},
"version": {
"type": "string"
}
}
}
},
"additionalProperties": true
},
"MemoryRecordCreate": {
"type": "object",
"required": [
"content"
],
"properties": {
"type": {
"type": "string"
},
"content": {
"oneOf": [
{
"type": "string",
"description": "Shorthand for one text part."
},
{
"type": "array",
"items": {
"$ref": "#/$defs/MemoryContentPart"
}
}
]
},
"attributes": {
"type": "object",
"additionalProperties": true
},
"references": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryReference"
}
},
"time": {
"type": "object",
"additionalProperties": true
}
}
},
"MemoryRecordRevise": {
"type": "object",
"properties": {
"content": {
"oneOf": [
{
"type": "string",
"description": "Shorthand for one text part."
},
{
"type": "array",
"items": {
"$ref": "#/$defs/MemoryContentPart"
}
}
]
},
"attributes": {
"type": "object",
"additionalProperties": true
},
"references": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryReference"
}
},
"time": {
"type": "object",
"additionalProperties": true
}
}
},
"MemoryRecordList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryRecord"
}
},
"next": {
"type": [
"string",
"null"
]
},
"job": {
"$ref": "#/$defs/MemoryJob"
},
"parent": {
"$ref": "#/$defs/MemoryNeighbour"
},
"children": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryNeighbour"
}
}
}
},
"MemoryObserve": {
"type": "object",
"required": [
"episodes"
],
"properties": {
"episodes": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"content"
],
"properties": {
"content": {
"oneOf": [
{
"type": "string",
"description": "Shorthand for one text part."
},
{
"type": "array",
"items": {
"$ref": "#/$defs/MemoryContentPart"
}
}
]
},
"time": {
"type": "object",
"properties": {
"valid_from": {
"type": [
"string",
"null"
],
"description": "When it happened. Left out, now."
}
},
"additionalProperties": true
},
"attributes": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
},
"MemoryJob": {
"type": "object",
"required": [
"id",
"status"
],
"properties": {
"object": {
"type": "string",
"const": "memory.job"
},
"id": {
"type": "string"
},
"memory_id": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"queued",
"running",
"pending",
"completed",
"failed"
],
"description": "`pending` when the provider cannot tell queued from running."
},
"error": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryRecord"
},
"description": "The records the job wrote."
},
"closed": {
"type": "array",
"items": {
"type": "string"
},
"description": "Records ended by a `one` fact the job wrote."
},
"conflicts": {
"type": "array",
"items": {
"type": "string"
},
"description": "Records linked with `contradicts` by a `one` fact the job wrote."
},
"usage": {
"type": "object",
"additionalProperties": true,
"description": "Tokens, when a model did the work: `input_tokens`, `output_tokens`."
},
"created_at": {
"type": "integer"
},
"started_at": {
"type": [
"integer",
"null"
]
},
"finished_at": {
"type": [
"integer",
"null"
]
}
}
},
"MemoryWriter": {
"type": "object",
"description": "Who wrote a record, stamped by the server from the authenticated caller. `kind` and `id` joined by a colon are the principal a grant would name.",
"required": [
"kind",
"id"
],
"properties": {
"kind": {
"type": "string",
"pattern": "^(member|provider|x\\.[a-z0-9_.-]+)$"
},
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"human",
"agent"
],
"description": "For a member: a person or an agent. No rule depends on it."
},
"on_behalf_of": {
"type": "string",
"description": "When the provider wrote it: the principal whose observation it was derived from."
},
"consolidation_id": {
"type": "string",
"description": "When the provider wrote it: the consolidation run that concluded it."
}
},
"additionalProperties": true
},
"MemoryFilter": {
"type": "object",
"description": "One of `{field, op, value}`, `{and: [...]}` or `{or: [...]}`.",
"additionalProperties": true
},
"MemoryPrime": {
"type": "object",
"required": [
"records",
"tokens",
"truncated"
],
"properties": {
"records": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryRecord"
}
},
"tokens": {
"type": "integer",
"description": "The provider's own estimate of what the records cost."
},
"truncated": {
"type": "boolean",
"description": "True when a standing record was left out."
}
}
},
"MemoryRecallRequest": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Meaning."
},
"text": {
"type": "string",
"description": "Words."
},
"filters": {
"$ref": "#/$defs/MemoryFilter"
},
"types": {
"type": "array",
"items": {
"type": "string"
}
},
"as_of": {
"type": [
"string",
"null"
]
},
"include": {
"type": "string",
"enum": [
"active",
"all"
]
},
"depth": {
"type": [
"integer",
"null"
],
"minimum": 0,
"description": "Levels below to search: 0 is this memory alone. Left out, the whole readable subtree."
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100
}
}
},
"MemoryRecall": {
"type": "object",
"required": [
"results",
"degraded",
"abstain"
],
"properties": {
"results": {
"type": "array",
"items": {
"type": "object",
"required": [
"record",
"memory"
],
"properties": {
"record": {
"$ref": "#/$defs/MemoryRecord"
},
"memory": {
"type": "object",
"description": "The memory this result is in, the one asked or one below it.",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"score": {
"type": [
"number",
"null"
]
},
"why": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"parent": {
"$ref": "#/$defs/MemoryNeighbour"
},
"children": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryNeighbour"
}
},
"degraded": {
"type": "array",
"items": {
"type": "string"
},
"description": "What the request asked for and was not done."
},
"abstain": {
"type": "boolean",
"description": "True when the provider judges that nothing it returned answers the question."
}
},
"additionalProperties": true
},
"MemoryGraphRequest": {
"type": "object",
"properties": {
"around": {
"type": "string",
"description": "A record to start from. Left out, every record of this memory."
},
"hops": {
"type": "integer",
"minimum": 0,
"maximum": 3,
"description": "References away from the start, in either direction. Default 1."
},
"types": {
"type": "array",
"items": {
"type": "string"
}
},
"limit": {
"type": "integer",
"minimum": 1
}
}
},
"MemoryRecordRef": {
"type": "object",
"description": "A record by where it is. `memory_id` is absent on the far end of an edge the caller may not follow.",
"required": [
"record_id"
],
"properties": {
"memory_id": {
"type": "string"
},
"record_id": {
"type": "string"
}
}
},
"MemoryGraph": {
"type": "object",
"required": [
"nodes",
"edges",
"truncated"
],
"properties": {
"object": {
"type": "string",
"const": "memory.graph"
},
"nodes": {
"type": "array",
"items": {
"type": "object",
"required": [
"record",
"memory"
],
"properties": {
"record": {
"$ref": "#/$defs/MemoryRecord"
},
"memory": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
}
}
},
"edges": {
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to",
"available"
],
"properties": {
"from": {
"$ref": "#/$defs/MemoryRecordRef"
},
"to": {
"$ref": "#/$defs/MemoryRecordRef"
},
"rel": {
"type": "string",
"description": "What the reference means. Absent when the target is not readable by the caller."
},
"available": {
"type": "boolean"
}
}
}
},
"truncated": {
"type": "boolean"
},
"degraded": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": true
},
"MemoryErase": {
"type": "object",
"required": [
"record_ids"
],
"properties": {
"record_ids": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
}
},
"MemoryErasure": {
"type": "object",
"required": [
"erased",
"unreachable"
],
"properties": {
"erased": {
"type": "array",
"items": {
"type": "string"
}
},
"unreachable": {
"type": "array",
"items": {
"type": "string"
},
"description": "Content the provider could not remove. Empty is a guarantee."
}
}
},
"MemoryQuery": {
"type": "object",
"required": [
"body"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"params": {
"type": "object",
"additionalProperties": true,
"description": "A JSON Schema for the parameters."
},
"requires": {
"type": "string",
"enum": [
"read",
"write"
]
},
"language": {
"type": "string",
"description": "Opaque to the protocol."
},
"body": {
"type": "string",
"description": "Opaque to the protocol."
}
},
"additionalProperties": true
},
"MemoryQueryList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryQuery"
}
}
}
},
"MemoryQueryRun": {
"type": "object",
"properties": {
"params": {
"type": "object",
"additionalProperties": true
}
}
},
"MemoryFreeQuery": {
"type": "object",
"required": [
"statement"
],
"properties": {
"language": {
"type": "string"
},
"statement": {
"type": "string"
},
"params": {
"type": "object",
"additionalProperties": true
},
"write": {
"type": "boolean"
}
}
},
"MemoryOperationResult": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"result": {}
}
},
"MemorySnapshot": {
"type": "object",
"required": [
"id",
"name",
"at"
],
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string",
"const": "memory.snapshot"
},
"memory_id": {
"type": "string"
},
"name": {
"type": "string"
},
"message": {
"type": "string"
},
"at": {
"type": "string"
}
}
},
"MemorySnapshotCreate": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"message": {
"type": "string"
}
}
},
"MemorySnapshotList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/MemorySnapshot"
}
}
}
},
"MemoryConsolidation": {
"type": "object",
"required": [
"id",
"status"
],
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string",
"const": "memory.consolidation"
},
"memory_id": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"queued",
"running",
"completed",
"stopped",
"failed"
]
},
"trigger": {
"type": "string"
},
"started_at": {
"type": [
"integer",
"null"
]
},
"finished_at": {
"type": [
"integer",
"null"
]
},
"read": {
"type": "object",
"additionalProperties": true
},
"changes": {
"type": "object",
"additionalProperties": true
},
"usage": {
"type": "object",
"additionalProperties": true
},
"budget": {
"type": "object",
"additionalProperties": true
},
"written_by": {
"$ref": "#/$defs/MemoryWriter"
},
"error": {
"type": "string"
}
},
"additionalProperties": true
},
"MemoryConsolidationStart": {
"type": "object",
"properties": {
"budget": {
"type": "object",
"additionalProperties": true
}
}
},
"MemoryConsolidationList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryConsolidation"
}
}
}
},
"MemoryProvider": {
"type": "object",
"required": [
"id",
"isolation"
],
"properties": {
"id": {
"type": "string"
},
"isolation": {
"type": "string",
"enum": [
"container",
"enforced_filter"
]
},
"derivation": {
"type": "string",
"enum": [
"write_time",
"background",
"agent",
"none"
]
},
"prime": {
"type": "boolean",
"description": "Whether the provider answers the prime read with its standing records."
},
"holds": {
"type": "boolean",
"description": "Whether the provider ends and links facts by `attributes.holds`."
},
"observe": {
"type": "object",
"additionalProperties": true
},
"recall": {
"type": "object",
"additionalProperties": true
},
"history": {
"type": "object",
"additionalProperties": true
},
"erase": {
"type": "object",
"additionalProperties": true
},
"queries": {
"type": "object",
"additionalProperties": true
},
"graph": {
"type": "object",
"properties": {
"entities": {
"type": "string",
"enum": [
"derived",
"stated",
"none"
],
"description": "Where a memory's entities come from on this provider."
}
},
"additionalProperties": true
},
"content": {
"type": "object",
"description": "What the content of a record may carry on this provider.",
"properties": {
"media": {
"type": "array",
"items": {
"type": "string"
},
"description": "Media types kept, as patterns such as `text/*` or `image/*`."
},
"bytes": {
"type": "string",
"enum": [
"kept",
"referenced"
]
},
"describes": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"additionalProperties": true
},
"MemoryProviderList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryProvider"
}
}
}
},
"MemoryType": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string"
},
"core": {
"type": "boolean"
},
"description": {
"type": "string"
},
"schema": {
"type": "object",
"additionalProperties": true
},
"text": {
"type": "string"
},
"operations": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"requires"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"input": {
"type": "object",
"additionalProperties": true
},
"requires": {
"$ref": "#/$defs/MemoryPrivilege"
}
}
}
}
},
"additionalProperties": true
},
"MemoryTypeList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/MemoryType"
}
}
}
},
"HarnessMemorySettings": {
"type": "object",
"properties": {
"default_memory_id": {
"type": [
"string",
"null"
],
"description": "Where an unaddressed remember goes and where turns are recorded. A memory the agent may write."
},
"observe": {
"type": "boolean",
"description": "Record each finished turn in the default memory. On by default."
}
}
},
"HarnessMemories": {
"type": "object",
"required": [
"principal",
"data"
],
"properties": {
"object": {
"type": "string",
"const": "harness.memories"
},
"principal": {
"type": "string",
"description": "Who this harness's agent is to the access model, `member:<id>`. A grant names it."
},
"default_memory_id": {
"type": [
"string",
"null"
]
},
"observe": {
"type": "boolean"
},
"data": {
"type": "array",
"description": "Every memory the agent holds a grant on, highest in the tree first. Read off the grants.",
"items": {
"type": "object",
"required": [
"id",
"privileges"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"privileges": {
"type": "array",
"items": {
"type": "string",
"enum": [
"read",
"write",
"create",
"delete"
]
}
},
"default": {
"type": "boolean"
}
},
"additionalProperties": true
}
}
}
}
}
}