Skip to content

Variable: AgentStorageNamespace

Makaio Framework


Makaio Framework / services-core / AgentStorageNamespace

const AgentStorageNamespace: StorageNamespace<"agent", SubjectRecordFromSchemaRecord<{ delete: { request: ZodObject<{ agentId: ZodString; }, $strip>; response: ZodObject<{ success: ZodBoolean; }, $strip>; }; get: { request: ZodObject<{ agentId: ZodString; }, $strip>; response: ZodObject<{ agent: ZodNullable<ZodObject<{ adapterId: ZodString; adapterName: ZodString; adapterSessionId: ZodOptional<ZodString>; agentId: ZodString; clientId: ZodOptional<ZodString>; compressionMode: ZodOptional<ZodEnum<…>>; createdAt: ZodNumber; cwd: ZodOptional<ZodString>; harnessId: ZodOptional<ZodString>; lastActivityAt: ZodNumber; model: ZodOptional<ZodString>; personaId: ZodOptional<ZodString>; profileId: ZodOptional<ZodString>; providerConfigId: ZodOptional<ZodString>; role: ZodEnum<{ lead: …; member: …; }>; sessionId: ZodString; status: ZodEnum<{ active: …; dead: …; disposed: …; idle: …; }>; }, $strip>>; }, $strip>; }; listByAdapter: { request: ZodObject<{ adapterName: ZodString; status: ZodOptional<ZodEnum<{ active: "active"; all: "all"; dead: "dead"; disposed: "disposed"; idle: "idle"; }>>; }, $strip>; response: ZodObject<{ agents: ZodArray<ZodObject<{ adapterId: ZodString; adapterName: ZodString; adapterSessionId: ZodOptional<ZodString>; agentId: ZodString; clientId: ZodOptional<ZodString>; compressionMode: ZodOptional<ZodEnum<…>>; createdAt: ZodNumber; cwd: ZodOptional<ZodString>; harnessId: ZodOptional<ZodString>; lastActivityAt: ZodNumber; model: ZodOptional<ZodString>; personaId: ZodOptional<ZodString>; profileId: ZodOptional<ZodString>; providerConfigId: ZodOptional<ZodString>; role: ZodEnum<{ lead: …; member: …; }>; sessionId: ZodString; status: ZodEnum<{ active: …; dead: …; disposed: …; idle: …; }>; }, $strip>>; }, $strip>; }; listBySession: { request: ZodObject<{ sessionId: ZodString; }, $strip>; response: ZodObject<{ agents: ZodArray<ZodObject<{ adapterId: ZodString; adapterName: ZodString; adapterSessionId: ZodOptional<ZodString>; agentId: ZodString; clientId: ZodOptional<ZodString>; compressionMode: ZodOptional<ZodEnum<…>>; createdAt: ZodNumber; cwd: ZodOptional<ZodString>; harnessId: ZodOptional<ZodString>; lastActivityAt: ZodNumber; model: ZodOptional<ZodString>; personaId: ZodOptional<ZodString>; profileId: ZodOptional<ZodString>; providerConfigId: ZodOptional<ZodString>; role: ZodEnum<{ lead: …; member: …; }>; sessionId: ZodString; status: ZodEnum<{ active: …; dead: …; disposed: …; idle: …; }>; }, $strip>>; }, $strip>; }; set: { request: ZodObject<{ agent: ZodObject<{ adapterId: ZodString; adapterName: ZodString; adapterSessionId: ZodOptional<ZodString>; agentId: ZodString; clientId: ZodOptional<ZodString>; compressionMode: ZodOptional<ZodEnum<{ auto: …; manual: …; off: …; }>>; createdAt: ZodNumber; cwd: ZodOptional<ZodString>; harnessId: ZodOptional<ZodString>; lastActivityAt: ZodNumber; model: ZodOptional<ZodString>; personaId: ZodOptional<ZodString>; profileId: ZodOptional<ZodString>; providerConfigId: ZodOptional<ZodString>; role: ZodEnum<{ lead: "lead"; member: "member"; }>; sessionId: ZodString; status: ZodEnum<{ active: "active"; dead: "dead"; disposed: "disposed"; idle: "idle"; }>; }, $strip>; agentId: ZodString; }, $strip>; response: ZodObject<{ success: ZodBoolean; }, $strip>; }; updateActivity: { request: ZodObject<{ agentId: ZodString; lastActivityAt: ZodNumber; }, $strip>; response: ZodObject<{ success: ZodBoolean; }, $strip>; }; updateRuntime: { request: ZodObject<{ agentId: ZodString; cwd: ZodOptional<ZodString>; model: ZodOptional<ZodString>; providerConfigId: ZodOptional<ZodString>; }, $strip>; response: ZodObject<{ success: ZodBoolean; }, $strip>; }; updateStatus: { request: ZodObject<{ agentId: ZodString; status: ZodEnum<{ active: "active"; dead: "dead"; disposed: "disposed"; idle: "idle"; }>; }, $strip>; response: ZodObject<{ success: ZodBoolean; }, $strip>; }; }>, { adapterName: string; agent: { adapterId: string; adapterName: string; adapterSessionId?: string; agentId: string; clientId?: string; compressionMode?: "manual" | "auto" | "off"; createdAt: number; cwd?: string; harnessId?: string; lastActivityAt: number; model?: string; personaId?: string; profileId?: string; providerConfigId?: string; role: "lead" | "member"; sessionId: string; status: "active" | "idle" | "dead" | "disposed"; }; agentId: string; cwd: never; lastActivityAt: number; model: never; providerConfigId: never; sessionId: string; status: "active" | "idle" | "dead" | "disposed"; }, { drizzle: { agents: SQLiteTableWithColumns<{ columns: { adapterId: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "adapter_id"; notNull: true; tableName: "agents"; }, { }, { length: number | undefined; }>; adapterName: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "adapter_name"; notNull: true; tableName: "agents"; }, { }, { length: number | undefined; }>; adapterSessionId: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "adapter_session_id"; notNull: false; tableName: "agents"; }, { }, { length: number | undefined; }>; agentId: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: true; name: "agent_id"; notNull: true; tableName: "agents"; }, { }, { length: number | undefined; }>; clientId: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "client_id"; notNull: false; tableName: "agents"; }, { }, { length: number | undefined; }>; compressionMode: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "compression_mode"; notNull: false; tableName: "agents"; }, { }, { length: number | undefined; }>; createdAt: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteInteger"; data: number; dataType: "number"; driverParam: number; enumValues: undefined; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "created_at"; notNull: true; tableName: "agents"; }, { }, { }>; cwd: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "cwd"; notNull: false; tableName: "agents"; }, { }, { length: number | undefined; }>; harnessId: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "harness_id"; notNull: false; tableName: "agents"; }, { }, { length: number | undefined; }>; lastActivityAt: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteInteger"; data: number; dataType: "number"; driverParam: number; enumValues: undefined; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "last_activity_at"; notNull: true; tableName: "agents"; }, { }, { }>; model: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "model"; notNull: false; tableName: "agents"; }, { }, { length: number | undefined; }>; personaId: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "persona_id"; notNull: false; tableName: "agents"; }, { }, { length: number | undefined; }>; profileId: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "profile_id"; notNull: false; tableName: "agents"; }, { }, { length: number | undefined; }>; providerConfigId: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "provider_config_id"; notNull: false; tableName: "agents"; }, { }, { length: number | undefined; }>; role: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: "lead" | "member"; dataType: "string"; driverParam: string; enumValues: ["lead", "member"]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "role"; notNull: true; tableName: "agents"; }, { }, { length: number | undefined; }>; sessionId: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: string; dataType: "string"; driverParam: string; enumValues: [string, ...string[]]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "session_id"; notNull: true; tableName: "agents"; }, { }, { length: number | undefined; }>; status: SQLiteColumn<{ baseColumn: never; columnType: "SQLiteText"; data: "active" | "idle" | "dead" | "disposed"; dataType: "string"; driverParam: string; enumValues: ["idle", "active", "dead", "disposed"]; generated: undefined; hasDefault: false; hasRuntimeDefault: false; identity: undefined; isAutoincrement: false; isPrimaryKey: false; name: "status"; notNull: true; tableName: "agents"; }, { }, { length: number | undefined; }>; }; dialect: "sqlite"; name: "agents"; schema: undefined; }>; }; }, { delete: { request: ZodObject<{ agentId: ZodString; }, $strip>; response: ZodObject<{ success: ZodBoolean; }, $strip>; }; get: { request: ZodObject<{ agentId: ZodString; }, $strip>; response: ZodObject<{ agent: ZodNullable<ZodObject<{ adapterId: ZodString; adapterName: ZodString; adapterSessionId: ZodOptional<ZodString>; agentId: ZodString; clientId: ZodOptional<ZodString>; compressionMode: ZodOptional<ZodEnum<{ auto: …; manual: …; off: …; }>>; createdAt: ZodNumber; cwd: ZodOptional<ZodString>; harnessId: ZodOptional<ZodString>; lastActivityAt: ZodNumber; model: ZodOptional<ZodString>; personaId: ZodOptional<ZodString>; profileId: ZodOptional<ZodString>; providerConfigId: ZodOptional<ZodString>; role: ZodEnum<{ lead: "lead"; member: "member"; }>; sessionId: ZodString; status: ZodEnum<{ active: "active"; dead: "dead"; disposed: "disposed"; idle: "idle"; }>; }, $strip>>; }, $strip>; }; listByAdapter: { request: ZodObject<{ adapterName: ZodString; status: ZodOptional<ZodEnum<{ active: "active"; all: "all"; dead: "dead"; disposed: "disposed"; idle: "idle"; }>>; }, $strip>; response: ZodObject<{ agents: ZodArray<ZodObject<{ adapterId: ZodString; adapterName: ZodString; adapterSessionId: ZodOptional<ZodString>; agentId: ZodString; clientId: ZodOptional<ZodString>; compressionMode: ZodOptional<ZodEnum<{ auto: …; manual: …; off: …; }>>; createdAt: ZodNumber; cwd: ZodOptional<ZodString>; harnessId: ZodOptional<ZodString>; lastActivityAt: ZodNumber; model: ZodOptional<ZodString>; personaId: ZodOptional<ZodString>; profileId: ZodOptional<ZodString>; providerConfigId: ZodOptional<ZodString>; role: ZodEnum<{ lead: "lead"; member: "member"; }>; sessionId: ZodString; status: ZodEnum<{ active: "active"; dead: "dead"; disposed: "disposed"; idle: "idle"; }>; }, $strip>>; }, $strip>; }; listBySession: { request: ZodObject<{ sessionId: ZodString; }, $strip>; response: ZodObject<{ agents: ZodArray<ZodObject<{ adapterId: ZodString; adapterName: ZodString; adapterSessionId: ZodOptional<ZodString>; agentId: ZodString; clientId: ZodOptional<ZodString>; compressionMode: ZodOptional<ZodEnum<{ auto: …; manual: …; off: …; }>>; createdAt: ZodNumber; cwd: ZodOptional<ZodString>; harnessId: ZodOptional<ZodString>; lastActivityAt: ZodNumber; model: ZodOptional<ZodString>; personaId: ZodOptional<ZodString>; profileId: ZodOptional<ZodString>; providerConfigId: ZodOptional<ZodString>; role: ZodEnum<{ lead: "lead"; member: "member"; }>; sessionId: ZodString; status: ZodEnum<{ active: "active"; dead: "dead"; disposed: "disposed"; idle: "idle"; }>; }, $strip>>; }, $strip>; }; set: { request: ZodObject<{ agent: ZodObject<{ adapterId: ZodString; adapterName: ZodString; adapterSessionId: ZodOptional<ZodString>; agentId: ZodString; clientId: ZodOptional<ZodString>; compressionMode: ZodOptional<ZodEnum<{ auto: "auto"; manual: "manual"; off: "off"; }>>; createdAt: ZodNumber; cwd: ZodOptional<ZodString>; harnessId: ZodOptional<ZodString>; lastActivityAt: ZodNumber; model: ZodOptional<ZodString>; personaId: ZodOptional<ZodString>; profileId: ZodOptional<ZodString>; providerConfigId: ZodOptional<ZodString>; role: ZodEnum<{ lead: "lead"; member: "member"; }>; sessionId: ZodString; status: ZodEnum<{ active: "active"; dead: "dead"; disposed: "disposed"; idle: "idle"; }>; }, $strip>; agentId: ZodString; }, $strip>; response: ZodObject<{ success: ZodBoolean; }, $strip>; }; updateActivity: { request: ZodObject<{ agentId: ZodString; lastActivityAt: ZodNumber; }, $strip>; response: ZodObject<{ success: ZodBoolean; }, $strip>; }; updateRuntime: { request: ZodObject<{ agentId: ZodString; cwd: ZodOptional<ZodString>; model: ZodOptional<ZodString>; providerConfigId: ZodOptional<ZodString>; }, $strip>; response: ZodObject<{ success: ZodBoolean; }, $strip>; }; updateStatus: { request: ZodObject<{ agentId: ZodString; status: ZodEnum<{ active: "active"; dead: "dead"; disposed: "disposed"; idle: "idle"; }>; }, $strip>; response: ZodObject<{ success: ZodBoolean; }, $strip>; }; }>

Defined in: ../../../packages/services/core/src/session/storage/agent-namespace.ts:18

Agent storage namespace.

Provides bus subjects for agent CRUD operations and Drizzle schemas for SQL-based persistence.

import { AgentStorageSubjects } from '@makaio/services-core/session';
const { agent } = await bus.request(AgentStorageSubjects.get, { agentId: '123' });