{ "info": { "description": "Local-first adaptive interaction platform (no MCP).", "title": "Adaptive Interaction Runtime", "version": "0.8.0" }, "openapi": "3.1.0", "paths": { "/v1/capabilities": { "get": { "responses": { "200": { "description": "Snapshot" } }, "summary": "Capability snapshot" } }, "/v1/health": { "get": { "responses": { "200": { "description": "OK" } }, "summary": "Liveness probe" } }, "/v1/tools/interaction.action_status/call": { "post": { "operationId": "interaction_action_status", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "actionId": { "type": "string" } }, "required": [ "actionId" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "ActionId": { "description": "Identifies a single bounded action / receipt.", "type": "string" }, "ActionParameters": { "description": "Normalized action parameters shared by all channels.", "properties": { "durationMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "extra": { "description": "Driver-specific extras (validated against the actuator's schema)." }, "magnitude": { "format": "double", "type": [ "number", "null" ] }, "message": { "type": [ "string", "null" ] } }, "type": "object" }, "ActionStatus": { "oneOf": [ { "const": "planned", "description": "Plan step exists but has not been authorized.", "type": "string" }, { "const": "authorized", "description": "Policy governor approved and produced a bounded action.", "type": "string" }, { "const": "accepted", "description": "Runtime accepted the action into its queue. NOT completion.", "type": "string" }, { "const": "dispatched", "description": "Driver has sent the command toward the target.", "type": "string" }, { "const": "acknowledged", "description": "Target (device/service) confirmed receipt of the command.", "type": "string" }, { "const": "observed", "description": "The effect was observed in the environment.", "type": "string" }, { "const": "completed", "description": "Terminal: goal achieved and verified to the configured standard.", "type": "string" }, { "const": "blocked", "description": "Terminal: policy refused the action.", "type": "string" }, { "const": "failed", "description": "Terminal: execution failed.", "type": "string" }, { "const": "uncertain", "description": "Terminal: outcome could not be determined.", "type": "string" }, { "const": "cancelled", "description": "Terminal: cancelled by user, AI, policy or shutdown.", "type": "string" }, { "const": "expired", "description": "Terminal: TTL elapsed before completion.", "type": "string" }, { "const": "stopped", "description": "Terminal: halted by emergency stop.", "type": "string" } ] }, "ActuatorId": { "description": "Identifies an actuator instance, e.g. `conversation`.", "type": "string" }, "CorrelationId": { "description": "Correlates observations, plans, actions and events end-to-end.", "type": "string" }, "ObservationId": { "description": "Identifies a single observation.", "type": "string" }, "PlanId": { "description": "Identifies a plan produced by the orchestrator.", "type": "string" }, "PolicyDecision": { "description": "One decision the governor made while bounding a request. The list of\ndecisions is the audit trail explaining requested -> effective.", "oneOf": [ { "properties": { "outcome": { "const": "allowed", "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule" ], "type": "object" }, { "properties": { "field": { "type": "string" }, "from": { "format": "double", "type": "number" }, "outcome": { "const": "clamped", "type": "string" }, "rule": { "type": "string" }, "to": { "format": "double", "type": "number" } }, "required": [ "outcome", "rule", "field", "from", "to" ], "type": "object" }, { "properties": { "detail": { "type": "string" }, "outcome": { "const": "silenced", "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "detail" ], "type": "object" }, { "properties": { "outcome": { "const": "blocked", "type": "string" }, "reason": { "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "reason" ], "type": "object" }, { "properties": { "outcome": { "const": "approvalRequired", "type": "string" }, "reason": { "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "reason" ], "type": "object" } ] }, "ReceiptError": { "properties": { "at": { "format": "date-time", "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } }, "required": [ "code", "message", "at" ], "type": "object" }, "SessionId": { "description": "Identifies an interaction session (the consent boundary).", "type": "string" }, "VerificationEvidence": { "description": "Standard verification outcome attached to receipts.", "properties": { "detail": { "type": [ "string", "null" ] }, "observationIds": { "default": [], "description": "Observation ids that support the verdict.", "items": { "$ref": "#/$defs/ObservationId" }, "type": "array" }, "verdict": { "$ref": "#/$defs/VerificationVerdict" }, "verifiedAt": { "format": "date-time", "type": "string" } }, "required": [ "verdict", "verifiedAt" ], "type": "object" }, "VerificationVerdict": { "oneOf": [ { "const": "observed", "description": "Effect observed in the environment.", "type": "string" }, { "const": "acknowledged-only", "description": "Driver acknowledged but no environmental confirmation.", "type": "string" }, { "const": "uncertain", "description": "Could not determine whether the effect happened.", "type": "string" }, { "const": "refuted", "description": "Evidence says the effect did NOT happen.", "type": "string" } ] } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Full lifecycle record of one action.", "properties": { "actionId": { "$ref": "#/$defs/ActionId" }, "actuatorId": { "$ref": "#/$defs/ActuatorId" }, "correlationId": { "$ref": "#/$defs/CorrelationId" }, "currentStatus": { "$ref": "#/$defs/ActionStatus" }, "driverResponse": { "additionalProperties": true, "default": {}, "description": "Raw driver response snippets (redacted upstream if sensitive).", "type": "object" }, "effectiveBoundedParameters": { "$ref": "#/$defs/ActionParameters" }, "errors": { "default": [], "items": { "$ref": "#/$defs/ReceiptError" }, "type": "array" }, "expiresAt": { "description": "TTL deadline inherited from the bounded action; the watchdog expires\nnon-terminal receipts past this instant.", "format": "date-time", "type": [ "string", "null" ] }, "intent": { "type": "string" }, "planId": { "$ref": "#/$defs/PlanId" }, "policyDecisions": { "default": [], "items": { "$ref": "#/$defs/PolicyDecision" }, "type": "array" }, "requestedParameters": { "$ref": "#/$defs/ActionParameters" }, "schemaVersion": { "type": "string" }, "sessionId": { "$ref": "#/$defs/SessionId" }, "timestamps": { "description": "Timestamp of each state entered, in order.", "items": { "maxItems": 2, "minItems": 2, "prefixItems": [ { "$ref": "#/$defs/ActionStatus" }, { "format": "date-time", "type": "string" } ], "type": "array" }, "type": "array" }, "verification": { "anyOf": [ { "$ref": "#/$defs/VerificationEvidence" }, { "type": "null" } ] } }, "required": [ "actionId", "planId", "sessionId", "actuatorId", "intent", "requestedParameters", "effectiveBoundedParameters", "currentStatus", "timestamps", "correlationId", "schemaVersion" ], "title": "ActionReceipt", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Get the full receipt (state machine history) of one action.", "x-external-side-effect": false, "x-risk": "read-only" } }, "/v1/tools/interaction.cancel/call": { "post": { "operationId": "interaction_cancel", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "actionId": { "type": "string" } }, "required": [ "actionId" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "ActionId": { "description": "Identifies a single bounded action / receipt.", "type": "string" }, "ActionParameters": { "description": "Normalized action parameters shared by all channels.", "properties": { "durationMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "extra": { "description": "Driver-specific extras (validated against the actuator's schema)." }, "magnitude": { "format": "double", "type": [ "number", "null" ] }, "message": { "type": [ "string", "null" ] } }, "type": "object" }, "ActionStatus": { "oneOf": [ { "const": "planned", "description": "Plan step exists but has not been authorized.", "type": "string" }, { "const": "authorized", "description": "Policy governor approved and produced a bounded action.", "type": "string" }, { "const": "accepted", "description": "Runtime accepted the action into its queue. NOT completion.", "type": "string" }, { "const": "dispatched", "description": "Driver has sent the command toward the target.", "type": "string" }, { "const": "acknowledged", "description": "Target (device/service) confirmed receipt of the command.", "type": "string" }, { "const": "observed", "description": "The effect was observed in the environment.", "type": "string" }, { "const": "completed", "description": "Terminal: goal achieved and verified to the configured standard.", "type": "string" }, { "const": "blocked", "description": "Terminal: policy refused the action.", "type": "string" }, { "const": "failed", "description": "Terminal: execution failed.", "type": "string" }, { "const": "uncertain", "description": "Terminal: outcome could not be determined.", "type": "string" }, { "const": "cancelled", "description": "Terminal: cancelled by user, AI, policy or shutdown.", "type": "string" }, { "const": "expired", "description": "Terminal: TTL elapsed before completion.", "type": "string" }, { "const": "stopped", "description": "Terminal: halted by emergency stop.", "type": "string" } ] }, "ActuatorId": { "description": "Identifies an actuator instance, e.g. `conversation`.", "type": "string" }, "CorrelationId": { "description": "Correlates observations, plans, actions and events end-to-end.", "type": "string" }, "ObservationId": { "description": "Identifies a single observation.", "type": "string" }, "PlanId": { "description": "Identifies a plan produced by the orchestrator.", "type": "string" }, "PolicyDecision": { "description": "One decision the governor made while bounding a request. The list of\ndecisions is the audit trail explaining requested -> effective.", "oneOf": [ { "properties": { "outcome": { "const": "allowed", "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule" ], "type": "object" }, { "properties": { "field": { "type": "string" }, "from": { "format": "double", "type": "number" }, "outcome": { "const": "clamped", "type": "string" }, "rule": { "type": "string" }, "to": { "format": "double", "type": "number" } }, "required": [ "outcome", "rule", "field", "from", "to" ], "type": "object" }, { "properties": { "detail": { "type": "string" }, "outcome": { "const": "silenced", "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "detail" ], "type": "object" }, { "properties": { "outcome": { "const": "blocked", "type": "string" }, "reason": { "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "reason" ], "type": "object" }, { "properties": { "outcome": { "const": "approvalRequired", "type": "string" }, "reason": { "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "reason" ], "type": "object" } ] }, "ReceiptError": { "properties": { "at": { "format": "date-time", "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } }, "required": [ "code", "message", "at" ], "type": "object" }, "SessionId": { "description": "Identifies an interaction session (the consent boundary).", "type": "string" }, "VerificationEvidence": { "description": "Standard verification outcome attached to receipts.", "properties": { "detail": { "type": [ "string", "null" ] }, "observationIds": { "default": [], "description": "Observation ids that support the verdict.", "items": { "$ref": "#/$defs/ObservationId" }, "type": "array" }, "verdict": { "$ref": "#/$defs/VerificationVerdict" }, "verifiedAt": { "format": "date-time", "type": "string" } }, "required": [ "verdict", "verifiedAt" ], "type": "object" }, "VerificationVerdict": { "oneOf": [ { "const": "observed", "description": "Effect observed in the environment.", "type": "string" }, { "const": "acknowledged-only", "description": "Driver acknowledged but no environmental confirmation.", "type": "string" }, { "const": "uncertain", "description": "Could not determine whether the effect happened.", "type": "string" }, { "const": "refuted", "description": "Evidence says the effect did NOT happen.", "type": "string" } ] } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Full lifecycle record of one action.", "properties": { "actionId": { "$ref": "#/$defs/ActionId" }, "actuatorId": { "$ref": "#/$defs/ActuatorId" }, "correlationId": { "$ref": "#/$defs/CorrelationId" }, "currentStatus": { "$ref": "#/$defs/ActionStatus" }, "driverResponse": { "additionalProperties": true, "default": {}, "description": "Raw driver response snippets (redacted upstream if sensitive).", "type": "object" }, "effectiveBoundedParameters": { "$ref": "#/$defs/ActionParameters" }, "errors": { "default": [], "items": { "$ref": "#/$defs/ReceiptError" }, "type": "array" }, "expiresAt": { "description": "TTL deadline inherited from the bounded action; the watchdog expires\nnon-terminal receipts past this instant.", "format": "date-time", "type": [ "string", "null" ] }, "intent": { "type": "string" }, "planId": { "$ref": "#/$defs/PlanId" }, "policyDecisions": { "default": [], "items": { "$ref": "#/$defs/PolicyDecision" }, "type": "array" }, "requestedParameters": { "$ref": "#/$defs/ActionParameters" }, "schemaVersion": { "type": "string" }, "sessionId": { "$ref": "#/$defs/SessionId" }, "timestamps": { "description": "Timestamp of each state entered, in order.", "items": { "maxItems": 2, "minItems": 2, "prefixItems": [ { "$ref": "#/$defs/ActionStatus" }, { "format": "date-time", "type": "string" } ], "type": "array" }, "type": "array" }, "verification": { "anyOf": [ { "$ref": "#/$defs/VerificationEvidence" }, { "type": "null" } ] } }, "required": [ "actionId", "planId", "sessionId", "actuatorId", "intent", "requestedParameters", "effectiveBoundedParameters", "currentStatus", "timestamps", "correlationId", "schemaVersion" ], "title": "ActionReceipt", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Cancel a queued or running action.", "x-external-side-effect": false, "x-risk": "low" } }, "/v1/tools/interaction.capabilities/call": { "post": { "operationId": "interaction_capabilities", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "includeUnavailable": { "default": false, "type": "boolean" } }, "required": [], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "ActuatorId": { "description": "Identifies an actuator instance, e.g. `conversation`.", "type": "string" }, "ActuatorLimits": { "description": "Deterministic per-actuator limits enforced by the safety governor.", "properties": { "maxDurationMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "maxMagnitude": { "description": "Hard ceiling on normalized magnitude 0..1 (device safe limit).", "format": "double", "type": [ "number", "null" ] }, "maxPatternSteps": { "description": "Max steps in a pattern timeline.", "format": "uint32", "minimum": 0, "type": [ "integer", "null" ] }, "maxPayloadBytes": { "description": "Max payload size in bytes accepted by the driver.", "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "maxPerHour": { "description": "Max invocations per rolling hour.", "format": "uint32", "minimum": 0, "type": [ "integer", "null" ] } }, "type": "object" }, "ActuatorManifest": { "properties": { "availability": { "$ref": "#/$defs/Availability", "default": "available" }, "capabilities": { "default": [], "description": "Capability tags, e.g. `[\"text\", \"pattern\", \"cancel\"]`.", "items": { "type": "string" }, "type": "array" }, "channel": { "description": "Primary interaction channel, see [`channels`].", "type": "string" }, "cost": { "$ref": "#/$defs/CostDescriptor", "default": { "monetaryPerInvocation": 0.0, "resource": 0.0 } }, "description": { "type": "string" }, "driver": { "type": "string" }, "externalSideEffect": { "description": "True when effects leave the local machine.", "type": "boolean" }, "health": { "$ref": "#/$defs/ComponentHealth", "default": { "status": "healthy" } }, "human": { "anyOf": [ { "$ref": "#/$defs/HumanMeta" }, { "type": "null" } ], "description": "Optional human-readable layer (presentation + effect semantics).\nNever a safety truth source; formal fields above always win." }, "id": { "$ref": "#/$defs/ActuatorId" }, "latencyMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "limits": { "$ref": "#/$defs/ActuatorLimits", "default": {} }, "name": { "type": "string" }, "parametersSchema": { "description": "JSON Schema for driver-specific action parameters." }, "requiresConsent": { "type": "boolean" }, "reversible": { "type": "boolean" }, "riskClass": { "$ref": "#/$defs/RiskClass" }, "schemaVersion": { "type": "string" }, "supportsCancel": { "type": "boolean" }, "supportsPattern": { "type": "boolean" }, "version": { "type": "string" } }, "required": [ "id", "name", "description", "channel", "supportsCancel", "supportsPattern", "requiresConsent", "externalSideEffect", "reversible", "riskClass", "driver", "version", "schemaVersion" ], "type": "object" }, "Availability": { "description": "Whether a capability is currently available for planning.", "oneOf": [ { "enum": [ "available", "disabled", "offline", "unknown" ], "type": "string" }, { "const": "consent-required", "description": "Registered but requires consent that has not been granted in the session.", "type": "string" }, { "const": "revoked", "description": "Permission was revoked at runtime.", "type": "string" } ] }, "CapabilityConstraint": { "description": "A human-readable constraint the AI should surface when planning\n(e.g. \"quiet hours active until 08:00\").", "properties": { "detail": { "type": "string" }, "kind": { "type": "string" } }, "required": [ "kind", "detail" ], "type": "object" }, "ChannelLimits": { "description": "Per-channel deterministic limits.", "properties": { "cooldownMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "maxDurationMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "maxMagnitude": { "format": "double", "type": [ "number", "null" ] }, "maxPerHour": { "format": "uint32", "minimum": 0, "type": [ "integer", "null" ] }, "sessionBudgetMs": { "description": "Cumulative active-duration budget per session, in ms.", "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] } }, "type": "object" }, "ComponentHealth": { "properties": { "checkedAt": { "format": "date-time", "type": [ "string", "null" ] }, "message": { "type": [ "string", "null" ] }, "status": { "$ref": "#/$defs/HealthStatus" } }, "required": [ "status" ], "type": "object" }, "ConfirmationLevel": { "description": "The strongest delivery level an actuator can actually confirm.\n`queued` NEVER implies `completed`; UIs must not display beyond this level.", "enum": [ "requested", "queued", "acknowledged", "delivered", "completed", "verified", "unknown" ], "type": "string" }, "ConsentExpiry": { "description": "When a granted consent expires.", "oneOf": [ { "enum": [ "session", "duration", "persistent" ], "type": "string" }, { "const": "action", "description": "One action only.", "type": "string" } ] }, "ConsentSemantics": { "description": "Consent guidance in human terms. The *requirement* itself stays in the\nformal manifest (`requires_consent`) and the governor.", "properties": { "expires": { "$ref": "#/$defs/ConsentExpiry", "default": "session" }, "reason": { "$ref": "#/$defs/LocalizedText", "description": "Why consent is needed, in plain language." }, "required": { "$ref": "#/$defs/TriState", "default": "unknown" }, "suggestedScope": { "description": "Suggested consent scope string, e.g. `channel:haptic`.", "type": [ "string", "null" ] } }, "type": "object" }, "CostDescriptor": { "description": "Cost hints used by the orchestrator's utility scoring.", "properties": { "monetaryPerInvocation": { "default": 0.0, "description": "Monetary cost per invocation in USD (0 for local channels).", "format": "double", "type": "number" }, "resource": { "default": 0.0, "description": "Abstract resource cost 0..1 (CPU, battery, attention budget).", "format": "double", "type": "number" } }, "type": "object" }, "DataRetention": { "description": "How long observed data is retained.", "enum": [ "none", "session", "persistent", "unknown" ], "type": "string" }, "DataSemantics": { "description": "What a receptor's data means for the person: categories, whether it is\npersonal, whether it leaves this machine.", "properties": { "dataCategories": { "description": "Human-meaningful categories, e.g. `[\"task-status\", \"presence\"]`.", "items": { "type": "string" }, "type": "array" }, "factFields": { "description": "Fact keys that are direct observations.", "items": { "type": "string" }, "type": "array" }, "inferenceFields": { "description": "Fields that are model inferences (must be shown as guesses).", "items": { "type": "string" }, "type": "array" }, "leavesDevice": { "$ref": "#/$defs/TriState", "default": "unknown" }, "personalData": { "$ref": "#/$defs/TriState", "default": "unknown" }, "retention": { "$ref": "#/$defs/DataRetention", "default": "unknown" }, "sensitivity": { "$ref": "#/$defs/DataSensitivityLevel", "default": "unknown" }, "source": { "$ref": "#/$defs/DataSource", "default": "unknown" } }, "type": "object" }, "DataSensitivityLevel": { "description": "Sensitivity of the data a receptor produces, in human terms.", "enum": [ "none", "low", "medium", "high", "unknown" ], "type": "string" }, "DataSource": { "description": "Where observed data originates.", "enum": [ "local", "device", "external-service", "unknown" ], "type": "string" }, "DelegationLimits": { "description": "Deterministic delegation limits (policy-owned).", "properties": { "maxDepth": { "default": 3, "format": "uint32", "minimum": 0, "type": "integer" }, "maxMessagesPerSession": { "default": 200, "format": "uint32", "minimum": 0, "type": "integer" }, "maxParallel": { "default": 4, "format": "uint32", "minimum": 0, "type": "integer" }, "maxSessions": { "default": 8, "format": "uint32", "minimum": 0, "type": "integer" }, "providerAllowlist": { "default": [], "description": "Provider allowlist for delegation targets; empty = none allowed.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "EffectSemantics": { "description": "What an actuator or write-operation affects.", "properties": { "affects": { "description": "Human-meaningful targets, e.g. `[\"screen\", \"external-calendar\"]`.", "items": { "type": "string" }, "type": "array" }, "confirmationLevel": { "$ref": "#/$defs/ConfirmationLevel", "default": "unknown", "description": "The deepest confirmation the driver can honestly provide." }, "externalSideEffect": { "$ref": "#/$defs/TriState", "default": "unknown" }, "interruptiveness": { "$ref": "#/$defs/Interruptiveness", "default": "unknown" }, "physicalEffect": { "$ref": "#/$defs/TriState", "default": "unknown" }, "reversible": { "$ref": "#/$defs/TriState", "default": "unknown" } }, "type": "object" }, "HealthStatus": { "enum": [ "healthy", "degraded", "unhealthy", "offline", "unknown" ], "type": "string" }, "HumanMeta": { "description": "The optional human layer bundle carried by manifests.", "properties": { "consent": { "anyOf": [ { "$ref": "#/$defs/ConsentSemantics" }, { "type": "null" } ] }, "data": { "anyOf": [ { "$ref": "#/$defs/DataSemantics" }, { "type": "null" } ] }, "effect": { "anyOf": [ { "$ref": "#/$defs/EffectSemantics" }, { "type": "null" } ] }, "presentation": { "anyOf": [ { "$ref": "#/$defs/HumanPresentation" }, { "type": "null" } ] } }, "type": "object" }, "HumanPresentation": { "description": "Structured human description an adapter attaches to a capability.\nPurely presentational: names, examples, setup help. Never safety facts.", "properties": { "beginnerRecommended": { "default": false, "description": "Suggested for first-time users in onboarding.", "type": "boolean" }, "category": { "description": "Presentation category (e.g. `notification`, `time`); may differ from\nthe technical manifest category.", "type": [ "string", "null" ] }, "examples": { "items": { "$ref": "#/$defs/LocalizedText" }, "type": "array" }, "iconHint": { "description": "Icon name hint from the shared icon set (e.g. `bell`, `clock`).", "type": [ "string", "null" ] }, "longDescription": { "$ref": "#/$defs/LocalizedText" }, "name": { "$ref": "#/$defs/LocalizedText" }, "setupInstructions": { "$ref": "#/$defs/LocalizedText" }, "shortDescription": { "$ref": "#/$defs/LocalizedText" } }, "type": "object" }, "InitiativeLevel": { "description": "How proactive the runtime may be without an explicit request.", "oneOf": [ { "const": "passive", "description": "Never initiate; only respond to explicit requests.", "type": "string" }, { "const": "suggest", "description": "May surface low-risk, non-interrupting signals.", "type": "string" }, { "const": "active", "description": "May initiate bounded interactions on allowed channels.", "type": "string" } ] }, "Interruptiveness": { "description": "How disruptive an actuator's output is.", "enum": [ "none", "low", "medium", "high", "unknown" ], "type": "string" }, "LocalizedText": { "additionalProperties": { "type": "string" }, "description": "Localized text keyed by BCP-47 tag (`zh-TW`, `en`, …).\n\nLookup falls back: exact tag → same primary language → `en` → any entry.", "type": "object" }, "OperationId": { "description": "Identifies one operation of a tool, e.g. `interaction.observe`.", "type": "string" }, "PolicyConfig": { "properties": { "actuatorAllowlist": { "default": [], "description": "Explicit actuator allowlist; empty = builtin low-risk defaults only.", "items": { "type": "string" }, "type": "array" }, "allowedChannels": { "default": [], "description": "Channels the runtime may use at all.", "items": { "type": "string" }, "type": "array" }, "channelLimits": { "additionalProperties": { "$ref": "#/$defs/ChannelLimits" }, "default": {}, "description": "Per-channel limits keyed by channel name; `*` applies to all.", "type": "object" }, "defaultTtlMs": { "default": 30000, "description": "Global default TTL for plans/actions, ms.", "format": "uint64", "minimum": 0, "type": "integer" }, "delegation": { "$ref": "#/$defs/DelegationLimits", "default": { "maxDepth": 3, "maxMessagesPerSession": 200, "maxParallel": 4, "maxSessions": 8, "providerAllowlist": [] }, "description": "Deterministic delegation limits for agent sessions." }, "enabled": { "default": true, "description": "Master switch. When false, only read-only operations are allowed.", "type": "boolean" }, "initiative": { "$ref": "#/$defs/InitiativeLevel", "default": "suggest" }, "maxPatternSteps": { "default": 64, "description": "Hard cap for any pattern's steps.", "format": "uint32", "minimum": 0, "type": "integer" }, "maxScheduledActions": { "default": 128, "description": "Hard cap on total scheduled (queued+running) actions.", "format": "uint32", "minimum": 0, "type": "integer" }, "quietHours": { "default": [], "items": { "$ref": "#/$defs/QuietHours" }, "type": "array" }, "receptorAllowlist": { "default": [], "description": "Explicit receptor allowlist; empty = builtin defaults only.", "items": { "type": "string" }, "type": "array" }, "requireApprovalAt": { "$ref": "#/$defs/RiskClass", "default": "high", "description": "Actions at or above this risk require explicit human approval." }, "resumeHighRiskAfterRestart": { "default": false, "description": "Whether high-risk physical output may resume automatically after crash.\nThis is deliberately not configurable to `true` via the public API.", "type": "boolean" }, "schemaVersion": { "type": "string" }, "sessionMonetaryBudget": { "default": 0.0, "description": "Monetary budget per session in USD.", "format": "double", "type": "number" }, "toolAllowlist": { "default": [], "description": "Tool operations that may be invoked.", "items": { "type": "string" }, "type": "array" } }, "required": [ "schemaVersion" ], "type": "object" }, "QuietHours": { "description": "A daily quiet window in local wall-clock time (\"HH:MM\" 24h).", "properties": { "end": { "type": "string" }, "silencedChannels": { "default": [], "description": "Channels silenced during the window; empty = all audible/intrusive ones.", "items": { "type": "string" }, "type": "array" }, "start": { "type": "string" } }, "required": [ "start", "end" ], "type": "object" }, "ReceptorId": { "description": "Identifies a receptor instance, e.g. `system.time` or `mock.receptor`.", "type": "string" }, "ReceptorManifest": { "properties": { "availability": { "$ref": "#/$defs/Availability", "default": "available" }, "category": { "description": "Free-form category, e.g. `session`, `task`, `environment`, `device`.", "type": "string" }, "configSchema": { "description": "JSON Schema describing driver configuration." }, "description": { "type": "string" }, "driver": { "description": "Driver identifier, e.g. `builtin.system-time`.", "type": "string" }, "health": { "$ref": "#/$defs/ComponentHealth", "default": { "status": "healthy" } }, "human": { "anyOf": [ { "$ref": "#/$defs/HumanMeta" }, { "type": "null" } ], "description": "Optional human-readable layer (presentation + data semantics).\nNever a safety truth source; formal fields above always win." }, "id": { "$ref": "#/$defs/ReceptorId" }, "latencyMs": { "description": "Typical end-to-end latency in milliseconds.", "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "mode": { "$ref": "#/$defs/ReceptorMode" }, "name": { "type": "string" }, "provides": { "default": [], "description": "Fact keys this receptor can provide, e.g. `[\"event\", \"state\"]`.", "items": { "type": "string" }, "type": "array" }, "refreshIntervalMs": { "description": "Suggested polling interval for `mode = poll`.", "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "requiresConsent": { "type": "boolean" }, "schemaVersion": { "type": "string" }, "sensitivity": { "$ref": "#/$defs/Sensitivity" }, "version": { "type": "string" } }, "required": [ "id", "name", "description", "category", "mode", "sensitivity", "requiresConsent", "driver", "version", "schemaVersion" ], "type": "object" }, "ReceptorMode": { "enum": [ "poll", "event", "stream" ], "type": "string" }, "RiskClass": { "description": "Risk classification of an operation / actuator.\n\nOrdering matters: later variants are riskier. `Ord` is derived so policy can\ncompare against thresholds.", "oneOf": [ { "const": "read-only", "description": "Pure read, no side effect.", "type": "string" }, { "const": "low", "description": "Local, reversible, low-noise side effect (log line, UI hint).", "type": "string" }, { "const": "bounded-side-effect", "description": "Side effect bounded by deterministic policy limits (sound, haptic, notification).", "type": "string" }, { "const": "external-write", "description": "Writes that leave the machine (webhook, message, GitHub comment).", "type": "string" }, { "const": "high", "description": "Hard-to-reverse or high-impact operations (merge PR, purchase, physical device).", "type": "string" }, { "const": "critical", "description": "Destructive / safety-critical. Always requires explicit human approval.", "type": "string" } ] }, "Sensitivity": { "description": "How sensitive the data produced by a receptor is.", "oneOf": [ { "const": "public", "description": "Non-personal machine state (system time, task lifecycle).", "type": "string" }, { "const": "internal", "description": "Workspace-level information (file names, task titles).", "type": "string" }, { "const": "personal", "description": "Personal but not biometric (user text, presence).", "type": "string" }, { "const": "intimate", "description": "Camera, microphone, location, physiological signals.", "type": "string" } ] }, "ToolId": { "description": "Identifies a tool (namespace), e.g. `interaction`.", "type": "string" }, "ToolOperationManifest": { "properties": { "availability": { "$ref": "#/$defs/Availability", "default": "available" }, "cost": { "anyOf": [ { "$ref": "#/$defs/CostDescriptor" }, { "type": "null" } ] }, "description": { "type": "string" }, "externalSideEffect": { "type": "boolean" }, "human": { "anyOf": [ { "$ref": "#/$defs/HumanMeta" }, { "type": "null" } ], "description": "Optional human-readable layer. Never a safety truth source." }, "inputSchema": true, "name": { "description": "Fully qualified stable name, e.g. `interaction.observe`.", "type": "string" }, "operation": { "$ref": "#/$defs/OperationId" }, "outputSchema": true, "permissions": { "default": [], "items": { "type": "string" }, "type": "array" }, "requiresApproval": { "type": "boolean" }, "reversible": { "type": "boolean" }, "risk": { "$ref": "#/$defs/RiskClass" }, "roles": { "items": { "$ref": "#/$defs/ToolRole" }, "type": "array" }, "schemaVersion": { "type": "string" }, "tool": { "$ref": "#/$defs/ToolId" } }, "required": [ "tool", "operation", "name", "description", "roles", "inputSchema", "outputSchema", "risk", "reversible", "externalSideEffect", "requiresApproval", "schemaVersion" ], "type": "object" }, "ToolRole": { "description": "Role a tool operation plays in the interaction loop.", "enum": [ "receptor", "actuator" ], "type": "string" }, "TriState": { "anyOf": [ { "type": "boolean" }, { "const": "unknown", "type": "string" } ] } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "actuators": { "items": { "$ref": "#/$defs/ActuatorManifest" }, "type": "array" }, "constraints": { "default": [], "items": { "$ref": "#/$defs/CapabilityConstraint" }, "type": "array" }, "generatedAt": { "format": "date-time", "type": "string" }, "receptors": { "items": { "$ref": "#/$defs/ReceptorManifest" }, "type": "array" }, "schemaVersion": { "type": "string" }, "sessionPolicy": { "$ref": "#/$defs/PolicyConfig", "description": "Policy view relevant to planning (limits, initiative, quiet hours)." }, "toolOperations": { "items": { "$ref": "#/$defs/ToolOperationManifest" }, "type": "array" }, "version": { "description": "Monotonic-ish version: changes whenever registry content changes.", "format": "uint64", "minimum": 0, "type": "integer" } }, "required": [ "receptors", "actuators", "toolOperations", "sessionPolicy", "generatedAt", "version", "schemaVersion" ], "title": "CapabilitySnapshot", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Discover the current receptors, actuators, tool operations, constraints and session policy. Always call before planning; never assume a device exists.", "x-external-side-effect": false, "x-risk": "read-only" } }, "/v1/tools/interaction.execute/call": { "post": { "operationId": "interaction_execute", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "dryRun": { "default": false, "type": "boolean" }, "planId": { "type": "string" } }, "required": [ "planId" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$defs": { "ActionId": { "description": "Identifies a single bounded action / receipt.", "type": "string" }, "ActionParameters": { "description": "Normalized action parameters shared by all channels.", "properties": { "durationMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "extra": { "description": "Driver-specific extras (validated against the actuator's schema)." }, "magnitude": { "format": "double", "type": [ "number", "null" ] }, "message": { "type": [ "string", "null" ] } }, "type": "object" }, "ActionStatus": { "oneOf": [ { "const": "planned", "description": "Plan step exists but has not been authorized.", "type": "string" }, { "const": "authorized", "description": "Policy governor approved and produced a bounded action.", "type": "string" }, { "const": "accepted", "description": "Runtime accepted the action into its queue. NOT completion.", "type": "string" }, { "const": "dispatched", "description": "Driver has sent the command toward the target.", "type": "string" }, { "const": "acknowledged", "description": "Target (device/service) confirmed receipt of the command.", "type": "string" }, { "const": "observed", "description": "The effect was observed in the environment.", "type": "string" }, { "const": "completed", "description": "Terminal: goal achieved and verified to the configured standard.", "type": "string" }, { "const": "blocked", "description": "Terminal: policy refused the action.", "type": "string" }, { "const": "failed", "description": "Terminal: execution failed.", "type": "string" }, { "const": "uncertain", "description": "Terminal: outcome could not be determined.", "type": "string" }, { "const": "cancelled", "description": "Terminal: cancelled by user, AI, policy or shutdown.", "type": "string" }, { "const": "expired", "description": "Terminal: TTL elapsed before completion.", "type": "string" }, { "const": "stopped", "description": "Terminal: halted by emergency stop.", "type": "string" } ] }, "ActuatorId": { "description": "Identifies an actuator instance, e.g. `conversation`.", "type": "string" }, "CorrelationId": { "description": "Correlates observations, plans, actions and events end-to-end.", "type": "string" }, "ObservationId": { "description": "Identifies a single observation.", "type": "string" }, "PlanId": { "description": "Identifies a plan produced by the orchestrator.", "type": "string" }, "PolicyDecision": { "description": "One decision the governor made while bounding a request. The list of\ndecisions is the audit trail explaining requested -> effective.", "oneOf": [ { "properties": { "outcome": { "const": "allowed", "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule" ], "type": "object" }, { "properties": { "field": { "type": "string" }, "from": { "format": "double", "type": "number" }, "outcome": { "const": "clamped", "type": "string" }, "rule": { "type": "string" }, "to": { "format": "double", "type": "number" } }, "required": [ "outcome", "rule", "field", "from", "to" ], "type": "object" }, { "properties": { "detail": { "type": "string" }, "outcome": { "const": "silenced", "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "detail" ], "type": "object" }, { "properties": { "outcome": { "const": "blocked", "type": "string" }, "reason": { "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "reason" ], "type": "object" }, { "properties": { "outcome": { "const": "approvalRequired", "type": "string" }, "reason": { "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "reason" ], "type": "object" } ] }, "ReceiptError": { "properties": { "at": { "format": "date-time", "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } }, "required": [ "code", "message", "at" ], "type": "object" }, "SessionId": { "description": "Identifies an interaction session (the consent boundary).", "type": "string" }, "VerificationEvidence": { "description": "Standard verification outcome attached to receipts.", "properties": { "detail": { "type": [ "string", "null" ] }, "observationIds": { "default": [], "description": "Observation ids that support the verdict.", "items": { "$ref": "#/$defs/ObservationId" }, "type": "array" }, "verdict": { "$ref": "#/$defs/VerificationVerdict" }, "verifiedAt": { "format": "date-time", "type": "string" } }, "required": [ "verdict", "verifiedAt" ], "type": "object" }, "VerificationVerdict": { "oneOf": [ { "const": "observed", "description": "Effect observed in the environment.", "type": "string" }, { "const": "acknowledged-only", "description": "Driver acknowledged but no environmental confirmation.", "type": "string" }, { "const": "uncertain", "description": "Could not determine whether the effect happened.", "type": "string" }, { "const": "refuted", "description": "Evidence says the effect did NOT happen.", "type": "string" } ] } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Full lifecycle record of one action.", "properties": { "actionId": { "$ref": "#/$defs/ActionId" }, "actuatorId": { "$ref": "#/$defs/ActuatorId" }, "correlationId": { "$ref": "#/$defs/CorrelationId" }, "currentStatus": { "$ref": "#/$defs/ActionStatus" }, "driverResponse": { "additionalProperties": true, "default": {}, "description": "Raw driver response snippets (redacted upstream if sensitive).", "type": "object" }, "effectiveBoundedParameters": { "$ref": "#/$defs/ActionParameters" }, "errors": { "default": [], "items": { "$ref": "#/$defs/ReceiptError" }, "type": "array" }, "expiresAt": { "description": "TTL deadline inherited from the bounded action; the watchdog expires\nnon-terminal receipts past this instant.", "format": "date-time", "type": [ "string", "null" ] }, "intent": { "type": "string" }, "planId": { "$ref": "#/$defs/PlanId" }, "policyDecisions": { "default": [], "items": { "$ref": "#/$defs/PolicyDecision" }, "type": "array" }, "requestedParameters": { "$ref": "#/$defs/ActionParameters" }, "schemaVersion": { "type": "string" }, "sessionId": { "$ref": "#/$defs/SessionId" }, "timestamps": { "description": "Timestamp of each state entered, in order.", "items": { "maxItems": 2, "minItems": 2, "prefixItems": [ { "$ref": "#/$defs/ActionStatus" }, { "format": "date-time", "type": "string" } ], "type": "array" }, "type": "array" }, "verification": { "anyOf": [ { "$ref": "#/$defs/VerificationEvidence" }, { "type": "null" } ] } }, "required": [ "actionId", "planId", "sessionId", "actuatorId", "intent", "requestedParameters", "effectiveBoundedParameters", "currentStatus", "timestamps", "correlationId", "schemaVersion" ], "title": "ActionReceipt", "type": "object" }, "type": "array" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Execute an authorized plan. Returns action receipts. IMPORTANT: an accepted/queued receipt is NOT completion — poll action_status or verify.", "x-external-side-effect": false, "x-risk": "bounded-side-effect" } }, "/v1/tools/interaction.knowledge_expand_graph/call": { "post": { "operationId": "interaction_knowledge_expand_graph", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "root": { "type": "string" } }, "required": [ "root" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Expand one node's neighborhood (edges + neighbor summaries).", "x-external-side-effect": false, "x-risk": "read-only" } }, "/v1/tools/interaction.knowledge_get/call": { "post": { "operationId": "interaction_knowledge_get", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "nodeId": { "type": "string" } }, "required": [ "nodeId" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "KnowledgeNodeId": { "description": "Knowledge graph node id.", "type": "string" }, "KnowledgeReview": { "properties": { "at": { "format": "date-time", "type": "string" }, "note": { "type": "string" }, "reviewer": { "$ref": "#/$defs/MemoryActor" }, "verdict": { "description": "comment|approve|reject(approve 只有人類有效——服務層強制)。", "type": "string" } }, "required": [ "reviewer", "verdict", "note", "at" ], "type": "object" }, "KnowledgeStatus": { "description": "知識節點狀態機(spec §15)。", "enum": [ "candidate", "active", "stale", "disputed", "superseded", "archived" ], "type": "string" }, "MemoryActor": { "description": "誰建立的(權限規則依此判斷,不信任自稱)。", "oneOf": [ { "properties": { "kind": { "const": "human", "type": "string" } }, "required": [ "kind" ], "type": "object" }, { "properties": { "id": { "type": "string" }, "kind": { "const": "agent", "type": "string" } }, "required": [ "kind", "id" ], "type": "object" }, { "properties": { "kind": { "const": "runtime", "type": "string" } }, "required": [ "kind" ], "type": "object" } ] }, "NodeType": { "enum": [ "entity", "claim", "source" ], "type": "string" }, "SourceRef": { "description": "指回原始素材的精確引用(時間段/區域/行號)。", "properties": { "assetHash": { "type": [ "string", "null" ] }, "note": { "type": [ "string", "null" ] }, "segment": { "description": "片段語法:`t=12.5-30.2`(秒)|`region=x,y,w,h`|`lines=10-42`|`page=3`。", "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } }, "type": "object" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "applicability": { "type": [ "string", "null" ] }, "confidence": { "format": "double", "type": "number" }, "content": { "type": "string" }, "counterexamples": { "default": [], "description": "反例與適用範圍(升格 know-how 必填的誠實欄位)。", "items": { "type": "string" }, "type": "array" }, "createdAt": { "format": "date-time", "type": "string" }, "createdBy": { "$ref": "#/$defs/MemoryActor" }, "domains": { "default": [], "items": { "type": "string" }, "type": "array" }, "evidence": { "default": [], "description": "證據:指回素材/URL 的精確引用。Claim 必須至少一個。", "items": { "$ref": "#/$defs/SourceRef" }, "type": "array" }, "nodeId": { "$ref": "#/$defs/KnowledgeNodeId" }, "nodeType": { "$ref": "#/$defs/NodeType" }, "reviewAfter": { "format": "date-time", "type": [ "string", "null" ] }, "reviews": { "default": [], "description": "複審紀錄(agent 可 submit-review 留言;只有人類 approve 才 activate)。", "items": { "$ref": "#/$defs/KnowledgeReview" }, "type": "array" }, "schemaVersion": { "type": "string" }, "status": { "$ref": "#/$defs/KnowledgeStatus" }, "supersedes": { "anyOf": [ { "$ref": "#/$defs/KnowledgeNodeId" }, { "type": "null" } ] }, "title": { "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "version": { "format": "uint32", "minimum": 0, "type": "integer" } }, "required": [ "nodeId", "nodeType", "title", "content", "status", "confidence", "createdBy", "version", "createdAt", "updatedAt", "schemaVersion" ], "title": "KnowledgeNode", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Read one knowledge node (status shows candidate/active/stale/disputed/superseded honestly).", "x-external-side-effect": false, "x-risk": "read-only" } }, "/v1/tools/interaction.knowledge_get_source/call": { "post": { "operationId": "interaction_knowledge_get_source", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "hash": { "type": "string" } }, "required": [ "hash" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Read a source asset's metadata and (for text) a capped content preview. Raw assets are immutable.", "x-external-side-effect": false, "x-risk": "read-only" } }, "/v1/tools/interaction.knowledge_propose_claim/call": { "post": { "operationId": "interaction_knowledge_propose_claim", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "confidence": { "type": "number" }, "content": { "type": "string" }, "counterexamples": { "items": { "type": "string" }, "type": "array" }, "domains": { "items": { "type": "string" }, "type": "array" }, "evidence": { "items": { "type": "object" }, "type": "array" }, "title": { "type": "string" } }, "required": [ "title", "content", "evidence" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "KnowledgeNodeId": { "description": "Knowledge graph node id.", "type": "string" }, "KnowledgeReview": { "properties": { "at": { "format": "date-time", "type": "string" }, "note": { "type": "string" }, "reviewer": { "$ref": "#/$defs/MemoryActor" }, "verdict": { "description": "comment|approve|reject(approve 只有人類有效——服務層強制)。", "type": "string" } }, "required": [ "reviewer", "verdict", "note", "at" ], "type": "object" }, "KnowledgeStatus": { "description": "知識節點狀態機(spec §15)。", "enum": [ "candidate", "active", "stale", "disputed", "superseded", "archived" ], "type": "string" }, "MemoryActor": { "description": "誰建立的(權限規則依此判斷,不信任自稱)。", "oneOf": [ { "properties": { "kind": { "const": "human", "type": "string" } }, "required": [ "kind" ], "type": "object" }, { "properties": { "id": { "type": "string" }, "kind": { "const": "agent", "type": "string" } }, "required": [ "kind", "id" ], "type": "object" }, { "properties": { "kind": { "const": "runtime", "type": "string" } }, "required": [ "kind" ], "type": "object" } ] }, "NodeType": { "enum": [ "entity", "claim", "source" ], "type": "string" }, "SourceRef": { "description": "指回原始素材的精確引用(時間段/區域/行號)。", "properties": { "assetHash": { "type": [ "string", "null" ] }, "note": { "type": [ "string", "null" ] }, "segment": { "description": "片段語法:`t=12.5-30.2`(秒)|`region=x,y,w,h`|`lines=10-42`|`page=3`。", "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } }, "type": "object" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "applicability": { "type": [ "string", "null" ] }, "confidence": { "format": "double", "type": "number" }, "content": { "type": "string" }, "counterexamples": { "default": [], "description": "反例與適用範圍(升格 know-how 必填的誠實欄位)。", "items": { "type": "string" }, "type": "array" }, "createdAt": { "format": "date-time", "type": "string" }, "createdBy": { "$ref": "#/$defs/MemoryActor" }, "domains": { "default": [], "items": { "type": "string" }, "type": "array" }, "evidence": { "default": [], "description": "證據:指回素材/URL 的精確引用。Claim 必須至少一個。", "items": { "$ref": "#/$defs/SourceRef" }, "type": "array" }, "nodeId": { "$ref": "#/$defs/KnowledgeNodeId" }, "nodeType": { "$ref": "#/$defs/NodeType" }, "reviewAfter": { "format": "date-time", "type": [ "string", "null" ] }, "reviews": { "default": [], "description": "複審紀錄(agent 可 submit-review 留言;只有人類 approve 才 activate)。", "items": { "$ref": "#/$defs/KnowledgeReview" }, "type": "array" }, "schemaVersion": { "type": "string" }, "status": { "$ref": "#/$defs/KnowledgeStatus" }, "supersedes": { "anyOf": [ { "$ref": "#/$defs/KnowledgeNodeId" }, { "type": "null" } ] }, "title": { "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "version": { "format": "uint32", "minimum": 0, "type": "integer" } }, "required": [ "nodeId", "nodeType", "title", "content", "status", "confidence", "createdBy", "version", "createdAt", "updatedAt", "schemaVersion" ], "title": "KnowledgeNode", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Propose a CLAIM with evidence (asset hash/URL + segment REQUIRED). Always a CANDIDATE; never activates itself.", "x-external-side-effect": false, "x-risk": "low" } }, "/v1/tools/interaction.knowledge_propose_entity/call": { "post": { "operationId": "interaction_knowledge_propose_entity", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "content": { "type": "string" }, "domains": { "items": { "type": "string" }, "type": "array" }, "title": { "type": "string" } }, "required": [ "title", "content" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "KnowledgeNodeId": { "description": "Knowledge graph node id.", "type": "string" }, "KnowledgeReview": { "properties": { "at": { "format": "date-time", "type": "string" }, "note": { "type": "string" }, "reviewer": { "$ref": "#/$defs/MemoryActor" }, "verdict": { "description": "comment|approve|reject(approve 只有人類有效——服務層強制)。", "type": "string" } }, "required": [ "reviewer", "verdict", "note", "at" ], "type": "object" }, "KnowledgeStatus": { "description": "知識節點狀態機(spec §15)。", "enum": [ "candidate", "active", "stale", "disputed", "superseded", "archived" ], "type": "string" }, "MemoryActor": { "description": "誰建立的(權限規則依此判斷,不信任自稱)。", "oneOf": [ { "properties": { "kind": { "const": "human", "type": "string" } }, "required": [ "kind" ], "type": "object" }, { "properties": { "id": { "type": "string" }, "kind": { "const": "agent", "type": "string" } }, "required": [ "kind", "id" ], "type": "object" }, { "properties": { "kind": { "const": "runtime", "type": "string" } }, "required": [ "kind" ], "type": "object" } ] }, "NodeType": { "enum": [ "entity", "claim", "source" ], "type": "string" }, "SourceRef": { "description": "指回原始素材的精確引用(時間段/區域/行號)。", "properties": { "assetHash": { "type": [ "string", "null" ] }, "note": { "type": [ "string", "null" ] }, "segment": { "description": "片段語法:`t=12.5-30.2`(秒)|`region=x,y,w,h`|`lines=10-42`|`page=3`。", "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } }, "type": "object" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "applicability": { "type": [ "string", "null" ] }, "confidence": { "format": "double", "type": "number" }, "content": { "type": "string" }, "counterexamples": { "default": [], "description": "反例與適用範圍(升格 know-how 必填的誠實欄位)。", "items": { "type": "string" }, "type": "array" }, "createdAt": { "format": "date-time", "type": "string" }, "createdBy": { "$ref": "#/$defs/MemoryActor" }, "domains": { "default": [], "items": { "type": "string" }, "type": "array" }, "evidence": { "default": [], "description": "證據:指回素材/URL 的精確引用。Claim 必須至少一個。", "items": { "$ref": "#/$defs/SourceRef" }, "type": "array" }, "nodeId": { "$ref": "#/$defs/KnowledgeNodeId" }, "nodeType": { "$ref": "#/$defs/NodeType" }, "reviewAfter": { "format": "date-time", "type": [ "string", "null" ] }, "reviews": { "default": [], "description": "複審紀錄(agent 可 submit-review 留言;只有人類 approve 才 activate)。", "items": { "$ref": "#/$defs/KnowledgeReview" }, "type": "array" }, "schemaVersion": { "type": "string" }, "status": { "$ref": "#/$defs/KnowledgeStatus" }, "supersedes": { "anyOf": [ { "$ref": "#/$defs/KnowledgeNodeId" }, { "type": "null" } ] }, "title": { "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "version": { "format": "uint32", "minimum": 0, "type": "integer" } }, "required": [ "nodeId", "nodeType", "title", "content", "status", "confidence", "createdBy", "version", "createdAt", "updatedAt", "schemaVersion" ], "title": "KnowledgeNode", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Propose an ENTITY node. AI proposals always land as CANDIDATE — a human review activates them.", "x-external-side-effect": false, "x-risk": "low" } }, "/v1/tools/interaction.knowledge_propose_relation/call": { "post": { "operationId": "interaction_knowledge_propose_relation", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "confidence": { "type": "number" }, "from": { "type": "string" }, "origin": { "type": "string" }, "rationale": { "type": "string" }, "relation": { "type": "string" }, "to": { "type": "string" } }, "required": [ "from", "to", "relation", "origin" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "EdgeOrigin": { "description": "連結性質(跨領域連結必須標記;spec §11)。", "oneOf": [ { "const": "research-supported", "description": "研究支持。", "type": "string" }, { "const": "engineering-analogy", "description": "工程類比。", "type": "string" }, { "const": "creative-inspiration", "description": "創作啟發。", "type": "string" }, { "const": "ai-conjecture", "description": "AI 推測。", "type": "string" }, { "const": "user-confirmed", "description": "使用者確認的設計原則。", "type": "string" } ] }, "KnowledgeEdgeId": { "description": "Knowledge graph edge id.", "type": "string" }, "KnowledgeNodeId": { "description": "Knowledge graph node id.", "type": "string" }, "KnowledgeStatus": { "description": "知識節點狀態機(spec §15)。", "enum": [ "candidate", "active", "stale", "disputed", "superseded", "archived" ], "type": "string" }, "MemoryActor": { "description": "誰建立的(權限規則依此判斷,不信任自稱)。", "oneOf": [ { "properties": { "kind": { "const": "human", "type": "string" } }, "required": [ "kind" ], "type": "object" }, { "properties": { "id": { "type": "string" }, "kind": { "const": "agent", "type": "string" } }, "required": [ "kind", "id" ], "type": "object" }, { "properties": { "kind": { "const": "runtime", "type": "string" } }, "required": [ "kind" ], "type": "object" } ] }, "RelationType": { "description": "關係類型(spec §11 清單)。", "enum": [ "supports", "contradicts", "causes", "influences", "applies-to", "implemented-by", "similar-to", "analogy", "design-transfer", "derived-from", "supersedes", "conflicts-with" ], "type": "string" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "confidence": { "format": "double", "type": "number" }, "createdAt": { "format": "date-time", "type": "string" }, "createdBy": { "$ref": "#/$defs/MemoryActor" }, "edgeId": { "$ref": "#/$defs/KnowledgeEdgeId" }, "from": { "$ref": "#/$defs/KnowledgeNodeId" }, "origin": { "$ref": "#/$defs/EdgeOrigin" }, "rationale": { "type": [ "string", "null" ] }, "relation": { "$ref": "#/$defs/RelationType" }, "schemaVersion": { "type": "string" }, "status": { "$ref": "#/$defs/KnowledgeStatus" }, "to": { "$ref": "#/$defs/KnowledgeNodeId" } }, "required": [ "edgeId", "from", "to", "relation", "origin", "status", "confidence", "createdBy", "createdAt", "schemaVersion" ], "title": "KnowledgeEdge", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Propose a typed relation. Analogy/conjecture origins can NEVER claim causality; AI proposals are candidates.", "x-external-side-effect": false, "x-risk": "low" } }, "/v1/tools/interaction.knowledge_propose_supersede/call": { "post": { "operationId": "interaction_knowledge_propose_supersede", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "applicability": { "type": "string" }, "confidence": { "type": "number" }, "content": { "type": "string" }, "counterexamples": { "items": { "type": "string" }, "type": "array" }, "domains": { "items": { "type": "string" }, "type": "array" }, "evidence": { "items": { "type": "object" }, "type": "array" }, "supersedes": { "type": "string" }, "title": { "type": "string" } }, "required": [ "supersedes", "title", "content", "evidence", "domains" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "KnowledgeNodeId": { "description": "Knowledge graph node id.", "type": "string" }, "KnowledgeReview": { "properties": { "at": { "format": "date-time", "type": "string" }, "note": { "type": "string" }, "reviewer": { "$ref": "#/$defs/MemoryActor" }, "verdict": { "description": "comment|approve|reject(approve 只有人類有效——服務層強制)。", "type": "string" } }, "required": [ "reviewer", "verdict", "note", "at" ], "type": "object" }, "KnowledgeStatus": { "description": "知識節點狀態機(spec §15)。", "enum": [ "candidate", "active", "stale", "disputed", "superseded", "archived" ], "type": "string" }, "MemoryActor": { "description": "誰建立的(權限規則依此判斷,不信任自稱)。", "oneOf": [ { "properties": { "kind": { "const": "human", "type": "string" } }, "required": [ "kind" ], "type": "object" }, { "properties": { "id": { "type": "string" }, "kind": { "const": "agent", "type": "string" } }, "required": [ "kind", "id" ], "type": "object" }, { "properties": { "kind": { "const": "runtime", "type": "string" } }, "required": [ "kind" ], "type": "object" } ] }, "NodeType": { "enum": [ "entity", "claim", "source" ], "type": "string" }, "SourceRef": { "description": "指回原始素材的精確引用(時間段/區域/行號)。", "properties": { "assetHash": { "type": [ "string", "null" ] }, "note": { "type": [ "string", "null" ] }, "segment": { "description": "片段語法:`t=12.5-30.2`(秒)|`region=x,y,w,h`|`lines=10-42`|`page=3`。", "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } }, "type": "object" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "applicability": { "type": [ "string", "null" ] }, "confidence": { "format": "double", "type": "number" }, "content": { "type": "string" }, "counterexamples": { "default": [], "description": "反例與適用範圍(升格 know-how 必填的誠實欄位)。", "items": { "type": "string" }, "type": "array" }, "createdAt": { "format": "date-time", "type": "string" }, "createdBy": { "$ref": "#/$defs/MemoryActor" }, "domains": { "default": [], "items": { "type": "string" }, "type": "array" }, "evidence": { "default": [], "description": "證據:指回素材/URL 的精確引用。Claim 必須至少一個。", "items": { "$ref": "#/$defs/SourceRef" }, "type": "array" }, "nodeId": { "$ref": "#/$defs/KnowledgeNodeId" }, "nodeType": { "$ref": "#/$defs/NodeType" }, "reviewAfter": { "format": "date-time", "type": [ "string", "null" ] }, "reviews": { "default": [], "description": "複審紀錄(agent 可 submit-review 留言;只有人類 approve 才 activate)。", "items": { "$ref": "#/$defs/KnowledgeReview" }, "type": "array" }, "schemaVersion": { "type": "string" }, "status": { "$ref": "#/$defs/KnowledgeStatus" }, "supersedes": { "anyOf": [ { "$ref": "#/$defs/KnowledgeNodeId" }, { "type": "null" } ] }, "title": { "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "version": { "format": "uint32", "minimum": 0, "type": "integer" } }, "required": [ "nodeId", "nodeType", "title", "content", "status", "confidence", "createdBy", "version", "createdAt", "updatedAt", "schemaVersion" ], "title": "KnowledgeNode", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Propose a new version that would supersede an existing node. The old node is only superseded when a HUMAN approves.", "x-external-side-effect": false, "x-risk": "low" } }, "/v1/tools/interaction.knowledge_search/call": { "post": { "operationId": "interaction_knowledge_search", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "k": { "maximum": 50, "minimum": 1, "type": "integer" }, "query": { "type": "string" } }, "required": [ "query" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "description": "candidate matches with retrieval scores and usable flags", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Search the knowledge graph (FTS + lexical-vector CANDIDATE retrieval; results are candidates, not truth). Read-only.", "x-external-side-effect": false, "x-risk": "read-only" } }, "/v1/tools/interaction.knowledge_submit_review/call": { "post": { "operationId": "interaction_knowledge_submit_review", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "nodeId": { "type": "string" }, "note": { "type": "string" } }, "required": [ "nodeId", "note" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "KnowledgeNodeId": { "description": "Knowledge graph node id.", "type": "string" }, "KnowledgeReview": { "properties": { "at": { "format": "date-time", "type": "string" }, "note": { "type": "string" }, "reviewer": { "$ref": "#/$defs/MemoryActor" }, "verdict": { "description": "comment|approve|reject(approve 只有人類有效——服務層強制)。", "type": "string" } }, "required": [ "reviewer", "verdict", "note", "at" ], "type": "object" }, "KnowledgeStatus": { "description": "知識節點狀態機(spec §15)。", "enum": [ "candidate", "active", "stale", "disputed", "superseded", "archived" ], "type": "string" }, "MemoryActor": { "description": "誰建立的(權限規則依此判斷,不信任自稱)。", "oneOf": [ { "properties": { "kind": { "const": "human", "type": "string" } }, "required": [ "kind" ], "type": "object" }, { "properties": { "id": { "type": "string" }, "kind": { "const": "agent", "type": "string" } }, "required": [ "kind", "id" ], "type": "object" }, { "properties": { "kind": { "const": "runtime", "type": "string" } }, "required": [ "kind" ], "type": "object" } ] }, "NodeType": { "enum": [ "entity", "claim", "source" ], "type": "string" }, "SourceRef": { "description": "指回原始素材的精確引用(時間段/區域/行號)。", "properties": { "assetHash": { "type": [ "string", "null" ] }, "note": { "type": [ "string", "null" ] }, "segment": { "description": "片段語法:`t=12.5-30.2`(秒)|`region=x,y,w,h`|`lines=10-42`|`page=3`。", "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } }, "type": "object" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "applicability": { "type": [ "string", "null" ] }, "confidence": { "format": "double", "type": "number" }, "content": { "type": "string" }, "counterexamples": { "default": [], "description": "反例與適用範圍(升格 know-how 必填的誠實欄位)。", "items": { "type": "string" }, "type": "array" }, "createdAt": { "format": "date-time", "type": "string" }, "createdBy": { "$ref": "#/$defs/MemoryActor" }, "domains": { "default": [], "items": { "type": "string" }, "type": "array" }, "evidence": { "default": [], "description": "證據:指回素材/URL 的精確引用。Claim 必須至少一個。", "items": { "$ref": "#/$defs/SourceRef" }, "type": "array" }, "nodeId": { "$ref": "#/$defs/KnowledgeNodeId" }, "nodeType": { "$ref": "#/$defs/NodeType" }, "reviewAfter": { "format": "date-time", "type": [ "string", "null" ] }, "reviews": { "default": [], "description": "複審紀錄(agent 可 submit-review 留言;只有人類 approve 才 activate)。", "items": { "$ref": "#/$defs/KnowledgeReview" }, "type": "array" }, "schemaVersion": { "type": "string" }, "status": { "$ref": "#/$defs/KnowledgeStatus" }, "supersedes": { "anyOf": [ { "$ref": "#/$defs/KnowledgeNodeId" }, { "type": "null" } ] }, "title": { "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "version": { "format": "uint32", "minimum": 0, "type": "integer" } }, "required": [ "nodeId", "nodeType", "title", "content", "status", "confidence", "createdBy", "version", "createdAt", "updatedAt", "schemaVersion" ], "title": "KnowledgeNode", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Add a review COMMENT to a candidate. An AI can comment but can never approve/reject — that stays human.", "x-external-side-effect": false, "x-risk": "low" } }, "/v1/tools/interaction.observe/call": { "post": { "operationId": "interaction_observe", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "fresh": { "default": false, "description": "Read live from the receptor instead of the store", "type": "boolean" }, "limit": { "maximum": 500, "minimum": 1, "type": "integer" }, "maxAgeMs": { "minimum": 0, "type": "integer" }, "receptorId": { "type": "string" } }, "required": [], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$defs": { "CorrelationId": { "description": "Correlates observations, plans, actions and events end-to-end.", "type": "string" }, "ObservationId": { "description": "Identifies a single observation.", "type": "string" }, "ObservationSource": { "properties": { "detail": { "type": [ "string", "null" ] }, "driver": { "description": "Driver that produced the observation.", "type": "string" }, "quality": { "default": 1.0, "description": "Quality of the source 0..1 (sensor calibration, API reliability).", "format": "double", "type": "number" } }, "required": [ "driver" ], "type": "object" }, "ReceptorId": { "description": "Identifies a receptor instance, e.g. `system.time` or `mock.receptor`.", "type": "string" }, "SessionId": { "description": "Identifies an interaction session (the consent boundary).", "type": "string" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "confidence": { "default": 1.0, "description": "Confidence of the inferences, 0..1. Facts are assumed confidence 1.", "format": "double", "type": "number" }, "correlationId": { "anyOf": [ { "$ref": "#/$defs/CorrelationId" }, { "type": "null" } ] }, "facts": { "additionalProperties": true, "default": {}, "description": "Directly observable facts. Keys are receptor-defined.", "type": "object" }, "freshnessMs": { "default": 0, "description": "Age of the data when received, in milliseconds.", "format": "uint64", "minimum": 0, "type": "integer" }, "inferences": { "additionalProperties": true, "default": {}, "description": "Model/driver inferences. MUST NOT be treated as facts.", "type": "object" }, "observationId": { "$ref": "#/$defs/ObservationId" }, "quality": { "default": 1.0, "description": "Source quality 0..1.", "format": "double", "type": "number" }, "receivedAt": { "description": "When the runtime received it.", "format": "date-time", "type": "string" }, "receptorId": { "$ref": "#/$defs/ReceptorId" }, "schemaVersion": { "type": "string" }, "sessionId": { "anyOf": [ { "$ref": "#/$defs/SessionId" }, { "type": "null" } ] }, "source": { "$ref": "#/$defs/ObservationSource" }, "timestamp": { "description": "When the underlying event happened.", "format": "date-time", "type": "string" } }, "required": [ "observationId", "receptorId", "timestamp", "receivedAt", "source", "schemaVersion" ], "title": "Observation", "type": "object" }, "type": "array" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Query recent observations (optionally one receptor, freshness-bounded). Facts and inferences are separate; treat low-confidence inferences as guesses.", "x-external-side-effect": false, "x-risk": "read-only" } }, "/v1/tools/interaction.plan/call": { "post": { "operationId": "interaction_plan", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "allowNoAction": { "default": true, "type": "boolean" }, "candidates": { "items": { "type": "string" }, "type": "array" }, "durationMs": { "minimum": 0, "type": "integer" }, "intent": { "description": "Semantic intent, e.g. celebrate-progress, warning", "type": "string" }, "magnitude": { "maximum": 1, "minimum": 0, "type": "number" }, "maxChannels": { "minimum": 1, "type": "integer" }, "message": { "type": "string" }, "minChannels": { "minimum": 0, "type": "integer" }, "preferredChannels": { "items": { "type": "string" }, "type": "array" } }, "required": [ "intent" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "ActionParameters": { "description": "Normalized action parameters shared by all channels.", "properties": { "durationMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "extra": { "description": "Driver-specific extras (validated against the actuator's schema)." }, "magnitude": { "format": "double", "type": [ "number", "null" ] }, "message": { "type": [ "string", "null" ] } }, "type": "object" }, "ActuatorId": { "description": "Identifies an actuator instance, e.g. `conversation`.", "type": "string" }, "CorrelationId": { "description": "Correlates observations, plans, actions and events end-to-end.", "type": "string" }, "PlanId": { "description": "Identifies a plan produced by the orchestrator.", "type": "string" }, "PlanStatus": { "oneOf": [ { "enum": [ "draft", "simulated", "authorized", "blocked", "executed", "expired" ], "type": "string" }, { "const": "no-action", "description": "The orchestrator judged that doing nothing is the best action.", "type": "string" } ] }, "PlannedStep": { "description": "One candidate step inside a plan: a target actuator plus requested parameters.", "properties": { "actuatorId": { "$ref": "#/$defs/ActuatorId" }, "channel": { "type": "string" }, "rationale": { "description": "Human-readable reason this step was selected.", "type": "string" }, "requested": { "$ref": "#/$defs/ActionParameters", "description": "Requested (pre-bounding) parameters." }, "score": { "description": "Utility score assigned by the orchestrator (explainable heuristic).", "format": "double", "type": "number" } }, "required": [ "actuatorId", "channel", "requested", "score", "rationale" ], "type": "object" }, "PolicyDecision": { "description": "One decision the governor made while bounding a request. The list of\ndecisions is the audit trail explaining requested -> effective.", "oneOf": [ { "properties": { "outcome": { "const": "allowed", "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule" ], "type": "object" }, { "properties": { "field": { "type": "string" }, "from": { "format": "double", "type": "number" }, "outcome": { "const": "clamped", "type": "string" }, "rule": { "type": "string" }, "to": { "format": "double", "type": "number" } }, "required": [ "outcome", "rule", "field", "from", "to" ], "type": "object" }, { "properties": { "detail": { "type": "string" }, "outcome": { "const": "silenced", "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "detail" ], "type": "object" }, { "properties": { "outcome": { "const": "blocked", "type": "string" }, "reason": { "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "reason" ], "type": "object" }, { "properties": { "outcome": { "const": "approvalRequired", "type": "string" }, "reason": { "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "reason" ], "type": "object" } ] }, "RejectedCandidate": { "properties": { "actuatorId": { "$ref": "#/$defs/ActuatorId" }, "reason": { "type": "string" } }, "required": [ "actuatorId", "reason" ], "type": "object" }, "SemanticIntent": { "description": "A semantic interaction request from an AI (or a recipe).", "properties": { "character": { "description": "Optional persona/character flavor, e.g. `restrained-delight`.", "type": [ "string", "null" ] }, "correlationId": { "anyOf": [ { "$ref": "#/$defs/CorrelationId" }, { "type": "null" } ] }, "durationMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "expiresAt": { "description": "The intent is void after this instant.", "format": "date-time", "type": [ "string", "null" ] }, "intent": { "description": "Semantic intent name, e.g. `celebrate-progress`, `warning`, `presence`.", "type": "string" }, "magnitude": { "description": "Normalized magnitude 0..1. This is a *suggestion*; policy clamps it.", "format": "double", "type": [ "number", "null" ] }, "message": { "description": "Optional message text suggestion (may be rewritten or silenced).", "type": [ "string", "null" ] }, "payload": { "description": "Free-form structured payload for driver-specific hints." }, "preferredChannels": { "default": [], "description": "Preferred channels in priority order, e.g. `[\"visual\", \"audio\"]`.", "items": { "type": "string" }, "type": "array" } }, "required": [ "intent" ], "type": "object" }, "SessionId": { "description": "Identifies an interaction session (the consent boundary).", "type": "string" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "A plan: the orchestrator's (or AI's) proposed interaction, before/after\npolicy authorization.", "properties": { "correlationId": { "$ref": "#/$defs/CorrelationId" }, "createdAt": { "format": "date-time", "type": "string" }, "expiresAt": { "format": "date-time", "type": "string" }, "intent": { "$ref": "#/$defs/SemanticIntent" }, "metadata": { "additionalProperties": true, "default": {}, "description": "Execution semantics (actuation mode, source recipe, verification\nstrategy...) understood by the runtime.", "type": "object" }, "planId": { "$ref": "#/$defs/PlanId" }, "policyDecisions": { "default": [], "items": { "$ref": "#/$defs/PolicyDecision" }, "type": "array" }, "rejected": { "default": [], "description": "Candidates that were considered and rejected, with reasons (explainability).", "items": { "$ref": "#/$defs/RejectedCandidate" }, "type": "array" }, "schemaVersion": { "type": "string" }, "sessionId": { "$ref": "#/$defs/SessionId" }, "status": { "$ref": "#/$defs/PlanStatus" }, "steps": { "description": "Steps chosen for execution (post candidate filtering).", "items": { "$ref": "#/$defs/PlannedStep" }, "type": "array" } }, "required": [ "planId", "sessionId", "intent", "steps", "status", "createdAt", "expiresAt", "correlationId", "schemaVersion" ], "title": "Plan", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Create an interaction plan from a semantic intent. The deterministic policy governor bounds every parameter later; magnitudes are suggestions only. The plan may legitimately choose no action.", "x-external-side-effect": false, "x-risk": "low" } }, "/v1/tools/interaction.policy/call": { "post": { "operationId": "interaction_policy", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": {}, "required": [], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "ChannelLimits": { "description": "Per-channel deterministic limits.", "properties": { "cooldownMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "maxDurationMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "maxMagnitude": { "format": "double", "type": [ "number", "null" ] }, "maxPerHour": { "format": "uint32", "minimum": 0, "type": [ "integer", "null" ] }, "sessionBudgetMs": { "description": "Cumulative active-duration budget per session, in ms.", "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] } }, "type": "object" }, "DelegationLimits": { "description": "Deterministic delegation limits (policy-owned).", "properties": { "maxDepth": { "default": 3, "format": "uint32", "minimum": 0, "type": "integer" }, "maxMessagesPerSession": { "default": 200, "format": "uint32", "minimum": 0, "type": "integer" }, "maxParallel": { "default": 4, "format": "uint32", "minimum": 0, "type": "integer" }, "maxSessions": { "default": 8, "format": "uint32", "minimum": 0, "type": "integer" }, "providerAllowlist": { "default": [], "description": "Provider allowlist for delegation targets; empty = none allowed.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "InitiativeLevel": { "description": "How proactive the runtime may be without an explicit request.", "oneOf": [ { "const": "passive", "description": "Never initiate; only respond to explicit requests.", "type": "string" }, { "const": "suggest", "description": "May surface low-risk, non-interrupting signals.", "type": "string" }, { "const": "active", "description": "May initiate bounded interactions on allowed channels.", "type": "string" } ] }, "QuietHours": { "description": "A daily quiet window in local wall-clock time (\"HH:MM\" 24h).", "properties": { "end": { "type": "string" }, "silencedChannels": { "default": [], "description": "Channels silenced during the window; empty = all audible/intrusive ones.", "items": { "type": "string" }, "type": "array" }, "start": { "type": "string" } }, "required": [ "start", "end" ], "type": "object" }, "RiskClass": { "description": "Risk classification of an operation / actuator.\n\nOrdering matters: later variants are riskier. `Ord` is derived so policy can\ncompare against thresholds.", "oneOf": [ { "const": "read-only", "description": "Pure read, no side effect.", "type": "string" }, { "const": "low", "description": "Local, reversible, low-noise side effect (log line, UI hint).", "type": "string" }, { "const": "bounded-side-effect", "description": "Side effect bounded by deterministic policy limits (sound, haptic, notification).", "type": "string" }, { "const": "external-write", "description": "Writes that leave the machine (webhook, message, GitHub comment).", "type": "string" }, { "const": "high", "description": "Hard-to-reverse or high-impact operations (merge PR, purchase, physical device).", "type": "string" }, { "const": "critical", "description": "Destructive / safety-critical. Always requires explicit human approval.", "type": "string" } ] } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "actuatorAllowlist": { "default": [], "description": "Explicit actuator allowlist; empty = builtin low-risk defaults only.", "items": { "type": "string" }, "type": "array" }, "allowedChannels": { "default": [], "description": "Channels the runtime may use at all.", "items": { "type": "string" }, "type": "array" }, "channelLimits": { "additionalProperties": { "$ref": "#/$defs/ChannelLimits" }, "default": {}, "description": "Per-channel limits keyed by channel name; `*` applies to all.", "type": "object" }, "defaultTtlMs": { "default": 30000, "description": "Global default TTL for plans/actions, ms.", "format": "uint64", "minimum": 0, "type": "integer" }, "delegation": { "$ref": "#/$defs/DelegationLimits", "default": { "maxDepth": 3, "maxMessagesPerSession": 200, "maxParallel": 4, "maxSessions": 8, "providerAllowlist": [] }, "description": "Deterministic delegation limits for agent sessions." }, "enabled": { "default": true, "description": "Master switch. When false, only read-only operations are allowed.", "type": "boolean" }, "initiative": { "$ref": "#/$defs/InitiativeLevel", "default": "suggest" }, "maxPatternSteps": { "default": 64, "description": "Hard cap for any pattern's steps.", "format": "uint32", "minimum": 0, "type": "integer" }, "maxScheduledActions": { "default": 128, "description": "Hard cap on total scheduled (queued+running) actions.", "format": "uint32", "minimum": 0, "type": "integer" }, "quietHours": { "default": [], "items": { "$ref": "#/$defs/QuietHours" }, "type": "array" }, "receptorAllowlist": { "default": [], "description": "Explicit receptor allowlist; empty = builtin defaults only.", "items": { "type": "string" }, "type": "array" }, "requireApprovalAt": { "$ref": "#/$defs/RiskClass", "default": "high", "description": "Actions at or above this risk require explicit human approval." }, "resumeHighRiskAfterRestart": { "default": false, "description": "Whether high-risk physical output may resume automatically after crash.\nThis is deliberately not configurable to `true` via the public API.", "type": "boolean" }, "schemaVersion": { "type": "string" }, "sessionMonetaryBudget": { "default": 0.0, "description": "Monetary budget per session in USD.", "format": "double", "type": "number" }, "toolAllowlist": { "default": [], "description": "Tool operations that may be invoked.", "items": { "type": "string" }, "type": "array" } }, "required": [ "schemaVersion" ], "title": "PolicyConfig", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Read the effective policy (limits, quiet hours, allowlists, initiative).", "x-external-side-effect": false, "x-risk": "read-only" } }, "/v1/tools/interaction.recipe_run/call": { "post": { "operationId": "interaction_recipe_run", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "recipeId": { "type": "string" } }, "required": [ "recipeId" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "description": "Plan + receipts produced by the recipe run", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Manually run one recipe (its trigger conditions are bypassed; policy still applies).", "x-external-side-effect": false, "x-risk": "bounded-side-effect" } }, "/v1/tools/interaction.simulate/call": { "post": { "operationId": "interaction_simulate", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "planId": { "type": "string" } }, "required": [ "planId" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "description": "Simulation result with per-step policy decisions", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Dry-run a plan through the policy governor: returns per-step decisions and effective bounded parameters without any side effect.", "x-external-side-effect": false, "x-risk": "read-only" } }, "/v1/tools/interaction.status/call": { "post": { "operationId": "interaction_status", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": {}, "required": [], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "description": "Runtime status document", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Check that the interaction runtime is reachable and get its current state (emergency stop, session, counters).", "x-external-side-effect": false, "x-risk": "read-only" } }, "/v1/tools/interaction.stop/call": { "post": { "operationId": "interaction_stop", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "reason": { "type": "string" } }, "required": [], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "description": "Emergency stop acknowledgement", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "EMERGENCY STOP: cancel every open action and halt all actuators immediately. Never requires approval; does not auto-resume.", "x-external-side-effect": false, "x-risk": "low" } }, "/v1/tools/interaction.verify/call": { "post": { "operationId": "interaction_verify", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": { "actionId": { "type": "string" } }, "required": [ "actionId" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$defs": { "ActionId": { "description": "Identifies a single bounded action / receipt.", "type": "string" }, "ActionParameters": { "description": "Normalized action parameters shared by all channels.", "properties": { "durationMs": { "format": "uint64", "minimum": 0, "type": [ "integer", "null" ] }, "extra": { "description": "Driver-specific extras (validated against the actuator's schema)." }, "magnitude": { "format": "double", "type": [ "number", "null" ] }, "message": { "type": [ "string", "null" ] } }, "type": "object" }, "ActionStatus": { "oneOf": [ { "const": "planned", "description": "Plan step exists but has not been authorized.", "type": "string" }, { "const": "authorized", "description": "Policy governor approved and produced a bounded action.", "type": "string" }, { "const": "accepted", "description": "Runtime accepted the action into its queue. NOT completion.", "type": "string" }, { "const": "dispatched", "description": "Driver has sent the command toward the target.", "type": "string" }, { "const": "acknowledged", "description": "Target (device/service) confirmed receipt of the command.", "type": "string" }, { "const": "observed", "description": "The effect was observed in the environment.", "type": "string" }, { "const": "completed", "description": "Terminal: goal achieved and verified to the configured standard.", "type": "string" }, { "const": "blocked", "description": "Terminal: policy refused the action.", "type": "string" }, { "const": "failed", "description": "Terminal: execution failed.", "type": "string" }, { "const": "uncertain", "description": "Terminal: outcome could not be determined.", "type": "string" }, { "const": "cancelled", "description": "Terminal: cancelled by user, AI, policy or shutdown.", "type": "string" }, { "const": "expired", "description": "Terminal: TTL elapsed before completion.", "type": "string" }, { "const": "stopped", "description": "Terminal: halted by emergency stop.", "type": "string" } ] }, "ActuatorId": { "description": "Identifies an actuator instance, e.g. `conversation`.", "type": "string" }, "CorrelationId": { "description": "Correlates observations, plans, actions and events end-to-end.", "type": "string" }, "ObservationId": { "description": "Identifies a single observation.", "type": "string" }, "PlanId": { "description": "Identifies a plan produced by the orchestrator.", "type": "string" }, "PolicyDecision": { "description": "One decision the governor made while bounding a request. The list of\ndecisions is the audit trail explaining requested -> effective.", "oneOf": [ { "properties": { "outcome": { "const": "allowed", "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule" ], "type": "object" }, { "properties": { "field": { "type": "string" }, "from": { "format": "double", "type": "number" }, "outcome": { "const": "clamped", "type": "string" }, "rule": { "type": "string" }, "to": { "format": "double", "type": "number" } }, "required": [ "outcome", "rule", "field", "from", "to" ], "type": "object" }, { "properties": { "detail": { "type": "string" }, "outcome": { "const": "silenced", "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "detail" ], "type": "object" }, { "properties": { "outcome": { "const": "blocked", "type": "string" }, "reason": { "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "reason" ], "type": "object" }, { "properties": { "outcome": { "const": "approvalRequired", "type": "string" }, "reason": { "type": "string" }, "rule": { "type": "string" } }, "required": [ "outcome", "rule", "reason" ], "type": "object" } ] }, "ReceiptError": { "properties": { "at": { "format": "date-time", "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" } }, "required": [ "code", "message", "at" ], "type": "object" }, "SessionId": { "description": "Identifies an interaction session (the consent boundary).", "type": "string" }, "VerificationEvidence": { "description": "Standard verification outcome attached to receipts.", "properties": { "detail": { "type": [ "string", "null" ] }, "observationIds": { "default": [], "description": "Observation ids that support the verdict.", "items": { "$ref": "#/$defs/ObservationId" }, "type": "array" }, "verdict": { "$ref": "#/$defs/VerificationVerdict" }, "verifiedAt": { "format": "date-time", "type": "string" } }, "required": [ "verdict", "verifiedAt" ], "type": "object" }, "VerificationVerdict": { "oneOf": [ { "const": "observed", "description": "Effect observed in the environment.", "type": "string" }, { "const": "acknowledged-only", "description": "Driver acknowledged but no environmental confirmation.", "type": "string" }, { "const": "uncertain", "description": "Could not determine whether the effect happened.", "type": "string" }, { "const": "refuted", "description": "Evidence says the effect did NOT happen.", "type": "string" } ] } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Full lifecycle record of one action.", "properties": { "actionId": { "$ref": "#/$defs/ActionId" }, "actuatorId": { "$ref": "#/$defs/ActuatorId" }, "correlationId": { "$ref": "#/$defs/CorrelationId" }, "currentStatus": { "$ref": "#/$defs/ActionStatus" }, "driverResponse": { "additionalProperties": true, "default": {}, "description": "Raw driver response snippets (redacted upstream if sensitive).", "type": "object" }, "effectiveBoundedParameters": { "$ref": "#/$defs/ActionParameters" }, "errors": { "default": [], "items": { "$ref": "#/$defs/ReceiptError" }, "type": "array" }, "expiresAt": { "description": "TTL deadline inherited from the bounded action; the watchdog expires\nnon-terminal receipts past this instant.", "format": "date-time", "type": [ "string", "null" ] }, "intent": { "type": "string" }, "planId": { "$ref": "#/$defs/PlanId" }, "policyDecisions": { "default": [], "items": { "$ref": "#/$defs/PolicyDecision" }, "type": "array" }, "requestedParameters": { "$ref": "#/$defs/ActionParameters" }, "schemaVersion": { "type": "string" }, "sessionId": { "$ref": "#/$defs/SessionId" }, "timestamps": { "description": "Timestamp of each state entered, in order.", "items": { "maxItems": 2, "minItems": 2, "prefixItems": [ { "$ref": "#/$defs/ActionStatus" }, { "format": "date-time", "type": "string" } ], "type": "array" }, "type": "array" }, "verification": { "anyOf": [ { "$ref": "#/$defs/VerificationEvidence" }, { "type": "null" } ] } }, "required": [ "actionId", "planId", "sessionId", "actuatorId", "intent", "requestedParameters", "effectiveBoundedParameters", "currentStatus", "timestamps", "correlationId", "schemaVersion" ], "title": "ActionReceipt", "type": "object" } } }, "description": "Tool result" }, "4XX": { "description": "Validation / policy error" } }, "summary": "Re-verify an action against fresh observations and update its receipt (observed / uncertain).", "x-external-side-effect": false, "x-risk": "low" } } }, "servers": [ { "url": "http://127.0.0.1:8787" } ] }