import { MatrxTransport } from '@ai-matrx/api'; import { J as JsonValue, P as PortableAgentBundle, a as PortableAgentSummary } from '../types.generated-BP2_h0te.js'; export { b as PORTABLE_AGENT_CONTRACT, c as PortableAgentRequest, d as PortableSkill, e as PortableTool, f as PortableUnavailable } from '../types.generated-BP2_h0te.js'; /** * `@ai-matrx/agents/portable` — an AI Matrx agent as pieces a coding CLI loads. * * `fetchPortableAgent` reads `POST /ai/agents/{id}/portable` (or the version * door) and returns the server's `PortableAgentBundle`: the instructions with * the person's variable values filled, the skills as Claude `SKILL.md` files, * the server tools in MCP shape, and `unavailable[]` — what could not be * carried and why. The types are GENERATED from the server's Pydantic models * (`types.generated.ts`, `uv run python scripts/generate_types.py portable-agent` * in aidream), so the two cannot drift. * * Pure entry: no React, no Node, no I/O at import. Credentials and the * organization travel through the host's `MatrxTransport` * (`createMatrxTransport({ credentials, organizationId })`). */ /** Which definition to load: the agent's current one, or one immutable version. */ type PortableAgentTarget = { agentId: string; versionId?: undefined; } | { versionId: string; agentId?: string | undefined; }; interface FetchPortableAgentOptions { /** The person's values, by variable name. Unfilled variables use the agent's defaults. */ variables?: Record; /** The `ui.ui_surface` tools resolve on. Default: the server's coding-session surface. */ surface?: string; signal?: AbortSignal; } /** The server path for a target — exported so a host's tests can assert it. */ declare function portableAgentPath(target: PortableAgentTarget): string; /** * Load one agent as a portable bundle. Throws `MatrxApiError` on refusal — * 401 signed out, 404 not found or not shared with this person. */ declare function fetchPortableAgent(transport: MatrxTransport, target: PortableAgentTarget, options?: FetchPortableAgentOptions): Promise; /** * The light read behind an agent picker (`GET /ai/agents/{id}/portable/summary`): * name, variable declarations, versions newest first with their hashes. No * skills, no tools — call this when a person CHOOSES an agent, and * `fetchPortableAgent` only when a session starts. */ declare function fetchPortableAgentSummary(transport: MatrxTransport, agentId: string, options?: { signal?: AbortSignal; }): Promise; /** One saved version of an agent (`AgentVersionInfo` server-side). */ interface PortableAgentVersion { id: string; agent_id: string; version_number: number; name: string; change_note: string | null; changed_at: string | null; } /** * The agent's saved versions, oldest first (`GET /agent-service/agents/{id}/versions`, * authorized through the same viewer rule as the agent). Feeds a version menu. */ declare function fetchPortableAgentVersions(transport: MatrxTransport, agentId: string, options?: { signal?: AbortSignal; }): Promise; /** What a bundle loaded, counted — what a header chip shows. */ interface PortableAgentLoadSummary { instructions: boolean; skills: { loaded: number; total: number; }; tools: { loaded: number; total: number; }; } /** Count what a bundle carries against what the agent declares. */ declare function summarizePortableAgent(bundle: PortableAgentBundle): PortableAgentLoadSummary; export { JsonValue, PortableAgentBundle, PortableAgentSummary, fetchPortableAgent, fetchPortableAgentSummary, fetchPortableAgentVersions, portableAgentPath, summarizePortableAgent }; export type { FetchPortableAgentOptions, PortableAgentLoadSummary, PortableAgentTarget, PortableAgentVersion };