import type { AgentAvatarResult, AgentChannelsResult, AgentSearchHit, AgentSummary, AllAutomationRow, AsyncTaskRecord, BoxMcpServersResult, BoxStoreStatus, BroadcastResult, ConversationOutlineItem, CreateAgentResult, DeleteAgentResult, DiskSaverAuditResult, GatewayAutomation, GatewayDiscovery, GatewayEvent, GatewayWorkflow, HealthResponse, HostSettings, HostStatus, InterruptAgentRunResult, KickstartAgentResult, ListenerConnectUrlResult, ListenerIntegrationsResult, MemoryRecord, PluginSyncStatus, PromptAcceptanceStatus, PromptAcceptanceStatusInput, GatewaySearchMediaRow, SendPromptInput, SendPromptResult, SkillCatalogEntry, SubagentRecord, TranscriptPageResult, TranscriptTailResult, TranscriptThreadResult, TranscriptWindowResult, WidgetAcceptedResult, WorkflowImportResult } from "../types.js"; import { type CompatVerdict } from "./compat.js"; import { type AgentIdBody, type AgentThreadInput, type AutomationIdInput, type BroadcastInput, type CreateAgentInput, type CreateAutomationInput, type CreateGroupInput, type CreateWorkflowInput, type DeleteMemoryInput, type DismissWidgetInput, type ForeverBoxStatusInput, type GatewayCommandName, type ImportWorkflowTextInput, type ImportWorkflowUrlInput, type ListBoxMcpServersInput, type ListenerConnectUrlInput, type OpenAgentBoundedInput, type ReactToMessageInput, type SearchQueryInput, type SetAutomationEnabledInput, type SetGroupMembersInput, type SetHiddenInput, type SetNotifyInput, type SetUnreadInput, type SetWorkflowEnabledInput, type TranscriptPageInput, type TranscriptWindowInput, type UpdateAgentInput, type UpdateAutomationInput, type UpdateWorkflowInput, type WidgetResponseInput, type WorkflowIdInput } from "./commands.js"; import { type GatewayRequestOptions } from "./abort.js"; import { type DiscoverOptions } from "./discovery.js"; import { type DiscussOnceInput, type DiscussOnceReceipt, type RunOnceFromInput, type RunOnceInput, type OneShotReceipt, type SendAsAgentInput, type SendAsAgentReceipt, type SendPromptCallInput, type SendPromptWaitResult, type WaitForIdleInput, type WaitForIdleResult } from "./oneshot.js"; export { DEFAULT_GATEWAY_TIMEOUT_MS, type GatewayRequestOptions } from "./abort.js"; export { DISCOVERY_COMMAND, GrokBotGatewayError, discoveryFailureHint } from "./errors.js"; export type GrokBotOptions = DiscoverOptions & GatewayRequestOptions & { /** * Override the final request origin after discovery. * Prefer `gatewayUrl` (or GROKBOT_GATEWAY_URL) so scheme/host/port stay in sync. */ baseUrl?: string; /** * Override token. Prefer SAND_GATEWAY_TOKEN or gateway.json. * Never log this value. */ token?: string; /** Default true — ask the host to strip inline avatar data URLs. */ slimAvatars?: boolean; /** * Allow box-destructive / channel / secrets / webauthn commands via * `command()`. Default false. Typed wrappers never need this. */ allowUnsafeCommands?: boolean; fetch?: typeof fetch; }; export declare class GrokBot { #private; readonly slimAvatars: boolean; readonly timeoutMs: number | undefined; readonly allowUnsafeCommands: boolean; constructor(options?: GrokBotOptions); static fromDiscovery(options?: GrokBotOptions): GrokBot; refreshDiscovery(): GatewayDiscovery; discovery(): GatewayDiscovery; /** * Resolve a roster name or id to the agent id host POST bodies use. * UUID / `sand-subagent-*` values pass through. Names use disk * `resolveAgent` then gateway `listAgents`. sendPrompt still sends * the resolved value as `agentId`. */ resolveAgent(idOrName: string): Promise; get baseUrl(): string; health(options?: GatewayRequestOptions): Promise; avatar(agentId: string, options?: GatewayRequestOptions): Promise; /** * SSE GET /events?channels= — async iterator of { channel, payload }. * Pass channel names to filter; omit for all channels. * Does not apply the default unary timeout (streams stay open). */ events(channels?: string[], options?: GatewayRequestOptions): AsyncGenerator; /** * Compare live `getHostStatus()` to the extracted host-snapshot manifest. * Verdict only — never tokens or command payloads. */ compat(options?: GatewayRequestOptions): Promise; /** * Generic POST /api/. Omits the JSON body when `body` is undefined * (does not coerce a missing body to `{}`). * * Box-destructive, channel, secrets, and webauthn names require * `allowUnsafeCommands` or `commandUnsafe()`. Unknown non-unsafe names * are allowed so new host commands can be reached without a wrapper. */ command(name: GatewayCommandName | string, body?: TIn, options?: GatewayRequestOptions): Promise; /** * Escape hatch for unsugared unsafe commands (box-destructive, channel, * secrets, webauthn). Same POST as `command()`, with the unsafe gate off. */ commandUnsafe(name: GatewayCommandName | string, body?: TIn, options?: GatewayRequestOptions): Promise; listAgents(): Promise; countAgents(): Promise; searchAgents(body: SearchQueryInput): Promise; /** * Always POSTs a string name and description. Host mintAgent forwards * `{ name: args.name, description: args.description }` with no `?? ""`; * materializeSession then does `profile?.name.trim()` / * `profile?.description.trim()`. Omitting name mints `throwaway-`. * Omitting description sends `""`. */ createAgent(body?: CreateAgentInput): Promise; updateAgent(body: UpdateAgentInput): Promise; deleteAgent(body: AgentIdBody): Promise; duplicateAgent(body: AgentIdBody): Promise; openAgent(body: AgentIdBody): Promise; setAgentUnread(body: SetUnreadInput): Promise; setAgentHiddenFromSidebar(body: SetHiddenInput): Promise; /** * createHostGatewayApi.setAgentNotificationsEnabled. * Distinct from setAgentNotifyOnUpdates. Host handler is currently a no-op. */ setAgentNotificationsEnabled(body: SetNotifyInput): Promise; setAgentNotifyOnUpdates(body: SetNotifyInput): Promise; createGroup(body: CreateGroupInput): Promise; setGroupMembers(body: SetGroupMembersInput): Promise; sendPrompt(body: SendPromptCallInput & { wait: true; }): Promise; sendPrompt(body: SendPromptInput & { wait?: false; }): Promise; getTranscript(): Promise; getAgentTranscript(body: AgentIdBody): Promise; getAgentTranscriptPage(body: TranscriptPageInput): Promise; getAgentTranscriptWindow(body: TranscriptWindowInput): Promise; getAgentTranscriptTail(body: TranscriptWindowInput): Promise; getAgentThread(body: AgentThreadInput): Promise; getConversationOutline(body: AgentIdBody): Promise; interruptAgentRun(body: AgentIdBody): Promise; respondToWidget(body: WidgetResponseInput): Promise; dismissWidget(body: DismissWidgetInput): Promise; reactToMessage(body: ReactToMessageInput): Promise; promptAcceptanceStatus(body: PromptAcceptanceStatusInput): Promise; /** * Client poll until the agent is idle. Uses listAgents (isRunning / * isComposingMessage / awaitingUserResponse), getAsyncTasks, getSubagents, * and promptAcceptanceStatus when a nonce is passed (accountSlot is always * HOST_ACCOUNT_SLOT). Not a host command. Host sendPrompt is still * `{ accepted: true }`; pass SDK `wait: true` to poll after accept. */ waitForIdle(input: WaitForIdleInput): Promise; /** * createAgent (introduction suppressed) → sendPrompt (minted clientNonce) → * waitForIdle → read tail `reply` → deleteAgent in finally. * Always POSTs a string name and description (mints `throwaway-` and * `""` when omitted). Pass includeReply: false for metadata-only. */ runOnce(input: RunOnceInput): Promise; /** * duplicateAgent (manager.cloneAgent) → send → wait → delete the clone. * Rejects groups. Full host clone, not a persona-only thread. */ runOnceFrom(input: RunOnceFromInput): Promise; /** * Profile-only throwaway: createAgent with copied name/description/title/purpose. * Does not clone store.db, automations, or memory/. */ runOnceLike(input: RunOnceFromInput): Promise; /** * Throwaway group discussion: duplicate each source, createGroup with the * clone ids, sendPrompt to the group, wait until the group and every clone * are idle, snapshot the full room transcript, then delete group then clones. * Reused same-member-set groups are an error. awaiting-user keeps the room. * Omitting `name` mints a unique throwaway name (host createGroup crashes * on undefined `name.trim()`). */ discussOnce(input: DiscussOnceInput): Promise; /** Alias for discussOnce. */ runOnceDiscuss(input: DiscussOnceInput): Promise; /** * SDK-only peer send: mint or reuse a bus seat, sendPrompt that seat to * call the SendToAgent tool once, wait until idle, then deleteAgent the * throwaway unless keepBus / reuse. There is no host sendToAgent command. */ sendAsAgent(input: SendAsAgentInput): Promise; /** Alias for sendAsAgent. */ runOnceSendToAgent(input: SendAsAgentInput): Promise; getAgentMemories(body: AgentIdBody): Promise; deleteAgentMemory(body: DeleteMemoryInput): Promise; clearAgentMemories(body: AgentIdBody): Promise; getAgentAutomations(body: AgentIdBody): Promise; listAllAutomations(): Promise; createAgentAutomation(body: CreateAutomationInput): Promise; updateAgentAutomation(body: UpdateAutomationInput): Promise; deleteAgentAutomation(body: AutomationIdInput): Promise; setAgentAutomationEnabled(body: SetAutomationEnabledInput): Promise; runAgentAutomationNow(body: AutomationIdInput): Promise; getAgentWorkflows(body: AgentIdBody): Promise; createAgentWorkflow(body: CreateWorkflowInput): Promise; updateAgentWorkflow(body: UpdateWorkflowInput): Promise; deleteAgentWorkflow(body: WorkflowIdInput): Promise; setAgentWorkflowEnabled(body: SetWorkflowEnabledInput): Promise; runAgentWorkflowNow(body: WorkflowIdInput): Promise; skillsCatalog(): Promise; broadcastToAgents(body: BroadcastInput): Promise; searchMedia(body: SearchQueryInput): Promise; getHostSettings(): Promise; getHostStatus(options?: GatewayRequestOptions): Promise; getForeverBoxStatus(body: ForeverBoxStatusInput): Promise; kickstartAgent(body: AgentIdBody): Promise; getAgentChannels(body: AgentIdBody): Promise; getSubagents(body: AgentIdBody): Promise; getAsyncTasks(body: AgentIdBody): Promise; isAgentNetworkEnabled(): Promise; isGlobalSearchEnabled(): Promise; isEgressTunnelAvailable(): Promise; /** * POST /api/getAgentAvatar — data URL + version. * Distinct from avatar() which is GET /avatars/:id (raw PNG bytes). */ getAgentAvatar(body: AgentIdBody): Promise; requestDiskSaverAudit(body: AgentIdBody): Promise; /** * Always send `serverIdentifiers` as an array. Host `[...serverIdentifiers]` * throws if the key is omitted (`{}` → undefined). `[]` lists every server. */ listBoxMcpServers(body?: ListBoxMcpServersInput): Promise; getPluginSyncStatus(): Promise; getListenerIntegrations(): Promise; getListenerConnectUrl(body: ListenerConnectUrlInput): Promise; getBoxStoreStatus(): Promise; /** Sessions.openAgentWindowed — switches the active agent, then a window. */ openAgentWindowed(body: OpenAgentBoundedInput): Promise; /** Sessions.openAgentTail — switches the active agent, then a tail. */ openAgentTail(body: OpenAgentBoundedInput): Promise; importAgentWorkflowText(body: ImportWorkflowTextInput): Promise; importAgentWorkflowUrl(body: ImportWorkflowUrlInput): Promise; portAgentLocalSkills(body: AgentIdBody): Promise; } /** * Parse one SSE event block from host openSseStream (gateway-server.ts): * `data: ${JSON.stringify(event)}\\n\\n` plus `retry:` / `:ping` keepalives. * WHATWG event streams allow CR / LF / CRLF line breaks — strip trailing CR * so JSON.parse is not poisoned by `}\\r`. */ export declare function parseSseBlock(block: string): GatewayEvent | null; //# sourceMappingURL=client.d.ts.map