/** * What kind of note this is, on the shared project shelf. * * Derived from what crews already did by hand, not invented: across 32 real * notes in two production projects/ boxes, agents opened their own text * with a bracketed tag because the storage carried none. Counted: * status(11), claim(4), blocker(4), shipped(3), decision(2), context(2), plus * security/bug/handoff-pointer one-offs. The vocabulary below collapses that * into the seven that carry coordination meaning; the spellings it dropped are * kept working by MEMORY_ENTRY_KIND_ALIASES rather than rejected. * * Closed on purpose. An open string would reproduce exactly the problem this * fixes: a forgeable in-text tag that no reader can rely on. Absent stays * valid and means unclassified, so every write that predates this change, and * every caller that never sends it, keeps its current meaning. */ declare const MEMORY_ENTRY_KINDS: readonly ["context", "claim", "status", "finding", "decision", "question", "blocker"]; type MemoryEntryKind = typeof MEMORY_ENTRY_KINDS[number]; /** * SDK configuration options. */ interface ConfigureOptions { /** API key (sk_xxx). Alternative to passing as first constructor argument. */ apiKey?: string; /** Advanced: override API origin for local development or private deployments. */ baseUrl?: string; /** Agent handle — lowercase letters, numbers, and hyphens. */ agent?: string; /** Developer app-local user ID for unlinked profiles — sends X-User-Id. */ externalId?: string; /** Optional timeout in milliseconds for requests */ timeout?: number; /** Custom fetch implementation (for Node.js compatibility) */ fetch?: typeof fetch; } type ProfileSection = 'identity' | 'preferences' | 'integrations' | 'imports' | 'agents' | 'summary' | 'soul' | 'context'; /** * Selector for `profile.forget()`. Pass exactly one of `id`, `match`, * `import_id`, or `scope` (a bare string is shorthand for `{ id }`). `confirm` * only applies with `match`: without it, a match previews and deletes nothing. */ interface ForgetSelector { id?: string; match?: string; confirm?: boolean; import_id?: string; scope?: 'imports' | 'saved' | 'all'; date?: string; reason?: 'correction' | 'user_request'; } interface ProfileRuntimeOptions { /** Bearer token from Configure Link or auth flow for a linked profile. */ token?: string; /** Developer app-local user ID for an unlinked profile. */ externalId?: string; } /** Everything `remember` takes besides the fact itself. */ interface RememberOptions { /** Namespace box (shelf) to file under, including "projects/". */ box?: string; /** What kind of note this is. "question" and "blocker" are tracked as open * in a project box until another note resolves them; omitted is valid and * means unclassified. An unrecognized value never loses the note: it is * saved unclassified and the response reports which value was ignored. */ kind?: MemoryEntryKind; /** Memory id ("mem_...") of a note in the SAME box this one answers. */ reply_to?: string; /** Memory id ("mem_...") of a question or blocker in the SAME box this note * closes, which is what stops it being reported as open. */ resolves?: string; } interface ProfileReadOptions { sections?: ProfileSection[]; /** Open one box from the profile read's table of contents — a category * ("work"), a source ("agents/parry"), or a shared project tag * ("projects/"). */ box?: string; /** Continue a long box; pages start at 1. Only meaningful with box. */ page?: number; /** Delta cursor for a box open: only notes newer than this ("YYYY-MM-DD" or * ISO timestamp). The box result's `latest` is the next cursor. Only * meaningful with box. */ since?: string; /** Box-open verbosity: "compact" (default) truncates long notes and marks * them `truncated: true`; "full" returns whole notes. Only meaningful with * box. */ detail?: 'compact' | 'full'; } interface ProfileReadResult { profile: UserProfile; portable: boolean; filtered: boolean; hiddenSources?: string[]; } interface ProfileFormatOptions { /** Legacy alias for includeConnectorSnapshots. Prefer Configure connector tools for fresh data. */ includeTools?: boolean; /** Include small connector-derived snapshots already present in the profile read response. */ includeConnectorSnapshots?: boolean; /** Include CONFIGURE_GUIDELINES (default: true). Pass false to opt out. */ guidelines?: boolean; } interface ProfileSearchOptions { /** Optional search query. Omit or pass "*" to list bounded permitted attributed results. */ query?: string; /** Optional category box id from the profile read's table of contents; composes with query. */ box?: string; source?: string; from?: string; to?: string; limit?: number; /** Default "compact" may return snippets. "full" includes complete text plus safe inspectable metadata. */ detail?: 'compact' | 'full'; } interface ProfileSearchHit { id: string; title?: string; text: string; snippet?: string; path?: string; source: string; source_type?: 'agent' | 'import'; provider?: ImportMemoryProvider; written_by?: string; imported_by_agent?: string; /** Date the memory was saved, YYYY-MM-DD (the wire's temporal field). */ saved_on?: string; created_at?: string; updated_at?: string; event_at?: string; score?: number; type?: string; markers?: string[]; provenance?: Record; } interface ProfileSearchResult { results: ProfileSearchHit[]; visibleSources?: string[]; sourceCounts?: Record; diagnostic?: ProfileSearchDiagnostic; truncated?: boolean; } interface ProfileSearchSourceCount { matched: number; returned: number; } type ProfileSearchDiagnosticStatus = 'ok' | 'partial_results' | 'truncated' | 'no_matches' | 'source_not_found' | 'filtered_by_permissions' | 'auth_missing' | 'agent_unresolved'; interface ProfileSearchDiagnostic { status: ProfileSearchDiagnosticStatus; message: string; next_action?: string; } interface ProfileCommitMessage { role: 'user' | 'assistant' | 'tool'; content: string; toolName?: string; } interface ProfileCommitInput { messages?: ProfileCommitMessage[]; response?: unknown; toolResults?: Array<{ toolName: string; content: string | object; }>; memories?: string[]; sync?: boolean; } type ConnectorName = 'gmail' | 'outlook' | 'calendar' | 'drive' | 'notion' | 'sheets'; type ActionName = 'email.send' | 'calendar.create_event' | 'sheets.values_update' | 'sheets.values_append' | 'sheets.create_spreadsheet' | 'sheets.add_sheet'; interface ProfileToolsOptions { /** Optional connector tools this hosted/product surface requested and this app supports. */ connectors?: ConnectorName[]; /** Optional action tools this hosted/product surface requested and this app supports. Execution still enforces user state and approval. */ actions?: ActionName[]; /** Advanced adapter/runtime tools. Omit unless the host runtime explicitly supports them. */ advanced?: { /** Expose the model-facing commit tool for MCP/adapter runtimes. */ commit?: boolean; /** Expose raw profile file tools for advanced runtimes. */ files?: boolean; /** Expose Configure web search and URL fetch utility tools. */ utilitySearch?: boolean; }; } interface JsonSchemaObject { type: 'object'; properties: Record; required?: string[]; additionalProperties?: boolean; } interface ConfigureToolDefinition { name: string; description: string; input_schema: JsonSchemaObject; } interface ConfigureToolCall { name?: string; arguments?: Record | string; input?: Record; function?: { name?: string; arguments?: Record | string; }; } /** * Conversation message format used by private commit bridge code. */ interface ConversationMessage { role: 'user' | 'assistant'; content: string; } interface OtpStartResponse { ok: boolean; mocked?: boolean; } interface OtpVerifyResponse { token: string; userId: string; embedReceipt?: string; } interface SignInUrlOptions { /** Optional legacy browser credential. Registered agents resolve it server-side. */ publishableKey?: string; /** Web callback or deep link that receives a short-lived sign-in code. */ returnTo?: string; /** Optional opaque value returned with the sign-in code. */ state?: string; /** Optional id used to correlate message-agent browser completion with the original message space. */ journeyId?: string; /** Cosmetic app label shown on the hosted page. */ displayName?: string; /** Alias for displayName. */ agentName?: string; /** Optional logo URL shown on the hosted page. */ agentLogo?: string; /** Use "message" for sign-in.me message-agent handoffs. */ delivery?: 'browser' | 'message' | 'messages' | 'imessage' | 'sms' | 'opener' | string; /** Message line that users return to after hosted sign-in. */ messageLinePhone?: string; /** Alias for messageLinePhone: the agent's current message line, usually supplied by the messaging provider. */ agentPhone?: string; /** Suggested SMS/iMessage body for returning to the agent. */ messageBody?: string; /** Optional endpoint called by hosted message delivery with the agent token. */ messageCompleteUrl?: string; /** Optional connector setup requested during sign-in. */ connectors?: ConnectorName[] | string; /** Hosted sign-in origin. Defaults to https://sign-in.me. */ signInOrigin?: string; /** Hosted page theme. */ theme?: 'light' | 'dark'; } interface SignInReturnDestination { destination: string; createdAt?: string; } interface SignInReturnDestinationList { destinations: SignInReturnDestination[]; } interface SignInReturnDestinationResult extends SignInReturnDestination { deleted?: boolean; } interface MessageLine { id: string; channel: string; phoneLast4: string; label: string | null; status: 'active' | 'revoked'; /** Non-secret operator metadata stored with the line. Raw phone numbers are never returned. */ metadata: Record; createdAt?: string; updatedAt?: string; } interface RegisterMessageLineOptions { /** Stable message channel identifier. Defaults server-side to "imessage" for compatibility. */ channel?: string; /** Agent-owned return line in E.164 format. Requires a server-side `sk_` key. */ phone: string; /** Optional operator-readable label. */ label?: string; /** Optional non-secret metadata about where this line came from. Raw phone fields and phone-like values are rejected. */ metadata?: Record; } interface RevokeMessageLineOptions { /** Stable message channel identifier. Defaults server-side to "imessage" for compatibility. */ channel?: string; /** Agent-owned return line in E.164 format. */ phone: string; } interface RegisterMessageLineResult { line: MessageLine; } interface ListMessageLinesResult { lines: MessageLine[]; } interface RevokeMessageLineResult { deleted: boolean; lines: MessageLine[]; } interface SignInExchangeResult { token: string; userId: string; tokenUse: 'agent'; approved: boolean; agent: string; } interface SignInTokenValidationResult { valid: boolean; userId?: string; tokenUse?: 'agent'; approved?: boolean; agent?: string; } interface SignInPhoneRecognitionResult { matched: boolean; recognized?: boolean; approved: boolean; linked: boolean; token?: string; agentToken?: string; userId?: string; agent?: string; displayName?: string | null; phoneCandidateCount: number; } type MessageSignInReason = 'signin' | 'reconnect' | 'permissions'; type MessageSignInUrlMode = 'minted' | 'plain'; type MessageSignInFallbackReason = 'sender_proof_missing' | 'sender_proof_invalid' | 'sender_proof_unsupported'; interface CreateMessageSignInUrlOptions { reason: MessageSignInReason; channel: string; subject: { key: string; externalId: string; senderId?: string; }; thread?: { key?: string; spaceId?: string; messageId?: string; }; /** Provider-signed evidence that the message sender/thread claim is authentic. */ messageSenderProof?: string; connectors?: ConnectorName[] | string[]; displayName?: string; agentLogo?: string; theme?: 'light' | 'dark'; /** Message line that users return to after hosted sign-in. */ messageLinePhone?: string; /** Alias for messageLinePhone: the agent's current message line, usually supplied by the messaging provider. */ agentPhone?: string; messageBody?: string; messageCompleteUrl?: string; journeyId?: string; returnMode?: 'message'; idempotencyKey?: string; } type CreateMessageSignInUrlResult = { mode: 'minted'; url: string; code: string; reason: MessageSignInReason; expiresAt: string; idempotencyKey?: string; } | { mode: 'plain'; url: string; reason: MessageSignInReason; fallbackReason: MessageSignInFallbackReason; idempotencyKey?: string; }; type MessageIdentitySource = 'token' | 'phone_recognition' | 'external_id'; interface MessageIdentityResolveOptions { /** Stable app-local subject for unlinked, developer-scoped memory. */ externalId: string; /** Previously stored Configure agent token, if one exists. */ token?: string | null; /** Phone-like sender IDs from the message platform, usually E.164 when available. */ phoneCandidates?: string | string[] | null; /** Validate an existing token before accepting it. Defaults to false for hot paths. */ validateToken?: boolean; /** Throw recognition/validation errors instead of falling back to externalId. */ throwOnAuthError?: boolean; } interface MessageIdentity { externalId: string; token?: string; userId?: string; linked: boolean; approved: boolean; recognized: boolean; displayName?: string | null; source: MessageIdentitySource; } interface IntegrationData { connected: boolean; reconnectRequired?: boolean; error?: string; accountEmail?: string; accountName?: string; accountUsername?: string; providerAccountId?: string; connectedAccountId?: string; defaultAccountId?: string; accounts?: Array<{ connectedAccountId: string; providerAccountId?: string; accountEmail?: string; accountName?: string; accountUsername?: string; status?: 'ready' | 'reconnect'; error?: string; }>; ranked?: Record[]; synthesis?: { facts: { category: string; fact: string; confidence: number; }[]; summary: string; }; preferences?: string[]; events?: unknown[]; files?: unknown[]; pages?: unknown[]; spreadsheets?: unknown[]; } type ImportMemoryProvider = 'chatgpt' | 'gemini' | 'claude' | 'grok' | 'other'; interface ImportedMemory { id?: string; date?: string; text?: string; content?: string; path?: string; source?: string; source_type?: 'import'; provider?: ImportMemoryProvider; written_by?: string; imported_by_agent?: string; created_at?: string; event_at?: string; type?: string; } interface ImportedSourceData { name?: string; provider?: ImportMemoryProvider; source?: string; importedAt?: string; user_summary?: string; memory_count?: number; imported_by_agent?: string; legacy?: boolean; memories?: ImportedMemory[]; preferences?: string[]; } interface UserIdentity { name?: string; email?: string; phone_last4?: string; occupation?: string; location?: string; bio?: string; interests?: string[]; } interface UserProfile { identity: UserIdentity; preferences: string[]; summary?: string; integrations: Record; imports: Record; agents: Record>; /** Whether the user has linked their identity (completed auth at least once) */ linked?: boolean; /** Whether any sections were filtered due to user permissions */ filtered?: boolean; /** Section names hidden by user permissions (e.g., ['integrations.gmail', 'agents.travelbot']) */ hiddenSections?: string[]; /** Format this profile as a prompt-ready string */ format(options?: ProfileFormatOptions): string; } interface MemoriesResponse { user: Record; prefs: string[]; apps: Record; connectors: Record; updatedAt: number; } interface RememberResponse { saved: boolean; app: string; fact: string; memory?: ProfileSearchHit; } interface ForgetResponse { deleted: boolean; /** Present on a single-id delete; absent on bulk (`scope`/`import_id`) and `match` deletes. */ id?: string; path?: string; source?: string; /** Bulk (`scope`/`import_id`) and confirmed `match` deletes return how many memories were removed and their ids. */ deleted_count?: number; deleted_ids?: string[]; /** A `match` preview (no `confirm: true`) returns how many memories matched, having deleted nothing. */ matched?: number; suppressed?: boolean; suppressed_copies?: number; message?: string; } interface ImportResponse { saved: boolean; /** The namespace box the distilled note was filed under. */ box: string; /** False when the distiller degraded and stored a clamped raw stream. */ distilled?: boolean; memory?: unknown; path?: string; source?: string; /** True when the content matched a user_request suppression and was not saved. */ suppressed?: boolean; message?: string; } /** Apps a connect link can target. `import` lands on the memory-import page. */ type ConnectApp = 'gmail' | 'calendar' | 'drive' | 'notion' | 'sheets' | 'import'; /** Scope upgrades a connect link can request for a single capability. */ type ConnectCapability = 'gmail:read' | 'gmail:send' | 'calendar:read' | 'calendar:write'; /** * A server-minted connect link. Configure signs and hosts every link; you never * build one yourself. Include `connect_url` (or `import_url`) verbatim in your * reply so the user can act on it, and do not retry the underlying action until * they have. */ /** A short-lived single-bearer MCP session for the current user's runtime. */ interface McpSessionResponse { ok: boolean; /** true when the user has approved this agent; false = connect-only session. */ linked: boolean; /** * true when this mint carried the previous session's read/commit correlation * forward (a refresh with a still-valid `previousToken` for the same linked * user). false on first mints and whenever the previous token had expired. */ continued?: boolean; session: { token: string; expires_at: string; }; mcp_url: string; /** Drop-in for Anthropic's `mcp_servers` parameter or any MCP client config. */ mcp_servers: Array<{ type: 'url'; url: string; name: string; authorization_token: string; }>; message?: string; } interface McpSessionOptions { /** * The session token this mint replaces. When it is still valid and names the * same linked user, the new session keeps its read/commit correlation, so a * profile read done on the old token can be committed on the new one. * Expired or unusable previous tokens degrade to a fresh session * (`continued: false`) — they never fail the mint. */ previousToken?: string; } interface McpAuthOptions { /** * Re-mint when fewer than this many seconds remain on the current session. * Default 60 — wide enough that a slow mint never races the old token's * expiry on a live connection. */ refreshSkewSeconds?: number; } /** * A self-refreshing MCP session for runtimes that outlive one 15-minute token * (daemons, workers, long agent loops). Call `mcpServers()` (or `token()`) * before EVERY model call or MCP request batch: it returns the cached session * while it is fresh and transparently re-mints — carrying read/commit * correlation forward — when it is near expiry. On an unexpected 401, call * `invalidate()` and retry once. Sessions stay in memory only; nothing about * this provider extends a token's 15-minute life. */ interface McpSessionProvider { /** The full current session, minting or refreshing if needed. */ session(): Promise; /** The current bearer token (refreshing if needed). */ token(): Promise; /** The current `mcp_servers` block (refreshing if needed). */ mcpServers(): Promise; /** * Drop the cached session so the next call mints anew. Use after an * unexpected 401 (then retry once), and after the user completes a connect * link so an unlinked session upgrades to linked immediately instead of at * the next scheduled refresh. Remember to re-issue `tools/list` after an * unlinked session becomes linked — the tool surface grows. */ invalidate(): void; } interface ConnectResponse { /** * `authorization_required`: the user is not signed in; the link signs them in. * `connect_app`: signed in; the link connects or manages an app. * `permission_needed`: a specific capability (e.g. gmail:send) is missing; the * link grants that scope. * `import_ready`: the link opens the memory-import page. */ status: 'authorization_required' | 'connect_app' | 'permission_needed' | 'import_ready'; /** Configure-hosted link. Present on every status except `import_ready`. */ connect_url?: string; /** Present instead of `connect_url` when `status` is `import_ready`. */ import_url?: string; /** The connector this link targets, when one was named. */ app?: string; /** For `connect_app` with an app: whether that app is already connected. */ connected?: boolean; /** For `permission_needed`: the capability being requested (e.g. `gmail:send`). */ capability?: string; /** For `permission_needed`: the underlying connector (e.g. `gmail`). */ connector?: string; /** For `permission_needed`: a human label for the capability. */ label?: string; /** The human-facing reason shown on the connect page, when supplied. */ purpose?: string; /** ISO timestamp when the link expires. */ expires_at: string; /** Agent-facing instruction describing how to surface the link. */ instructions: string; /** * This same response pre-wrapped as an MCP tool-result envelope — the * ready-to-mount value for `ConfigureMcpAppHost.mount({ result })`, so the * envelope-vs-payload shape question cannot arise. Added client-side by the * SDK (additive; the rest of the response is unchanged). */ mcp_result?: { structuredContent: Record; }; } interface ProfileCommitResult { status: 'processing' | 'completed'; /** Facts extracted and saved to the user's memory */ facts_written?: string[]; /** Updated user summary after commit */ user_summary?: string; memories_written?: Array<{ id?: string; path: string; source: string; written_by?: string; created_at?: string; type?: string; marker?: string; }>; obligations_committed?: string[]; rejected_memories?: Array<{ memory: string; reason: string; }>; } type ImportMode = 'backfill'; type ImportJobStatus = 'queued' | 'processing' | 'completed' | 'failed' | 'cancelled'; interface ImportProfilesRequest { mode: ImportMode; users: ImportProfileUser[]; idempotencyKey?: string; } interface ImportProfileUser { externalId: string; idempotencyKey?: string; profile?: { summary?: string; preferences?: string[]; facts?: string[]; identity?: Record; [key: string]: unknown; }; conversations?: ImportConversation[]; } interface ImportConversation { id?: string; messages: ImportMessage[]; } interface ImportMessage { role: 'system' | 'user' | 'assistant' | 'tool'; content: string; } interface ImportQuotaState { used: number; limit: number | 'unlimited'; requestedNew: number; remaining: number | 'unlimited'; } interface ImportCaps { max_profiles_per_job: number; max_total_input_chars_per_job: number; max_concurrent_import_jobs: number; max_conversations_per_profile: number; max_messages_per_conversation: number; max_chars_per_message: number; } interface ImportJob { id: string; mode: ImportMode; status: ImportJobStatus; accepted_profiles: number; estimated_message_count: number; estimated_input_chars: number; imported_memory_count: number; processed_profile_count: number; failed_profile_count: number; quota?: { imported_profiles: ImportQuotaState; }; caps?: ImportCaps; created_at: string; updated_at: string; started_at?: string | null; completed_at?: string | null; cancelled_at?: string | null; error?: { code?: string | null; message?: string | null; }; reused?: boolean; } /** A single document in the document suite */ interface DocumentEntry { content: string; generated_at: string; } /** Response from getDocuments() */ interface DocumentsResponse { documents: { 'user.md'?: DocumentEntry | null; 'soul.md'?: DocumentEntry | null; 'preferences.md'?: DocumentEntry | null; 'context.md'?: DocumentEntry | null; }; } /** Response from generateDocuments() */ interface GenerateDocumentsResponse { documents: { 'user.md'?: (DocumentEntry & { chars: number; }) | null; 'soul.md'?: (DocumentEntry & { chars: number; }) | null; 'preferences.md'?: (DocumentEntry & { chars: number; }) | null; 'context.md'?: (DocumentEntry & { chars: number; }) | null; }; cached: boolean; } interface CreateEventResponse { created: boolean; event: { title: string; start: string; end: string; description?: string; location?: string; }; message: string; } interface SendEmailResponse { sent: boolean; retryable?: boolean; email: { to: string; subject: string; bodyPreview: string; body_preview?: string; delivery_status?: 'accepted' | 'unconfirmed'; provider_message_id?: string; from_account?: { id?: string; email?: string; provider?: EmailProvider; account?: { id: string; email?: string; } | null; }; gmail_data?: unknown; outlook_data?: unknown; }; message: string; } interface SearchOptions { maxResults?: number; account?: string; } interface SearchSpreadsheetsResponse { query: string; count: number; spreadsheets: Array<{ id?: string; name?: string; title?: string; webViewLink?: string; url?: string; modifiedTime?: string; }>; } interface GetSheetValuesResponse { spreadsheetId: string; ranges: string[]; valueRanges: Array<{ range?: string; majorDimension?: string; values?: unknown[][]; }>; } interface SheetValuesMutationInput { spreadsheetId: string; range: string; values: unknown[][]; valueInputOption?: 'USER_ENTERED' | 'RAW'; } interface UpdateSheetValuesResponse { updated: boolean; spreadsheetId: string; range: string; updatedRange?: string; updatedRows?: number; updatedColumns?: number; updatedCells?: number; data?: unknown; } interface AppendSheetValuesResponse { appended: boolean; spreadsheetId: string; range: string; tableRange?: string; updatedRange?: string; updatedRows?: number; updatedColumns?: number; updatedCells?: number; data?: unknown; } interface CreateSpreadsheetResponse { created: boolean; spreadsheetId?: string; title: string; url?: string; data?: unknown; } interface AddSheetResponse { created: boolean; spreadsheetId: string; title: string; sheetId?: number; data?: unknown; } interface UIResult { component: string; data: unknown; } type ConnectorType = 'gmail' | 'outlook' | 'calendar' | 'drive' | 'notion' | 'sheets'; type EmailProvider = 'gmail' | 'outlook'; interface Connector { id: ConnectorType; name: string; connected: boolean; reconnectRequired?: boolean; error?: string; description?: string; } interface ListConnectorsResponse { connectors: Connector[]; } interface ConnectConnectorResponse { success: boolean; url?: string; connectionRequestId: string; alreadyConnected?: boolean; connectedAccountId?: string; providerAccountId?: string; accountEmail?: string; accountName?: string; } interface ConfirmConnectorResponse { success: boolean; connected: boolean; /** True when the user granted only some of the requested OAuth permissions; reconnect to retry. */ partialPermissions?: boolean; sync?: { itemsSynced?: number; [key: string]: unknown; }; connectedAccountId?: string; providerAccountId?: string; accountEmail?: string; accountName?: string; } interface SyncConnectorResponse { synced: boolean; connector: ConnectorType; threads_count?: number; events_count?: number; files_count?: number; pages_count?: number; } interface SearchEmailsResponse { query: string; count: number; emails: Array<{ subject: string; snippet: string; date?: string; from?: string; body?: string; provider?: EmailProvider; account?: { id: string; email?: string; }; }>; accounts_searched?: Array<{ id: string; email?: string; provider?: EmailProvider; account?: { id: string; email?: string; }; }>; partial?: boolean; errors?: Array<{ provider: EmailProvider; error: string; }>; } interface SearchCalendarResponse { range: string; count: number; events: Array<{ summary: string; start?: string; end?: string; location?: string; description?: string; }>; } interface SearchFilesResponse { query: string; count: number; files: Array<{ name: string; mimeType?: string; modifiedTime?: string; webViewLink?: string; }>; } interface SearchNotesResponse { query: string; count: number; notes: Array<{ title: string; url?: string; lastEdited?: string; }>; } interface SearchWebResponse { query: string; count: number; results: Array<{ title: string; url?: string; snippet: string; publishedDate?: string; }>; } interface FetchUrlResponse { url: string; title: string; content: string; content_type: string; status_code: number; truncated: boolean; } type UIComponentType = 'phone_input' | 'otp_input' | 'memory_card' | 'connection_list' | 'single_connector' | 'confirmation' | 'memory_import' | 'status_indicator' | 'searching_indicator' | 'memory_badge' | 'tool_confirmation'; interface UIComponent { type: UIComponentType; props: Record; } interface SyncConnectorsResponse { userId: string; synced: Record; } /** * Payment method metadata stored in profile files at /payments/{id}.json. * No actual secret values — just labels, hints, and env var references. */ interface PaymentMeta { /** Payment type */ type: 'card' | 'bank_account' | 'digital_wallet' | 'crypto_wallet'; /** Human-readable label (e.g., "Personal Visa ****4242") */ label: string; /** Whether this is the default payment method */ isDefault?: boolean; /** Card-specific metadata */ brand?: string; last4?: string; expMonth?: number; expYear?: number; /** Crypto wallet metadata */ chain?: string; address?: string; /** Payment processor (e.g., "stripe") */ processor?: string; /** Env var name holding the actual token/secret */ envVar?: string; /** When this payment method was added */ addedAt?: number; } /** * Credential metadata stored in profile files at /credentials/{id}.json. * No actual secret values — just labels, hints, and env var references. */ interface CredentialMeta { /** Credential type */ type: 'login' | 'api_key' | 'token' | 'certificate' | 'ssh_key' | 'other'; /** Human-readable label (e.g., "OpenAI Production") */ label: string; /** Service domain (e.g., "openai.com") */ service: string; /** Optional category (e.g., "ai", "development", "finance") */ category?: string; /** Non-secret username (if applicable) */ username?: string; /** Hint showing last few chars (e.g., "sk-...4f2x") */ hint?: string; /** Env var name holding the actual credential */ envVar?: string; /** When this credential was added */ addedAt?: number; } /** * Assembled agent profile for internal agent file operations. */ interface AgentProfile { /** Agent's soul/identity document (markdown) */ soul?: string; /** Agent configuration */ config?: Record; /** List of skill files */ skills?: { path: string; name: string; }[]; /** Number of memory entries */ memoryCount?: number; /** List of note files */ notes?: { path: string; name: string; }[]; } /** * A single agent memory entry for internal agent file operations. */ interface AgentMemoryEntry { /** Date of the memory (YYYY-MM-DD) */ date: string; /** Memory content (markdown) */ content: string; /** Profile file path to the memory file */ path: string; } export type { ActionName, AddSheetResponse, AgentMemoryEntry, AgentProfile, AppendSheetValuesResponse, ConfigureOptions, ConfigureToolCall, ConfigureToolDefinition, ConfirmConnectorResponse, ConnectApp, ConnectCapability, ConnectConnectorResponse, ConnectResponse, Connector, ConnectorName, ConnectorType, ConversationMessage, CreateEventResponse, CreateMessageSignInUrlOptions, CreateMessageSignInUrlResult, CreateSpreadsheetResponse, CredentialMeta, DocumentEntry, DocumentsResponse, EmailProvider, FetchUrlResponse, ForgetResponse, ForgetSelector, GenerateDocumentsResponse, GetSheetValuesResponse, ImportCaps, ImportConversation, ImportJob, ImportJobStatus, ImportMemoryProvider, ImportMessage, ImportMode, ImportProfileUser, ImportProfilesRequest, ImportQuotaState, ImportResponse, ImportedMemory, ImportedSourceData, IntegrationData, JsonSchemaObject, ListConnectorsResponse, ListMessageLinesResult, McpAuthOptions, McpSessionOptions, McpSessionProvider, McpSessionResponse, MemoriesResponse, MessageIdentity, MessageIdentityResolveOptions, MessageIdentitySource, MessageLine, MessageSignInFallbackReason, MessageSignInReason, MessageSignInUrlMode, OtpStartResponse, OtpVerifyResponse, PaymentMeta, ProfileCommitInput, ProfileCommitMessage, ProfileCommitResult, ProfileFormatOptions, ProfileReadOptions, ProfileReadResult, ProfileRuntimeOptions, ProfileSearchDiagnostic, ProfileSearchDiagnosticStatus, ProfileSearchHit, ProfileSearchOptions, ProfileSearchResult, ProfileSearchSourceCount, ProfileSection, ProfileToolsOptions, RegisterMessageLineOptions, RegisterMessageLineResult, RememberOptions, RememberResponse, RevokeMessageLineOptions, RevokeMessageLineResult, SearchCalendarResponse, SearchEmailsResponse, SearchFilesResponse, SearchNotesResponse, SearchOptions, SearchSpreadsheetsResponse, SearchWebResponse, SendEmailResponse, SheetValuesMutationInput, SignInExchangeResult, SignInPhoneRecognitionResult, SignInReturnDestination, SignInReturnDestinationList, SignInReturnDestinationResult, SignInTokenValidationResult, SignInUrlOptions, SyncConnectorResponse, SyncConnectorsResponse, UIComponent, UIComponentType, UIResult, UpdateSheetValuesResponse, UserIdentity, UserProfile };