@alfe.ai/mcp-server 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["ChangelogAction","ChangelogActor","ChangelogEntry","ChangelogEntry$1","EncryptedEnvelopeV1","EncryptedEnvelopeV1$1","Field","FieldEnvelope","FieldEnvelope$1","FieldFormat","FieldFormat$1","FieldSensitivity","FieldSensitivity$1","FieldView","GeneratedDataKey","GeneratedDataKey$1","IntegrationConfigResult","IntegrationConfigResult$1","IntegrationConfigSchemaField","IntegrationInstall","IntegrationInstall$1","RegistryEntry","RegistryEntry$1","ScopeInfo","ScopeInfo$1","SecretAggregate","SecretAggregate$1","SecretCategory","SecretCategory$1","SecretMetadata","SecretMetadata$1","SecretScope","SecretScope$1","ToolCaptureApi","InstallToolErrorCaptureOptions","installToolErrorCapture","AgentApiClientConfig","AgentApiTransport","Headers","BodyInit","Uint8Array","Response","Promise","RequestInit","T","ApiBase","AgentWorkspaceInfo","WorkspaceApi","Record","SyncAgentInfo","SyncManifestEntry","SyncManifest","SyncPresignedUrl","SyncConfirmedUpload","SyncReconstructFile","SyncReconstructBundle","SyncAgentStats","SyncFileEntry","SyncSessionEntry","SyncSessionContent","SharedFileEntry","SyncApi","KnowledgeScopeType","KnowledgeScope","KnowledgeSearchHit","KnowledgeSearchResult","KnowledgeProfileLink","KnowledgeProfile","ChangeRequestResourceType","ChangeRequestOperation","ChangeRequestStatus","ChangeRequestActorKind","KnowledgeChangeRequest","ProposeScopeChangeInput","KnowledgeDoc","KnowledgeApi","MobileNumberInfo","MobileAvailableNumber","WhatsAppTemplate","MobileApi","RemoteSessionInfo","RemoteApi","AgentVoiceConfig","AgentSelf","AgentAvatarPresign","AgentVoice","SelfApi","VoiceTtsModel","VoiceTtsArgs","VoiceTtsResult","Buffer","VoiceSttArgs","VoiceSttResult","VoiceApi","NewsProvider","NewsArticle","NewsResult","SearchApi","ChatApi","ConnectCredentialsApi","DatabaseApi","IdentityApi","ImagesApi","IntegrationsApi","MemoryApi","SecretsApi","TeamsApi","AgentApiClient"],"sources":["../../agent-api-client/dist/index.d.ts","../src/index.ts"],"sourcesContent":["import { ChangelogAction, ChangelogActor, ChangelogEntry, ChangelogEntry as ChangelogEntry$1, EncryptedEnvelopeV1, EncryptedEnvelopeV1 as EncryptedEnvelopeV1$1, Field, FieldEnvelope, FieldEnvelope as FieldEnvelope$1, FieldFormat, FieldFormat as FieldFormat$1, FieldSensitivity, FieldSensitivity as FieldSensitivity$1, FieldView, GeneratedDataKey, GeneratedDataKey as GeneratedDataKey$1, IntegrationConfigResult, IntegrationConfigResult as IntegrationConfigResult$1, IntegrationConfigSchemaField, IntegrationInstall, IntegrationInstall as IntegrationInstall$1, RegistryEntry, RegistryEntry as RegistryEntry$1, ScopeInfo, ScopeInfo as ScopeInfo$1, SecretAggregate, SecretAggregate as SecretAggregate$1, SecretCategory, SecretCategory as SecretCategory$1, SecretMetadata, SecretMetadata as SecretMetadata$1, SecretScope, SecretScope as SecretScope$1 } from \"@alfe/types\";\n\n//#region src/tool-error-capture.d.ts\n\n/**\n * Tool-error capture for Alfe OpenClaw plugins.\n *\n * OpenClaw converts a thrown tool handler into a model-facing `tool_result`\n * WITHOUT logging, and most Alfe plugins catch-and-return an error result the\n * same silent way — so tool failures never appear in the runtime's output and\n * therefore never reach Sentry (the gateway daemon supervises the OpenClaw\n * process and reports error-looking output lines to the `agent-runtime`\n * project — see packages/gateway/src/runtime-output-monitor.ts).\n *\n * `installToolErrorCapture(api, { plugin })` closes that gap at the ONE choke\n * point every plugin already has: it wraps `api.registerTool` so every tool's\n * `execute` emits a deterministic, detector-matched line on failure:\n *\n * [ERROR] alfe-tool plugin=<plugin> tool=<name> <thrown|result-error>: <msg> (at <first-frame>)\n *\n * The `[ERROR]` prefix at line start is exactly what the daemon's\n * `ErrorLineDetector` classifies as an error-log block, so the failure lands\n * in Sentry fingerprinted by its normalized message — no Sentry SDK inside\n * the plugin process, no new dependency. Behavior toward OpenClaw and the\n * model is UNCHANGED: throws are rethrown, results returned as-is.\n */\n/**\n * Minimal shape of the OpenClaw plugin api this helper relies on. Method\n * syntax on purpose — TS checks method signatures bivariantly, so each\n * plugin's own concretely-typed `registerTool(tool: ToolDef): void` is\n * accepted without casts.\n */\ninterface ToolCaptureApi {\n registerTool(...args: never[]): unknown;\n}\ninterface InstallToolErrorCaptureOptions {\n /** Plugin package short-name for attribution (e.g. \"openclaw-secrets\"). */\n plugin: string;\n /**\n * Line sink — defaults to writing `process.stderr` directly (the plugin\n * runs in-process in OpenClaw, so this lands on the runtime's stderr, which\n * the daemon supervises — and a console patch can't reformat it away).\n * Injectable for tests.\n */\n emit?: (line: string) => void;\n}\n/**\n * Wrap `api.registerTool` so every tool registered AFTER this call gets\n * failure capture. Handles both OpenClaw registration signatures:\n * `registerTool(toolDef)` and `registerTool((ctx) => toolDef, opts)`.\n * Call once, first thing in the plugin's `activate`/`register` entry.\n * Never throws.\n */\ndeclare function installToolErrorCapture(api: ToolCaptureApi, options: InstallToolErrorCaptureOptions): void;\n//# sourceMappingURL=tool-error-capture.d.ts.map\n//#endregion\n//#region src/transport.d.ts\n/**\n * Shared HTTP transport for the Agent API client — request core, retry\n * policy, error formatting, and the `ApiBase` class the domain method\n * groups under `./domains/` build on.\n */\ninterface AgentApiClientConfig {\n apiKey: string;\n apiUrl: string;\n}\n/**\n * Encode each path segment but keep the `/` separators — `encodeURIComponent`\n * would escape the slashes too, breaking greedy proxy routes.\n */\n\ndeclare class AgentApiTransport {\n private readonly apiKey;\n private readonly apiUrl;\n constructor(config: AgentApiClientConfig);\n /**\n * Binary sibling of `request<T>()`. `request()` forces\n * `Content-Type: application/json` and parses a `{ data: T }` envelope,\n * neither of which fits a raw-audio flow (voice TTS/STT), so those go\n * through this instead. Auth (Bearer), the request budget, and the single\n * retry on transient 5xx / network errors are kept in sync with\n * `request()`. Retries fire only on statuses produced BEFORE the route\n * handler runs (authorizer-timeout 500 + LB 502/503/504), so re-issuing a\n * POST does not risk a duplicate side effect.\n */\n rawRequest(path: string, init: {\n method: string;\n headers: Headers;\n body?: BodyInit | Uint8Array;\n }): Promise<Response>;\n /**\n * @param extra.timeoutMs Per-request abort timeout (default REQUEST_TIMEOUT_MS).\n * Long endpoints (image generation) pass a larger value so the gateway's\n * own timeout wins with a readable status instead of a client-side abort.\n * @param extra.retry Whether to retry once on transient failures (default\n * true). Expensive/non-idempotent endpoints pass false.\n */\n request<T>(path: string, options?: RequestInit, extra?: {\n timeoutMs?: number;\n retry?: boolean;\n }): Promise<T>;\n}\n/**\n * Base class for the domain method groups. Holds the shared transport;\n * `AgentApiClient` assembles the groups onto one class via `applyMixins`\n * (prototype copy), so methods keep their original `this`-on-the-client\n * call shape.\n */\ndeclare class ApiBase {\n protected readonly transport: AgentApiTransport;\n constructor(transport: AgentApiTransport);\n}\n//# sourceMappingURL=transport.d.ts.map\n//#endregion\n//#region src/domains/workspace.d.ts\n/** Response of GET /agents/me/workspace (services/agents). */\ninterface AgentWorkspaceInfo {\n templateKey?: string;\n defaultModel?: string;\n installedFrom?: {\n templateKey: string;\n authorTenantId: string;\n version: number;\n };\n runtime?: string;\n teams?: {\n teamId: string;\n name: string;\n description?: string;\n parentTeamId?: string;\n }[];\n projects?: {\n projectId: string;\n name: string;\n description?: string;\n status: string;\n parentProjectId?: string;\n }[];\n teamIds?: string[];\n projectIds?: string[];\n}\ndeclare class WorkspaceApi extends ApiBase {\n /**\n * GET /agents/me/workspace — workspace config for the authenticated agent\n * (template assignment, default model, org roster).\n */\n getWorkspace(): Promise<AgentWorkspaceInfo>;\n /**\n * GET /templates/{key}/files — persona/workspace file contents for a\n * template the agent has access to. Pass `version` to pin to the version\n * the agent was installed from (omit → the endpoint resolves `latest`).\n */\n getTemplateFiles(templateKey: string, opts?: {\n version?: number;\n }): Promise<{\n files: Record<string, string>;\n }>;\n}\n//# sourceMappingURL=workspace.d.ts.map\n//#endregion\n//#region src/domains/sync.d.ts\ninterface SyncAgentInfo {\n agentId: string;\n tenantId: string;\n displayName: string;\n s3Prefix: string;\n status: \"stale\" | \"syncing\" | \"synced\";\n fileCount?: number;\n totalSize?: number;\n lastSync?: string;\n}\ninterface SyncManifestEntry {\n hash: string;\n size: number;\n modified: string;\n etag?: string;\n storageClass?: string;\n compressed?: boolean;\n}\ninterface SyncManifest {\n version: 1;\n agentId: string;\n lastSync: string;\n files: Record<string, SyncManifestEntry>;\n}\ninterface SyncPresignedUrl {\n path: string;\n url: string;\n expiresAt: string;\n}\ninterface SyncConfirmedUpload {\n filePath: string;\n hash: string;\n size: number;\n storageClass: \"STANDARD\" | \"GLACIER_IR\";\n syncedAt: string;\n}\ninterface SyncReconstructFile {\n path: string;\n size: number;\n url: string;\n storageClass?: string;\n compressed?: boolean;\n}\ninterface SyncReconstructBundle {\n agentId: string;\n mode: \"full\" | \"active\" | \"memory\";\n fileCount: number;\n totalSize: number;\n files: SyncReconstructFile[];\n expiresAt: string;\n}\ninterface SyncAgentStats {\n agentId: string;\n standardBytes: number;\n glacierBytes: number;\n fileCount: number;\n lastSyncAt: string | null;\n}\ninterface SyncFileEntry {\n filePath: string;\n size: number;\n modified: string;\n contentHash: string;\n storageClass?: string;\n compressed?: boolean;\n}\ninterface SyncSessionEntry {\n sessionId: string;\n size: number;\n lastModified: string;\n storageClass?: string;\n isArchived: boolean;\n}\ninterface SyncSessionContent {\n sessionId: string;\n content: string;\n compressed: boolean;\n}\ninterface SharedFileEntry {\n filePath: string;\n fileName: string;\n size: number;\n contentType?: string;\n}\ndeclare class SyncApi extends ApiBase {\n syncRegister(args?: {\n displayName?: string;\n }): Promise<{\n agent: SyncAgentInfo;\n }>;\n syncGetManifest(): Promise<SyncManifest>;\n syncPresign(args: {\n files: {\n path: string;\n operation: \"put\" | \"get\";\n contentType?: string;\n }[];\n }): Promise<{\n urls: SyncPresignedUrl[];\n }>;\n syncConfirmUpload(args: {\n filePath: string;\n hash: string;\n size: number;\n storageClass?: \"STANDARD\" | \"GLACIER_IR\";\n }): Promise<SyncConfirmedUpload>;\n syncReconstruct(args: {\n mode: \"full\" | \"active\" | \"memory\";\n }): Promise<SyncReconstructBundle>;\n syncGetStats(): Promise<SyncAgentStats>;\n syncListFiles(args?: {\n prefix?: string;\n }): Promise<{\n files: SyncFileEntry[];\n }>;\n syncListSessions(): Promise<{\n sessions: SyncSessionEntry[];\n }>;\n syncGetSession(sessionId: string): Promise<SyncSessionContent>;\n syncDeleteFile(filePath: string): Promise<{\n removed: boolean;\n }>;\n sharedListFiles(args: {\n scope: \"org\" | \"team\" | \"project\";\n scopeId: string;\n }): Promise<{\n files: SharedFileEntry[];\n nextCursor: string | null;\n }>;\n sharedDownloadUrl(args: {\n scope: \"org\" | \"team\" | \"project\";\n scopeId: string;\n filePath: string;\n }): Promise<{\n downloadUrl: string;\n expiresIn: number;\n }>;\n}\n//# sourceMappingURL=sync.d.ts.map\n//#endregion\n//#region src/domains/knowledge.d.ts\ntype KnowledgeScopeType = \"org\" | \"team\" | \"project\";\ninterface KnowledgeScope {\n scopeType: KnowledgeScopeType;\n scopeId: string;\n name: string;\n}\ninterface KnowledgeSearchHit {\n id: string;\n text: string;\n /** Normalized relevance in (0,1]; higher = closer. */\n score: number;\n scopeType: KnowledgeScopeType;\n scopeId: string;\n /**\n * Provenance of the hit. All live results are `\"doc\"`; `\"fact\"` only ever\n * appears for legacy vectors indexed before the facts primitive was removed\n * (the search index stays tolerant of them). Treat every hit as a doc.\n */\n source: \"doc\" | \"fact\";\n /** The canonical file under shared/<scope>/ (present on doc hits). */\n filePath?: string;\n /** Legacy-only: the id of a pre-removal fact vector. */\n factId?: string;\n}\ninterface KnowledgeSearchResult {\n results: KnowledgeSearchHit[];\n /** True when fan-out breadth was capped (more member scopes than the cap). */\n truncatedScopes: boolean;\n}\ninterface KnowledgeProfileLink {\n label: string;\n url: string;\n}\ninterface KnowledgeProfile {\n scopeType: KnowledgeScopeType;\n scopeId: string;\n about: string | null;\n description: string | null;\n links: KnowledgeProfileLink[];\n updatedAt: string | null;\n updatedBy: string | null;\n}\ntype ChangeRequestResourceType = \"doc\" | \"profile\";\ntype ChangeRequestOperation = \"create\" | \"update\" | \"delete\";\ntype ChangeRequestStatus = \"open\" | \"approved\" | \"rejected\" | \"withdrawn\" | \"superseded\";\ntype ChangeRequestActorKind = \"human\" | \"agent\";\n/** Public projection of a change request (mirrors `PublicChangeRequest` in services/org). */\ninterface KnowledgeChangeRequest {\n changeRequestId: string;\n scopeType: KnowledgeScopeType;\n scopeId: string;\n resourceType: ChangeRequestResourceType;\n operation: ChangeRequestOperation;\n targetPath: string | null;\n baseVersionId: string | null;\n proposedContentType: string | null;\n status: ChangeRequestStatus;\n proposerId: string;\n proposerKind: ChangeRequestActorKind;\n rationale: string;\n reviewerId: string | null;\n reviewerKind: ChangeRequestActorKind | null;\n reviewedAt: string | null;\n reviewNote: string | null;\n appliedRef: string | null;\n createdAt: string;\n updatedAt: string;\n}\n/** Per-type proposal payload for `proposeScopeChange`. */\ninterface ProposeScopeChangeInput {\n resourceType: ChangeRequestResourceType;\n operation: ChangeRequestOperation;\n /** Why the change is proposed — shown to the reviewer. */\n rationale: string;\n /** doc: the path the proposal applies to (e.g. designs/data-center.md). */\n targetPath?: string;\n /** doc create/update: the staged body to upload (markdown or other text). */\n content?: string;\n /** doc create/update: content type of the staged body (default text/markdown). */\n contentType?: string;\n /** profile: the proposed value ({ about, description, links }). */\n proposedValue?: unknown;\n}\ninterface KnowledgeDoc {\n filePath: string;\n fileName: string;\n contentType?: string;\n size: number;\n uploadedBy?: string;\n createdAt: string;\n updatedAt: string;\n}\ndeclare class KnowledgeApi extends ApiBase {\n /**\n * Semantic search across the agent's member scopes. Fan-out is gated\n * server-side by `listScopes` set-inclusion (fail-closed). Pass\n * `scopeType` + `scopeId` to narrow to one scope; a non-member scope\n * yields empty results (never a cross-scope leak).\n */\n knowledgeSearch(query: string, opts?: {\n limit?: number;\n scopeType?: KnowledgeScopeType;\n scopeId?: string;\n }): Promise<KnowledgeSearchResult>;\n /** Enumerate the scopes (org + teams + projects) this agent belongs to. */\n listScopes(): Promise<{\n scopes: KnowledgeScope[];\n }>;\n /** Read a scope's structured knowledge profile (after membership check). */\n getScopeProfile(scopeType: KnowledgeScopeType, scopeId: string): Promise<KnowledgeProfile>;\n /**\n * Open a change request against a scope's knowledge resource. For a doc\n * create/update, `services/org` returns a presigned staging PUT; this method\n * uploads the proposed `content` to it (echoing the same Content-Type that\n * was signed), mirroring `writeScopeDoc`. The staged body is applied to the\n * canonical doc — attributed to this agent — only when a reviewer approves.\n */\n proposeScopeChange(scopeType: KnowledgeScopeType, scopeId: string, input: ProposeScopeChangeInput): Promise<KnowledgeChangeRequest>;\n /**\n * List the agent's OWN change requests in a scope (filtered server-side to\n * this agent as proposer). Pass `status` to narrow to open / approved / etc.\n */\n listScopeChangeRequests(scopeType: KnowledgeScopeType, scopeId: string, opts?: {\n status?: ChangeRequestStatus;\n limit?: number;\n cursor?: string;\n }): Promise<{\n changeRequests: KnowledgeChangeRequest[];\n nextCursor: string | null;\n }>;\n /** List a scope's docs (the org-files corpus; mirrored to shared/<scope>/). */\n listScopeDocs(scopeType: KnowledgeScopeType, scopeId: string, opts?: {\n limit?: number;\n cursor?: string;\n }): Promise<{\n files: KnowledgeDoc[];\n nextCursor: string | null;\n }>;\n /**\n * Read the full text of a scope doc. Resolves a presigned download URL\n * from `services/org`, then fetches the bytes directly from S3 (the one\n * legitimate raw fetch in a plugin — same pattern as sync).\n */\n readScopeDoc(scopeType: KnowledgeScopeType, scopeId: string, filePath: string): Promise<{\n filePath: string;\n text: string;\n }>;\n /**\n * Write (create or overwrite) a scope doc. Two-step presigned upload:\n * `services/org` returns a signed URL plus `requiredHeaders` (author /\n * authorKind / message as `x-amz-meta-*`) that MUST be sent verbatim on\n * the PUT, alongside the same `Content-Type` that was signed. Author and\n * authorKind are server-set from the agent token — never trusted here.\n */\n writeScopeDoc(scopeType: KnowledgeScopeType, scopeId: string, filePath: string, content: string, opts?: {\n contentType?: string;\n message?: string;\n }): Promise<{\n filePath: string;\n }>;\n}\n//# sourceMappingURL=knowledge.d.ts.map\n//#endregion\n//#region src/domains/mobile.d.ts\n/** Response of GET /mobile/numbers for an agent (services/mobile). */\ninterface MobileNumberInfo {\n phoneNumber: string;\n countryCode: string;\n monthlyPrice?: number;\n status: string;\n errorMessage?: string;\n}\n/** One purchasable number from GET /mobile/numbers/search. */\ninterface MobileAvailableNumber {\n number: string;\n friendlyName: string;\n locality: string;\n region: string;\n country: string;\n}\n/** Approved WhatsApp content template from GET /mobile/whatsapp/templates. */\ninterface WhatsAppTemplate {\n sid: string;\n friendlyName: string;\n language: string;\n body: string;\n variables: Record<string, string>;\n dateCreated: string;\n dateUpdated: string;\n approvalStatus?: string;\n rejectionReason?: string;\n category?: string;\n}\ndeclare class MobileApi extends ApiBase {\n getMobileNumber(): Promise<MobileNumberInfo>;\n searchMobileNumbers(args?: {\n country?: string;\n query?: string;\n }): Promise<{\n numbers: MobileAvailableNumber[];\n monthlyPrice: number;\n }>;\n assignMobileNumber(args: {\n phoneNumber: string;\n countryCode: string;\n }): Promise<{\n phoneNumber: string;\n countryCode: string;\n status: \"pending\";\n }>;\n releaseMobileNumber(): Promise<{\n released: true;\n }>;\n sendSms(args: {\n to: string;\n body: string;\n }): Promise<{\n sent: true;\n sid: string;\n }>;\n startOutboundCall(args: {\n to: string;\n }): Promise<{\n callSid: string;\n status: string;\n }>;\n getWhatsAppSession(to: string): Promise<{\n active: boolean;\n expiresAt?: string;\n }>;\n sendWhatsAppMessage(args: {\n to: string;\n body: string;\n }): Promise<{\n sent: true;\n sid: string;\n }>;\n sendWhatsAppTemplate(args: {\n to: string;\n contentSid: string;\n contentVariables: Record<string, string>;\n bodyPreview?: string;\n }): Promise<{\n sent: true;\n sid: string;\n }>;\n listWhatsAppTemplates(): Promise<{\n templates: WhatsAppTemplate[];\n }>;\n}\n//# sourceMappingURL=mobile.d.ts.map\n//#endregion\n//#region src/domains/remote.d.ts\ninterface RemoteSessionInfo {\n sessionId: string;\n agentId: string;\n surface: \"browser\" | \"terminal\";\n status: \"agent_driving\" | \"awaiting_human\" | \"human_in_control\" | \"resuming\" | \"completed\" | \"expired\" | \"failed\";\n url?: string;\n instructions?: string;\n requestedAt?: string;\n}\ndeclare class RemoteApi extends ApiBase {\n requestBrowserTakeover(args: {\n instructions: string;\n url?: string;\n conversationId?: string;\n }): Promise<{\n sessionId: string;\n status: string;\n }>;\n getRemoteSession(sessionId: string): Promise<RemoteSessionInfo>;\n completeRemoteSession(sessionId: string): Promise<{\n ok: boolean;\n }>;\n}\n//# sourceMappingURL=remote.d.ts.map\n//#endregion\n//#region src/domains/self.d.ts\n/** Voice settings — core agent config. Mirrors `VoiceConfig` in `@alfe/types`. */\ninterface AgentVoiceConfig {\n /** ElevenLabs voice ID; platform default when unset. */\n voiceId?: string;\n ttsModel?: string;\n enabled?: boolean;\n}\n/**\n * The agent's own public identity, as returned by `updateSelf`, `generateAvatar`,\n * `presignAvatar`'s finalize (`finalizeAvatar`). This is the public agent\n * projection; only the identity-relevant fields are typed here — the response\n * carries the full public agent record.\n */\ninterface AgentSelf {\n agentId: string;\n tenantId: string;\n name: string;\n avatarUrl?: string;\n voiceConfig?: AgentVoiceConfig;\n status: string;\n}\n/** Result of `presignAvatar` — the agent PUTs bytes to `uploadUrl`, then finalizes with `s3Key`. */\ninterface AgentAvatarPresign {\n /** Presigned PUT URL to upload the image bytes to. */\n uploadUrl: string;\n /** Object key — echoed back to `finalizeAvatar`. */\n s3Key: string;\n /** Stable public URL the avatar will be served from once finalized. */\n publicUrl: string;\n /** ISO expiry of the presigned PUT URL. */\n expiresAt: string;\n}\n/** A voice in the platform catalogue (ElevenLabs), from `listVoices`. */\ninterface AgentVoice {\n id: string;\n name: string;\n previewUrl: string;\n description: string;\n labels: Record<string, string>;\n category: string;\n}\ndeclare class SelfApi extends ApiBase {\n /** Update the agent's own name and/or voice config. Returns the updated agent. */\n updateSelf(update: {\n name?: string;\n voiceConfig?: AgentVoiceConfig;\n }): Promise<AgentSelf>;\n /**\n * Generate the agent's own avatar from a text prompt. The image is generated,\n * stored, and set on the agent server-side; returns the updated agent.\n *\n * ASYNC (same reason as `generateImage`): avatar gen runs `gpt-image-1`\n * (30–60s) which exceeds the API Gateway 30s ceiling, so this enqueues a job\n * (`POST /agent/avatar/generate` → `jobId`) then polls (`GET /agent/avatar/{jobId}`)\n * until the avatar is set. Signature unchanged — the plugin is unaffected.\n */\n generateAvatar(args: {\n prompt: string;\n }): Promise<AgentSelf>;\n /**\n * Get a presigned PUT URL to upload a new avatar image. Upload the bytes to\n * `uploadUrl`, then call `finalizeAvatar(s3Key)` to set it on the agent.\n */\n presignAvatar(args: {\n mimeType: string;\n size: number;\n }): Promise<AgentAvatarPresign>;\n /**\n * Finalize an avatar upload — validates ownership + size, then sets the\n * agent's `avatarUrl` server-side. Returns the updated agent.\n */\n finalizeAvatar(s3Key: string): Promise<AgentSelf>;\n /** List the platform voice catalogue (ElevenLabs) so the agent can pick its own voice. */\n listVoices(): Promise<{\n voices: AgentVoice[];\n }>;\n}\n//# sourceMappingURL=self.d.ts.map\n//#endregion\n//#region src/domains/voice.d.ts\n/** The ElevenLabs models with a pricing row — the TTS endpoint rejects any other value. */\ntype VoiceTtsModel = \"eleven_turbo_v2_5\" | \"eleven_multilingual_v2\";\ninterface VoiceTtsArgs {\n /** Text to synthesize (1–5000 chars — the endpoint enforces this). */\n text: string;\n /** ElevenLabs voice id; platform default when unset. */\n voiceId?: string;\n /** TTS model; `eleven_turbo_v2_5` (lower latency) when unset. */\n model?: VoiceTtsModel;\n}\n/** Raw synthesized audio plus its PCM framing (from the response headers). */\ninterface VoiceTtsResult {\n /** Raw little-endian PCM samples — no container. Wrap in WAV to make a playable file. */\n audio: Buffer;\n /** Samples per second (e.g. 24000). */\n sampleRate: number;\n /** Channel count (mono = 1). */\n channels: number;\n /** Bits per sample (e.g. 16). */\n bitDepth: number;\n}\ninterface VoiceSttArgs {\n /** Raw linear16 (16-bit little-endian) mono PCM samples — no WAV/container header. */\n audio: Uint8Array;\n /** Sample rate of `audio` in Hz (8000–48000). */\n sampleRate: number;\n}\ninterface VoiceSttResult {\n text: string;\n /** Deepgram confidence in (0,1]. */\n confidence: number;\n}\ndeclare class VoiceApi extends ApiBase {\n /**\n * Text-to-speech. Returns raw PCM audio bytes plus their framing — the\n * voice service defaults to 24 kHz / mono / 16-bit. Wrap in a WAV container\n * to produce a playable file. Metered per character against the tenant\n * credit pool server-side; TTS completes regardless of metering outcome.\n */\n tts(args: VoiceTtsArgs): Promise<VoiceTtsResult>;\n /**\n * Speech-to-text. Accepts raw linear16 (16-bit LE) mono PCM — NOT a WAV or\n * other container (the endpoint transcribes with a fixed linear16 encoding,\n * so a container header would be transcribed as noise). Strip any WAV header\n * and pass `sampleRate` from it before calling. Metered by transcribed\n * duration against the tenant credit pool server-side.\n */\n stt(args: VoiceSttArgs): Promise<VoiceSttResult>;\n}\n//# sourceMappingURL=voice.d.ts.map\n//#endregion\n//#region src/domains/search.d.ts\n/**\n * The broad-news providers behind the metered `services/news` Lambda. The\n * server validates this with a zod enum; a value outside the union is an\n * unpriceable product, so keep the literal union in lockstep with the service.\n */\ntype NewsProvider = \"apitube\" | \"newsdata\";\n/** One normalized article. `sentiment` is provider-shaped (APITube supplies it). */\ninterface NewsArticle {\n title: string;\n url: string;\n source: string;\n publishedAt: string;\n snippet: string;\n sentiment?: unknown;\n}\n/** Provider-agnostic result — the server normalizes every adapter to this. */\ninterface NewsResult {\n articles: NewsArticle[];\n provider: string;\n}\ndeclare class SearchApi extends ApiBase {\n searchWeb(params: {\n query: string;\n count?: number;\n offset?: number;\n country?: string;\n freshness?: string;\n }): Promise<unknown>;\n searchImages(params: {\n query: string;\n count?: number;\n }): Promise<unknown>;\n searchNews(params: {\n query: string;\n count?: number;\n freshness?: string;\n }): Promise<unknown>;\n /** Search news across the selected provider's corpus. → POST /agent/news/search */\n newsSearch(params: {\n query: string;\n provider?: NewsProvider;\n source?: string;\n from?: string;\n to?: string;\n language?: string;\n category?: string;\n limit?: number;\n }): Promise<NewsResult>;\n /** Top headlines for the selected provider. → POST /agent/news/headlines */\n newsHeadlines(params?: {\n provider?: NewsProvider;\n category?: string;\n source?: string;\n language?: string;\n limit?: number;\n }): Promise<NewsResult>;\n}\n//# sourceMappingURL=search.d.ts.map\n//#endregion\n//#region src/domains/chat.d.ts\ndeclare class ChatApi extends ApiBase {\n presignAttachments(files: {\n filename: string;\n mimeType: string;\n size: number;\n }[]): Promise<{\n attachments: {\n id: string;\n uploadUrl: string;\n downloadUrl: string;\n s3Key: string;\n expiresAt: string;\n }[];\n }>;\n recordActivity(data: {\n userId?: string;\n channel: string;\n role: \"user\" | \"assistant\";\n }): Promise<{\n recorded: boolean;\n }>;\n}\n//# sourceMappingURL=chat.d.ts.map\n//#endregion\n//#region src/domains/connect-credentials.d.ts\ndeclare class ConnectCredentialsApi extends ApiBase {\n /**\n * Returns every connected Google account for the agent. Multi-account by\n * design — the openclaw-google plugin requires the LLM to pass `email`\n * explicitly to `google_run_command` so an account is always selected\n * deliberately.\n *\n * 2026-05-14 (connections-redesign PR 1): the legacy flat shape (`email`,\n * `refreshToken`, `accessToken`, etc., populated from the default account)\n * is gone. Iterate over `accounts`.\n */\n getGoogleCredentials(): Promise<{\n accounts: {\n email: string;\n refreshToken: string;\n clientId: string;\n clientSecret: string;\n displayName?: string;\n connectedAt?: string;\n }[];\n }>;\n disconnectGoogleAccount(email: string): Promise<{\n accounts: {\n email: string;\n displayName?: string;\n connectedAt?: string;\n }[];\n }>;\n getGoogleChatCredentials(): Promise<{\n email: string;\n refreshToken: string;\n clientId: string;\n clientSecret: string;\n displayName?: string;\n }>;\n /**\n * Fetch decrypted credentials for ONE specific connection by its\n * stable connectionId (connection-scoped, vs the provider-scoped\n * `get<Provider>Credentials` helpers). Used by the daemon to resolve\n * a Custom Connection-driven integration's credentials from the\n * exact connection it was installed from — every custom connection\n * shares the `custom` provider id, so provider-scoping is ambiguous.\n *\n * For custom connections `accessToken` is the JSON-encoded secret\n * bundle (the daemon un-bundles it); non-secret fields are on\n * `providerMetadata`. The endpoint enforces that the connection is in\n * the calling agent's effective scope (403 otherwise).\n */\n getConnectionCredentials(connectionId: string): Promise<{\n provider: string;\n connectionId: string;\n accountIdentifier?: string;\n accessToken?: string;\n providerMetadata?: Record<string, unknown>;\n [key: string]: unknown;\n }>;\n /**\n * @deprecated Returns a single primary credential blob (legacy \"pick-the-\n * default-connection\" shape). Use `getGithubAccounts()` for the multi-\n * account shape required by Pattern A — explicit selector args on every\n * tool. Retained because the `@alfe.ai/github-mcp` proxy is the\n * only consumer that knows about Pattern A; legacy env-interpolation\n * callers will keep hitting `/credentials` until they move to the proxy.\n */\n getGithubCredentials(): Promise<{\n login: string;\n accessToken: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for GitHub.\n *\n * Returns every agent-scoped GitHub connection. The caller is expected\n * to require a `login` selector on every credential-touching tool and\n * look up the matching account at dispatch time.\n *\n * GitHub OAuth tokens have no expiry (`tokenLifecycle: \"no_expiry\"`),\n * so there is intentionally no `refreshGithubAccountToken` method — if\n * a token is revoked the user must re-run the OAuth flow.\n *\n * Returned `accounts[i].login` is the GitHub username — the stable\n * cross-session identifier the LLM should pass.\n */\n getGithubAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n login: string;\n scopes: string;\n }[];\n }>;\n /**\n * @deprecated Returns a single primary credential blob (legacy \"pick-the-\n * default-connection\" shape). Use `getXeroAccounts()` for the multi-\n * account shape required by Pattern A — explicit selector args on every\n * tool. This method will be removed once all consumers migrate.\n */\n getXeroCredentials(): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n xeroTenantId: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for Xero. Returns every\n * agent-scoped Xero connection. The caller is expected to require a\n * selector arg (e.g. `xeroTenantId`) on every credential-touching tool\n * and look up the matching account by that selector at dispatch time.\n *\n * Returned `accounts[i].accountIdentifier` is the Xero tenantId — the\n * stable cross-session identifier the LLM should pass.\n */\n getXeroAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n xeroTenantId: string;\n }[];\n }>;\n refreshXeroToken(): Promise<{\n accessToken: string;\n expiresAt: string;\n }>;\n /**\n * Pattern A: refresh a specific Xero connection by its `accountIdentifier`\n * (the Xero `tenantId`). The legacy `refreshXeroToken()` only refreshes\n * the *primary* connection, which is wrong for multi-tenant Xero where\n * each tenant has its own non-interchangeable access token.\n */\n refreshXeroAccountToken(xeroTenantId: string): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n /**\n * @deprecated Returns a single primary credential blob (legacy \"pick-the-\n * default-connection\" shape). Use `getNotionAccounts()` for the multi-\n * account shape required by Pattern A.\n */\n getNotionCredentials(): Promise<{\n accessToken: string;\n workspaceId: string;\n workspaceName: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for Notion. Returns every\n * agent-scoped Notion connection. The caller is expected to require a\n * selector arg (e.g. `workspaceId`) on every credential-touching tool.\n *\n * Returned `accounts[i].accountIdentifier` is the Notion workspaceId.\n */\n getNotionAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n workspaceId: string;\n workspaceName: string;\n }[];\n }>;\n /**\n * @deprecated Returns a single primary Atlassian Connection's credentials\n * (one OAuth user, one cloudId) — the legacy \"pick-the-default-connection\"\n * shape. Atlassian is multi-site by nature (each OAuth user may have\n * access to multiple Cloud sites), so Pattern A plugins MUST use\n * `getAtlassianAccounts()` to discover the full set and dispatch via\n * the `cloudId` selector arg.\n */\n getAtlassianCredentials(): Promise<{\n accessToken: string;\n refreshToken: string;\n accessTokenExpiresAt: string;\n cloudId: string;\n siteName: string;\n siteUrl: string;\n email: string;\n enabledProducts: string[];\n clientId: string;\n clientSecret: string;\n }>;\n refreshAtlassianToken(): Promise<{\n accessToken: string;\n expiresAt: string;\n }>;\n /**\n * Pattern A: multi-account / multi-site credential fetch for Atlassian.\n *\n * Returns every agent-scoped Atlassian Connection. Each Connection is\n * one OAuth user with a single access token and N accessible Cloud\n * sites (`availableSites`). The caller is expected to:\n *\n * 1. Flatten (connection × cloudId) into one MCP child per site.\n * 2. Require a `cloudId` selector on every credential-touching tool.\n * 3. Use the access token bound to the Connection that owns the\n * requested `cloudId` (Atlassian shares one access token across\n * all sites accessible to the OAuth user).\n *\n * Per-account token refresh uses `refreshAtlassianAccountToken(email)`\n * — refreshing one Connection rotates its single access token, which\n * then applies to every cloudId for that Connection.\n *\n * Returned `accounts[i].accountIdentifier` is the OAuth user's email\n * — the stable cross-session identifier for refresh purposes. The LLM\n * never sees this directly: it picks a site via the `cloudId` arg\n * instead.\n */\n getAtlassianAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n clientId: string;\n clientSecret: string;\n cloudId: string;\n siteName: string;\n siteUrl: string;\n availableSites: {\n id: string;\n url: string;\n name: string;\n scopes?: string[];\n avatarUrl?: string;\n }[];\n }[];\n }>;\n /**\n * Pattern A: refresh a specific Atlassian Connection by `accountIdentifier`\n * (the OAuth user's email).\n *\n * Atlassian rotates refresh tokens (`rotatesRefreshToken: true`); the\n * server-side per-account refresh endpoint handles rotation and\n * persistence. Refreshing one Connection updates its single access\n * token, which applies to every accessible Cloud site (cloudId) for\n * that OAuth user.\n *\n * Returns the new access token + expiry. The proxy is responsible for\n * fanning the new token out to every child server it spawned for\n * cloudIds owned by this Connection.\n */\n refreshAtlassianAccountToken(accountIdentifier: string): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n /**\n * @deprecated Returns a single primary credential blob (legacy \"pick-the-\n * default-connection\" shape). Use `getMYOBAccounts()` for the multi-\n * account shape required by Pattern A.\n */\n getMYOBCredentials(): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n myobBusinessId: string;\n clientId: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for MYOB. Returns every\n * agent-scoped MYOB connection. The caller is expected to require a\n * selector arg (e.g. `myobBusinessId` / `accountIdentifier`) on every\n * credential-touching tool.\n *\n * Returned `accounts[i].accountIdentifier` is the MYOB businessId.\n */\n getMYOBAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n myobBusinessId: string;\n clientId: string;\n }[];\n }>;\n refreshMYOBToken(): Promise<{\n accessToken: string;\n expiresAt: string;\n }>;\n /**\n * @deprecated Returns a single primary credential blob. Use\n * `getSalesforceAccounts()` for the multi-account shape required by\n * Pattern A.\n */\n getSalesforceCredentials(): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n instanceUrl: string;\n orgId: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for Salesforce. Returns every\n * agent-scoped Salesforce connection. One OAuth grant maps to one org, so\n * `accounts[i].accountIdentifier` (and `orgId`) is the Salesforce org id —\n * the selector every credential-touching tool requires.\n */\n getSalesforceAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n instanceUrl: string;\n orgId: string;\n }[];\n }>;\n /**\n * Refresh the access token for a specific Salesforce org. Salesforce\n * tokens aren't interchangeable across orgs, so the connection is targeted\n * by `accountIdentifier` (the org id) — mirrors `refreshXeroAccountToken`.\n */\n refreshSalesforceAccountToken(orgId: string): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for Microsoft 365.\n *\n * Returns every agent-scoped Microsoft connection. The caller is expected\n * to require an `email` selector on every credential-touching tool and\n * look up the matching account at dispatch time.\n *\n * Returned `accounts[i].accountIdentifier` is the user's primary email\n * (or the tid claim as fallback) — the stable cross-session identifier\n * the LLM should pass.\n *\n * Per-account token refresh is exposed via `refreshMicrosoftAccountToken`,\n * NOT `refreshXeroAccountToken` — Microsoft refresh tokens are not\n * interchangeable across (tenant, user) pairs.\n */\n getMicrosoftAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n refreshToken: string;\n clientId: string;\n clientSecret: string;\n email: string;\n microsoftTenantId: string;\n workspaceDomain: string;\n }[];\n }>;\n /**\n * Pattern A: refresh a specific Microsoft 365 connection by its\n * `accountIdentifier`. For Microsoft, `accountIdentifier` is the user's\n * email when the Graph profile fetch succeeded at connect time, and the\n * Azure tenant id (`tid` claim) as fallback. Callers should pass the\n * value returned by `getMicrosoftAccounts()` rather than synthesising\n * an email locally.\n *\n * Microsoft refresh tokens are bound to a specific (tenant, user) pair —\n * they are NOT interchangeable across accounts, so per-account refresh\n * is mandatory. The generic /accounts/{accountIdentifier}/refresh\n * endpoint walks the agent's full visible scope chain to find a matching\n * connection (works for inherited team/project Microsoft connections).\n */\n refreshMicrosoftAccountToken(accountIdentifier: string): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n /**\n * Disconnects one connected Microsoft 365 account for the agent, by its\n * `accountIdentifier`. Hits the generic per-account disconnect route\n * (`DELETE /agent/connect/microsoft/accounts/{accountIdentifier}`), which\n * resolves across the agent's full effective scope chain and deletes the\n * matching Connection row. Returns the remaining accounts.\n *\n * IMPORTANT: pass the `accountIdentifier` from `getMicrosoftAccounts()`, NOT\n * a synthesised email. For Microsoft, `accountIdentifier` is the user's email\n * only when the Graph profile fetch succeeded at connect time; it falls back\n * to the Azure tenant id (`tid` claim) otherwise. The backend matches on\n * `accountIdentifier` exactly, so passing an email would 404 on those\n * fallback-identifier accounts. (This is why the param is not named `email`,\n * unlike `disconnectGoogleAccount` where the identifier is always the email.)\n */\n disconnectMicrosoftAccount(accountIdentifier: string): Promise<{\n accounts: {\n accountIdentifier: string;\n displayName?: string;\n connectedAt?: string;\n }[];\n }>;\n /**\n * Resolve the primary cTrader Connection's credentials for the calling\n * agent. Unlike most providers, the cTrader Open API needs app-level auth\n * (`clientId` + `clientSecret`) AND account auth (`accessToken` +\n * `accountId`) on the socket, so `@alfe.ai/ctrader-mcp` self-fetches the\n * full set here at startup (the atlassian/google pattern). `clientId` /\n * `clientSecret` are the SST-sourced global app credentials the connect\n * endpoint injects — they are never persisted on the connection. `host` is\n * the resolved TLS endpoint (`live.ctraderapi.com` / `demo.ctraderapi.com`)\n * derived from the selected account's live/demo flag.\n */\n getCTraderCredentials(): Promise<{\n accessToken: string;\n refreshToken: string;\n accountId: string;\n host: string;\n clientId: string;\n clientSecret: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for cTrader.\n *\n * Unlike atlassian/salesforce (one Connection row per account/site), a\n * cTrader is MULTI-grant per agent: an agent may connect several distinct\n * cTrader logins, each its own Connection row keyed on `accountIdentifier =\n * ctid:<userId>` (Phase 1). This aggregates the *trading accounts* across\n * ALL of those Connection rows — each row contributes its `availableAccounts`\n * flattened, and every account carries ITS OWN grant's `accessToken` (the\n * token that authenticates that account against the cTrader Open API). One\n * OAuth grant still covers all accounts under that single login on one shared\n * token; only the `ctidTraderAccountId` and the protobuf socket `host` (live\n * vs demo) differ within a grant. Across grants the tokens differ, so the\n * token is now PER-ACCOUNT rather than hoisted to the top level.\n *\n * `host` per account is derived from the account's `isLive` flag\n * (`live.ctraderapi.com` / `demo.ctraderapi.com`) — the same mapping the\n * connect provider applies server-side when an account is auto-selected.\n *\n * `clientId` / `clientSecret` are the SST-sourced GLOBAL app credentials the\n * connect endpoint injects — identical across every Connection row (one\n * cTrader app), never persisted on a connection. We take them from the first\n * row that carries them.\n *\n * Accounts are deduped on `ctidTraderAccountId` first-wins: Spotware ids are\n * globally unique across logins, so a duplicate can only appear if the same\n * account somehow surfaced under two grants — first-wins keeps it\n * deterministic.\n *\n * `accounts` may be empty (no cTrader Connection at all), in which case we\n * return empty creds rather than throwing.\n */\n getCTraderAccounts(): Promise<{\n accounts: {\n ctidTraderAccountId: string;\n host: string;\n isLive: boolean;\n brokerName?: string;\n accountNumber?: string;\n accessToken: string;\n }[];\n clientId: string;\n clientSecret: string;\n }>;\n /**\n * @deprecated Returns a single primary credential blob. Use\n * `getShopifyAccounts()` for the multi-account shape required by Pattern A\n * (`@alfe.ai/shopify-mcp` keys per-shop on the myshopify domain).\n */\n getShopifyCredentials(): Promise<{\n accessToken: string;\n shopDomain: string;\n shopGid: string;\n shopName: string;\n apiVersion: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for Shopify. Returns every\n * agent-scoped Shopify Connection. One OAuth grant maps to one store, so the\n * stable per-call selector is the store's myshopify domain (`shopDomain`),\n * NOT `accountIdentifier` — the connect provider keys `accountIdentifier` on\n * the immutable shop GID (falling back to the domain), so `shopDomain` is the\n * value the LLM passes and the plugin routes on.\n *\n * Each entry is shaped by the connect provider's `buildCredentialsResponse`:\n * `{ accessToken, shopDomain, shopGid, shopName, apiVersion }` — offline\n * Shopify tokens never expire, so there is NO token / expiry field and no\n * refresh method (unlike Salesforce). The GraphQL Admin API authenticates\n * purely on `X-Shopify-Access-Token`; no client credentials are on the wire.\n */\n getShopifyAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n shopDomain: string;\n shopGid: string;\n shopName: string;\n apiVersion: string;\n }[];\n }>;\n /**\n * Pattern A: provider-parameterized multi-account credential fetch for the\n * social connectors (Bluesky, and the approval-gated backlog: X, Meta,\n * Threads, LinkedIn, Pinterest, TikTok, Reddit, YouTube).\n *\n * Unlike the bespoke `getGithubAccounts()` / `getXeroAccounts()` shapes,\n * this returns a UNIFORM normalized account shape so `@alfe.ai/social-mcp`'s\n * shared driver can require a single `account` selector on every\n * credential-touching tool regardless of platform. The backend\n * `api-agents/{provider}/accounts` route is already provider-generic; this\n * is the client-side normalization the plan (`do-we-need-any-moonlit-toucan`\n * Phase 0, step 5) calls for.\n *\n * `accountIdentifier` is the stable per-account selector the LLM should\n * pass back (for Bluesky: the account DID). `accessToken` carries whatever\n * the provider's `buildCredentialsResponse` bundles (for Bluesky: the JSON\n * session bundle — the driver parses the `accessJwt` out of it, or reads the\n * top-level `accessJwt` from `providerMetadata`-adjacent fields). Everything\n * else the driver needs for routing (handle, pdsHost, did, …) is on\n * `providerMetadata`.\n *\n * Token refresh is delegated to connect (never done in-plugin) via the\n * per-account route `POST /agent/connect/{provider}/accounts/{accountIdentifier}/refresh`\n * — call `refreshSocialAccount(provider, accountIdentifier)`. (The non-account\n * `POST /agent/connect/{provider}/refresh` route refreshes the provider's\n * PRIMARY connection, which is wrong under multi-account Pattern A.)\n */\n getSocialAccounts(provider: string): Promise<{\n provider: string;\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n accessToken: string;\n providerMetadata: Record<string, unknown>;\n connectedAt: string;\n }[];\n }>;\n /**\n * Pattern A: refresh a specific social Connection by its stable\n * `accountIdentifier` (for Bluesky: the account DID) via the\n * provider-generic per-account refresh route. The counterpart to\n * `getSocialAccounts(provider)`; `@alfe.ai/social-mcp` calls this on a\n * 401/ExpiredToken from the platform PDS/API, then re-fetches accounts to\n * pick up the rotated bundle.\n *\n * Refresh itself is ALWAYS delegated to connect — the plugin never calls\n * the platform's own refresh XRPC (e.g. `com.atproto.server.refreshSession`)\n * because connect owns the encrypted refresh token + rotation persistence\n * (Bluesky rotates the refreshJwt; a missed rotation kills the connection\n * after one refresh). The returned `accessToken` is whatever the provider's\n * `refreshToken` hook re-bundled (for Bluesky: the JSON session bundle with\n * the fresh `accessJwt`) — callers typically ignore it and re-fetch via\n * `getSocialAccounts` for a consistent shape.\n */\n refreshSocialAccount(provider: string, accountIdentifier: string): Promise<{\n accountIdentifier: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n}\n//# sourceMappingURL=connect-credentials.d.ts.map\n//#endregion\n//#region src/domains/database.d.ts\ndeclare class DatabaseApi extends ApiBase {\n registerDatabaseCredentials(): Promise<{\n connectionString: string;\n username: string;\n password: string;\n databases: string[];\n }>;\n reportDatabaseAudit(entry: {\n database: string;\n collection: string;\n operation: string;\n summary?: string;\n }): Promise<void>;\n}\n//# sourceMappingURL=database.d.ts.map\n//#endregion\n//#region src/domains/identity.d.ts\ndeclare class IdentityApi extends ApiBase {\n /**\n * Returns the calling agent's own identity context — `{ agentId, tenantId }`\n * decoded server-side from the agent API token. Used by the\n * `@alfe.ai/openclaw-identity` plugin to bootstrap context when the\n * OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.\n * Plugins should cache this for the daemon's lifetime (single-agent-per-\n * process invariant). One HTTP round-trip per process activate; not for\n * per-call use.\n */\n whoami(): Promise<{\n agentId: string;\n tenantId: string;\n }>;\n resolveIdentity(args: {\n provider: string;\n platformId: string;\n kind?: \"user\" | \"agent\" | \"service\" | \"bot\" | \"workspace\";\n displayName?: string;\n }): Promise<{\n identityId: string | null;\n status: string;\n created?: boolean;\n reason?: string;\n /**\n * Flattened auriclabs permission strings for the resolved identity\n * (scope-prefixed where applicable). Empty array on miss / org service\n * outage — the runtime gate fails closed in that case.\n */\n permissions: string[];\n }>;\n searchIdentities(args?: {\n q?: string;\n status?: string;\n limit?: number;\n }): Promise<{\n identities: unknown[];\n }>;\n getIdentityContext(identityId: string): Promise<{\n context: unknown;\n }>;\n mergeIdentities(survivorId: string, args: {\n mergedId: string;\n changedBy: {\n type: string;\n id: string;\n name?: string;\n };\n }): Promise<{\n ok: boolean;\n error?: string;\n }>;\n unmergeIdentity(identityId: string, args: {\n changedBy: {\n type: string;\n id: string;\n name?: string;\n };\n }): Promise<{\n ok: boolean;\n error?: string;\n }>;\n addIdentityNote(identityId: string, args: {\n content: string;\n category?: string;\n changedBy: {\n type: string;\n id: string;\n name?: string;\n };\n }): Promise<{\n noteId: string | null;\n }>;\n tagIdentity(identityId: string, args: {\n tag: string;\n action: \"add\" | \"remove\";\n changedBy: {\n type: string;\n id: string;\n name?: string;\n };\n }): Promise<{\n ok: boolean;\n }>;\n getIdentityChangelog(identityId: string, args?: {\n limit?: number;\n }): Promise<{\n entries: unknown[];\n }>;\n rollbackIdentity(identityId: string, args: {\n targetVersion: number;\n changedBy: {\n type: string;\n id: string;\n name?: string;\n };\n }): Promise<{\n ok: boolean;\n entry?: unknown;\n }>;\n requestIdentityVerification(args: {\n claimedIdentityId: string;\n requestingIdentityId: string;\n requestingProvider: string;\n requestingPlatformId: string;\n preferredChannel?: \"mobile\" | \"email\";\n /**\n * Phase 2: agent-supplied contact endpoint. When provided, the top-level\n * `preferredChannel` is ignored — the contact's channel wins.\n */\n contact?: {\n channel: \"email\" | \"mobile\";\n value: string;\n };\n }): Promise<{\n verificationId: string;\n channel: string;\n deliveredTo: string;\n expiresAt: string;\n availableChannels: {\n channel: string;\n deliveredTo: string;\n }[];\n } | {\n error: string;\n }>;\n confirmIdentityVerification(args: {\n claimedIdentityId: string;\n verificationId: string;\n phrase: string;\n }): Promise<{\n verified: boolean;\n identityId?: string;\n /** Phase 2: how the confirm resolved — Scenario A vs B. */\n action?: \"merged\" | \"contact_verified\";\n error?: string;\n }>;\n /**\n * Update display-shape fields on an Identity. Body excludes `email` /\n * `phone` / `title` / `company` / `metadata` per Section D4 — contacts go\n * via the verify flow, title/company live on OrgMembership, metadata is\n * not agent-writable.\n */\n updateIdentity(identityId: string, args: {\n name?: string;\n avatarUrl?: string;\n timezone?: string;\n locale?: string;\n }): Promise<{\n ok: boolean;\n }>;\n /**\n * Phase 2 (Section H): server-side verification of a Google Chat sender via\n * the agent's existing Google OAuth credentials. Returns the resolved\n * identity (created or matched via Scenario-B email enrichment).\n */\n resolveGoogleChatSender(args: {\n senderUserId: string;\n spaceId?: string;\n }): Promise<{\n identityId: string | null;\n status: string;\n }>;\n}\n//# sourceMappingURL=identity.d.ts.map\n//#endregion\n//#region src/domains/images.d.ts\ndeclare class ImagesApi extends ApiBase {\n /**\n * Generate an image from a text prompt and get back a STABLE, public URL\n * (served from the agent-assets CDN — it does not expire). Embed the returned\n * `imageUrl` in a reply as markdown to show it to the user.\n *\n * ASYNC: `gpt-image-1` routinely runs 30–60s, which exceeds the API Gateway\n * 30s ceiling, so this enqueues a job (`POST /agent/images/generate` →\n * `jobId`) then polls (`GET /agent/images/{jobId}`) until it completes. The\n * worker's real failure message (e.g. an unsupported `size`) surfaces via the\n * job's `error` field.\n */\n generateImage(args: {\n prompt: string;\n model?: string;\n size?: string;\n quality?: string;\n }): Promise<{\n imageUrl: string;\n model: string;\n }>;\n}\n//# sourceMappingURL=images.d.ts.map\n//#endregion\n//#region src/domains/integrations.d.ts\ndeclare class IntegrationsApi extends ApiBase {\n listIntegrations(): Promise<IntegrationInstall$1[]>;\n getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult$1>;\n updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;\n installIntegration(integrationId: string, options?: {\n version?: string;\n config?: Record<string, unknown>;\n }): Promise<IntegrationInstall$1>;\n removeIntegration(integrationId: string): Promise<IntegrationInstall$1>;\n getOAuthUrl(provider: string, scopes?: string[]): Promise<{\n url: string;\n provider: string;\n expiresIn: number;\n }>;\n getOAuthStatus(provider: string): Promise<{\n provider: string;\n connected: boolean;\n config?: Record<string, string>;\n }>;\n getRegistry(): Promise<{\n integrations: RegistryEntry$1[];\n }>;\n}\n//# sourceMappingURL=integrations.d.ts.map\n//#endregion\n//#region src/domains/memory.d.ts\ndeclare class MemoryApi extends ApiBase {\n memorySearch(query: string, opts?: {\n limit?: number;\n topic?: string;\n subtopic?: string;\n tag?: string;\n includeKnowledge?: boolean;\n }): Promise<{\n facts: {\n subject: string;\n predicate: string;\n object: string;\n since: string;\n confidence: number;\n }[];\n memories: {\n id: string;\n text: string;\n topic: string;\n subtopic: string;\n tag: string;\n importance: number;\n timestamp: number;\n score: number;\n }[];\n }>;\n memoryStore(text: string, opts?: {\n topic?: string;\n subtopic?: string;\n tag?: string;\n importance?: number;\n }): Promise<{\n memoryId: string;\n }>;\n memoryIngest(sessionKey: string, messages: {\n role: string;\n content: string;\n index: number;\n timestamp?: string;\n }[], metadata?: {\n channelId?: string;\n userId?: string;\n userName?: string;\n }, ingestEpoch?: number): Promise<{\n queued: boolean;\n messageCount: number;\n }>;\n memoryLoadContext(tier?: number, topicHint?: string): Promise<{\n formatted: string;\n [key: string]: unknown;\n }>;\n memoryLookupEntity(subject: string): Promise<{\n subject: string;\n triples: {\n tripleId: string;\n predicate: string;\n object: string;\n validFrom: string;\n validTo?: string;\n confidence: number;\n }[];\n }>;\n memoryNavigate(): Promise<{\n topics: {\n name: string;\n tripleCount: number;\n subtopics: string[];\n }[];\n cursor: string | null;\n }>;\n memoryDelete(memoryId: string): Promise<{\n deleted: boolean;\n }>;\n memoryStats(): Promise<{\n vectorCount: number;\n tripleCount: number;\n storageEstimateBytes: number;\n lastIngestionAt?: string;\n }>;\n memoryLearn(args: {\n text: string;\n source?: string;\n sourceType?: \"file\" | \"url\" | \"inline\";\n metadata?: {\n sessionId?: string;\n channelId?: string;\n userName?: string;\n };\n }): Promise<{\n memoriesStored: number;\n triplesStored: number;\n chunks: number;\n source?: string;\n }>;\n memoryBootstrapStatus(): Promise<{\n synced: boolean;\n syncedAt?: string;\n sessionsBackfillSynced?: boolean;\n sessionsBackfillSyncedAt?: string;\n }>;\n memoryBootstrapStatusMark(scope?: \"files\" | \"sessions\"): Promise<{\n synced: true;\n syncedAt: string;\n }>;\n}\n//# sourceMappingURL=memory.d.ts.map\n//#endregion\n//#region src/domains/secrets.d.ts\ndeclare class SecretsApi extends ApiBase {\n /**\n * Mint a fresh AES-256 data key for a specific (secret, field) pair. The\n * encryption context is rebuilt server-side from `auth.tenantId` + the body\n * fields including `fieldKey`; the agent cannot forge context for a scope\n * or field it doesn't own. Legacy single-envelope secrets are migrated to\n * `field#value` rows by the data migration, so call with `fieldKey: \"value\"`\n * to reach them.\n */\n generateSecretDataKey(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n fieldKey: string;\n }): Promise<GeneratedDataKey$1>;\n /**\n * Unwrap a wrapped data key so the agent can decrypt the envelope locally.\n * `fieldKey` MUST match the value supplied when the data key was generated\n * (it's bound into KMS encryption context); mismatch fails with\n * `InvalidCiphertextException`.\n */\n decryptSecretDataKey(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n fieldKey: string;\n dataKeyCiphertext: string;\n }): Promise<{\n plaintextKey: string;\n }>;\n /**\n * Create a new secret with one or more fields. Encrypted fields must arrive\n * pre-sealed (the agent has already obtained per-field data keys via\n * `generateSecretDataKey({ ..., fieldKey })` and AES-encrypted locally).\n * Plaintext fields ship the value inline.\n */\n createSecret(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n secretName: string;\n category?: SecretCategory$1;\n description?: string;\n tags?: string[];\n fields: {\n key: string;\n format?: FieldFormat$1;\n sensitivity: FieldSensitivity$1;\n value?: string;\n envelope?: EncryptedEnvelopeV1$1;\n }[];\n reason?: string;\n }): Promise<SecretAggregate$1>;\n /** Fetch the secret aggregate plus per-field encrypted envelopes. */\n getSecret(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n }): Promise<{\n aggregate: SecretAggregate$1;\n envelopes: FieldEnvelope$1[];\n }>;\n /** Fetch one field. Plaintext: value inline. Encrypted: envelope. */\n getSecretField(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n fieldKey: string;\n }): Promise<{\n key: string;\n sensitivity: FieldSensitivity$1;\n format?: FieldFormat$1;\n value?: string;\n envelope?: EncryptedEnvelopeV1$1;\n rotatedAt?: string;\n createdAt: string;\n updatedAt: string;\n }>;\n /** Add OR rotate one field. */\n setSecretField(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n fieldKey: string;\n sensitivity: FieldSensitivity$1;\n format?: FieldFormat$1;\n value?: string;\n envelope?: EncryptedEnvelopeV1$1;\n reason?: string;\n }): Promise<{\n fieldKey: string;\n rotated: boolean;\n }>;\n /** Remove one field. */\n removeSecretField(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n fieldKey: string;\n }): Promise<void>;\n /** Update secret-level metadata (name/description/tags/category). */\n updateSecretMetadata(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n secretName?: string;\n description?: string;\n tags?: string[];\n category?: SecretCategory$1;\n reason?: string;\n }): Promise<SecretAggregate$1>;\n /** List metadata for secrets in a scope. Optional filters route through the byFacet GSI. */\n listSecrets(args: {\n scope: SecretScope$1;\n scopeId: string;\n category?: SecretCategory$1;\n tag?: string;\n fieldKey?: string;\n }): Promise<SecretMetadata$1[]>;\n /** Bounded changelog read — metadata-only audit entries. */\n getSecretHistory(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n limit?: number;\n cursor?: string;\n }): Promise<{\n entries: ChangelogEntry$1[];\n nextCursor?: string;\n }>;\n /** Delete a secret (and all its field rows + tag rows + changelog rows). */\n deleteSecret(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n }): Promise<void>;\n /** Enumerate scopes (org/team/project/agent) this agent can access. */\n listSecretScopes(): Promise<ScopeInfo$1[]>;\n}\n//# sourceMappingURL=secrets.d.ts.map\n//#endregion\n//#region src/domains/teams.d.ts\ndeclare class TeamsApi extends ApiBase {\n getTeamsCredentials(): Promise<{\n agentId: string;\n tenantId: string;\n azureAppId: string;\n azureBotId: string;\n azureClientSecret: string;\n botDisplayName?: string;\n teamsTenantId?: string;\n serviceUrl?: string;\n }>;\n sendTeamsMessage(data: {\n conversationId: string;\n text?: string;\n adaptiveCard?: Record<string, unknown>;\n }): Promise<{\n ok: boolean;\n activityId: string;\n }>;\n listTeamsChannels(): Promise<{\n channels: {\n id: string;\n name: string;\n description?: string;\n }[];\n }>;\n}\n//# sourceMappingURL=teams.d.ts.map\n\n//#endregion\n//#region src/index.d.ts\ninterface AgentApiClient extends SyncApi, IntegrationsApi, WorkspaceApi, ConnectCredentialsApi, TeamsApi, ChatApi, SecretsApi, IdentityApi, MemoryApi, SearchApi, KnowledgeApi, DatabaseApi, MobileApi, RemoteApi, SelfApi, VoiceApi, ImagesApi {}\ndeclare class AgentApiClient extends ApiBase {\n constructor(config: AgentApiClientConfig);\n}\n//# sourceMappingURL=index.d.ts.map\n\n//#endregion\nexport { AgentApiClient, type AgentApiClientConfig, type AgentAvatarPresign, type AgentSelf, type AgentVoice, type AgentVoiceConfig, type AgentWorkspaceInfo, type ChangeRequestActorKind, type ChangeRequestOperation, type ChangeRequestResourceType, type ChangeRequestStatus, type ChangelogAction, type ChangelogActor, type ChangelogEntry, type EncryptedEnvelopeV1, type Field, type FieldEnvelope, type FieldFormat, type FieldSensitivity, type FieldView, type GeneratedDataKey, type InstallToolErrorCaptureOptions, type IntegrationConfigResult, type IntegrationConfigSchemaField, type IntegrationInstall, type KnowledgeChangeRequest, type KnowledgeDoc, type KnowledgeProfile, type KnowledgeProfileLink, type KnowledgeScope, type KnowledgeScopeType, type KnowledgeSearchHit, type KnowledgeSearchResult, type MobileAvailableNumber, type MobileNumberInfo, type NewsArticle, type NewsProvider, type NewsResult, type ProposeScopeChangeInput, type RegistryEntry, type RemoteSessionInfo, type ScopeInfo, type SecretAggregate, type SecretCategory, type SecretMetadata, type SecretScope, type SharedFileEntry, type SyncAgentInfo, type SyncAgentStats, type SyncConfirmedUpload, type SyncFileEntry, type SyncManifest, type SyncManifestEntry, type SyncPresignedUrl, type SyncReconstructBundle, type SyncReconstructFile, type SyncSessionContent, type SyncSessionEntry, type ToolCaptureApi, type VoiceSttArgs, type VoiceSttResult, type VoiceTtsArgs, type VoiceTtsModel, type VoiceTtsResult, type WhatsAppTemplate, installToolErrorCapture };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;UA8DUoC,oBAAAA,CAmNJM;QA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AAAA;;AAAO;;;;;AAU6B;AAMd;;;;AAuCjBM,cC/GE,eD+GFA,EAAAA,MAAAA;;;;AAd+B;AAoBnB;AAUI;;;;;AAYZ;AAEW;AAKG;AAcnBO,KCjJE,aAAA,GDiJmB,SAAA,GAKtBD,aAAAA;AAGCE,UCvJO,aAAA,CDuJO;EAOdC;AAAa;AAQG;AAOE;EAWdI,MAAAA,CAAAA,ECnLH,cDmLU;EAAA;UAIVZ,CAAAA,EAAAA;IADLP,OAAAA,EAAAA,MAAAA;IAGuBS,QAAAA,EAAAA,MAAAA;;;QAOvBT,CAAAA,EAAAA,MAAAA;;;;;;SAYYA,CAAAA,EClMN,aDkMMA;;;;;;aASmBA,CAAAA,ECrMrB,cDqMqBA;;aAQ1BkB,CAAAA,EAAAA,MAAAA;;;;;AA1C0B;AAyDd;AAEQ;AASA;AAcF;AAIC;AAIJ,iBC/OJ,YAAA,CD+OI,IAAA,CAAA,EC/Oe,aD+Of,CAAA,EC/OoC,OD+OpC,CC/O4C,SD+O5C,CAAA;;;;AAKG;AAIC;AACH;AAEtBW,iBC5MW,eAAA,CD4MW,IAAA,EAAA,MAAA,EAAA,CAAA,EC5MsB,aD4MtB;AAAA;;;;;;AAaXA,iBCrMM,IAAA,CDqMNA,IAGsB,CAHtBA,EAAAA;SAGAA,CAAAA,ECxM6B,aDwM7BA;CAAsB,CAAA,ECxM8B,ODwM9B,CAAA,IAAA,CAAA;AAAA"}
1
+ {"version":3,"file":"index.d.ts","names":["ChangelogAction","ChangelogActor","ChangelogEntry","ChangelogEntry$1","EncryptedEnvelopeV1","EncryptedEnvelopeV1$1","Field","FieldEnvelope","FieldEnvelope$1","FieldFormat","FieldFormat$1","FieldSensitivity","FieldSensitivity$1","FieldView","GeneratedDataKey","GeneratedDataKey$1","IntegrationConfigResult","IntegrationConfigResult$1","IntegrationConfigSchemaField","IntegrationInstall","IntegrationInstall$1","RegistryEntry","RegistryEntry$1","ScopeInfo","ScopeInfo$1","SecretAggregate","SecretAggregate$1","SecretCategory","SecretCategory$1","SecretMetadata","SecretMetadata$1","SecretScope","SecretScope$1","ToolCaptureApi","InstallToolErrorCaptureOptions","installToolErrorCapture","AgentApiClientConfig","AgentApiTransport","Headers","BodyInit","Uint8Array","Response","Promise","RequestInit","AbortSignal","T","ApiBase","AgentWorkspaceInfo","WorkspaceApi","Record","SyncAgentInfo","SyncManifestEntry","SyncManifest","SyncPresignedUrl","SyncConfirmedUpload","SyncReconstructFile","SyncReconstructBundle","SyncAgentStats","SyncFileEntry","SyncSessionEntry","SyncSessionContent","SharedFileEntry","SyncApi","KnowledgeScopeType","KnowledgeScope","KnowledgeSearchHit","KnowledgeSearchResult","KnowledgeProfileLink","KnowledgeProfile","ChangeRequestResourceType","ChangeRequestOperation","ChangeRequestStatus","ChangeRequestActorKind","KnowledgeChangeRequest","ProposeScopeChangeInput","KnowledgeDoc","KnowledgeApi","MobileNumberInfo","MobileAvailableNumber","WhatsAppTemplate","MobileApi","RemoteSessionInfo","RemoteApi","AgentVoiceConfig","AgentSelf","AgentAvatarPresign","AgentVoice","SelfApi","VoiceTtsModel","VoiceTtsArgs","VoiceTtsResult","Buffer","VoiceSttArgs","VoiceSttResult","VoiceApi","NewsProvider","NewsArticle","NewsResult","SearchApi","AgentWebhook","CreatedAgentWebhook","AgentWebhookDelivery","WebhooksApi","ChatApi","ConnectCredentialsApi","DatabaseApi","IdentityApi","ImagesApi","IntegrationsApi","MemoryApi","SecretsApi","TeamsApi","AgentApiClient"],"sources":["../../agent-api-client/dist/index.d.ts","../src/index.ts"],"sourcesContent":["import { ChangelogAction, ChangelogActor, ChangelogEntry, ChangelogEntry as ChangelogEntry$1, EncryptedEnvelopeV1, EncryptedEnvelopeV1 as EncryptedEnvelopeV1$1, Field, FieldEnvelope, FieldEnvelope as FieldEnvelope$1, FieldFormat, FieldFormat as FieldFormat$1, FieldSensitivity, FieldSensitivity as FieldSensitivity$1, FieldView, GeneratedDataKey, GeneratedDataKey as GeneratedDataKey$1, IntegrationConfigResult, IntegrationConfigResult as IntegrationConfigResult$1, IntegrationConfigSchemaField, IntegrationInstall, IntegrationInstall as IntegrationInstall$1, RegistryEntry, RegistryEntry as RegistryEntry$1, ScopeInfo, ScopeInfo as ScopeInfo$1, SecretAggregate, SecretAggregate as SecretAggregate$1, SecretCategory, SecretCategory as SecretCategory$1, SecretMetadata, SecretMetadata as SecretMetadata$1, SecretScope, SecretScope as SecretScope$1 } from \"@alfe/types\";\n\n//#region src/tool-error-capture.d.ts\n\n/**\n * Tool-error capture for Alfe OpenClaw plugins.\n *\n * OpenClaw converts a thrown tool handler into a model-facing `tool_result`\n * WITHOUT logging, and most Alfe plugins catch-and-return an error result the\n * same silent way — so tool failures never appear in the runtime's output and\n * therefore never reach Sentry (the gateway daemon supervises the OpenClaw\n * process and reports error-looking output lines to the `agent-runtime`\n * project — see packages/gateway/src/runtime-output-monitor.ts).\n *\n * `installToolErrorCapture(api, { plugin })` closes that gap at the ONE choke\n * point every plugin already has: it wraps `api.registerTool` so every tool's\n * `execute` emits a deterministic, detector-matched line on failure:\n *\n * [ERROR] alfe-tool plugin=<plugin> tool=<name> <thrown|result-error>: <msg> (at <first-frame>)\n *\n * The `[ERROR]` prefix at line start is exactly what the daemon's\n * `ErrorLineDetector` classifies as an error-log block, so the failure lands\n * in Sentry fingerprinted by its normalized message — no Sentry SDK inside\n * the plugin process, no new dependency. Behavior toward OpenClaw and the\n * model is UNCHANGED: throws are rethrown, results returned as-is.\n */\n/**\n * Minimal shape of the OpenClaw plugin api this helper relies on. Method\n * syntax on purpose — TS checks method signatures bivariantly, so each\n * plugin's own concretely-typed `registerTool(tool: ToolDef): void` is\n * accepted without casts.\n */\ninterface ToolCaptureApi {\n registerTool(...args: never[]): unknown;\n}\ninterface InstallToolErrorCaptureOptions {\n /** Plugin package short-name for attribution (e.g. \"openclaw-secrets\"). */\n plugin: string;\n /**\n * Line sink — defaults to writing `process.stderr` directly (the plugin\n * runs in-process in OpenClaw, so this lands on the runtime's stderr, which\n * the daemon supervises — and a console patch can't reformat it away).\n * Injectable for tests.\n */\n emit?: (line: string) => void;\n}\n/**\n * Wrap `api.registerTool` so every tool registered AFTER this call gets\n * failure capture. Handles both OpenClaw registration signatures:\n * `registerTool(toolDef)` and `registerTool((ctx) => toolDef, opts)`.\n * Call once, first thing in the plugin's `activate`/`register` entry.\n * Never throws.\n */\ndeclare function installToolErrorCapture(api: ToolCaptureApi, options: InstallToolErrorCaptureOptions): void;\n//# sourceMappingURL=tool-error-capture.d.ts.map\n//#endregion\n//#region src/transport.d.ts\n/**\n * Shared HTTP transport for the Agent API client — request core, retry\n * policy, error formatting, and the `ApiBase` class the domain method\n * groups under `./domains/` build on.\n */\ninterface AgentApiClientConfig {\n apiKey: string;\n apiUrl: string;\n}\n/**\n * Encode each path segment but keep the `/` separators — `encodeURIComponent`\n * would escape the slashes too, breaking greedy proxy routes.\n */\n\ndeclare class AgentApiTransport {\n private readonly apiKey;\n private readonly apiUrl;\n constructor(config: AgentApiClientConfig);\n /**\n * Binary sibling of `request<T>()`. `request()` forces\n * `Content-Type: application/json` and parses a `{ data: T }` envelope,\n * neither of which fits a raw-audio flow (voice TTS/STT), so those go\n * through this instead. Auth (Bearer), the request budget, and the single\n * retry policy on transient 5xx / network errors is kept in sync with\n * `request()`. Safe read methods retry once by default; mutation methods do\n * not, because a response can be lost after a handler or provider call has\n * already succeeded.\n */\n rawRequest(path: string, init: {\n method: string;\n headers: Headers;\n body?: BodyInit | Uint8Array;\n }, extra?: {\n retry?: boolean;\n }): Promise<Response>;\n /**\n * @param extra.timeoutMs Per-request abort timeout (default REQUEST_TIMEOUT_MS).\n * Long endpoints (image generation) pass a larger value so the gateway's\n * own timeout wins with a readable status instead of a client-side abort.\n * @param extra.retry Whether to retry once on transient failures. Safe reads\n * (GET/HEAD/OPTIONS) default to true; mutations default to false. Set true\n * only when the endpoint's server-side contract is explicitly idempotent.\n * @param extra.signal Optional caller cancellation combined with the client's\n * own timeout budget. Aborting either signal cancels the request.\n */\n request<T>(path: string, options?: RequestInit, extra?: {\n timeoutMs?: number;\n retry?: boolean;\n signal?: AbortSignal;\n }): Promise<T>;\n}\n/**\n * Base class for the domain method groups. Holds the shared transport;\n * `AgentApiClient` assembles the groups onto one class via `applyMixins`\n * (prototype copy), so methods keep their original `this`-on-the-client\n * call shape.\n */\ndeclare class ApiBase {\n protected readonly transport: AgentApiTransport;\n constructor(transport: AgentApiTransport);\n}\n//# sourceMappingURL=transport.d.ts.map\n//#endregion\n//#region src/domains/workspace.d.ts\n/** Response of GET /agent/workspace (services/agents). */\ninterface AgentWorkspaceInfo {\n templateKey?: string;\n defaultModel?: string;\n installedFrom?: {\n templateKey: string;\n authorTenantId: string;\n version: number;\n };\n runtime?: string;\n teams?: {\n teamId: string;\n name: string;\n description?: string;\n parentTeamId?: string;\n }[];\n projects?: {\n projectId: string;\n name: string;\n description?: string;\n status: string;\n parentProjectId?: string;\n }[];\n teamIds?: string[];\n projectIds?: string[];\n}\ndeclare class WorkspaceApi extends ApiBase {\n /**\n * GET /agent/workspace — workspace config for the authenticated agent\n * (template assignment, default model, org roster).\n */\n getWorkspace(): Promise<AgentWorkspaceInfo>;\n /**\n * GET /templates/{key}/files — persona/workspace file contents for a\n * template the agent has access to. Pass `version` to pin to the version\n * the agent was installed from (omit → the endpoint resolves `latest`).\n */\n getTemplateFiles(templateKey: string, opts?: {\n version?: number;\n }): Promise<{\n files: Record<string, string>;\n }>;\n}\n//# sourceMappingURL=workspace.d.ts.map\n//#endregion\n//#region src/domains/sync.d.ts\ninterface SyncAgentInfo {\n agentId: string;\n tenantId: string;\n displayName: string;\n s3Prefix: string;\n status: \"stale\" | \"syncing\" | \"synced\";\n fileCount?: number;\n totalSize?: number;\n lastSync?: string;\n}\ninterface SyncManifestEntry {\n hash: string;\n size: number;\n modified: string;\n etag?: string;\n storageClass?: string;\n compressed?: boolean;\n}\ninterface SyncManifest {\n version: 1;\n agentId: string;\n lastSync: string;\n files: Record<string, SyncManifestEntry>;\n}\ninterface SyncPresignedUrl {\n path: string;\n url: string;\n expiresAt: string;\n}\ninterface SyncConfirmedUpload {\n filePath: string;\n hash: string;\n size: number;\n storageClass: \"STANDARD\" | \"GLACIER_IR\";\n syncedAt: string;\n}\ninterface SyncReconstructFile {\n path: string;\n size: number;\n url: string;\n storageClass?: string;\n compressed?: boolean;\n}\ninterface SyncReconstructBundle {\n agentId: string;\n mode: \"full\" | \"active\" | \"memory\";\n fileCount: number;\n totalSize: number;\n files: SyncReconstructFile[];\n expiresAt: string;\n}\ninterface SyncAgentStats {\n agentId: string;\n standardBytes: number;\n glacierBytes: number;\n fileCount: number;\n lastSyncAt: string | null;\n}\ninterface SyncFileEntry {\n filePath: string;\n size: number;\n modified: string;\n contentHash: string;\n storageClass?: string;\n compressed?: boolean;\n}\ninterface SyncSessionEntry {\n sessionId: string;\n size: number;\n lastModified: string;\n storageClass?: string;\n isArchived: boolean;\n}\ninterface SyncSessionContent {\n sessionId: string;\n content: string;\n compressed: boolean;\n}\ninterface SharedFileEntry {\n filePath: string;\n fileName: string;\n size: number;\n contentType?: string;\n}\ndeclare class SyncApi extends ApiBase {\n syncRegister(args?: {\n displayName?: string;\n }): Promise<{\n agent: SyncAgentInfo;\n }>;\n syncGetManifest(): Promise<SyncManifest>;\n syncPresign(args: {\n files: {\n path: string;\n operation: \"put\" | \"get\";\n contentType?: string;\n }[];\n }): Promise<{\n urls: SyncPresignedUrl[];\n }>;\n syncConfirmUpload(args: {\n filePath: string;\n hash: string;\n size: number;\n storageClass?: \"STANDARD\" | \"GLACIER_IR\";\n }): Promise<SyncConfirmedUpload>;\n syncReconstruct(args: {\n mode: \"full\" | \"active\" | \"memory\";\n }): Promise<SyncReconstructBundle>;\n syncGetStats(): Promise<SyncAgentStats>;\n syncListFiles(args?: {\n prefix?: string;\n }): Promise<{\n files: SyncFileEntry[];\n }>;\n syncListSessions(): Promise<{\n sessions: SyncSessionEntry[];\n }>;\n syncGetSession(sessionId: string): Promise<SyncSessionContent>;\n syncDeleteFile(filePath: string): Promise<{\n removed: boolean;\n }>;\n sharedListFiles(args: {\n scope: \"org\" | \"team\" | \"project\";\n scopeId: string;\n limit?: number;\n cursor?: string;\n }): Promise<{\n files: SharedFileEntry[];\n nextCursor: string | null;\n }>;\n sharedDownloadUrl(args: {\n scope: \"org\" | \"team\" | \"project\";\n scopeId: string;\n filePath: string;\n }): Promise<{\n downloadUrl: string;\n expiresIn: number;\n }>;\n}\n//# sourceMappingURL=sync.d.ts.map\n//#endregion\n//#region src/domains/knowledge.d.ts\ntype KnowledgeScopeType = \"org\" | \"team\" | \"project\";\ninterface KnowledgeScope {\n scopeType: KnowledgeScopeType;\n scopeId: string;\n name: string;\n}\ninterface KnowledgeSearchHit {\n id: string;\n text: string;\n /** Normalized relevance in (0,1]; higher = closer. */\n score: number;\n scopeType: KnowledgeScopeType;\n scopeId: string;\n /**\n * Provenance of the hit. All live results are `\"doc\"`; `\"fact\"` only ever\n * appears for legacy vectors indexed before the facts primitive was removed\n * (the search index stays tolerant of them). Treat every hit as a doc.\n */\n source: \"doc\" | \"fact\";\n /** The canonical file under shared/<scope>/ (present on doc hits). */\n filePath?: string;\n /** Legacy-only: the id of a pre-removal fact vector. */\n factId?: string;\n}\ninterface KnowledgeSearchResult {\n results: KnowledgeSearchHit[];\n /** True when fan-out breadth was capped (more member scopes than the cap). */\n truncatedScopes: boolean;\n}\ninterface KnowledgeProfileLink {\n label: string;\n url: string;\n}\ninterface KnowledgeProfile {\n scopeType: KnowledgeScopeType;\n scopeId: string;\n about: string | null;\n description: string | null;\n links: KnowledgeProfileLink[];\n updatedAt: string | null;\n updatedBy: string | null;\n}\ntype ChangeRequestResourceType = \"doc\" | \"profile\";\ntype ChangeRequestOperation = \"create\" | \"update\" | \"delete\";\ntype ChangeRequestStatus = \"open\" | \"approved\" | \"rejected\" | \"withdrawn\" | \"superseded\";\ntype ChangeRequestActorKind = \"human\" | \"agent\";\n/** Public projection of a change request (mirrors `PublicChangeRequest` in services/org). */\ninterface KnowledgeChangeRequest {\n changeRequestId: string;\n scopeType: KnowledgeScopeType;\n scopeId: string;\n resourceType: ChangeRequestResourceType;\n operation: ChangeRequestOperation;\n targetPath: string | null;\n baseVersionId: string | null;\n proposedContentType: string | null;\n status: ChangeRequestStatus;\n proposerId: string;\n proposerKind: ChangeRequestActorKind;\n rationale: string;\n reviewerId: string | null;\n reviewerKind: ChangeRequestActorKind | null;\n reviewedAt: string | null;\n reviewNote: string | null;\n appliedRef: string | null;\n createdAt: string;\n updatedAt: string;\n}\n/** Per-type proposal payload for `proposeScopeChange`. */\ninterface ProposeScopeChangeInput {\n resourceType: ChangeRequestResourceType;\n operation: ChangeRequestOperation;\n /** Why the change is proposed — shown to the reviewer. */\n rationale: string;\n /** doc: the path the proposal applies to (e.g. designs/data-center.md). */\n targetPath?: string;\n /** doc create/update: the staged body to upload (markdown or other text). */\n content?: string;\n /** doc create/update: content type of the staged body (default text/markdown). */\n contentType?: string;\n /** profile: the proposed value ({ about, description, links }). */\n proposedValue?: unknown;\n}\ninterface KnowledgeDoc {\n filePath: string;\n fileName: string;\n contentType?: string;\n size: number;\n uploadedBy?: string;\n createdAt: string;\n updatedAt: string;\n}\ndeclare class KnowledgeApi extends ApiBase {\n /**\n * Semantic search across the agent's member scopes. Fan-out is gated\n * server-side by `listScopes` set-inclusion (fail-closed). Pass\n * `scopeType` + `scopeId` to narrow to one scope; a non-member scope\n * yields empty results (never a cross-scope leak).\n */\n knowledgeSearch(query: string, opts?: {\n limit?: number;\n scopeType?: KnowledgeScopeType;\n scopeId?: string;\n }): Promise<KnowledgeSearchResult>;\n /** Enumerate the scopes (org + teams + projects) this agent belongs to. */\n listScopes(): Promise<{\n scopes: KnowledgeScope[];\n }>;\n /** Read a scope's structured knowledge profile (after membership check). */\n getScopeProfile(scopeType: KnowledgeScopeType, scopeId: string): Promise<KnowledgeProfile>;\n /**\n * Open a change request against a scope's knowledge resource. For a doc\n * create/update, `services/org` returns a presigned staging PUT; this method\n * uploads the proposed `content` to it (echoing the same Content-Type that\n * was signed), mirroring `writeScopeDoc`. The staged body is applied to the\n * canonical doc — attributed to this agent — only when a reviewer approves.\n */\n proposeScopeChange(scopeType: KnowledgeScopeType, scopeId: string, input: ProposeScopeChangeInput): Promise<KnowledgeChangeRequest>;\n /**\n * List the agent's OWN change requests in a scope (filtered server-side to\n * this agent as proposer). Pass `status` to narrow to open / approved / etc.\n */\n listScopeChangeRequests(scopeType: KnowledgeScopeType, scopeId: string, opts?: {\n status?: ChangeRequestStatus;\n limit?: number;\n cursor?: string;\n }): Promise<{\n changeRequests: KnowledgeChangeRequest[];\n nextCursor: string | null;\n }>;\n /** List a scope's docs (the org-files corpus; mirrored to shared/<scope>/). */\n listScopeDocs(scopeType: KnowledgeScopeType, scopeId: string, opts?: {\n limit?: number;\n cursor?: string;\n }): Promise<{\n files: KnowledgeDoc[];\n nextCursor: string | null;\n }>;\n /**\n * Read the full text of a scope doc. Resolves a presigned download URL\n * from `services/org`, then fetches the bytes directly from S3 (the one\n * legitimate raw fetch in a plugin — same pattern as sync).\n */\n readScopeDoc(scopeType: KnowledgeScopeType, scopeId: string, filePath: string, opts?: {\n maxBytes?: number;\n }): Promise<{\n filePath: string;\n text: string;\n }>;\n /**\n * Write (create or overwrite) a scope doc. Two-step presigned upload:\n * `services/org` returns a signed URL plus `requiredHeaders` (author /\n * authorKind / message as `x-amz-meta-*`) that MUST be sent verbatim on\n * the PUT, alongside the same `Content-Type` that was signed. Author and\n * authorKind are server-set from the agent token — never trusted here.\n */\n writeScopeDoc(scopeType: KnowledgeScopeType, scopeId: string, filePath: string, content: string, opts?: {\n contentType?: string;\n message?: string;\n }): Promise<{\n filePath: string;\n }>;\n}\n//# sourceMappingURL=knowledge.d.ts.map\n//#endregion\n//#region src/domains/mobile.d.ts\n/** Response of GET /mobile/numbers for an agent (services/mobile). */\ninterface MobileNumberInfo {\n phoneNumber: string;\n countryCode: string;\n monthlyPrice?: number;\n status: string;\n errorMessage?: string;\n}\n/** One purchasable number from GET /mobile/numbers/search. */\ninterface MobileAvailableNumber {\n number: string;\n friendlyName: string;\n locality: string;\n region: string;\n country: string;\n}\n/** Approved WhatsApp content template from GET /mobile/whatsapp/templates. */\ninterface WhatsAppTemplate {\n contentSid: string;\n name: string;\n language: string;\n body: string;\n variables: Record<string, string>;\n category?: string;\n}\ndeclare class MobileApi extends ApiBase {\n getMobileNumber(): Promise<MobileNumberInfo>;\n searchMobileNumbers(args?: {\n country?: string;\n query?: string;\n }): Promise<{\n numbers: MobileAvailableNumber[];\n monthlyPrice: number;\n }>;\n assignMobileNumber(args: {\n phoneNumber: string;\n countryCode: string;\n }): Promise<{\n phoneNumber: string;\n countryCode: string;\n status: \"pending\";\n }>;\n releaseMobileNumber(): Promise<{\n released: true;\n }>;\n sendSms(args: {\n to: string;\n body: string;\n }): Promise<{\n sent: true;\n sid: string;\n }>;\n startOutboundCall(args: {\n to: string;\n }): Promise<{\n callSid: string;\n status: string;\n }>;\n getWhatsAppSession(to: string): Promise<{\n active: boolean;\n expiresAt?: string;\n }>;\n sendWhatsAppMessage(args: {\n to: string;\n body: string;\n }): Promise<{\n sent: true;\n sid: string;\n }>;\n sendWhatsAppTemplate(args: {\n to: string;\n contentSid: string;\n contentVariables: Record<string, string>;\n bodyPreview?: string;\n }): Promise<{\n sent: true;\n sid: string;\n }>;\n listWhatsAppTemplates(): Promise<{\n templates: WhatsAppTemplate[];\n }>;\n}\n//# sourceMappingURL=mobile.d.ts.map\n//#endregion\n//#region src/domains/remote.d.ts\ninterface RemoteSessionInfo {\n sessionId: string;\n agentId: string;\n surface: \"browser\" | \"terminal\";\n status: \"agent_driving\" | \"awaiting_human\" | \"human_in_control\" | \"resuming\" | \"completed\" | \"expired\" | \"failed\";\n url?: string;\n instructions?: string;\n requestedAt?: string;\n}\ndeclare class RemoteApi extends ApiBase {\n requestBrowserTakeover(args: {\n instructions: string;\n url?: string;\n conversationId?: string;\n }): Promise<{\n sessionId: string;\n status: string;\n }>;\n getRemoteSession(sessionId: string): Promise<RemoteSessionInfo>;\n completeRemoteSession(sessionId: string): Promise<{\n ok: boolean;\n }>;\n}\n//# sourceMappingURL=remote.d.ts.map\n//#endregion\n//#region src/domains/self.d.ts\n/** Voice settings — core agent config. Mirrors `VoiceConfig` in `@alfe/types`. */\ninterface AgentVoiceConfig {\n /** ElevenLabs voice ID; platform default when unset. */\n voiceId?: string;\n ttsModel?: string;\n enabled?: boolean;\n}\n/**\n * The agent's own public identity, as returned by `updateSelf`, `generateAvatar`,\n * `presignAvatar`'s finalize (`finalizeAvatar`). This is the public agent\n * projection; only the identity-relevant fields are typed here — the response\n * carries the full public agent record.\n */\ninterface AgentSelf {\n agentId: string;\n tenantId: string;\n name: string;\n avatarUrl?: string;\n voiceConfig?: AgentVoiceConfig;\n status: string;\n}\n/** Result of `presignAvatar` — the agent PUTs bytes to `uploadUrl`, then finalizes with `s3Key`. */\ninterface AgentAvatarPresign {\n /** Presigned PUT URL to upload the image bytes to. */\n uploadUrl: string;\n /** Object key — echoed back to `finalizeAvatar`. */\n s3Key: string;\n /** Stable public URL the avatar will be served from once finalized. */\n publicUrl: string;\n /** ISO expiry of the presigned PUT URL. */\n expiresAt: string;\n}\n/** A voice in the platform catalogue (ElevenLabs), from `listVoices`. */\ninterface AgentVoice {\n id: string;\n name: string;\n previewUrl: string;\n description: string;\n labels: Record<string, string>;\n category: string;\n}\ndeclare class SelfApi extends ApiBase {\n /** Update the agent's own name and/or voice config. Returns the updated agent. */\n updateSelf(update: {\n name?: string;\n voiceConfig?: AgentVoiceConfig;\n }): Promise<AgentSelf>;\n /**\n * Generate the agent's own avatar from a text prompt. The image is generated,\n * stored, and set on the agent server-side; returns the updated agent.\n *\n * ASYNC (same reason as `generateImage`): avatar gen runs `gpt-image-1`\n * (30–60s) which exceeds the API Gateway 30s ceiling, so this enqueues a job\n * (`POST /agent/avatar/generate` → `jobId`) then polls (`GET /agent/avatar/{jobId}`)\n * until the avatar is set. Signature unchanged — the plugin is unaffected.\n */\n generateAvatar(args: {\n prompt: string;\n }): Promise<AgentSelf>;\n /**\n * Get a presigned PUT URL to upload a new avatar image. Upload the bytes to\n * `uploadUrl`, then call `finalizeAvatar(s3Key)` to set it on the agent.\n */\n presignAvatar(args: {\n mimeType: string;\n size: number;\n }): Promise<AgentAvatarPresign>;\n /**\n * Finalize an avatar upload — validates ownership + size, then sets the\n * agent's `avatarUrl` server-side. Returns the updated agent.\n */\n finalizeAvatar(s3Key: string): Promise<AgentSelf>;\n /** List the platform voice catalogue (ElevenLabs) so the agent can pick its own voice. */\n listVoices(): Promise<{\n voices: AgentVoice[];\n }>;\n}\n//# sourceMappingURL=self.d.ts.map\n//#endregion\n//#region src/domains/voice.d.ts\n/** The ElevenLabs models with a pricing row — the TTS endpoint rejects any other value. */\ntype VoiceTtsModel = \"eleven_turbo_v2_5\" | \"eleven_multilingual_v2\";\ninterface VoiceTtsArgs {\n /** Text to synthesize (1–5000 chars — the endpoint enforces this). */\n text: string;\n /** ElevenLabs voice id; platform default when unset. */\n voiceId?: string;\n /** TTS model; `eleven_turbo_v2_5` (lower latency) when unset. */\n model?: VoiceTtsModel;\n}\n/** Raw synthesized audio plus its PCM framing (from the response headers). */\ninterface VoiceTtsResult {\n /** Raw little-endian PCM samples — no container. Wrap in WAV to make a playable file. */\n audio: Buffer;\n /** Samples per second (e.g. 24000). */\n sampleRate: number;\n /** Channel count (mono = 1). */\n channels: number;\n /** Bits per sample (e.g. 16). */\n bitDepth: number;\n}\ninterface VoiceSttArgs {\n /** Raw linear16 (16-bit little-endian) mono PCM samples — no WAV/container header. */\n audio: Uint8Array;\n /** Sample rate of `audio` in Hz (8000–48000). */\n sampleRate: number;\n}\ninterface VoiceSttResult {\n text: string;\n /** Deepgram confidence in (0,1]. */\n confidence: number;\n}\ndeclare class VoiceApi extends ApiBase {\n /**\n * Text-to-speech. Returns raw PCM audio bytes plus their framing — the\n * voice service defaults to 24 kHz / mono / 16-bit. Wrap in a WAV container\n * to produce a playable file. Metered per character against the tenant\n * credit pool server-side; TTS completes regardless of metering outcome.\n */\n tts(args: VoiceTtsArgs): Promise<VoiceTtsResult>;\n /**\n * Speech-to-text. Accepts raw linear16 (16-bit LE) mono PCM — NOT a WAV or\n * other container (the endpoint transcribes with a fixed linear16 encoding,\n * so a container header would be transcribed as noise). Strip any WAV header\n * and pass `sampleRate` from it before calling. Metered by transcribed\n * duration against the tenant credit pool server-side.\n */\n stt(args: VoiceSttArgs): Promise<VoiceSttResult>;\n}\n//# sourceMappingURL=voice.d.ts.map\n//#endregion\n//#region src/domains/search.d.ts\n/**\n * The broad-news providers behind the metered `services/news` Lambda. The\n * server validates this with a zod enum; a value outside the union is an\n * unpriceable product, so keep the literal union in lockstep with the service.\n */\ntype NewsProvider = \"apitube\" | \"newsdata\";\n/** One normalized article. `sentiment` is provider-shaped (APITube supplies it). */\ninterface NewsArticle {\n title: string;\n url: string;\n source: string;\n publishedAt: string;\n snippet: string;\n sentiment?: unknown;\n}\n/** Provider-agnostic result — the server normalizes every adapter to this. */\ninterface NewsResult {\n articles: NewsArticle[];\n provider: string;\n}\ndeclare class SearchApi extends ApiBase {\n searchWeb(params: {\n query: string;\n count?: number;\n offset?: number;\n country?: string;\n freshness?: string;\n }, options?: {\n signal?: AbortSignal;\n }): Promise<unknown>;\n searchImages(params: {\n query: string;\n count?: number;\n }, options?: {\n signal?: AbortSignal;\n }): Promise<unknown>;\n searchNews(params: {\n query: string;\n count?: number;\n offset?: number;\n freshness?: string;\n }, options?: {\n signal?: AbortSignal;\n }): Promise<unknown>;\n /** Search news across the selected provider's corpus. → POST /agent/news/search */\n newsSearch(params: {\n query: string;\n provider?: NewsProvider;\n source?: string;\n from?: string;\n to?: string;\n language?: string;\n category?: string;\n limit?: number;\n }): Promise<NewsResult>;\n /** Top headlines for the selected provider. → POST /agent/news/headlines */\n newsHeadlines(params?: {\n provider?: NewsProvider;\n category?: string;\n source?: string;\n language?: string;\n limit?: number;\n }): Promise<NewsResult>;\n}\n//# sourceMappingURL=search.d.ts.map\n//#endregion\n//#region src/domains/webhooks.d.ts\ninterface AgentWebhook {\n webhookId: string;\n tenantId: string;\n agentId: string;\n name: string;\n provider: string;\n active: boolean;\n createdBy: string;\n createdAt: string;\n updatedAt: string;\n}\ninterface CreatedAgentWebhook extends AgentWebhook {\n url: string;\n signingSecret: string;\n}\ninterface AgentWebhookDelivery {\n deliveryId: string;\n webhookId: string;\n status: string;\n attempts: number;\n createdAt: string;\n deliveredAt?: string;\n}\ndeclare class WebhooksApi extends ApiBase {\n createWebhook(args: {\n name: string;\n provider?: \"generic\" | \"github\" | \"stripe\" | \"slack\";\n }): Promise<CreatedAgentWebhook>;\n listWebhooks(): Promise<AgentWebhook[]>;\n deleteWebhook(webhookId: string): Promise<{\n webhookId: string;\n active: false;\n }>;\n rotateWebhookSecret(webhookId: string): Promise<{\n webhookId: string;\n signingSecret: string;\n }>;\n listWebhookDeliveries(webhookId: string): Promise<AgentWebhookDelivery[]>;\n}\n//# sourceMappingURL=webhooks.d.ts.map\n//#endregion\n//#region src/domains/chat.d.ts\ndeclare class ChatApi extends ApiBase {\n presignAttachments(files: {\n filename: string;\n mimeType: string;\n size: number;\n }[]): Promise<{\n attachments: {\n id: string;\n uploadUrl: string;\n downloadUrl: string;\n s3Key: string;\n expiresAt: string;\n }[];\n }>;\n recordActivity(data: {\n userId?: string;\n channel: string;\n role: \"user\" | \"assistant\";\n }): Promise<{\n recorded: boolean;\n }>;\n}\n//# sourceMappingURL=chat.d.ts.map\n//#endregion\n//#region src/domains/connect-credentials.d.ts\ndeclare class ConnectCredentialsApi extends ApiBase {\n /**\n * Returns every connected Google account for the agent. Multi-account by\n * design — the openclaw-google plugin requires the LLM to pass `email`\n * explicitly to `google_run_command` so an account is always selected\n * deliberately.\n *\n * 2026-05-14 (connections-redesign PR 1): the legacy flat shape (`email`,\n * `refreshToken`, `accessToken`, etc., populated from the default account)\n * is gone. Iterate over `accounts`.\n */\n getGoogleCredentials(): Promise<{\n accounts: {\n email: string;\n refreshToken: string;\n clientId: string;\n clientSecret: string;\n displayName?: string;\n connectedAt?: string;\n }[];\n }>;\n disconnectGoogleAccount(email: string): Promise<{\n accounts: {\n email: string;\n displayName?: string;\n connectedAt?: string;\n }[];\n }>;\n getGoogleChatCredentials(): Promise<{\n email: string;\n refreshToken: string;\n clientId: string;\n clientSecret: string;\n displayName?: string;\n }>;\n /**\n * Fetch decrypted credentials for ONE specific connection by its\n * stable connectionId (connection-scoped, vs the provider-scoped\n * `get<Provider>Credentials` helpers). Used by the daemon to resolve\n * a Custom Connection-driven integration's credentials from the\n * exact connection it was installed from — every custom connection\n * shares the `custom` provider id, so provider-scoping is ambiguous.\n *\n * For custom connections `accessToken` is the JSON-encoded secret\n * bundle (the daemon un-bundles it); non-secret fields are on\n * `providerMetadata`. The endpoint enforces that the connection is in\n * the calling agent's effective scope (403 otherwise).\n */\n getConnectionCredentials(connectionId: string): Promise<{\n provider: string;\n connectionId: string;\n accountIdentifier?: string;\n accessToken?: string;\n providerMetadata?: Record<string, unknown>;\n [key: string]: unknown;\n }>;\n /**\n * @deprecated Returns a single primary credential blob (legacy \"pick-the-\n * default-connection\" shape). Use `getGithubAccounts()` for the multi-\n * account shape required by Pattern A — explicit selector args on every\n * tool. Retained because the `@alfe.ai/github-mcp` proxy is the\n * only consumer that knows about Pattern A; legacy env-interpolation\n * callers will keep hitting `/credentials` until they move to the proxy.\n */\n getGithubCredentials(): Promise<{\n login: string;\n accessToken: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for GitHub.\n *\n * Returns every agent-scoped GitHub connection. The caller is expected\n * to require a `login` selector on every credential-touching tool and\n * look up the matching account at dispatch time.\n *\n * GitHub OAuth tokens have no expiry (`tokenLifecycle: \"no_expiry\"`),\n * so there is intentionally no `refreshGithubAccountToken` method — if\n * a token is revoked the user must re-run the OAuth flow.\n *\n * Returned `accounts[i].login` is the GitHub username — the stable\n * cross-session identifier the LLM should pass.\n */\n getGithubAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n login: string;\n scopes: string;\n }[];\n }>;\n /**\n * @deprecated Returns a single primary credential blob (legacy \"pick-the-\n * default-connection\" shape). Use `getXeroAccounts()` for the multi-\n * account shape required by Pattern A — explicit selector args on every\n * tool. This method will be removed once all consumers migrate.\n */\n getXeroCredentials(): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n xeroTenantId: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for Xero. Returns every\n * agent-scoped Xero connection. The caller is expected to require a\n * selector arg (e.g. `xeroTenantId`) on every credential-touching tool\n * and look up the matching account by that selector at dispatch time.\n *\n * `xeroTenantId` is the model-facing organisation selector. The separate\n * `accountIdentifier` is the Connect persistence key used for refresh and\n * may be an email; never substitute one for the other.\n */\n getXeroAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n xeroTenantId: string;\n }[];\n }>;\n refreshXeroToken(): Promise<{\n accessToken: string;\n expiresAt: string;\n }>;\n /**\n * Refresh a specific Xero Connection by its exact `accountIdentifier` from\n * `getXeroAccounts()`. Do not substitute `xeroTenantId`: current Xero OAuth\n * rows may use the account email as their persistence key even when a sole\n * organisation tenant ID is available in provider metadata.\n */\n refreshXeroAccountToken(accountIdentifier: string): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n /**\n * @deprecated Returns a single primary credential blob (legacy \"pick-the-\n * default-connection\" shape). Use `getNotionAccounts()` for the multi-\n * account shape required by Pattern A.\n */\n getNotionCredentials(): Promise<{\n accessToken: string;\n workspaceId: string;\n workspaceName: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for Notion. Returns every\n * agent-scoped Notion connection. The caller is expected to require a\n * selector arg (e.g. `workspaceId`) on every credential-touching tool.\n *\n * Returned `accounts[i].accountIdentifier` is the Notion workspaceId.\n */\n getNotionAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n workspaceId: string;\n workspaceName: string;\n }[];\n }>;\n /**\n * @deprecated Returns a single primary Atlassian Connection's credentials\n * (one OAuth user, one cloudId) — the legacy \"pick-the-default-connection\"\n * shape. Atlassian is multi-site by nature (each OAuth user may have\n * access to multiple Cloud sites), so Pattern A plugins MUST use\n * `getAtlassianAccounts()` to discover the full set and dispatch via\n * the `cloudId` selector arg.\n */\n getAtlassianCredentials(): Promise<{\n accessToken: string;\n refreshToken: string;\n accessTokenExpiresAt: string;\n cloudId: string;\n siteName: string;\n siteUrl: string;\n email: string;\n enabledProducts: string[];\n clientId: string;\n clientSecret: string;\n }>;\n refreshAtlassianToken(): Promise<{\n accessToken: string;\n expiresAt: string;\n }>;\n /**\n * Pattern A: multi-account / multi-site credential fetch for Atlassian.\n *\n * Returns every agent-scoped Atlassian Connection. Each Connection is\n * one OAuth user with a single access token and N accessible Cloud\n * sites (`availableSites`). The caller is expected to:\n *\n * 1. Flatten (connection × cloudId) into one MCP child per site.\n * 2. Require a `cloudId` selector on every credential-touching tool.\n * 3. Use the access token bound to the Connection that owns the\n * requested `cloudId` (Atlassian shares one access token across\n * all sites accessible to the OAuth user).\n *\n * Per-account token refresh uses `refreshAtlassianAccountToken(email)`\n * — refreshing one Connection rotates its single access token, which\n * then applies to every cloudId for that Connection.\n *\n * Returned `accounts[i].accountIdentifier` is the OAuth user's email\n * — the stable cross-session identifier for refresh purposes. The LLM\n * never sees this directly: it picks a site via the `cloudId` arg\n * instead.\n */\n getAtlassianAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n clientId: string;\n clientSecret: string;\n cloudId: string;\n siteName: string;\n siteUrl: string;\n availableSites: {\n id: string;\n url: string;\n name: string;\n scopes?: string[];\n avatarUrl?: string;\n }[];\n }[];\n }>;\n /**\n * Pattern A: refresh a specific Atlassian Connection by `accountIdentifier`\n * (the OAuth user's email).\n *\n * Atlassian rotates refresh tokens (`rotatesRefreshToken: true`); the\n * server-side per-account refresh endpoint handles rotation and\n * persistence. Refreshing one Connection updates its single access\n * token, which applies to every accessible Cloud site (cloudId) for\n * that OAuth user.\n *\n * Returns the new access token + expiry. The proxy is responsible for\n * fanning the new token out to every child server it spawned for\n * cloudIds owned by this Connection.\n */\n refreshAtlassianAccountToken(accountIdentifier: string): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n /**\n * @deprecated Returns a single primary credential blob (legacy \"pick-the-\n * default-connection\" shape). Use `getMYOBAccounts()` for the multi-\n * account shape required by Pattern A.\n */\n getMYOBCredentials(): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n myobBusinessId: string;\n clientId: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for MYOB. Returns every\n * agent-scoped MYOB connection. The caller is expected to require a\n * selector arg (e.g. `myobBusinessId` / `accountIdentifier`) on every\n * credential-touching tool.\n *\n * Returned `accounts[i].accountIdentifier` is the MYOB businessId.\n */\n getMYOBAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n myobBusinessId: string;\n clientId: string;\n }[];\n }>;\n refreshMYOBToken(): Promise<{\n accessToken: string;\n expiresAt: string;\n }>;\n /**\n * Pattern A: refresh one MYOB Connection by its stable\n * `accountIdentifier` (the MYOB business id returned by\n * `getMYOBAccounts()`).\n *\n * MYOB refresh tokens belong to individual Connection rows. A\n * multi-business client must use this method instead of refreshing the\n * primary Connection and copying that access token into every cached\n * business client.\n */\n refreshMYOBAccountToken(accountIdentifier: string): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n /**\n * @deprecated Returns a single primary credential blob. Use\n * `getSalesforceAccounts()` for the multi-account shape required by\n * Pattern A.\n */\n getSalesforceCredentials(): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n instanceUrl: string;\n orgId: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for Salesforce. Returns every\n * agent-scoped Salesforce connection. One OAuth grant maps to one org, so\n * `accounts[i].accountIdentifier` (and `orgId`) is the Salesforce org id —\n * the selector every credential-touching tool requires.\n */\n getSalesforceAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n instanceUrl: string;\n orgId: string;\n }[];\n }>;\n /**\n * Refresh the access token for a specific Salesforce org. Salesforce\n * tokens aren't interchangeable across orgs, so the connection is targeted\n * by `accountIdentifier` (the org id) — mirrors `refreshXeroAccountToken`.\n */\n refreshSalesforceAccountToken(orgId: string): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for Microsoft 365.\n *\n * Returns every agent-scoped Microsoft connection. The caller is expected\n * to require an `email` selector on every credential-touching tool and\n * look up the matching account at dispatch time.\n *\n * Returned `accounts[i].accountIdentifier` is the user's primary email\n * (or the tid claim as fallback) — the stable cross-session identifier\n * the LLM should pass.\n *\n * Per-account token refresh is exposed via `refreshMicrosoftAccountToken`,\n * NOT `refreshXeroAccountToken` — Microsoft refresh tokens are not\n * interchangeable across (tenant, user) pairs.\n */\n getMicrosoftAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n email: string;\n microsoftTenantId: string;\n workspaceDomain: string;\n }[];\n }>;\n /**\n * Pattern A: refresh a specific Microsoft 365 connection by its\n * `accountIdentifier`. For Microsoft, `accountIdentifier` is the user's\n * email when the Graph profile fetch succeeded at connect time, and the\n * Azure tenant id (`tid` claim) as fallback. Callers should pass the\n * value returned by `getMicrosoftAccounts()` rather than synthesising\n * an email locally.\n *\n * Microsoft refresh tokens are bound to a specific (tenant, user) pair —\n * they are NOT interchangeable across accounts, so per-account refresh\n * is mandatory. The generic /accounts/{accountIdentifier}/refresh\n * endpoint walks the agent's full visible scope chain to find a matching\n * connection (works for inherited team/project Microsoft connections).\n */\n refreshMicrosoftAccountToken(accountIdentifier: string): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n /**\n * Disconnects one connected Microsoft 365 account for the agent, by its\n * `accountIdentifier`. Hits the generic per-account disconnect route\n * (`DELETE /agent/connect/microsoft/accounts/{accountIdentifier}`), which\n * resolves across the agent's full effective scope chain and deletes the\n * matching Connection row. Returns the remaining accounts.\n *\n * IMPORTANT: pass the `accountIdentifier` from `getMicrosoftAccounts()`, NOT\n * a synthesised email. For Microsoft, `accountIdentifier` is the user's email\n * only when the Graph profile fetch succeeded at connect time; it falls back\n * to the Azure tenant id (`tid` claim) otherwise. The backend matches on\n * `accountIdentifier` exactly, so passing an email would 404 on those\n * fallback-identifier accounts. (This is why the param is not named `email`,\n * unlike `disconnectGoogleAccount` where the identifier is always the email.)\n */\n disconnectMicrosoftAccount(accountIdentifier: string): Promise<{\n accounts: {\n accountIdentifier: string;\n displayName?: string;\n connectedAt?: string;\n }[];\n }>;\n /**\n * Resolve the primary cTrader Connection's credentials for the calling\n * agent. Unlike most providers, the cTrader Open API needs app-level auth\n * (`clientId` + `clientSecret`) AND account auth (`accessToken` +\n * `accountId`) on the socket, so `@alfe.ai/ctrader-mcp` self-fetches the\n * full set here at startup (the atlassian/google pattern). `clientId` /\n * `clientSecret` are the SST-sourced global app credentials the connect\n * endpoint injects — they are never persisted on the connection. `host` is\n * the resolved TLS endpoint (`live.ctraderapi.com` / `demo.ctraderapi.com`)\n * derived from the selected account's live/demo flag.\n */\n getCTraderCredentials(): Promise<{\n accessToken: string;\n refreshToken: string;\n accountId: string;\n host: string;\n clientId: string;\n clientSecret: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for cTrader.\n *\n * Unlike atlassian/salesforce (one Connection row per account/site), a\n * cTrader is MULTI-grant per agent: an agent may connect several distinct\n * cTrader logins, each its own Connection row keyed on `accountIdentifier =\n * ctid:<userId>` (Phase 1). This aggregates the *trading accounts* across\n * ALL of those Connection rows — each row contributes its `availableAccounts`\n * flattened, and every account carries ITS OWN grant's `accessToken` (the\n * token that authenticates that account against the cTrader Open API). One\n * OAuth grant still covers all accounts under that single login on one shared\n * token; only the `ctidTraderAccountId` and the protobuf socket `host` (live\n * vs demo) differ within a grant. Across grants the tokens differ, so the\n * token is now PER-ACCOUNT rather than hoisted to the top level.\n *\n * `host` per account is derived from the account's `isLive` flag\n * (`live.ctraderapi.com` / `demo.ctraderapi.com`) — the same mapping the\n * connect provider applies server-side when an account is auto-selected.\n *\n * `clientId` / `clientSecret` are the SST-sourced GLOBAL app credentials the\n * connect endpoint injects — identical across every Connection row (one\n * cTrader app), never persisted on a connection. We take them from the first\n * row that carries them.\n *\n * Accounts are deduped on `ctidTraderAccountId` first-wins: Spotware ids are\n * globally unique across logins, so a duplicate can only appear if the same\n * account somehow surfaced under two grants — first-wins keeps it\n * deterministic.\n *\n * `accounts` may be empty (no cTrader Connection at all), in which case we\n * return empty creds rather than throwing.\n */\n getCTraderAccounts(): Promise<{\n accounts: {\n ctidTraderAccountId: string;\n host: string;\n isLive: boolean;\n brokerName?: string;\n accountNumber?: string;\n accessToken: string;\n /**\n * The stable per-grant Connection key (`ctid:<userId>`) this account\n * belongs to. Every trading account under one cTrader login shares one\n * grant (one OAuth token), so this is the identifier the MCP server\n * passes to `refreshCTraderAccount()` to rotate the token for the whole\n * grant on a `CH_ACCESS_TOKEN_INVALID` expiry. Empty string when the\n * server did not supply one (legacy rows) — such an account can still\n * trade with its current token but cannot self-refresh.\n */\n accountIdentifier: string;\n }[];\n clientId: string;\n clientSecret: string;\n }>;\n /**\n * Pattern A: refresh a specific cTrader grant by its stable\n * `accountIdentifier` (`ctid:<userId>` from `getCTraderAccounts()`).\n *\n * cTrader access tokens live ~30 days; the `getCTraderAccounts()` /\n * credentials reads serve the STORED token without refreshing, so refresh is\n * the consumer's job. `@alfe.ai/ctrader-mcp` calls this when the cTrader Open\n * API rejects an account-auth with `CH_ACCESS_TOKEN_INVALID`, then re-runs\n * the socket handshake with the returned `accessToken`.\n *\n * Refreshing one grant rotates the single OAuth token that covers EVERY\n * trading account under that login. cTrader's refresh token itself does not\n * expire but may rotate on refresh (`rotatesRefreshToken: true`); connect\n * persists the rotated refresh token server-side, so the caller only needs\n * the new `accessToken`. Mirrors `refreshXeroAccountToken`.\n */\n refreshCTraderAccount(accountIdentifier: string): Promise<{\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n /**\n * @deprecated Returns a single primary credential blob. Use\n * `getShopifyAccounts()` for the multi-account shape required by Pattern A\n * (`@alfe.ai/shopify-mcp` keys per-shop on the myshopify domain).\n */\n getShopifyCredentials(): Promise<{\n accessToken: string;\n shopDomain: string;\n shopGid: string;\n shopName: string;\n apiVersion: string;\n }>;\n /**\n * Pattern A: multi-account credential fetch for Shopify. Returns every\n * agent-scoped Shopify Connection. One OAuth grant maps to one store, so the\n * stable per-call selector is the store's myshopify domain (`shopDomain`),\n * NOT `accountIdentifier` — the connect provider keys `accountIdentifier` on\n * the immutable shop GID (falling back to the domain), so `shopDomain` is the\n * value the LLM passes and the plugin routes on.\n *\n * Each entry is shaped by the connect provider's `buildCredentialsResponse`:\n * `{ accessToken, shopDomain, shopGid, shopName, apiVersion }` — offline\n * Shopify tokens never expire, so there is NO token / expiry field and no\n * refresh method (unlike Salesforce). The GraphQL Admin API authenticates\n * purely on `X-Shopify-Access-Token`; no client credentials are on the wire.\n */\n getShopifyAccounts(): Promise<{\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n connectedAt: string;\n accessToken: string;\n shopDomain: string;\n shopGid: string;\n shopName: string;\n apiVersion: string;\n }[];\n }>;\n /**\n * Pattern A: provider-parameterized multi-account credential fetch for the\n * social connectors (Bluesky, and the approval-gated backlog: X, Meta,\n * Threads, LinkedIn, Pinterest, TikTok, Reddit, YouTube).\n *\n * Unlike the bespoke `getGithubAccounts()` / `getXeroAccounts()` shapes,\n * this returns a UNIFORM normalized account shape so `@alfe.ai/social-mcp`'s\n * shared driver can require a single `account` selector on every\n * credential-touching tool regardless of platform. The backend\n * `api-agents/{provider}/accounts` route is already provider-generic; this\n * is the client-side normalization the plan (`do-we-need-any-moonlit-toucan`\n * Phase 0, step 5) calls for.\n *\n * `accountIdentifier` is the stable per-account selector the LLM should\n * pass back (for Bluesky: the account DID). `accessToken` carries whatever\n * the provider's `buildCredentialsResponse` bundles (for Bluesky: the JSON\n * session bundle — the driver parses the `accessJwt` out of it, or reads the\n * top-level `accessJwt` from `providerMetadata`-adjacent fields). Everything\n * else the driver needs for routing (handle, pdsHost, did, …) is on\n * `providerMetadata`.\n *\n * Token refresh is delegated to connect (never done in-plugin) via the\n * per-account route `POST /agent/connect/{provider}/accounts/{accountIdentifier}/refresh`\n * — call `refreshSocialAccount(provider, accountIdentifier)`. (The non-account\n * `POST /agent/connect/{provider}/refresh` route refreshes the provider's\n * PRIMARY connection, which is wrong under multi-account Pattern A.)\n */\n getSocialAccounts(provider: string): Promise<{\n provider: string;\n accounts: {\n connectionId: string;\n accountIdentifier: string;\n displayName: string | null;\n accessToken: string;\n providerMetadata: Record<string, unknown>;\n connectedAt: string;\n }[];\n }>;\n /**\n * Pattern A: refresh a specific social Connection by its stable\n * `accountIdentifier` (for Bluesky: the account DID) via the\n * provider-generic per-account refresh route. The counterpart to\n * `getSocialAccounts(provider)`; `@alfe.ai/social-mcp` calls this on a\n * 401/ExpiredToken from the platform PDS/API, then re-fetches accounts to\n * pick up the rotated bundle.\n *\n * Refresh itself is ALWAYS delegated to connect — the plugin never calls\n * the platform's own refresh XRPC (e.g. `com.atproto.server.refreshSession`)\n * because connect owns the encrypted refresh token + rotation persistence\n * (Bluesky rotates the refreshJwt; a missed rotation kills the connection\n * after one refresh). The returned `accessToken` is whatever the provider's\n * `refreshToken` hook re-bundled (for Bluesky: the JSON session bundle with\n * the fresh `accessJwt`) — callers typically ignore it and re-fetch via\n * `getSocialAccounts` for a consistent shape.\n */\n refreshSocialAccount(provider: string, accountIdentifier: string): Promise<{\n accountIdentifier: string;\n accessToken: string;\n accessTokenExpiresAt: string;\n expiresAt: string;\n }>;\n}\n//# sourceMappingURL=connect-credentials.d.ts.map\n//#endregion\n//#region src/domains/database.d.ts\ndeclare class DatabaseApi extends ApiBase {\n registerDatabaseCredentials(): Promise<{\n connectionString: string;\n username: string;\n password: string;\n databases: string[];\n }>;\n reportDatabaseAudit(entry: {\n database: string;\n collection: string;\n operation: string;\n summary?: string;\n }): Promise<void>;\n}\n//# sourceMappingURL=database.d.ts.map\n//#endregion\n//#region src/domains/identity.d.ts\ndeclare class IdentityApi extends ApiBase {\n /**\n * Returns the calling agent's own identity context — `{ agentId, tenantId }`\n * decoded server-side from the agent API token. Used by the\n * `@alfe.ai/openclaw-identity` plugin to bootstrap context when the\n * OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.\n * Plugins should cache this for the daemon's lifetime (single-agent-per-\n * process invariant). One HTTP round-trip per process activate; not for\n * per-call use.\n */\n whoami(): Promise<{\n agentId: string;\n tenantId: string;\n }>;\n resolveIdentity(args: {\n provider: string;\n platformId: string;\n kind?: \"user\" | \"agent\" | \"service\" | \"bot\" | \"workspace\";\n displayName?: string;\n }): Promise<{\n identityId: string | null;\n status: string;\n created?: boolean;\n reason?: string;\n /**\n * Flattened auriclabs permission strings for the resolved identity\n * (scope-prefixed where applicable). Empty array on miss / org service\n * outage — the runtime gate fails closed in that case.\n */\n permissions: string[];\n }>;\n searchIdentities(args?: {\n q?: string;\n status?: string;\n limit?: number;\n }): Promise<{\n identities: unknown[];\n }>;\n getIdentityContext(identityId: string): Promise<{\n context: unknown;\n }>;\n mergeIdentities(survivorId: string, args: {\n mergedId: string;\n }): Promise<{\n ok: boolean;\n error?: string;\n }>;\n unmergeIdentity(identityId: string): Promise<{\n ok: boolean;\n error?: string;\n }>;\n addIdentityNote(identityId: string, args: {\n content: string;\n category?: string;\n }): Promise<{\n noteId: string | null;\n }>;\n tagIdentity(identityId: string, args: {\n tag: string;\n action: \"add\" | \"remove\";\n }): Promise<{\n ok: boolean;\n }>;\n getIdentityChangelog(identityId: string, args?: {\n limit?: number;\n cursor?: string;\n }): Promise<{\n entries: unknown[];\n cursor: string | null;\n }>;\n rollbackIdentity(identityId: string, args: {\n targetVersion: number;\n }): Promise<{\n ok: boolean;\n entry?: unknown;\n }>;\n requestIdentityVerification(args: {\n claimedIdentityId: string;\n requestingIdentityId: string;\n requestingProvider: string;\n requestingPlatformId: string;\n preferredChannel?: \"mobile\" | \"email\";\n /**\n * Phase 2: agent-supplied contact endpoint. When provided, the top-level\n * `preferredChannel` is ignored — the contact's channel wins.\n */\n contact?: {\n channel: \"email\" | \"mobile\";\n value: string;\n };\n }): Promise<{\n verificationId: string;\n channel: string;\n deliveredTo: string;\n expiresAt: string;\n availableChannels: {\n channel: string;\n deliveredTo: string;\n }[];\n } | {\n error: string;\n }>;\n confirmIdentityVerification(args: {\n claimedIdentityId: string;\n verificationId: string;\n phrase: string;\n }): Promise<{\n verified: boolean;\n identityId?: string;\n /** Phase 2: how the confirm resolved — Scenario A vs B. */\n action?: \"merged\" | \"contact_verified\" | \"already_confirmed\";\n error?: string;\n }>;\n /**\n * Update display-shape fields on an Identity. Body excludes `email` /\n * `phone` / `title` / `company` / `metadata` per Section D4 — contacts go\n * via the verify flow, title/company live on OrgMembership, metadata is\n * not agent-writable.\n */\n updateIdentity(identityId: string, args: {\n name?: string;\n avatarUrl?: string;\n timezone?: string;\n locale?: string;\n }): Promise<{\n ok: boolean;\n }>;\n /**\n * Phase 2 (Section H): server-side verification of a Google Chat sender via\n * the agent's existing Google OAuth credentials. Returns the resolved\n * identity (created or matched via Scenario-B email enrichment).\n */\n resolveGoogleChatSender(args: {\n senderUserId: string;\n spaceId?: string;\n }): Promise<{\n identityId: string | null;\n status: string;\n }>;\n}\n//# sourceMappingURL=identity.d.ts.map\n//#endregion\n//#region src/domains/images.d.ts\ndeclare class ImagesApi extends ApiBase {\n /**\n * Generate an image from a text prompt and get back a STABLE, public URL\n * (served from the agent-assets CDN — it does not expire). Embed the returned\n * `imageUrl` in a reply as markdown to show it to the user.\n *\n * ASYNC: `gpt-image-1` routinely runs 30–60s, which exceeds the API Gateway\n * 30s ceiling, so this enqueues a job (`POST /agent/images/generate` →\n * `jobId`) then polls (`GET /agent/images/{jobId}`) until it completes. The\n * worker's real failure message (e.g. an unsupported `size`) surfaces via the\n * job's `error` field.\n */\n generateImage(args: {\n prompt: string;\n model?: string;\n size?: string;\n quality?: string;\n }): Promise<{\n imageUrl: string;\n model: string;\n }>;\n}\n//# sourceMappingURL=images.d.ts.map\n//#endregion\n//#region src/domains/integrations.d.ts\ndeclare class IntegrationsApi extends ApiBase {\n listIntegrations(): Promise<IntegrationInstall$1[]>;\n getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult$1>;\n updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;\n installIntegration(integrationId: string, options?: {\n version?: string;\n config?: Record<string, unknown>;\n }): Promise<IntegrationInstall$1>;\n removeIntegration(integrationId: string): Promise<IntegrationInstall$1>;\n getOAuthUrl(provider: string, scopes?: string[]): Promise<{\n url: string;\n provider: string;\n expiresIn: number;\n }>;\n getOAuthStatus(provider: string): Promise<{\n provider: string;\n connected: boolean;\n config?: Record<string, string>;\n }>;\n getRegistry(): Promise<{\n integrations: RegistryEntry$1[];\n }>;\n}\n//# sourceMappingURL=integrations.d.ts.map\n//#endregion\n//#region src/domains/memory.d.ts\ndeclare class MemoryApi extends ApiBase {\n memorySearch(query: string, opts?: {\n limit?: number;\n topic?: string;\n subtopic?: string;\n tag?: string;\n includeKnowledge?: boolean;\n }): Promise<{\n facts: {\n subject: string;\n predicate: string;\n object: string;\n since: string;\n confidence: number;\n }[];\n memories: {\n id: string;\n text: string;\n topic: string;\n subtopic: string;\n tag: string;\n importance: number;\n timestamp: number;\n score: number;\n }[];\n }>;\n memoryStore(text: string, opts?: {\n topic?: string;\n subtopic?: string;\n tag?: string;\n importance?: number;\n }): Promise<{\n memoryId: string;\n }>;\n memoryIngest(sessionKey: string, messages: {\n role: string;\n content: string;\n index: number;\n timestamp?: string;\n }[], metadata?: {\n channelId?: string;\n userId?: string;\n userName?: string;\n }, ingestEpoch?: number): Promise<{\n queued: boolean;\n messageCount: number;\n }>;\n memoryLoadContext(tier?: number, topicHint?: string): Promise<{\n tier: number;\n facts: {\n subject: string;\n predicate: string;\n object: string;\n since: string;\n }[];\n memories: {\n text: string;\n topic: string;\n subtopic: string;\n score: number;\n }[];\n tokenEstimate: number;\n formatted: string;\n }>;\n memoryLookupEntity(subject: string): Promise<{\n subject: string;\n triples: {\n tripleId: string;\n predicate: string;\n object: string;\n validFrom: string;\n validTo?: string;\n confidence: number;\n }[];\n }>;\n memoryNavigate(): Promise<{\n topics: {\n name: string;\n tripleCount: number;\n subtopics: string[];\n }[];\n cursor: string | null;\n }>;\n memoryDelete(memoryId: string): Promise<{\n deleted: boolean;\n }>;\n memoryStats(): Promise<{\n vectorCount: number;\n tripleCount: number;\n storageEstimateBytes: number;\n lastIngestionAt?: string;\n }>;\n memoryLearn(args: {\n text: string;\n source?: string;\n sourceType?: \"file\" | \"url\" | \"inline\";\n metadata?: {\n sessionId?: string;\n channelId?: string;\n userName?: string;\n };\n }): Promise<{\n memoriesStored: number;\n triplesStored: number;\n chunks: number;\n source?: string;\n }>;\n memoryBootstrapStatus(): Promise<{\n synced: boolean;\n syncedAt?: string;\n sessionsBackfillSynced?: boolean;\n sessionsBackfillSyncedAt?: string;\n }>;\n memoryBootstrapStatusMark(scope?: \"files\" | \"sessions\"): Promise<{\n synced: true;\n syncedAt: string;\n }>;\n}\n//# sourceMappingURL=memory.d.ts.map\n//#endregion\n//#region src/domains/secrets.d.ts\ndeclare class SecretsApi extends ApiBase {\n /**\n * Mint a fresh AES-256 data key for a specific (secret, field) pair. The\n * encryption context is rebuilt server-side from `auth.tenantId` + the body\n * fields including `fieldKey`; the agent cannot forge context for a scope\n * or field it doesn't own. Legacy single-envelope secrets are migrated to\n * `field#value` rows by the data migration, so call with `fieldKey: \"value\"`\n * to reach them.\n */\n generateSecretDataKey(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n fieldKey: string;\n }): Promise<GeneratedDataKey$1>;\n /**\n * Unwrap a wrapped data key so the agent can decrypt the envelope locally.\n * `fieldKey` MUST match the value supplied when the data key was generated\n * (it's bound into KMS encryption context); mismatch fails with\n * `InvalidCiphertextException`.\n */\n decryptSecretDataKey(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n fieldKey: string;\n dataKeyCiphertext: string;\n }): Promise<{\n plaintextKey: string;\n }>;\n /**\n * Create a new secret with one or more fields. Encrypted fields must arrive\n * pre-sealed (the agent has already obtained per-field data keys via\n * `generateSecretDataKey({ ..., fieldKey })` and AES-encrypted locally).\n * Plaintext fields ship the value inline.\n */\n createSecret(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n secretName: string;\n category?: SecretCategory$1;\n description?: string;\n tags?: string[];\n fields: {\n key: string;\n format?: FieldFormat$1;\n sensitivity: FieldSensitivity$1;\n value?: string;\n envelope?: EncryptedEnvelopeV1$1;\n }[];\n reason?: string;\n }): Promise<SecretAggregate$1>;\n /** Fetch the secret aggregate plus per-field encrypted envelopes. */\n getSecret(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n }): Promise<{\n aggregate: SecretAggregate$1;\n envelopes: FieldEnvelope$1[];\n }>;\n /** Fetch one field. Plaintext: value inline. Encrypted: envelope. */\n getSecretField(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n fieldKey: string;\n }): Promise<{\n key: string;\n sensitivity: FieldSensitivity$1;\n format?: FieldFormat$1;\n value?: string;\n envelope?: EncryptedEnvelopeV1$1;\n rotatedAt?: string;\n createdAt: string;\n updatedAt: string;\n }>;\n /** Add OR rotate one field. */\n setSecretField(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n fieldKey: string;\n sensitivity: FieldSensitivity$1;\n format?: FieldFormat$1;\n value?: string;\n envelope?: EncryptedEnvelopeV1$1;\n reason?: string;\n }): Promise<{\n fieldKey: string;\n rotated: boolean;\n }>;\n /** Remove one field. */\n removeSecretField(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n fieldKey: string;\n }): Promise<void>;\n /** Update secret-level metadata (name/description/tags/category). */\n updateSecretMetadata(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n secretName?: string;\n description?: string;\n tags?: string[];\n category?: SecretCategory$1;\n reason?: string;\n }): Promise<SecretAggregate$1>;\n /** List metadata for secrets in a scope. Optional filters route through the byFacet GSI. */\n listSecrets(args: {\n scope: SecretScope$1;\n scopeId: string;\n category?: SecretCategory$1;\n tag?: string;\n fieldKey?: string;\n }): Promise<SecretMetadata$1[]>;\n /** Bounded changelog read — metadata-only audit entries. */\n getSecretHistory(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n limit?: number;\n cursor?: string;\n }): Promise<{\n entries: ChangelogEntry$1[];\n nextCursor?: string;\n }>;\n /** Delete a secret (and all its field rows + tag rows + changelog rows). */\n deleteSecret(args: {\n scope: SecretScope$1;\n scopeId: string;\n secretId: string;\n }): Promise<void>;\n /** Enumerate scopes (org/team/project/agent) this agent can access. */\n listSecretScopes(): Promise<ScopeInfo$1[]>;\n}\n//# sourceMappingURL=secrets.d.ts.map\n//#endregion\n//#region src/domains/teams.d.ts\ndeclare class TeamsApi extends ApiBase {\n getTeamsCredentials(): Promise<{\n agentId: string;\n tenantId: string;\n azureAppId: string;\n azureBotId: string;\n azureClientSecret: string;\n botDisplayName?: string;\n teamsTenantId?: string;\n serviceUrl?: string;\n }>;\n sendTeamsMessage(data: {\n conversationId: string;\n text?: string;\n adaptiveCard?: Record<string, unknown>;\n }): Promise<{\n ok: boolean;\n activityId: string;\n }>;\n listTeamsChannels(): Promise<{\n channels: {\n id: string;\n name: string;\n description?: string;\n }[];\n }>;\n}\n//# sourceMappingURL=teams.d.ts.map\n\n//#endregion\n//#region src/index.d.ts\ninterface AgentApiClient extends SyncApi, IntegrationsApi, WorkspaceApi, ConnectCredentialsApi, TeamsApi, ChatApi, SecretsApi, IdentityApi, MemoryApi, SearchApi, KnowledgeApi, DatabaseApi, MobileApi, RemoteApi, SelfApi, VoiceApi, ImagesApi, WebhooksApi {}\ndeclare class AgentApiClient extends ApiBase {\n constructor(config: AgentApiClientConfig);\n}\n//# sourceMappingURL=index.d.ts.map\n\n//#endregion\nexport { AgentApiClient, type AgentApiClientConfig, type AgentAvatarPresign, type AgentSelf, type AgentVoice, type AgentVoiceConfig, type AgentWebhook, type AgentWebhookDelivery, type AgentWorkspaceInfo, type ChangeRequestActorKind, type ChangeRequestOperation, type ChangeRequestResourceType, type ChangeRequestStatus, type ChangelogAction, type ChangelogActor, type ChangelogEntry, type CreatedAgentWebhook, type EncryptedEnvelopeV1, type Field, type FieldEnvelope, type FieldFormat, type FieldSensitivity, type FieldView, type GeneratedDataKey, type InstallToolErrorCaptureOptions, type IntegrationConfigResult, type IntegrationConfigSchemaField, type IntegrationInstall, type KnowledgeChangeRequest, type KnowledgeDoc, type KnowledgeProfile, type KnowledgeProfileLink, type KnowledgeScope, type KnowledgeScopeType, type KnowledgeSearchHit, type KnowledgeSearchResult, type MobileAvailableNumber, type MobileNumberInfo, type NewsArticle, type NewsProvider, type NewsResult, type ProposeScopeChangeInput, type RegistryEntry, type RemoteSessionInfo, type ScopeInfo, type SecretAggregate, type SecretCategory, type SecretMetadata, type SecretScope, type SharedFileEntry, type SyncAgentInfo, type SyncAgentStats, type SyncConfirmedUpload, type SyncFileEntry, type SyncManifest, type SyncManifestEntry, type SyncPresignedUrl, type SyncReconstructBundle, type SyncReconstructFile, type SyncSessionContent, type SyncSessionEntry, type ToolCaptureApi, type VoiceS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I;;;;;AAYZ;AAEW;AAYhBa,KC7IE,aAAA,GD6IiB,SAAA,GAAA,aAAA;AAOnBC,UClJO,aAAA,CDkJc;EAQrBC;AAAc;AAOD;AAQG;EAYhBI,MAAAA,CAAAA,EChLC,cDgLc;EAMXC;EAAO,QAAA,CAAA,EAAA;IAIVZ,OAAAA,EAAAA,MAAAA;IADLR,QAAAA,EAAAA,MAAAA;;;QAWIW,CAAAA,EAAAA,MAAAA;;;;;;SAWgBI,CAAAA,ECrMd,aDqMcA;;;;;;aASmBG,CAAAA,ECxM7B,cDwM6BA;;aACTlB,CAAAA,EAAAA,MAAAA;;;;;;AAnCC;AA2Dd;AAEQ;AASA;AAcF;AAQnB0B,iBCpPY,YAAA,CDoPI,IAAA,CAAA,ECpPe,aDoPf,CAAA,ECpPoC,ODoPpC,CCpP4C,SDoP5C,CAAA;;;;;AAKG;AAIC;AAEzBG,iBCjLW,eAAA,CDiLQ,IAAA,EAAA,MAAA,EAAA,CAAA,ECjLyB,aDiLzB;AAAA;AACG;;;;AAOdD,iBCtKS,IAAA,CDsKTA,KAAAA,ECrKL,aDqKKA,GAAAA;WAIHC,CAAAA,ECzK4B,SDyK5BA;ICxKP,OD0KaC,CC1KL,SD0KKA,CAAAA"}
package/dist/index.js CHANGED
@@ -7,6 +7,8 @@ import { resolveConfig } from "@alfe.ai/config";
7
7
  import { registerIntegrationsTools, registerMemoryTools, registerMessagingTools, registerVoiceTools } from "@alfe.ai/mcp-tools";
8
8
  //#region src/index.ts
9
9
  const pkg = createRequire(import.meta.url)("../package.json");
10
+ const MAX_IDENTITY_CHARS = 256;
11
+ const MAX_SERVICE_URL_CHARS = 8192;
10
12
  /**
11
13
  * Wire shape the bundler advertises this server as — must match the
12
14
  * key the CLI registers (`alfe-platform`) so namespacing is consistent
@@ -38,30 +40,44 @@ const SERVER_BIN_PATH = fileURLToPath(new URL("./bin.js", import.meta.url));
38
40
  * Pure construction — does not connect a transport. Callers (the bin
39
41
  * entry, or tests) attach `StdioServerTransport` or any other transport.
40
42
  *
41
- * `resolveConfig()` is only called when neither `client` nor `apiUrl`
42
- * is provided tests can fully construct the server without touching
43
- * `~/.alfe/config.toml`.
43
+ * `resolveConfig()` is only called when the main `client`/`apiUrl` pair is
44
+ * omitted. Tests and alternate hosts can inject a complete pair without
45
+ * touching `~/.alfe/config.toml`.
44
46
  */
45
47
  async function createServer(opts = {}) {
46
- const profile = opts.profile ?? "default";
47
- let client = opts.client;
48
- let apiUrl = opts.apiUrl;
48
+ const profile = validateProfile(opts.profile ?? "default");
49
+ if (opts.client !== void 0 !== (opts.apiUrl !== void 0)) throw new Error("client and apiUrl must be provided together.");
50
+ let client;
51
+ let apiUrl;
49
52
  let voiceClient = opts.voiceClient;
50
53
  let voiceApiUrl = opts.voiceApiUrl;
51
- if (!client || !apiUrl || profile === "claude-code" && !voiceClient && !voiceApiUrl) {
52
- const cfg = resolveConfig();
53
- client = client ?? new AgentApiClient({
54
+ let config;
55
+ const getConfig = () => {
56
+ config ??= resolveConfig();
57
+ return config;
58
+ };
59
+ if (opts.client !== void 0 && opts.apiUrl !== void 0) {
60
+ client = opts.client;
61
+ apiUrl = validateServiceUrl("apiUrl", opts.apiUrl);
62
+ } else {
63
+ const cfg = getConfig();
64
+ apiUrl = validateServiceUrl("apiUrl", cfg.apiUrl);
65
+ client = new AgentApiClient({
54
66
  apiKey: cfg.apiKey,
55
- apiUrl: cfg.apiUrl
67
+ apiUrl
56
68
  });
57
- apiUrl = apiUrl ?? cfg.apiUrl;
58
- voiceApiUrl = voiceApiUrl ?? cfg.voiceServiceUrl;
59
- voiceClient = voiceClient ?? new AgentApiClient({
60
- apiKey: cfg.apiKey,
61
- apiUrl: cfg.voiceServiceUrl
69
+ }
70
+ if (profile === "claude-code") {
71
+ const explicitVoiceUrl = voiceApiUrl !== void 0;
72
+ voiceApiUrl = validateServiceUrl("voiceApiUrl", voiceApiUrl ?? config?.voiceServiceUrl ?? apiUrl);
73
+ if (!voiceClient) if (voiceApiUrl === apiUrl) voiceClient = client;
74
+ else if (!explicitVoiceUrl) voiceClient = new AgentApiClient({
75
+ apiKey: getConfig().apiKey,
76
+ apiUrl: voiceApiUrl
62
77
  });
78
+ else throw new Error("voiceClient is required when voiceApiUrl differs from apiUrl.");
63
79
  }
64
- const identity = opts.identity ?? await client.whoami();
80
+ const identity = validateIdentity(opts.identity ?? await client.whoami());
65
81
  const ctx = {
66
82
  client,
67
83
  apiUrl,
@@ -99,23 +115,57 @@ function parseProfileArg(argv) {
99
115
  return "default";
100
116
  }
101
117
  /**
102
- * Entry point boot the server on stdio. Used by `bin.ts`. Any
103
- * startup failure is fatal: log and exit non-zero so the bundler's
104
- * connection attempt surfaces a clear error rather than a hung
105
- * handshake.
118
+ * Boot the server and attach its transport. Used by `bin.ts`; tests can inject
119
+ * an in-memory transport. Process policy (logging, exit code, signals) remains
120
+ * in the executable boundary rather than this reusable library function.
106
121
  */
107
122
  async function main(opts = {}) {
123
+ const { transport = new StdioServerTransport(), ...serverOptions } = opts;
124
+ const server = await createServer(serverOptions);
108
125
  try {
109
- const server = await createServer({ profile: opts.profile });
110
- const transport = new StdioServerTransport();
111
126
  await server.connect(transport);
127
+ return server;
112
128
  } catch (err) {
113
- process.stderr.write(`[alfe-mcp-server] failed to start: ${errMsg(err)}\n`);
114
- process.exit(1);
129
+ await server.close().catch(() => void 0);
130
+ throw err;
131
+ }
132
+ }
133
+ function validateProfile(value) {
134
+ if (value !== "default" && value !== "claude-code") throw new Error("profile must be \"default\" or \"claude-code\".");
135
+ return value;
136
+ }
137
+ function validateIdentity(value) {
138
+ if (value === null || typeof value !== "object" || Array.isArray(value)) throw new Error("Agent identity must be an object.");
139
+ const record = value;
140
+ return {
141
+ agentId: validateIdentityPart("agentId", record.agentId),
142
+ tenantId: validateIdentityPart("tenantId", record.tenantId)
143
+ };
144
+ }
145
+ function validateIdentityPart(label, value) {
146
+ if (typeof value !== "string" || value.length < 1 || value.length > MAX_IDENTITY_CHARS || hasControlCharacters(value)) throw new Error(`${label} must contain 1 to ${String(MAX_IDENTITY_CHARS)} non-control characters.`);
147
+ return value;
148
+ }
149
+ function hasControlCharacters(value) {
150
+ return Array.from(value).some((character) => {
151
+ const codePoint = character.codePointAt(0) ?? 0;
152
+ return codePoint < 32 || codePoint === 127;
153
+ });
154
+ }
155
+ function validateServiceUrl(label, value) {
156
+ if (typeof value !== "string" || value.length < 1 || value.length > MAX_SERVICE_URL_CHARS) throw new Error(`${label} must be a bounded absolute HTTP(S) URL.`);
157
+ let parsed;
158
+ try {
159
+ parsed = new URL(value);
160
+ } catch {
161
+ throw new Error(`${label} must be a bounded absolute HTTP(S) URL.`);
115
162
  }
163
+ if (!["http:", "https:"].includes(parsed.protocol) || parsed.username !== "" || parsed.password !== "" || parsed.search !== "" || parsed.hash !== "" || parsed.protocol === "http:" && !isLoopbackHostname(parsed.hostname)) throw new Error(`${label} must use HTTPS (or loopback HTTP) without credentials, query, or fragment.`);
164
+ return parsed.href.replace(/\/$/u, "");
116
165
  }
117
- function errMsg(err) {
118
- return err instanceof Error ? err.message : String(err);
166
+ function isLoopbackHostname(hostname) {
167
+ const normalized = hostname.replace(/^\[|\]$/gu, "").toLowerCase();
168
+ return normalized === "localhost" || normalized === "127.0.0.1" || normalized === "::1";
119
169
  }
120
170
  //#endregion
121
171
  export { SERVER_BIN_PATH, SERVER_NAME, SERVER_VERSION, createServer, main, parseProfileArg };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { fileURLToPath } from 'node:url';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { AgentApiClient } from '@alfe.ai/agent-api-client';\nimport { resolveConfig } from '@alfe.ai/config';\nimport {\n registerIntegrationsTools,\n registerMemoryTools,\n registerVoiceTools,\n registerMessagingTools,\n type ToolContext,\n} from '@alfe.ai/mcp-tools';\n\nconst require = createRequire(import.meta.url);\nconst pkg = require('../package.json') as { version: string };\n\n/**\n * Wire shape the bundler advertises this server as — must match the\n * key the CLI registers (`alfe-platform`) so namespacing is consistent\n * across components.\n */\nexport const SERVER_NAME = 'alfe-platform';\n\n/**\n * Single source of truth for the server's own version, read straight\n * from package.json so it can't drift with bumps. The CLI's\n * version-drift hook compares this against the entry stored in\n * `~/.alfe/mcp/servers.json` and re-resolves the command path when\n * they diverge (e.g. after an `npm install -g @alfe.ai/cli`).\n */\nexport const SERVER_VERSION = pkg.version;\n\n/**\n * Absolute path to this package's stdio bin. Computed from\n * `import.meta.url` (always available, regardless of how the package\n * is installed) and resolved to a sibling of the main dist file.\n *\n * Exported so the CLI's `ensureAlfePlatformRegistered` doesn't need\n * to call `require.resolve('@alfe.ai/mcp-server/package.json')`, which\n * trips Node's strict exports-map enforcement when `./package.json`\n * isn't listed in `exports`. The package knows where its own binary\n * lives; consumers shouldn't have to crawl `package.json` for it.\n */\nexport const SERVER_BIN_PATH = fileURLToPath(new URL('./bin.js', import.meta.url));\n\n/**\n * Which tool surface the server exposes.\n *\n * - `default` (the OpenClaw daemon bundler's path — the bin is launched with\n * no `--profile`) registers ONLY the integrations tools. OpenClaw agents\n * consume this same server and already get `memory_*` from the\n * `@alfe.ai/openclaw-memory-cloud` plugin, so registering memory here would\n * DOUBLE their tool surface. Do not add tools to this profile without\n * confirming they don't already ship as an OpenClaw plugin.\n * - `claude-code` additionally registers memory + voice + messaging tools —\n * for a Claude Code session that has no Alfe plugins and needs those\n * capabilities delivered via MCP.\n */\nexport type ServerProfile = 'default' | 'claude-code';\n\nexport interface ServerOptions {\n /**\n * Optional override for the API client — tests inject a fake so the\n * server can be exercised end-to-end without real network I/O.\n */\n client?: AgentApiClient;\n /** Pre-resolved context fields. If omitted, the server calls `whoami()` itself. */\n identity?: { agentId: string; tenantId: string };\n /** Override apiUrl reported in the ToolContext. Defaults to the resolved CLI config. */\n apiUrl?: string;\n /**\n * Tool surface to register. Defaults to `default` (integrations only) so\n * the OpenClaw bundler path is unchanged. `claude-code` adds memory + voice\n * + messaging.\n */\n profile?: ServerProfile;\n /**\n * Optional override for the voice-service client — tests inject a fake.\n * Only consumed by the `claude-code` profile's voice tools. When omitted\n * (and not resolvable from config) the voice tools fall back to `client`.\n */\n voiceClient?: AgentApiClient;\n /** Override voice-service apiUrl. Defaults to the resolved CLI config's `voiceServiceUrl`. */\n voiceApiUrl?: string;\n}\n\n/**\n * Build a configured `McpServer` with all thin-slice tools registered.\n * Pure construction — does not connect a transport. Callers (the bin\n * entry, or tests) attach `StdioServerTransport` or any other transport.\n *\n * `resolveConfig()` is only called when neither `client` nor `apiUrl`\n * is provided — tests can fully construct the server without touching\n * `~/.alfe/config.toml`.\n */\nexport async function createServer(opts: ServerOptions = {}): Promise<McpServer> {\n const profile: ServerProfile = opts.profile ?? 'default';\n\n let client = opts.client;\n let apiUrl = opts.apiUrl;\n let voiceClient = opts.voiceClient;\n let voiceApiUrl = opts.voiceApiUrl;\n // Only touch config when something is unresolved — tests fully construct\n // the server without reading ~/.alfe/config.toml. The voice client is\n // only needed for the claude-code profile, so resolveConfig() stays out\n // of the default path unless apiUrl/client were omitted.\n if (!client || !apiUrl || (profile === 'claude-code' && !voiceClient && !voiceApiUrl)) {\n const cfg = resolveConfig();\n client = client ?? new AgentApiClient({ apiKey: cfg.apiKey, apiUrl: cfg.apiUrl });\n apiUrl = apiUrl ?? cfg.apiUrl;\n voiceApiUrl = voiceApiUrl ?? cfg.voiceServiceUrl;\n voiceClient =\n voiceClient ?? new AgentApiClient({ apiKey: cfg.apiKey, apiUrl: cfg.voiceServiceUrl });\n }\n\n const identity = opts.identity ?? (await client.whoami());\n\n const ctx: ToolContext = {\n client,\n apiUrl,\n agentId: identity.agentId,\n tenantId: identity.tenantId,\n voiceApiUrl,\n voiceClient,\n };\n\n const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION });\n registerIntegrationsTools(server, ctx);\n if (profile === 'claude-code') {\n registerMemoryTools(server, ctx);\n registerVoiceTools(server, ctx);\n registerMessagingTools(server, ctx);\n }\n return server;\n}\n\n/**\n * Parse the server profile out of a raw argv slice. Accepts both\n * `--profile claude-code` and `--profile=claude-code`. Unknown or missing\n * values resolve to `default`, so the OpenClaw bundler (which launches the\n * bin with no args) always gets the integrations-only surface.\n */\nexport function parseProfileArg(argv: string[]): ServerProfile {\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i];\n let value: string | undefined;\n if (arg === '--profile') {\n value = argv[i + 1];\n } else if (arg.startsWith('--profile=')) {\n value = arg.slice('--profile='.length);\n }\n if (value === 'claude-code') return 'claude-code';\n }\n return 'default';\n}\n\n/**\n * Entry point — boot the server on stdio. Used by `bin.ts`. Any\n * startup failure is fatal: log and exit non-zero so the bundler's\n * connection attempt surfaces a clear error rather than a hung\n * handshake.\n */\nexport async function main(opts: { profile?: ServerProfile } = {}): Promise<void> {\n try {\n const server = await createServer({ profile: opts.profile });\n const transport = new StdioServerTransport();\n await server.connect(transport);\n // McpServer keeps the transport alive; node holds the event loop\n // open via stdin until the parent (the bundler) closes the stream.\n } catch (err) {\n process.stderr.write(`[alfe-mcp-server] failed to start: ${errMsg(err)}\\n`);\n process.exit(1);\n }\n}\n\nfunction errMsg(err: unknown): string {\n return err instanceof Error ? err.message : String(err);\n}\n"],"mappings":";;;;;;;;AAeA,MAAM,MADU,cAAc,OAAO,KAAK,IAAI,CAC1B,kBAAkB;;;;;;AAOtC,MAAa,cAAc;;;;;;;;AAS3B,MAAa,iBAAiB,IAAI;;;;;;;;;;;;AAalC,MAAa,kBAAkB,cAAc,IAAI,IAAI,YAAY,OAAO,KAAK,IAAI,CAAC;;;;;;;;;;AAoDlF,eAAsB,aAAa,OAAsB,EAAE,EAAsB;CAC/E,MAAM,UAAyB,KAAK,WAAW;CAE/C,IAAI,SAAS,KAAK;CAClB,IAAI,SAAS,KAAK;CAClB,IAAI,cAAc,KAAK;CACvB,IAAI,cAAc,KAAK;AAKvB,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,KAAsB;AACpC,QAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { fileURLToPath } from 'node:url';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';\nimport { AgentApiClient } from '@alfe.ai/agent-api-client';\nimport { resolveConfig } from '@alfe.ai/config';\nimport {\n registerIntegrationsTools,\n registerMemoryTools,\n registerVoiceTools,\n registerMessagingTools,\n type ToolContext,\n} from '@alfe.ai/mcp-tools';\n\nconst require = createRequire(import.meta.url);\nconst pkg = require('../package.json') as { version: string };\nconst MAX_IDENTITY_CHARS = 256;\nconst MAX_SERVICE_URL_CHARS = 8192;\n\n/**\n * Wire shape the bundler advertises this server as — must match the\n * key the CLI registers (`alfe-platform`) so namespacing is consistent\n * across components.\n */\nexport const SERVER_NAME = 'alfe-platform';\n\n/**\n * Single source of truth for the server's own version, read straight\n * from package.json so it can't drift with bumps. The CLI's\n * version-drift hook compares this against the entry stored in\n * `~/.alfe/mcp/servers.json` and re-resolves the command path when\n * they diverge (e.g. after an `npm install -g @alfe.ai/cli`).\n */\nexport const SERVER_VERSION = pkg.version;\n\n/**\n * Absolute path to this package's stdio bin. Computed from\n * `import.meta.url` (always available, regardless of how the package\n * is installed) and resolved to a sibling of the main dist file.\n *\n * Exported so the CLI's `ensureAlfePlatformRegistered` doesn't need\n * to call `require.resolve('@alfe.ai/mcp-server/package.json')`, which\n * trips Node's strict exports-map enforcement when `./package.json`\n * isn't listed in `exports`. The package knows where its own binary\n * lives; consumers shouldn't have to crawl `package.json` for it.\n */\nexport const SERVER_BIN_PATH = fileURLToPath(new URL('./bin.js', import.meta.url));\n\n/**\n * Which tool surface the server exposes.\n *\n * - `default` (the OpenClaw daemon bundler's path — the bin is launched with\n * no `--profile`) registers ONLY the integrations tools. OpenClaw agents\n * consume this same server and already get `memory_*` from the\n * `@alfe.ai/openclaw-memory-cloud` plugin, so registering memory here would\n * DOUBLE their tool surface. Do not add tools to this profile without\n * confirming they don't already ship as an OpenClaw plugin.\n * - `claude-code` additionally registers memory + voice + messaging tools —\n * for a Claude Code session that has no Alfe plugins and needs those\n * capabilities delivered via MCP.\n */\nexport type ServerProfile = 'default' | 'claude-code';\n\nexport interface ServerOptions {\n /**\n * Optional pre-bound API client. Must be supplied together with `apiUrl` so\n * the client authority and the OAuth URL authority cannot diverge.\n */\n client?: AgentApiClient;\n /** Pre-resolved context fields. If omitted, the server calls `whoami()` itself. */\n identity?: { agentId: string; tenantId: string };\n /** Authority bound to an injected `client`. Omit both to use resolved CLI config. */\n apiUrl?: string;\n /**\n * Tool surface to register. Defaults to `default` (integrations only) so\n * the OpenClaw bundler path is unchanged. `claude-code` adds memory + voice\n * + messaging.\n */\n profile?: ServerProfile;\n /**\n * Optional override for the voice-service client — tests inject a fake.\n * Only consumed by the `claude-code` profile's voice tools. When omitted\n * (and not resolvable from config) the voice tools fall back to `client`.\n */\n voiceClient?: AgentApiClient;\n /** Override voice-service apiUrl. Defaults to the resolved CLI config's `voiceServiceUrl`. */\n voiceApiUrl?: string;\n}\n\n/**\n * Build a configured `McpServer` with all thin-slice tools registered.\n * Pure construction — does not connect a transport. Callers (the bin\n * entry, or tests) attach `StdioServerTransport` or any other transport.\n *\n * `resolveConfig()` is only called when the main `client`/`apiUrl` pair is\n * omitted. Tests and alternate hosts can inject a complete pair without\n * touching `~/.alfe/config.toml`.\n */\nexport async function createServer(opts: ServerOptions = {}): Promise<McpServer> {\n const profile = validateProfile(opts.profile ?? 'default');\n\n const hasInjectedClient = opts.client !== undefined;\n const hasInjectedApiUrl = opts.apiUrl !== undefined;\n if (hasInjectedClient !== hasInjectedApiUrl) {\n throw new Error('client and apiUrl must be provided together.');\n }\n\n let client: AgentApiClient;\n let apiUrl: string;\n let voiceClient = opts.voiceClient;\n let voiceApiUrl = opts.voiceApiUrl;\n let config: ReturnType<typeof resolveConfig> | undefined;\n const getConfig = (): ReturnType<typeof resolveConfig> => {\n config ??= resolveConfig();\n return config;\n };\n\n if (opts.client !== undefined && opts.apiUrl !== undefined) {\n client = opts.client;\n apiUrl = validateServiceUrl('apiUrl', opts.apiUrl);\n } else {\n const cfg = getConfig();\n apiUrl = validateServiceUrl('apiUrl', cfg.apiUrl);\n client = new AgentApiClient({ apiKey: cfg.apiKey, apiUrl });\n }\n\n if (profile === 'claude-code') {\n const explicitVoiceUrl = voiceApiUrl !== undefined;\n voiceApiUrl = validateServiceUrl(\n 'voiceApiUrl',\n voiceApiUrl ?? config?.voiceServiceUrl ?? apiUrl,\n );\n if (!voiceClient) {\n if (voiceApiUrl === apiUrl) {\n // Voice's one-shot routes are currently co-located with the main API;\n // reuse the client instead of allocating an identical credentialed one.\n voiceClient = client;\n } else if (!explicitVoiceUrl) {\n const cfg = getConfig();\n voiceClient = new AgentApiClient({ apiKey: cfg.apiKey, apiUrl: voiceApiUrl });\n } else {\n // Do not read a local API key and attach it to an arbitrary injected\n // destination. Callers that override the voice authority must provide\n // the already-bound client as well.\n throw new Error('voiceClient is required when voiceApiUrl differs from apiUrl.');\n }\n }\n }\n\n const identity = validateIdentity(opts.identity ?? (await client.whoami()));\n\n const ctx: ToolContext = {\n client,\n apiUrl,\n agentId: identity.agentId,\n tenantId: identity.tenantId,\n voiceApiUrl,\n voiceClient,\n };\n\n const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION });\n registerIntegrationsTools(server, ctx);\n if (profile === 'claude-code') {\n registerMemoryTools(server, ctx);\n registerVoiceTools(server, ctx);\n registerMessagingTools(server, ctx);\n }\n return server;\n}\n\n/**\n * Parse the server profile out of a raw argv slice. Accepts both\n * `--profile claude-code` and `--profile=claude-code`. Unknown or missing\n * values resolve to `default`, so the OpenClaw bundler (which launches the\n * bin with no args) always gets the integrations-only surface.\n */\nexport function parseProfileArg(argv: string[]): ServerProfile {\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i];\n let value: string | undefined;\n if (arg === '--profile') {\n value = argv[i + 1];\n } else if (arg.startsWith('--profile=')) {\n value = arg.slice('--profile='.length);\n }\n if (value === 'claude-code') return 'claude-code';\n }\n return 'default';\n}\n\n/**\n * Boot the server and attach its transport. Used by `bin.ts`; tests can inject\n * an in-memory transport. Process policy (logging, exit code, signals) remains\n * in the executable boundary rather than this reusable library function.\n */\nexport async function main(\n opts: ServerOptions & { transport?: Transport } = {},\n): Promise<McpServer> {\n const { transport = new StdioServerTransport(), ...serverOptions } = opts;\n const server = await createServer(serverOptions);\n try {\n await server.connect(transport);\n return server;\n } catch (err) {\n // connect() transfers transport ownership before start(); close even when\n // start rejects so listeners/buffers from a partial transport do not leak.\n await server.close().catch(() => undefined);\n throw err;\n }\n}\n\nfunction validateProfile(value: unknown): ServerProfile {\n if (value !== 'default' && value !== 'claude-code') {\n throw new Error('profile must be \"default\" or \"claude-code\".');\n }\n return value;\n}\n\nfunction validateIdentity(value: unknown): { agentId: string; tenantId: string } {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw new Error('Agent identity must be an object.');\n }\n const record = value as Record<string, unknown>;\n return {\n agentId: validateIdentityPart('agentId', record.agentId),\n tenantId: validateIdentityPart('tenantId', record.tenantId),\n };\n}\n\nfunction validateIdentityPart(label: string, value: unknown): string {\n if (\n typeof value !== 'string' ||\n value.length < 1 ||\n value.length > MAX_IDENTITY_CHARS ||\n hasControlCharacters(value)\n ) {\n throw new Error(`${label} must contain 1 to ${String(MAX_IDENTITY_CHARS)} non-control characters.`);\n }\n return value;\n}\n\nfunction hasControlCharacters(value: string): boolean {\n return Array.from(value).some((character) => {\n const codePoint = character.codePointAt(0) ?? 0;\n return codePoint < 32 || codePoint === 127;\n });\n}\n\nfunction validateServiceUrl(label: string, value: unknown): string {\n if (typeof value !== 'string' || value.length < 1 || value.length > MAX_SERVICE_URL_CHARS) {\n throw new Error(`${label} must be a bounded absolute HTTP(S) URL.`);\n }\n let parsed: URL;\n try {\n parsed = new URL(value);\n } catch {\n throw new Error(`${label} must be a bounded absolute HTTP(S) URL.`);\n }\n if (\n !['http:', 'https:'].includes(parsed.protocol) ||\n parsed.username !== '' ||\n parsed.password !== '' ||\n parsed.search !== '' ||\n parsed.hash !== '' ||\n (parsed.protocol === 'http:' && !isLoopbackHostname(parsed.hostname))\n ) {\n throw new Error(`${label} must use HTTPS (or loopback HTTP) without credentials, query, or fragment.`);\n }\n return parsed.href.replace(/\\/$/u, '');\n}\n\nfunction isLoopbackHostname(hostname: string): boolean {\n const normalized = hostname.replace(/^\\[|\\]$/gu, '').toLowerCase();\n return normalized === 'localhost' || normalized === '127.0.0.1' || normalized === '::1';\n}\n"],"mappings":";;;;;;;;AAgBA,MAAM,MADU,cAAc,OAAO,KAAK,IAAI,CAC1B,kBAAkB;AACtC,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;;;;;;AAO9B,MAAa,cAAc;;;;;;;;AAS3B,MAAa,iBAAiB,IAAI;;;;;;;;;;;;AAalC,MAAa,kBAAkB,cAAc,IAAI,IAAI,YAAY,OAAO,KAAK,IAAI,CAAC;;;;;;;;;;AAoDlF,eAAsB,aAAa,OAAsB,EAAE,EAAsB;CAC/E,MAAM,UAAU,gBAAgB,KAAK,WAAW,UAAU;AAI1D,KAF0B,KAAK,WAAW,KAAA,OAChB,KAAK,WAAW,KAAA,GAExC,OAAM,IAAI,MAAM,+CAA+C;CAGjE,IAAI;CACJ,IAAI;CACJ,IAAI,cAAc,KAAK;CACvB,IAAI,cAAc,KAAK;CACvB,IAAI;CACJ,MAAM,kBAAoD;AACxD,aAAW,eAAe;AAC1B,SAAO;;AAGT,KAAI,KAAK,WAAW,KAAA,KAAa,KAAK,WAAW,KAAA,GAAW;AAC1D,WAAS,KAAK;AACd,WAAS,mBAAmB,UAAU,KAAK,OAAO;QAC7C;EACL,MAAM,MAAM,WAAW;AACvB,WAAS,mBAAmB,UAA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