import type { Cuid2 } from "./protocol/common.js"; import { type ConnectionListResponse, type ReorderConnectionRequest, type ReorderConnectionResponse } from "./protocol/connections.js"; import type { BinaryContent, ConditionalRequestOptions, ImageUpload, OptionallyVersionedRequestOptions, RequestOptions, VersionedRequestOptions } from "./requestOptions.js"; import type { AbortAgentRequest, AgentAbortResponse, AgentActivityResponse, AgentCompactResponse, AgentDraftResponse, AgentModeResponse, AgentResponse, CreateAgentRequest, MutationOnlyRequest, ReorderAgentRequest, SaveAgentDraftRequest } from "./protocol/agents.js"; import type { AgentBootstrapResponse, DesktopBootstrapResponse } from "./protocol/bootstrap.js"; import type { ArchiveBotRequest, BotListResponse, BotResponse, CreateBotRequest, RenameBotRequest, ReorderBotRequest, UnarchiveBotRequest } from "./protocol/bots.js"; import type { CloudAccessTokenResponse, CloudAuthorizingResponse, CloudConnectedResponse, CloudDisconnectedResponse, CloudMutationRequest, CloudOrganizationsResponse, CloudResponse, CompleteCloudAuthorizationRequest, CreateCloudOrganizationRequest, CreateCloudOrganizationResponse, DeleteCloudOrganizationResponse, StartCloudAuthorizationRequest } from "./protocol/cloud.js"; import type { ConfigPatch, ConfigResponse, DrainResponse, GreetingResponse, HealthResponse, InspectorStartedResponse, InspectorStoppedResponse, InstructionsResponse, OnboardingCompletedResponse, OnboardingState, ProviderScanResponse, ProviderVerificationRequest, ProviderVerificationResponse, SecurityPolicyResponse, ShutdownResponse } from "./protocol/daemon.js"; import type { EventPageQuery, EventPageResponse, EventStreamFrame, EventStreamOptions } from "./protocol/events.js"; import type { FileContentResponse, FileRevisionQuery, FileRevisionResponse, FileSearchQuery, FileSearchResponse, FileTreeQuery, FileTreeResponse, WriteFileRequest, WriteFileResponse } from "./protocol/files.js"; import type { GitStateResponse, WatchGitRequest, WatchGitResponse } from "./protocol/git.js"; import type { HappyIntegrationResponse } from "./protocol/integrations.js"; import type { MessageHistoryQuery, MessageHistoryResponse, SendMessageRequest, SendMessageResponse } from "./protocol/messages.js"; import type { BackgroundProcessResponse } from "./protocol/processes.js"; import type { ProfileResponse, ProfileUpdateRequest } from "./protocol/profile.js"; import { type UsersResponse } from "./protocol/users.js"; import type { ArchiveProjectRequest, CloneProjectRequest, ProjectListResponse, ProjectResponse, ProjectSettingsResponse, RegisterProjectRequest, RenameProjectRequest, ReorderProjectRequest, ReplaceProjectSettingsRequest } from "./protocol/projects.js"; import type { AnswerQuestionRequest, PendingQuestionResponse, QuestionResponse } from "./protocol/questions.js"; import type { CreateSecretRequest, SecretAttachmentListQuery, SecretAttachmentListResponse, SecretAttachmentMutationRequest, SecretAttachmentTarget, SecretAttachResult, SecretDetachResponse, SecretListQuery, SecretListResponse, SecretResponse, UpdateSecretRequest } from "./protocol/secrets.js"; import type { OpenTerminalRequest, ResizeTerminalRequest, TerminalListResponse, TerminalResponse } from "./protocol/terminals.js"; import type { AgentUsageResponse, DaemonUsageResponse } from "./protocol/usage.js"; import type { StopWorkspaceServiceRequest, WorkspaceServiceAccessTokenResponse, WorkspaceServiceInputRequest, WorkspaceServiceInputResponse, WorkspaceServiceListQuery, WorkspaceServiceListResponse, WorkspaceServiceResponse } from "./protocol/services.js"; import type { InvokeSlashCommandRequest, InvokeSlashCommandResponse } from "./protocol/slashCommands.js"; import type { ArchiveWorkspaceRequest, CreateWorkspaceRequest, ListWorkspacesQuery, RenameWorkspaceRequest, ReorderWorkspaceRequest, WorkspaceListResponse, WorkspaceResponse } from "./protocol/workspaces.js"; import type { GlobalSkillDocumentResponse, GlobalSkillFileListResponse, GlobalSkillListResponse, GlobalSkillResponse, SkillPageQuery, UpdateGlobalSkillRequest } from "./protocol/skills.js"; import { type HappyAgentUpdate, type HappyAgentUpdatesOptions } from "./updates.js"; /** What the client needs to reach a daemon. */ export interface HappyAgentClientOptions { /** * Where the daemon answers. * * The daemon serves HTTP over a Unix domain socket and ignores the `Host` * header, so the authority is whatever the transport needs; only the path * and query matter. A path prefix here is preserved and every route is * resolved beneath it. */ endpoint: string | URL; /** The bearer token; every route, health included, requires one. */ token: string; /** * The `fetch` to make requests with. Defaults to the global one. * * A caller reaching a Unix socket supplies its own runtime's `fetch` here; * nothing else in this package knows how the bytes travel. */ fetch?: typeof globalThis.fetch; } /** * A thin, faithful client for the Happy agent HTTP API. * * Every request-response route of `packages/happy-agent/API.md` is one method, * and the event journal is available both as pages and as the live stream. The * low-level request and stream methods keep no application state. The * higher-level `updates` feed owns only its accepted event cursor and * connection state so it can resume after transport interruptions. * * It is built on `fetch`, streams, `AbortController`, and standard timers * alone, so one build runs unchanged in Node and in a browser. Nothing is * validated at runtime; the types are a promise about what the specification * says the daemon sends. */ export declare class HappyAgentClient { #private; constructor(options: HappyAgentClientOptions); /** Where this client talks, as it was given. */ get endpoint(): string; /** `GET /v0/connections` — the main daemon's configured remote roster. */ listConnections(options?: RequestOptions): Promise; /** `POST /v0/connections/:id/reorder` — guarded by the complete roster's version. */ reorderConnection(id: string, request: ReorderConnectionRequest, options: VersionedRequestOptions): Promise; /** A separate client for a remote daemon, using the main daemon's authenticated proxy. */ connection(id: string): HappyAgentClient; /** `GET /v0/node/avatar` — authenticated image bytes; `null` when unchanged. */ getNodeAvatar(options?: ConditionalRequestOptions): Promise; /** `GET /` — a greeting confirming the caller reached a Happy agent. */ getGreeting(options?: RequestOptions): Promise; /** * `GET /v0/health` — whether the daemon is alive and ready to serve. * * The only route guaranteed to answer during startup; a client polls it * until `ready` is `true` before using the rest of the API. */ getHealth(options?: RequestOptions): Promise; /** `GET /v0/config` — the sanitized effective configuration. */ getConfig(options?: RequestOptions): Promise; /** * `PATCH /v0/config` — requests a runtime settings change. * * A daemon that cannot reconfigure itself at runtime answers `409`. */ patchConfig(patch: ConfigPatch, options?: RequestOptions): Promise; /** `POST /v0/providers/scan` — runs or joins bounded local credential discovery. */ scanProviders(options?: RequestOptions): Promise; /** `POST /v0/providers/:providerId/verify` — checks credentials, auth, or inference. */ verifyProvider(providerId: string, request: ProviderVerificationRequest, options?: RequestOptions): Promise; /** `GET /v0/config/instructions` — the global instructions document. */ getInstructions(options?: RequestOptions): Promise; /** `PUT /v0/config/instructions` — replaces it; the maximum size is 256 KB. */ putInstructions(instructions: string, options?: RequestOptions): Promise; /** `GET /v0/config/security` — the security policy document. */ getSecurityPolicy(options?: RequestOptions): Promise; /** `PUT /v0/config/security` — replaces it; the maximum size is 32 KB. */ putSecurityPolicy(policy: string, options?: RequestOptions): Promise; /** `POST /v0/drain` — permanently enters this daemon process's read-only drain mode. */ drain(options?: RequestOptions): Promise; /** `POST /v0/shutdown` — asks the daemon to shut down; it answers first. */ shutdown(options?: RequestOptions): Promise; /** `POST /v0/debug/inspector` — starts the Node.js inspector on the daemon. */ startInspector(options?: RequestOptions): Promise; /** `DELETE /v0/debug/inspector` — stops it. */ stopInspector(options?: RequestOptions): Promise; /** `GET /v0/cloud` — current Happy Cloud authentication state. */ getCloud(options?: RequestOptions): Promise; /** `POST /v0/cloud/auth/start` — starts or joins WorkOS PKCE authorization. */ startCloudAuthorization(request: StartCloudAuthorizationRequest, options?: RequestOptions): Promise; /** `POST /v0/cloud/auth/complete` — exchanges and verifies the WorkOS callback. */ completeCloudAuthorization(request: CompleteCloudAuthorizationRequest, options?: RequestOptions): Promise; /** `DELETE /v0/cloud/auth` — removes daemon-owned Cloud credentials. */ disconnectCloud(request?: CloudMutationRequest, options?: RequestOptions): Promise; /** `POST /v0/cloud/access-token` — refreshes, verifies, and returns one access token. */ mintCloudAccessToken(request?: CloudMutationRequest, options?: RequestOptions): Promise; /** `GET /v0/cloud/organizations` — lists the connected user's WorkOS organizations. */ listCloudOrganizations(options?: RequestOptions): Promise; /** `POST /v0/cloud/organizations` — creates a WorkOS organization for the Cloud user. */ createCloudOrganization(request: CreateCloudOrganizationRequest, options?: RequestOptions): Promise; /** `DELETE /v0/cloud/organizations/:id` — deletes an administered organization. */ deleteCloudOrganization(organizationId: string, request?: CloudMutationRequest, options?: RequestOptions): Promise; /** `GET /v0/integrations/happy` — current Happy mobile connection state. */ getHappyIntegration(options?: RequestOptions): Promise; /** `POST /v0/integrations/happy/start` — starts or joins pairing or connection. */ startHappyIntegration(options?: RequestOptions): Promise; /** `POST /v0/integrations/happy/cancel` — cancels active pairing. */ cancelHappyIntegration(options?: RequestOptions): Promise; /** `DELETE /v0/integrations/happy` — unlinks this daemon from Happy. */ disconnectHappyIntegration(options?: RequestOptions): Promise; /** `POST /v0/integrations/happy/re-pair` — unlinks and starts fresh pairing. */ rePairHappyIntegration(options?: RequestOptions): Promise; /** `GET /v0/secrets` — global safe metadata, optionally for one direct target. */ listSecrets(query?: SecretListQuery, options?: RequestOptions): Promise; /** `GET /v0/secrets/:secretId` — safe metadata only. */ getSecret(secretId: Cuid2, options?: RequestOptions): Promise; /** `POST /v0/secrets` — stores a write-only environment bundle without attaching it. */ createSecret(request: CreateSecretRequest, options?: RequestOptions): Promise; /** `PATCH /v0/secrets/:secretId` — updates metadata or write-only values. */ updateSecret(secretId: Cuid2, request: UpdateSecretRequest, options: VersionedRequestOptions): Promise; /** `GET /v0/secrets/:secretId/attachments` — direct grants only. */ listSecretAttachments(secretId: Cuid2, query?: SecretAttachmentListQuery, options?: RequestOptions): Promise; /** Attaches one secret directly to a project, workspace, or exact agent. */ attachSecret(secretId: Cuid2, target: SecretAttachmentTarget, request?: SecretAttachmentMutationRequest, options?: RequestOptions): Promise; /** Detaches one exact direct grant; inherited access is unaffected. */ detachSecret(secretId: Cuid2, target: SecretAttachmentTarget, request?: SecretAttachmentMutationRequest, options?: RequestOptions): Promise; /** `GET /v0/skills` — installed global skills, including disabled and broken records. */ listGlobalSkills(query?: SkillPageQuery, options?: RequestOptions): Promise; /** `GET /v0/skills/:skillId` — the summary, original document, and parsed Markdown body. */ getGlobalSkill(skillId: Cuid2, options?: RequestOptions): Promise; /** `PATCH /v0/skills/:skillId` — enable or disable without modifying installed files. */ updateGlobalSkill(skillId: Cuid2, request: UpdateGlobalSkillRequest, options: VersionedRequestOptions): Promise; /** `GET /v0/skills/:skillId/files` — one version-bound page of supporting files. */ listGlobalSkillFiles(skillId: Cuid2, query?: SkillPageQuery, options?: RequestOptions): Promise; /** `GET /v0/skills/:skillId/file` — original file bytes, including for disabled skills. */ readGlobalSkillFile(skillId: Cuid2, path: string, options?: RequestOptions): Promise; /** `GET /v0/users` — resolve up to 100 local team user IDs to public display information. */ getUsers(ids: readonly Cuid2[], options?: RequestOptions): Promise; /** `GET /v0/profile` — always succeeds; an untouched profile is all `null`. */ getProfile(options?: RequestOptions): Promise; /** `PATCH /v0/profile` — a partial update; a field set to `null` is cleared. */ updateProfile(request: ProfileUpdateRequest, options: VersionedRequestOptions): Promise; /** `GET /v0/profile/photo` — the photo bytes; `null` when unchanged. */ getProfilePhoto(options?: ConditionalRequestOptions): Promise; /** `PUT /v0/profile/photo` — the daemon computes the ThumbHash. */ setProfilePhoto(image: ImageUpload, options?: OptionallyVersionedRequestOptions): Promise; /** `DELETE /v0/profile/photo` */ deleteProfilePhoto(options?: OptionallyVersionedRequestOptions): Promise; /** `GET /v0/onboarding` — what a fresh installation still needs. */ getOnboarding(options?: RequestOptions): Promise; /** `POST /v0/onboarding/complete` — idempotent. */ completeOnboarding(options?: RequestOptions): Promise; /** `GET /v0/projects` — every project, archived ones included. */ listProjects(options?: RequestOptions): Promise; /** `POST /v0/projects` — registers an existing local folder. */ registerProject(request: RegisterProjectRequest, options?: RequestOptions): Promise; /** `POST /v0/projects/clone` — the clone itself runs in the background. */ cloneProject(request: CloneProjectRequest, options?: RequestOptions): Promise; /** `GET /v0/projects/:projectId` */ getProject(projectId: Cuid2, options?: RequestOptions): Promise; /** `PATCH /v0/projects/:projectId` — renames it; `nameSource` becomes `"user"`. */ renameProject(projectId: Cuid2, request: RenameProjectRequest, options: VersionedRequestOptions): Promise; /** `PUT /v0/projects/:projectId/settings` — replaces the settings. */ replaceProjectSettings(projectId: Cuid2, request: ReplaceProjectSettingsRequest, options: VersionedRequestOptions): Promise; /** `POST /v0/projects/:projectId/refresh` — re-runs project setup. */ refreshProject(projectId: Cuid2, options?: RequestOptions): Promise; /** `POST /v0/projects/:projectId/reorder` — neighbours move through events. */ reorderProject(projectId: Cuid2, request: ReorderProjectRequest, options: VersionedRequestOptions): Promise; /** `POST /v0/projects/:projectId/archive` — idempotent; cleanup is background work. */ archiveProject(projectId: Cuid2, options: VersionedRequestOptions & ArchiveProjectRequest): Promise; /** `GET /v0/projects/:projectId/avatar` — the picture bytes; `null` when unchanged. */ getProjectAvatar(projectId: Cuid2, options?: ConditionalRequestOptions): Promise; /** `PUT /v0/projects/:projectId/avatar` — the limit is 8 MB. */ setProjectAvatar(projectId: Cuid2, image: ImageUpload, options: VersionedRequestOptions): Promise; /** `DELETE /v0/projects/:projectId/avatar` */ deleteProjectAvatar(projectId: Cuid2, options: VersionedRequestOptions): Promise; /** `GET /v0/workspaces` — a flat array; clients build the tree from `parentId`. */ listWorkspaces(query?: ListWorkspacesQuery, options?: RequestOptions): Promise; /** `POST /v0/workspaces` — the checkout builds in the background. */ createWorkspace(request: CreateWorkspaceRequest, options?: RequestOptions): Promise; /** `GET /v0/workspaces/:workspaceId` — a project ID answers with its root workspace. */ getWorkspace(workspaceId: Cuid2, options?: RequestOptions): Promise; /** `PATCH /v0/workspaces/:workspaceId` — the Git branch moves in the background. */ renameWorkspace(workspaceId: Cuid2, request: RenameWorkspaceRequest, options: VersionedRequestOptions): Promise; /** `POST /v0/workspaces/:workspaceId/archive` — archives it and everything beneath. */ archiveWorkspace(workspaceId: Cuid2, options: VersionedRequestOptions & ArchiveWorkspaceRequest): Promise; /** `POST /v0/workspaces/:workspaceId/reorder` — moves it among its siblings. */ reorderWorkspace(workspaceId: Cuid2, request: ReorderWorkspaceRequest, options: VersionedRequestOptions): Promise; /** `GET /v0/bots` — every bot, archived ones included. */ listBots(options?: RequestOptions): Promise; /** `POST /v0/bots` — creates the bot, its dedicated workspace, and its one agent. */ createBot(request: CreateBotRequest, options?: RequestOptions): Promise; /** `GET /v0/bots/:botId` */ getBot(botId: Cuid2, options?: RequestOptions): Promise; /** `PATCH /v0/bots/:botId` — renames the display name; the username is immutable. */ renameBot(botId: Cuid2, request: RenameBotRequest, options: VersionedRequestOptions): Promise; /** `POST /v0/bots/:botId/archive` — idempotent; the folder stays on disk. */ archiveBot(botId: Cuid2, options: VersionedRequestOptions & ArchiveBotRequest): Promise; /** `POST /v0/bots/:botId/unarchive` — restores the workspace and agent. */ unarchiveBot(botId: Cuid2, options: VersionedRequestOptions & UnarchiveBotRequest): Promise; /** `POST /v0/bots/:botId/reorder` — moves it in the bot catalog. */ reorderBot(botId: Cuid2, request: ReorderBotRequest, options: VersionedRequestOptions): Promise; /** `GET /v0/bots/:botId/avatar` — the picture bytes; `null` when unchanged. */ getBotAvatar(botId: Cuid2, options?: ConditionalRequestOptions): Promise; /** `PUT /v0/bots/:botId/avatar` — the limit is 8 MB. */ setBotAvatar(botId: Cuid2, image: ImageUpload, options: VersionedRequestOptions): Promise; /** `DELETE /v0/bots/:botId/avatar` */ deleteBotAvatar(botId: Cuid2, options: VersionedRequestOptions): Promise; /** `GET /v0/workspaces/:workspaceId/terminals` */ listTerminals(workspaceId: Cuid2, options?: RequestOptions): Promise; /** `POST /v0/workspaces/:workspaceId/terminals` — a workspace holds at most 32. */ openTerminal(workspaceId: Cuid2, request?: OpenTerminalRequest, options?: RequestOptions): Promise; /** `PATCH /v0/workspaces/:workspaceId/terminals/:terminalId` */ resizeTerminal(workspaceId: Cuid2, terminalId: Cuid2, request: ResizeTerminalRequest, options?: RequestOptions): Promise; /** `DELETE /v0/workspaces/:workspaceId/terminals/:terminalId` — stops it and its process. */ stopTerminal(workspaceId: Cuid2, terminalId: Cuid2, options?: RequestOptions): Promise; /** * The URL of `GET /v0/workspaces/:workspaceId/terminals/:terminalId/attach`. * * The attachment is a WebSocket upgrade carrying binary terminal frames, * which `fetch` cannot open. This client hands back the address so a caller * can attach with whatever WebSocket its runtime provides; the bearer token * goes on that request the same way it does here. */ terminalAttachUrl(workspaceId: Cuid2, terminalId: Cuid2): string; /** * The URL of `CONNECT /v0/workspaces/:workspaceId/proxy`. * * The tunnel is a raw byte stream that `fetch` cannot open either, so the * address is what this client offers. */ workspaceProxyUrl(workspaceId: Cuid2): string; /** `GET /v0/workspaces/:workspaceId/services`. Unavailable is not an empty list. */ listWorkspaceServices(workspaceId: Cuid2, query?: WorkspaceServiceListQuery, options?: RequestOptions): Promise; /** `GET /v0/workspaces/:workspaceId/services/:serviceId`. */ getWorkspaceService(workspaceId: Cuid2, serviceId: Cuid2, options?: RequestOptions): Promise; /** Empty chars reads; non-empty chars writes then reads. Never automatically replay input. */ inputWorkspaceService(workspaceId: Cuid2, serviceId: Cuid2, request: WorkspaceServiceInputRequest, options?: RequestOptions): Promise; /** Stops the runtime, not its record. A stopping response is not proof of termination. */ stopWorkspaceService(workspaceId: Cuid2, serviceId: Cuid2, request?: StopWorkspaceServiceRequest, options?: RequestOptions): Promise; /** Issues a short-lived credential for existing permission; does not create a sharing grant. */ issueWorkspaceServiceAccessToken(workspaceId: Cuid2, serviceId: Cuid2, options?: RequestOptions): Promise; /** * Address of the fixed-service CONNECT tunnel. Fetch cannot open this attachment. * Send ordinary API authentication and X-Happy-Service-Authorization separately; * neither credential belongs in the URL or in the application request stream. */ workspaceServiceProxyUrl(workspaceId: Cuid2, serviceId: Cuid2): string; /** `GET /v0/workspaces/:workspaceId/files` — ranked fuzzy workspace-file search. */ searchFiles(workspaceId: Cuid2, query: FileSearchQuery, options?: RequestOptions): Promise; /** `GET /v0/workspaces/:workspaceId/file-tree` — one directory level, paginated. */ getFileTree(workspaceId: Cuid2, query?: FileTreeQuery, options?: RequestOptions): Promise; /** `GET /v0/workspaces/:workspaceId/file` — base64 content and its sha256. */ readFile(workspaceId: Cuid2, path: string, options?: RequestOptions): Promise; /** `PUT /v0/workspaces/:workspaceId/file` — `expectedHash` is the compare-and-swap. */ writeFile(workspaceId: Cuid2, request: WriteFileRequest, options?: RequestOptions): Promise; /** `GET /v0/workspaces/:workspaceId/file-revision` — one file as of a revision. */ readFileRevision(workspaceId: Cuid2, query: FileRevisionQuery, options?: RequestOptions): Promise; /** `GET /v0/workspaces/:workspaceId/git` — scans if nothing fresh is cached. */ getWorkspaceGit(workspaceId: Cuid2, options?: RequestOptions): Promise; /** * `POST /v0/git/watch` — subscribes workspaces to the live git watcher. * * Registrations are held per subscription set: a client re-posts its * current interest, and workspaces it stops naming age out of the watcher. */ watchGit(request: WatchGitRequest, options?: RequestOptions): Promise; /** `POST /v0/agents` — creates a parentless, user-controlled workspace root. */ createAgent(request: CreateAgentRequest, options?: RequestOptions): Promise; /** `GET /v0/agents/:agentId` */ getAgent(agentId: Cuid2, options?: RequestOptions): Promise; /** `GET /v0/agents/:agentId/mode` — the last submitted message mode. */ getAgentMode(agentId: Cuid2, options?: RequestOptions): Promise; /** `GET /v0/agents/:agentId/bootstrap` — current agent state, activity, and cursor. */ getAgentBootstrap(agentId: Cuid2, options?: RequestOptions): Promise; /** * `POST /v0/agents/:agentId/send` — queues a message, or steers the run. * * The message is pending until inference accepts it; the acceptance travels * inside a `run.started` or `run.boundary` event, and the `runId` it brings * is the handle for `abortAgent`. */ sendMessage(agentId: Cuid2, request: SendMessageRequest, options?: RequestOptions): Promise; /** * `GET /v0/agents/:agentId/messages` — history, grouped by run. * * `limit` is a lower bound: a page always contains whole runs and may * overflow well past it, so buffers are sized for the runs received. */ getMessages(agentId: Cuid2, query?: MessageHistoryQuery, options?: RequestOptions): Promise; /** `GET /v0/agents/:agentId/question` — the open question, or `null`. */ getPendingQuestion(agentId: Cuid2, options?: RequestOptions): Promise; /** * `POST /v0/agents/:agentId/question/:questionId/answer` — the run resumes. * * Answering is first-write-wins across clients: a second answer is `409` * carrying the question as it now stands. */ answerQuestion(agentId: Cuid2, questionId: Cuid2, request: AnswerQuestionRequest, options?: RequestOptions): Promise; /** `POST /v0/agents/:agentId/abort` — immediately aborts this and every descendant run. */ abortAgent(agentId: Cuid2, request?: AbortAgentRequest, options?: RequestOptions): Promise; /** `POST /v0/agents/:agentId/compact` — summarizes older context for the model. */ compactAgent(agentId: Cuid2, request?: MutationOnlyRequest, options?: RequestOptions): Promise; /** The slash command's image bytes; `null` when the caller's `ETag` is still current. */ getSlashCommandImage(agentId: Cuid2, name: string, options?: ConditionalRequestOptions): Promise; /** Invoke a slash command directly on the agent module that contributed it. */ invokeSlashCommand(agentId: Cuid2, name: string, request: InvokeSlashCommandRequest, options?: RequestOptions): Promise; /** `POST /v0/agents/:agentId/read` — clears `unread`. */ markAgentRead(agentId: Cuid2, request?: MutationOnlyRequest, options?: RequestOptions): Promise; /** `POST /v0/agents/:agentId/archive` — keeps the history; aborts a running turn. */ archiveAgent(agentId: Cuid2, request?: MutationOnlyRequest, options?: RequestOptions): Promise; /** `POST /v0/agents/:agentId/unarchive` — idempotent. */ unarchiveAgent(agentId: Cuid2, request?: MutationOnlyRequest, options?: RequestOptions): Promise; /** `POST /v0/agents/:agentId/reorder` — moves the agent in the list order. */ reorderAgent(agentId: Cuid2, request: ReorderAgentRequest, options?: RequestOptions): Promise; /** `PUT /v0/agents/:agentId/draft` — saves or clears the composer draft. */ saveAgentDraft(agentId: Cuid2, request: SaveAgentDraftRequest, options?: RequestOptions): Promise; /** `GET /v0/agents/:agentId/draft` — current composer state and LWW timestamp. */ getAgentDraft(agentId: Cuid2, options?: RequestOptions): Promise; /** `GET /v0/agents/:agentId/usage` — the agent's whole life, subagents included. */ getAgentUsage(agentId: Cuid2, options?: RequestOptions): Promise; /** `GET /v0/agents/:agentId/activity` — every subagent and process it set in motion. */ getAgentActivity(agentId: Cuid2, options?: RequestOptions): Promise; /** `DELETE /v0/agents/:agentId/processes/:processId` — stops a running process. */ stopProcess(agentId: Cuid2, processId: Cuid2, options?: RequestOptions): Promise; /** `GET /v0/usage` — the whole daemon, in rolling windows ending now. */ getUsage(options?: RequestOptions): Promise; /** * `GET /v0/events` — pulls events, oldest first. * * A cursor that fell out of the bounded journal answers `409` with code * `cursor_unavailable`, carrying the cursor to resync from. */ getEvents(query?: EventPageQuery, options?: RequestOptions): Promise; /** * `GET /v0/events/stream` — the same journal, live. * * The iteration yields the opening `hello` frame and then every event, and * ends when the daemon closes the stream or the signal aborts. One * connection is one iteration: reconnecting is the caller's decision, made * with the last cursor it received and honored through `after` or * `lastEventId`. */ streamEvents(options?: EventStreamOptions): AsyncGenerator; /** * Follows daemon updates across connection failures. * * Events are yielded in strictly increasing cursor order. Duplicate and * older events are ignored, reconnects resume after the last accepted * cursor with exponential backoff, and connection, interruption, and * recoverable journal-gap transitions are visible in the same ordered * iteration. */ updates(options?: HappyAgentUpdatesOptions): AsyncGenerator; /** * `GET /v0/bootstrap/desktop` — one request that gets a client on screen. * * The `cursor` it carries is the newest event as of the snapshot, so a * stream opened from it leaves no window for a change to fall through. */ getDesktopBootstrap(options?: RequestOptions): Promise; } //# sourceMappingURL=HappyAgentClient.d.ts.map