Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

Listener mode (#9486)

Shubham Naik4a829123cdbd
diff --git a/fern/openapi.json b/fern/openapi.json
index d3f76e765..82a56d831 100644
--- a/fern/openapi.json
+++ b/fern/openapi.json
@@ -25782,6 +25782,418 @@
}
}
}
+ },
+ "/v1/listeners/register": {
+ "post": {
+ "description": "Register a new listener connection and get connectionId for WebSocket",
+ "summary": "Register Listener",
+ "tags": ["listeners"],
+ "parameters": [],
+ "operationId": "listeners.register",
+ "requestBody": {
+ "description": "Body",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "deviceId": {
+ "type": "string"
+ },
+ "connectionName": {
+ "type": "string"
+ },
+ "agentId": {
+ "type": "string"
+ }
+ },
+ "required": ["deviceId", "connectionName"]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "200",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "connectionId": {
+ "type": "string"
+ },
+ "wsUrl": {
+ "type": "string"
+ }
+ },
+ "required": ["connectionId", "wsUrl"]
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "400",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "errorCode": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": ["errorCode", "message"]
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/listeners": {
+ "get": {
+ "description": "List all active listener connections for the organization",
+ "summary": "List Listener Connections",
+ "tags": ["listeners"],
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "after",
+ "in": "query",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "userId",
+ "in": "query",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "agentId",
+ "in": "query",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "operationId": "listeners.listConnections",
+ "responses": {
+ "200": {
+ "description": "200",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "connections": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "connectionId": {
+ "type": "string"
+ },
+ "deviceId": {
+ "type": "string"
+ },
+ "connectionName": {
+ "type": "string"
+ },
+ "organizationId": {
+ "type": "string"
+ },
+ "userId": {
+ "type": "string"
+ },
+ "apiKeyOwner": {
+ "type": "string"
+ },
+ "agentId": {
+ "type": "string"
+ },
+ "podId": {
+ "type": "string"
+ },
+ "connectedAt": {
+ "type": "number"
+ },
+ "lastHeartbeat": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "connectionId",
+ "deviceId",
+ "connectionName",
+ "organizationId",
+ "podId",
+ "connectedAt",
+ "lastHeartbeat"
+ ]
+ }
+ },
+ "hasNextPage": {
+ "type": "boolean"
+ }
+ },
+ "required": ["connections", "hasNextPage"]
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v1/listeners/{connectionId}/messages": {
+ "post": {
+ "description": "Send a message to a specific listener connection",
+ "summary": "Send Message to Listener",
+ "tags": ["listeners"],
+ "parameters": [
+ {
+ "name": "connectionId",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "operationId": "listeners.sendMessage",
+ "requestBody": {
+ "description": "Body",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "messages": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "role": {
+ "type": "string",
+ "enum": ["user"]
+ },
+ "content": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": ["text"]
+ },
+ "text": {
+ "type": "string"
+ }
+ },
+ "required": ["type", "text"]
+ }
+ }
+ ]
+ },
+ "otid": {
+ "type": "string"
+ }
+ },
+ "required": ["role", "content"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": ["approval"]
+ },
+ "approvals": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": ["tool"]
+ },
+ "tool_call_id": {
+ "type": "string"
+ },
+ "tool_return": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": ["text"]
+ },
+ "text": {
+ "type": "string"
+ }
+ },
+ "required": ["type", "text"]
+ }
+ }
+ ]
+ },
+ "status": {
+ "type": "string",
+ "enum": ["success", "error"]
+ },
+ "stdout": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ },
+ "stderr": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "nullable": true
+ }
+ },
+ "required": [
+ "tool_call_id",
+ "tool_return",
+ "status"
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": ["approval"]
+ },
+ "approve": {
+ "type": "boolean"
+ },
+ "tool_call_id": {
+ "type": "string"
+ },
+ "reason": {
+ "type": "string",
+ "nullable": true
+ }
+ },
+ "required": ["approve", "tool_call_id"]
+ }
+ ]
+ }
+ }
+ },
+ "required": ["type", "approvals"]
+ }
+ ]
+ }
+ },
+ "agentId": {
+ "type": "string"
+ },
+ "conversationId": {
+ "type": "string",
+ "nullable": true
+ }
+ },
+ "required": ["messages"]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "200",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ },
+ "message": {
+ "type": "string"
+ },
+ "runId": {
+ "type": "string"
+ }
+ },
+ "required": ["success", "message"]
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "404",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "errorCode": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": ["errorCode", "message"]
+ }
+ }
+ }
+ },
+ "503": {
+ "description": "503",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "errorCode": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": ["errorCode", "message"]
+ }
+ }
+ }
+ }
+ }
+ }
}
},
"components": {