@hypercli.com/sdk 2026.6.26 → 2026.8.11

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.
Files changed (106) hide show
  1. package/README.md +181 -1
  2. package/dist/agent-slots.d.ts +17 -0
  3. package/dist/agent-slots.d.ts.map +1 -0
  4. package/dist/agent-slots.js +18 -0
  5. package/dist/agent-slots.js.map +1 -0
  6. package/dist/agent.d.ts +67 -12
  7. package/dist/agent.d.ts.map +1 -1
  8. package/dist/agent.js +220 -28
  9. package/dist/agent.js.map +1 -1
  10. package/dist/agents.d.ts +690 -82
  11. package/dist/agents.d.ts.map +1 -1
  12. package/dist/agents.js +2595 -225
  13. package/dist/agents.js.map +1 -1
  14. package/dist/browser.d.ts +4 -2
  15. package/dist/browser.d.ts.map +1 -1
  16. package/dist/browser.js +10 -3
  17. package/dist/browser.js.map +1 -1
  18. package/dist/channels.d.ts +156 -0
  19. package/dist/channels.d.ts.map +1 -0
  20. package/dist/channels.js +110 -0
  21. package/dist/channels.js.map +1 -0
  22. package/dist/client.d.ts +2 -0
  23. package/dist/client.d.ts.map +1 -1
  24. package/dist/client.js +14 -4
  25. package/dist/client.js.map +1 -1
  26. package/dist/config.d.ts +1 -1
  27. package/dist/config.js +2 -2
  28. package/dist/config.js.map +1 -1
  29. package/dist/connectors.d.ts +79 -0
  30. package/dist/connectors.d.ts.map +1 -0
  31. package/dist/connectors.js +2 -0
  32. package/dist/connectors.js.map +1 -0
  33. package/dist/errors.d.ts +4 -1
  34. package/dist/errors.d.ts.map +1 -1
  35. package/dist/errors.js +9 -2
  36. package/dist/errors.js.map +1 -1
  37. package/dist/hermes/gateway.d.ts +194 -0
  38. package/dist/hermes/gateway.d.ts.map +1 -0
  39. package/dist/hermes/gateway.js +209 -0
  40. package/dist/hermes/gateway.js.map +1 -0
  41. package/dist/http.d.ts +16 -3
  42. package/dist/http.d.ts.map +1 -1
  43. package/dist/http.js +196 -63
  44. package/dist/http.js.map +1 -1
  45. package/dist/index.d.ts +15 -5
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +13 -4
  48. package/dist/index.js.map +1 -1
  49. package/dist/job/base.d.ts +6 -0
  50. package/dist/job/base.d.ts.map +1 -1
  51. package/dist/job/base.js +7 -1
  52. package/dist/job/base.js.map +1 -1
  53. package/dist/keys.d.ts +21 -5
  54. package/dist/keys.d.ts.map +1 -1
  55. package/dist/keys.js +62 -3
  56. package/dist/keys.js.map +1 -1
  57. package/dist/openclaw/channels.d.ts +86 -0
  58. package/dist/openclaw/channels.d.ts.map +1 -0
  59. package/dist/openclaw/channels.js +290 -0
  60. package/dist/openclaw/channels.js.map +1 -0
  61. package/dist/openclaw/connectors.d.ts +61 -0
  62. package/dist/openclaw/connectors.d.ts.map +1 -0
  63. package/dist/openclaw/connectors.js +174 -0
  64. package/dist/openclaw/connectors.js.map +1 -0
  65. package/dist/openclaw/gateway.d.ts +682 -16
  66. package/dist/openclaw/gateway.d.ts.map +1 -1
  67. package/dist/openclaw/gateway.js +1794 -187
  68. package/dist/openclaw/gateway.js.map +1 -1
  69. package/dist/openclaw/skills.d.ts +106 -0
  70. package/dist/openclaw/skills.d.ts.map +1 -0
  71. package/dist/openclaw/skills.js +575 -0
  72. package/dist/openclaw/skills.js.map +1 -0
  73. package/dist/openclaw/slack.d.ts +818 -0
  74. package/dist/openclaw/slack.d.ts.map +1 -0
  75. package/dist/openclaw/slack.js +536 -0
  76. package/dist/openclaw/slack.js.map +1 -0
  77. package/dist/openclaw/whatsapp.d.ts +63 -0
  78. package/dist/openclaw/whatsapp.d.ts.map +1 -0
  79. package/dist/openclaw/whatsapp.js +264 -0
  80. package/dist/openclaw/whatsapp.js.map +1 -0
  81. package/dist/renders.js +11 -11
  82. package/dist/renders.js.map +1 -1
  83. package/dist/skills.d.ts +126 -0
  84. package/dist/skills.d.ts.map +1 -0
  85. package/dist/skills.js +2 -0
  86. package/dist/skills.js.map +1 -0
  87. package/dist/user.d.ts +15 -2
  88. package/dist/user.d.ts.map +1 -1
  89. package/dist/user.js +51 -4
  90. package/dist/user.js.map +1 -1
  91. package/dist/voice-session.d.ts +74 -0
  92. package/dist/voice-session.d.ts.map +1 -0
  93. package/dist/voice-session.js +255 -0
  94. package/dist/voice-session.js.map +1 -0
  95. package/dist/voice.d.ts +27 -3
  96. package/dist/voice.d.ts.map +1 -1
  97. package/dist/voice.js +89 -6
  98. package/dist/voice.js.map +1 -1
  99. package/dist/workspaces.d.ts +181 -0
  100. package/dist/workspaces.d.ts.map +1 -0
  101. package/dist/workspaces.js +495 -0
  102. package/dist/workspaces.js.map +1 -0
  103. package/dist/x402.d.ts.map +1 -1
  104. package/dist/x402.js +1 -2
  105. package/dist/x402.js.map +1 -1
  106. package/package.json +42 -2
package/dist/agents.d.ts CHANGED
@@ -1,7 +1,32 @@
1
- import { HTTPClient } from './http.js';
2
- import { GatewayClient, type ChatAttachment, type ChatEvent, type GatewayIntegrationAuthStartParams, type GatewayIntegrationAuthStartResult, type GatewayIntegrationAuthStatusParams, type GatewayIntegrationAuthStatusResult, type GatewayIntegrationDisconnectParams, type GatewayIntegrationDisconnectResult, type GatewayIntegrationStatusParams, type GatewayIntegrationStatusResult, type GatewayOptions, type GatewayWaitReadyOptions, type OpenClawConfigSchemaResponse } from './openclaw/gateway.js';
3
- export declare const DEFAULT_OPENCLAW_IMAGE = "ghcr.io/hypercli/hypercli-openclaw:prod";
4
- export declare const DEFAULT_OPENCLAW_PRO_IMAGE = "ghcr.io/hypercli/hypercli-openclaw:pro-prod";
1
+ import { type AgentSlot, type AgentSlotInventory } from './agent-slots.js';
2
+ export { agentSlotFromDict, type AgentSlot, type AgentSlotInventory, type AgentSlotSize, } from './agent-slots.js';
3
+ import { HTTPClient, type RequestOverrides } from './http.js';
4
+ import { GatewayClient, type ChatAttachment, type ChatEvent, type GatewayIntegrationAuthStartParams, type GatewayIntegrationAuthStartResult, type GatewayIntegrationAuthStatusParams, type GatewayIntegrationAuthStatusResult, type GatewayIntegrationDisconnectParams, type GatewayIntegrationDisconnectResult, type GatewayIntegrationStatusParams, type GatewayIntegrationStatusResult, type GatewayOptions, type GatewaySessionsListResult, type GatewayWebLoginStartOptions, type GatewayWebLoginStartResult, type GatewayWebLoginWaitOptions, type GatewayWebLoginWaitResult, type GatewayWaitReadyOptions, type OpenClawConfigSchemaResponse, type OpenClawSlackRelayOptions } from './openclaw/gateway.js';
5
+ import type { OpenClawTelegramConfigPatch, OpenClawWhatsAppConfigPatch } from './openclaw/channels.js';
6
+ import type { OpenClawSlackHttpConfiguration, OpenClawSlackRelayConfiguration, OpenClawSlackSocketConfiguration } from './openclaw/slack.js';
7
+ import { HermesApiClient } from './hermes/gateway.js';
8
+ export declare const DEFAULT_OPENCLAW_IMAGE = "ghcr.io/hypercli/hypercli-openclaw:pro-latest";
9
+ export declare const DEFAULT_OPENCLAW_PRO_IMAGE = "ghcr.io/hypercli/hypercli-openclaw:pro-latest";
10
+ export declare const DEFAULT_HERMES_AGENT_IMAGE = "ghcr.io/hypercli/hypercli-hermes-agent:latest";
11
+ export declare const DEFAULT_OPENCODE_IMAGE = "ghcr.io/hypercli/hypercli-opencode:latest";
12
+ export declare const DEFAULT_CODEX_IMAGE = "ghcr.io/hypercli/hypercli-codex:latest";
13
+ export declare const DEFAULT_CLAUDE_CODE_IMAGE = "ghcr.io/hypercli/hypercli-claude-code:latest";
14
+ export declare const DEFAULT_GOOSE_IMAGE = "ghcr.io/hypercli/hypercli-goose:latest";
15
+ export declare const DEFAULT_KIMI_CODE_IMAGE = "ghcr.io/hypercli/hypercli-kimi-code:latest";
16
+ export declare const DEFAULT_BUZZ_AGENT_IMAGE = "ghcr.io/hypercli/hypercli-buzz-agent:latest";
17
+ export declare const DEFAULT_BUZZ_OPENCODE_IMAGE = "ghcr.io/hypercli/hypercli-buzz-opencode:latest";
18
+ export declare const DEFAULT_BUZZ_CODEX_IMAGE = "ghcr.io/hypercli/hypercli-buzz-codex:latest";
19
+ export declare const DEFAULT_BUZZ_CLAUDE_CODE_IMAGE = "ghcr.io/hypercli/hypercli-buzz-claude:latest";
20
+ export declare const DEFAULT_BUZZ_GOOSE_IMAGE = "ghcr.io/hypercli/hypercli-buzz-goose:latest";
21
+ export declare const DEFAULT_BUZZ_KIMI_CODE_IMAGE = "ghcr.io/hypercli/hypercli-buzz-kimi-code:latest";
22
+ export declare const DEFAULT_AGENT_RUNTIME_SCOPES: readonly string[];
23
+ export declare const DEFAULT_CODING_AGENT_SYNC_ROOT = "/home/node";
24
+ export type ManagedAgentRuntime = 'generic' | 'openclaw' | 'openclaw-pro' | 'hermes-agent' | 'buzz-agent' | 'opencode' | 'codex' | 'claude-code' | 'goose' | 'kimi-code';
25
+ export type CodingAgentRuntime = Extract<ManagedAgentRuntime, 'buzz-agent' | 'opencode' | 'codex' | 'claude-code' | 'goose' | 'kimi-code'>;
26
+ export declare const DEFAULT_CODING_AGENT_IMAGES: Readonly<Record<CodingAgentRuntime, string>>;
27
+ export declare const DEFAULT_CODING_AGENT_SYNC_INCLUDES: Readonly<Record<CodingAgentRuntime, readonly string[]>>;
28
+ export declare const DEFAULT_BUZZ_CODING_AGENT_IMAGES: Readonly<Record<CodingAgentRuntime, string>>;
29
+ export declare const DEFAULT_BUZZ_RUST_LOG = "buzz_acp=info,pool::prompt=info,acp::stream=off";
5
30
  export declare const OPENCLAW_MEMORY_SEARCH_ENV_DEFAULTS: {
6
31
  readonly OPENCLAW_MEMORY_SEARCH_ENABLED: "1";
7
32
  readonly OPENCLAW_MEMORY_SEARCH_SYNC_ON_SESSION_START: "0";
@@ -10,6 +35,14 @@ export declare const OPENCLAW_MEMORY_SEARCH_ENV_DEFAULTS: {
10
35
  readonly OPENCLAW_MEMORY_SEARCH_SYNC_WATCH_DEBOUNCE_MS: "30000";
11
36
  readonly OPENCLAW_MEMORY_SEARCH_SYNC_INTERVAL_MINUTES: "0";
12
37
  };
38
+ export declare const OPENCLAW_WORKSPACES_SYNC_ENV_DEFAULTS: {
39
+ readonly HYPER_WORKSPACES_BOOT_SYNC: "1";
40
+ readonly HYPER_WORKSPACES_DIR: "/home/node/shared";
41
+ readonly HYPER_WORKSPACES_SYNC_READY_ONLY: "1";
42
+ };
43
+ export declare const DEFAULT_HERMES_AGENT_SYNC_ROOT = "/opt/data";
44
+ export declare const DEFAULT_HERMES_AGENT_SYNC_UID = 10000;
45
+ export declare const DEFAULT_HERMES_AGENT_SYNC_GID = 10000;
13
46
  export declare const AGENT_FILE_MAX_BYTES: number;
14
47
  export declare const AGENT_FILE_TRANSFER_CHUNK_BYTES: number;
15
48
  export declare const AGENT_FILE_OPERATION_TIMEOUT_MS = 300000;
@@ -20,19 +53,46 @@ export interface AgentExecResult {
20
53
  }
21
54
  export interface AgentTokenResponse {
22
55
  agent_id?: string;
23
- pod_id?: string;
24
56
  token?: string;
25
57
  jwt?: string;
26
58
  expires_at?: string | null;
27
59
  }
60
+ export interface BrowserDesktopUrlOptions {
61
+ redirect?: string | null;
62
+ resize?: string | null;
63
+ }
28
64
  export interface AgentGatewayContext {
29
- agent_id?: string;
30
- hostname?: string | null;
31
- gateway_token?: string | null;
65
+ agent_id: string;
66
+ gateway_url: string;
67
+ gateway_token: string;
68
+ launch_epoch: number;
69
+ }
70
+ export interface AgentEnvResponse {
71
+ agent_id: string;
72
+ env: Record<string, string>;
73
+ launch_epoch: number;
74
+ }
75
+ export interface AgentSecretNamesResponse {
76
+ agent_id: string;
77
+ names: string[];
78
+ launch_epoch: number;
79
+ }
80
+ export interface AgentSecretResponse {
81
+ agent_id: string;
82
+ key: string;
83
+ value: string;
84
+ launch_epoch: number;
32
85
  }
33
86
  export interface GatewayContextWaitOptions {
34
87
  timeoutMs?: number;
35
88
  retryIntervalMs?: number;
89
+ signal?: AbortSignal;
90
+ }
91
+ export interface OpenClawOperationsSnapshot {
92
+ sessions: GatewaySessionsListResult | null;
93
+ cronJobs: any[] | null;
94
+ failures: Partial<Record<'sessions' | 'cron', string>>;
95
+ capturedAt: number;
36
96
  }
37
97
  export interface AgentShellTokenResponse {
38
98
  agent_id?: string;
@@ -42,12 +102,144 @@ export interface AgentShellTokenResponse {
42
102
  shell?: string | null;
43
103
  dry_run?: boolean;
44
104
  }
105
+ export interface AgentShellConnectOptions {
106
+ signal?: AbortSignal;
107
+ tokenTimeoutMs?: number;
108
+ openTimeoutMs?: number;
109
+ }
45
110
  export interface AgentLogsTokenResponse {
46
111
  agent_id?: string;
47
112
  jwt: string;
48
113
  expires_at?: string | null;
49
114
  ws_url?: string;
50
115
  }
116
+ export interface AgentRelayKey {
117
+ key_id?: string | null;
118
+ key_name?: string | null;
119
+ tags?: string[];
120
+ api_key?: string | null;
121
+ api_key_preview?: string | null;
122
+ last4?: string | null;
123
+ [key: string]: any;
124
+ }
125
+ export interface AgentProfileImageUploadResult {
126
+ id: string;
127
+ avatar_url: string | null;
128
+ s3_key: string | null;
129
+ }
130
+ export interface BootstrapInferenceMessage {
131
+ role: 'system' | 'user' | 'assistant';
132
+ content: string;
133
+ }
134
+ export interface BootstrapInferenceResponseFormat {
135
+ type: 'text' | 'json_object' | 'json_schema';
136
+ json_schema?: {
137
+ name: string;
138
+ description?: string;
139
+ strict?: boolean;
140
+ schema: Record<string, unknown>;
141
+ };
142
+ }
143
+ export interface BootstrapInferenceResult {
144
+ model: string;
145
+ content: string;
146
+ finish_reason: string | null;
147
+ usage: {
148
+ prompt_tokens: number;
149
+ completion_tokens: number;
150
+ total_tokens: number;
151
+ };
152
+ }
153
+ export interface ListAgentsOptions extends RequestOverrides {
154
+ state?: string | null;
155
+ handle?: string | null;
156
+ name?: string | null;
157
+ query?: string | null;
158
+ includeDeleted?: boolean | null;
159
+ }
160
+ export interface AgentCapacity {
161
+ items: Agent[];
162
+ totalAgents: number;
163
+ maxAgentsPerAccount: number;
164
+ runningAgents: number;
165
+ slots: Record<string, AgentSlotInventory>;
166
+ agentSlots: AgentSlot[];
167
+ pooledTpd: number;
168
+ }
169
+ export interface SlackOAuthStartOptions {
170
+ relayBaseUrl: string;
171
+ token: string;
172
+ }
173
+ export interface SlackOAuthStartResult {
174
+ authorizeUrl: string;
175
+ expiresAt?: string | null;
176
+ }
177
+ export interface SlackInstallStatusOptions {
178
+ relayBaseUrl: string;
179
+ token: string;
180
+ }
181
+ export interface SlackInstallStatus {
182
+ connected: boolean;
183
+ teamId?: string | null;
184
+ teamName?: string | null;
185
+ botUserId?: string | null;
186
+ installerUserId?: string | null;
187
+ updatedAt?: string | null;
188
+ }
189
+ export interface SlackDirectoryOptions {
190
+ relayBaseUrl: string;
191
+ token: string;
192
+ cursor?: string | null;
193
+ limit?: number | null;
194
+ }
195
+ export interface SlackDirectoryConversationsOptions extends SlackDirectoryOptions {
196
+ types?: string | null;
197
+ }
198
+ export interface SlackDirectoryConversation {
199
+ id: string;
200
+ name?: string | null;
201
+ isChannel?: boolean | null;
202
+ isGroup?: boolean | null;
203
+ isIm?: boolean | null;
204
+ isMpim?: boolean | null;
205
+ isMember?: boolean | null;
206
+ isPrivate?: boolean | null;
207
+ }
208
+ export interface SlackDirectoryUser {
209
+ id: string;
210
+ name?: string | null;
211
+ realName?: string | null;
212
+ teamId?: string | null;
213
+ isBot?: boolean | null;
214
+ deleted?: boolean | null;
215
+ }
216
+ export interface SlackDirectoryConversationsResult {
217
+ conversations: SlackDirectoryConversation[];
218
+ nextCursor?: string | null;
219
+ }
220
+ export interface SlackDirectoryUsersResult {
221
+ users: SlackDirectoryUser[];
222
+ nextCursor?: string | null;
223
+ }
224
+ export interface AttachSlackRelayAgentOptions {
225
+ relayBaseUrl: string;
226
+ token: string;
227
+ agentId: string;
228
+ }
229
+ export interface AttachSlackRelayAgentResult {
230
+ connected: boolean;
231
+ agentId: string;
232
+ gatewayId: string;
233
+ config: Record<string, unknown>;
234
+ restartRequired: boolean;
235
+ teamId?: string | null;
236
+ teamName?: string | null;
237
+ botUserId?: string | null;
238
+ }
239
+ export interface AttachDeploymentSlackRelayAgentOptions {
240
+ relayBaseUrl: string;
241
+ token?: string;
242
+ }
51
243
  export interface BraveWebSearchOptions {
52
244
  count?: number;
53
245
  country?: string;
@@ -67,8 +259,17 @@ export interface AgentRouteConfig {
67
259
  port: number;
68
260
  prefix?: string;
69
261
  auth?: boolean;
70
- strip_prefix?: boolean;
71
- [key: string]: any;
262
+ }
263
+ export interface AgentRoutesState {
264
+ agentId: string;
265
+ routes: Record<string, AgentRouteConfig>;
266
+ routeStatuses: Record<string, Record<string, unknown>>;
267
+ }
268
+ export type LaunchConfigFlatMap = Record<string, unknown>;
269
+ export interface AgentDesktopConfigSource {
270
+ launchConfig?: unknown;
271
+ launch_config?: unknown;
272
+ routes?: unknown;
72
273
  }
73
274
  export interface RegistryAuth {
74
275
  username?: string;
@@ -78,21 +279,26 @@ export interface RegistryAuth {
78
279
  }
79
280
  export interface BuildAgentConfigOptions {
80
281
  env?: Record<string, string>;
81
- ports?: Record<string, any>[] | null;
282
+ secrets?: Record<string, string>;
82
283
  routes?: Record<string, AgentRouteConfig> | null;
83
284
  command?: string[] | null;
84
285
  entrypoint?: string[] | null;
85
286
  image?: string | null;
86
287
  syncRoot?: string | null;
87
- syncEnabled?: boolean | null;
288
+ syncInclude?: readonly string[] | null;
289
+ syncExclude?: readonly string[] | null;
88
290
  syncUid?: number | null;
89
291
  syncGid?: number | null;
90
292
  registryUrl?: string | null;
91
293
  registryAuth?: RegistryAuth | null;
294
+ restart?: boolean | null;
295
+ runtimeScopes?: readonly string[] | null;
92
296
  gatewayToken?: string | null;
93
297
  heartbeat?: OpenClawHeartbeatConfig | null;
94
298
  /** Disable to avoid automatically locking browser control UI access to globalThis.location.origin. */
95
299
  controlUiOriginLock?: boolean | null;
300
+ /** Internal launch behavior; coding runtimes do not use the OpenClaw gateway. */
301
+ injectGatewayToken?: boolean;
96
302
  }
97
303
  export interface OpenClawRouteOptions {
98
304
  includeGateway?: boolean;
@@ -104,6 +310,11 @@ export interface OpenClawRouteOptions {
104
310
  gatewayPrefix?: string;
105
311
  desktopPrefix?: string;
106
312
  }
313
+ export interface HermesAgentRouteOptions {
314
+ port?: number;
315
+ auth?: boolean;
316
+ prefix?: string;
317
+ }
107
318
  export interface OpenClawMemoryIndexOptions {
108
319
  enabled?: boolean | null;
109
320
  onSessionStart?: boolean | null;
@@ -112,6 +323,11 @@ export interface OpenClawMemoryIndexOptions {
112
323
  watchDebounceMs?: number | null;
113
324
  intervalMinutes?: number | null;
114
325
  }
326
+ export interface OpenClawWorkspacesSyncOptions {
327
+ enabled?: boolean | null;
328
+ readyOnly?: boolean | null;
329
+ workspace?: string | null;
330
+ }
115
331
  export interface OpenClawHeartbeatConfig {
116
332
  every?: string;
117
333
  model?: string;
@@ -137,7 +353,6 @@ export interface AgentUiAvatarMeta {
137
353
  }
138
354
  export interface AgentUiMeta {
139
355
  avatar?: AgentUiAvatarMeta | null;
140
- [key: string]: any;
141
356
  }
142
357
  export interface AgentMeta {
143
358
  ui?: AgentUiMeta | null;
@@ -193,12 +408,30 @@ export interface OpenClawModelProviderConfig {
193
408
  export type OpenClawModelProviderPatch = Partial<Omit<OpenClawModelProviderConfig, 'baseUrl'>> & Pick<OpenClawModelProviderConfig, 'baseUrl'>;
194
409
  export interface CreateAgentOptions extends BuildAgentConfigOptions {
195
410
  name?: string;
411
+ handle?: string | null;
196
412
  size?: string;
197
413
  config?: Record<string, any>;
198
414
  meta?: AgentMeta | null;
199
415
  tags?: string[];
200
416
  dryRun?: boolean;
201
417
  start?: boolean;
418
+ runtime?: ManagedAgentRuntime;
419
+ }
420
+ export interface CreateExternalAgentOptions {
421
+ name: string;
422
+ displayName?: string | null;
423
+ handle?: string | null;
424
+ runtime?: string;
425
+ status?: string;
426
+ meta?: Record<string, any> | null;
427
+ }
428
+ export interface UpdateExternalAgentOptions {
429
+ name?: string | null;
430
+ displayName?: string | null;
431
+ handle?: string | null;
432
+ runtime?: 'openclaw' | null;
433
+ status?: 'active' | 'inactive' | 'error' | null;
434
+ meta?: Record<string, any> | null;
202
435
  }
203
436
  export interface StartAgentOptions extends BuildAgentConfigOptions {
204
437
  config?: Record<string, any>;
@@ -206,19 +439,79 @@ export interface StartAgentOptions extends BuildAgentConfigOptions {
206
439
  }
207
440
  export interface UpdateAgentOptions {
208
441
  name?: string;
442
+ handle?: string | null;
209
443
  size?: string;
444
+ launchConfig?: Record<string, any> | null;
210
445
  refreshFromLagoon?: boolean;
211
- lastError?: string | null;
446
+ error?: string | null;
212
447
  }
213
448
  export interface OpenClawCreateAgentOptions extends CreateAgentOptions {
214
449
  openClawRoutes?: OpenClawRouteOptions | null;
215
450
  heartbeat?: OpenClawHeartbeatConfig | null;
216
451
  memoryIndex?: OpenClawMemoryIndexOptions | null;
452
+ workspacesSync?: OpenClawWorkspacesSyncOptions | boolean | null;
217
453
  }
218
454
  export interface OpenClawStartAgentOptions extends StartAgentOptions {
219
455
  openClawRoutes?: OpenClawRouteOptions | null;
220
456
  heartbeat?: OpenClawHeartbeatConfig | null;
221
457
  memoryIndex?: OpenClawMemoryIndexOptions | null;
458
+ workspacesSync?: OpenClawWorkspacesSyncOptions | boolean | null;
459
+ }
460
+ export interface HermesAgentCreateOptions extends CreateAgentOptions {
461
+ hermesRoute?: HermesAgentRouteOptions | null;
462
+ /** Explicit inbound Hermes API credential; a fresh 32-byte key is generated when omitted. */
463
+ apiServerKey?: string | null;
464
+ }
465
+ export interface HermesAgentStartOptions extends StartAgentOptions {
466
+ hermesRoute?: HermesAgentRouteOptions | null;
467
+ /** Explicit inbound Hermes API credential; a fresh 32-byte key is generated when omitted. */
468
+ apiServerKey?: string | null;
469
+ }
470
+ export interface CodingAgentCreateOptions extends Omit<CreateAgentOptions, 'runtime' | 'injectGatewayToken'> {
471
+ workspacesSync?: OpenClawWorkspacesSyncOptions | boolean | null;
472
+ /** @deprecated Use the typed `buzz` launch contract. */
473
+ buzzEnabled?: boolean;
474
+ /** Launch Buzz ACP with runtime-specific harness and MCP defaults. */
475
+ buzz?: BuzzLaunchConfig | null;
476
+ }
477
+ export interface BuzzLaunchConfig {
478
+ privateKeyNsec: string;
479
+ relayUrl: string;
480
+ authTag?: string | null;
481
+ systemPrompt?: string | null;
482
+ model?: string | null;
483
+ idleTimeoutSeconds?: number | null;
484
+ maxTurnDurationSeconds?: number | null;
485
+ parallelism?: number;
486
+ respondTo?: string | null;
487
+ respondToAllowlist?: string[];
488
+ displayName?: string | null;
489
+ textMentions?: boolean;
490
+ requireReply?: boolean;
491
+ sessionTitle?: string | null;
492
+ rustLog?: string;
493
+ }
494
+ export interface RuntimeAuthMethod {
495
+ id: string;
496
+ name: string;
497
+ description: string;
498
+ kind: string;
499
+ command: string[];
500
+ metadata: Record<string, unknown>;
501
+ }
502
+ export interface RuntimeAuthStatus {
503
+ authenticated: boolean;
504
+ provider?: string | null;
505
+ account?: string | null;
506
+ method?: string | null;
507
+ detail: Record<string, unknown>;
508
+ }
509
+ export interface RuntimeAuthLoginOptions {
510
+ method?: string;
511
+ provider?: string;
512
+ providerMethod?: string;
513
+ email?: string;
514
+ challengeTimeoutMs?: number;
222
515
  }
223
516
  export interface AgentExecOptions {
224
517
  timeout?: number;
@@ -230,9 +523,92 @@ export interface AgentFileEntry {
230
523
  type: 'file' | 'directory';
231
524
  size?: number;
232
525
  size_formatted?: string;
526
+ mime_type?: string;
527
+ mimeType?: string;
528
+ content_type?: string;
529
+ contentType?: string;
233
530
  last_modified?: string;
531
+ checksum?: string;
532
+ checksum_algorithm?: string;
533
+ checksumAlgorithm?: string;
534
+ hash?: string;
535
+ hash_algorithm?: string;
536
+ hashAlgorithm?: string;
537
+ sha256?: string;
538
+ sha_256?: string;
539
+ md5?: string;
540
+ etag?: string;
541
+ version_id?: string;
542
+ versionId?: string;
543
+ source?: AgentFileSource;
234
544
  [key: string]: any;
235
545
  }
546
+ export interface AgentFileReadOptions {
547
+ maxBytes?: number;
548
+ signal?: AbortSignal;
549
+ }
550
+ export interface AgentFileReadBytesResult {
551
+ content: Uint8Array;
552
+ mimeType?: string;
553
+ }
554
+ /**
555
+ * The three file-access paths for an OpenClaw agent, each with its own root —
556
+ * the SDK owns the roots so a workspace-relative path (e.g. `"AGENTS.md"`) hits
557
+ * the same file on all three:
558
+ * - `agent` — the files API on the agent's live pod filesystem. A
559
+ * workspace-relative path resolves under the workspace, while an
560
+ * absolute `/…` path can be listed/read anywhere on the pod.
561
+ * Writes under the sync root are supported. (wire `source=pod`)
562
+ * - `backup` — the S3 backup of the sync root (`/home/node`); served when the
563
+ * pod is stopped. Scoped to the sync root. (wire `source=s3`)
564
+ * - `gateway`— the operator-WebSocket `agents.files.*` RPC; scoped to the
565
+ * `.openclaw/workspace` (name-addressed; no delete). Works on any
566
+ * gateway, self-hosted included.
567
+ * - `auto` — backend default: the agent while running, else the backup.
568
+ *
569
+ * `pod`/`s3` are accepted as deprecated aliases of `agent`/`backup`.
570
+ */
571
+ export type AgentFileSource = 'auto' | 'agent' | 'backup' | 'gateway' | 'pod' | 's3';
572
+ /** @deprecated Alias of {@link AgentFileSource}; gateway is a base capability now. */
573
+ export type OpenClawFileSource = AgentFileSource;
574
+ /** The backend (non-gateway) file sources — the deployment HTTP files store. */
575
+ export type AgentFileBackendSource = Exclude<AgentFileSource, 'gateway'>;
576
+ /** The value the deployment HTTP API accepts on the wire (`source`/`destination`). */
577
+ export type AgentFileWireSource = 'auto' | 'pod' | 's3';
578
+ /** The agent's sync root and workspace, owned by the SDK so paths are unambiguous. */
579
+ export declare const OPENCLAW_SYNC_ROOT = "/home/node";
580
+ export declare const OPENCLAW_WORKSPACE_PREFIX = ".openclaw/workspace";
581
+ /** Map the friendly `agent`/`backup` names to their on-the-wire `pod`/`s3` values. */
582
+ export declare function toWireFileSource(source: AgentFileBackendSource): AgentFileWireSource;
583
+ /** Hooks an OpenClaw agent provides so AgentFiles can reach its gateway. */
584
+ export interface AgentFilesGatewayHooks {
585
+ withGateway<T>(fn: (client: GatewayClient) => Promise<T>): Promise<T>;
586
+ resolveAgentId(client: GatewayClient): Promise<string>;
587
+ }
588
+ /**
589
+ * ONE client wrapping all three agent file-access paths behind a single `source`
590
+ * switch (`agent` | `backup` | `gateway`, plus `auto`). The SDK owns the roots,
591
+ * so a workspace-relative path is the same file on every source; `agent` also
592
+ * takes absolute `/…` paths for read-only full-filesystem browsing. The
593
+ * underlying APIs are left as-is — this only wraps them.
594
+ */
595
+ export declare class AgentFiles {
596
+ private readonly agent;
597
+ private readonly deployments;
598
+ private readonly gatewayHooks?;
599
+ constructor(agent: Agent, deployments: Deployments, gatewayHooks?: AgentFilesGatewayHooks | undefined);
600
+ private requireGateway;
601
+ list(path?: string, source?: OpenClawFileSource): Promise<AgentFileEntry[]>;
602
+ readBytes(path: string, source?: OpenClawFileSource, options?: AgentFileReadOptions): Promise<Uint8Array>;
603
+ readBytesWithMetadata(path: string, source?: OpenClawFileSource, options?: AgentFileReadOptions): Promise<AgentFileReadBytesResult>;
604
+ read(path: string, source?: OpenClawFileSource, options?: AgentFileReadOptions): Promise<string>;
605
+ writeBytes(path: string, content: Uint8Array | ArrayBuffer | string, source?: OpenClawFileSource): Promise<Record<string, any>>;
606
+ write(path: string, content: string, source?: OpenClawFileSource): Promise<Record<string, any>>;
607
+ delete(path: string, options?: {
608
+ recursive?: boolean;
609
+ source?: OpenClawFileSource;
610
+ }): Promise<Record<string, any>>;
611
+ }
236
612
  export interface AgentDirectoryListing {
237
613
  type: 'directory';
238
614
  prefix: string;
@@ -241,13 +617,45 @@ export interface AgentDirectoryListing {
241
617
  truncated?: boolean;
242
618
  [key: string]: any;
243
619
  }
620
+ export type AgentState = 'CREATING' | 'STARTING' | 'RESTORING' | 'RUNNING' | 'STOPPING' | 'STOPPED' | 'ARCHIVING' | 'ARCHIVED' | 'FAILED' | 'DELETED' | (string & {});
621
+ /** Canonical states understood by this SDK. AgentState remains forward-open. */
622
+ export declare const CANONICAL_AGENT_STATES: readonly ["CREATING", "STARTING", "RESTORING", "RUNNING", "STOPPING", "STOPPED", "ARCHIVING", "ARCHIVED", "FAILED", "DELETED"];
623
+ export declare const AGENT_TRANSITIONAL_STATES: ReadonlySet<AgentState>;
624
+ export declare const AGENT_RUNTIME_INACTIVE_STATES: ReadonlySet<AgentState>;
625
+ export declare function isAgentTransitionalState(state: string): boolean;
626
+ export declare function isAgentRuntimeInactiveState(state: string): boolean;
627
+ export interface DeploymentTransitionEvent {
628
+ type: 'deployment.transition';
629
+ agent_id: string;
630
+ state?: AgentState;
631
+ reason?: string | null;
632
+ error?: string | null;
633
+ message?: string | null;
634
+ launch_epoch?: number;
635
+ resources_exist?: boolean;
636
+ namespace_exists?: boolean;
637
+ }
638
+ export type DeploymentEvent = DeploymentTransitionEvent;
639
+ export interface DeploymentSubscribeOptions {
640
+ signal?: AbortSignal;
641
+ /** Runs after socket authentication and before transition frames are read. */
642
+ onReady?: () => void | Promise<void>;
643
+ }
244
644
  export interface AgentStateFields {
245
645
  id: string;
246
646
  userId: string;
247
- podId: string;
248
- podName: string;
249
- state: string;
647
+ state: AgentState;
250
648
  name?: string | null;
649
+ handle?: string | null;
650
+ displayName?: string | null;
651
+ avatarUrl?: string | null;
652
+ displayIdentity?: Record<string, any> | null;
653
+ runtime?: string | null;
654
+ managed?: boolean | null;
655
+ isLaunchable?: boolean;
656
+ gatewayId?: string | null;
657
+ runtimeKeyAlias?: string | null;
658
+ relayKey?: AgentRelayKey | null;
251
659
  cpu: number;
252
660
  memory: number;
253
661
  hostname?: string | null;
@@ -256,7 +664,9 @@ export interface AgentStateFields {
256
664
  jwtExpiresAt?: Date | null;
257
665
  startedAt?: Date | null;
258
666
  stoppedAt?: Date | null;
259
- lastError?: string | null;
667
+ archivedAt?: Date | null;
668
+ clusterId?: string | null;
669
+ launchEpoch?: number;
260
670
  createdAt?: Date | null;
261
671
  updatedAt?: Date | null;
262
672
  launchConfig?: Record<string, any> | null;
@@ -264,16 +674,23 @@ export interface AgentStateFields {
264
674
  routes: Record<string, AgentRouteConfig>;
265
675
  command: string[];
266
676
  entrypoint: string[];
267
- ports: Record<string, any>[];
268
677
  dryRun: boolean;
269
678
  }
270
679
  export interface AgentHydrationData {
271
680
  id?: string;
272
681
  user_id?: string;
273
- pod_id?: string;
274
- pod_name?: string;
275
- state?: string;
682
+ state?: AgentState;
276
683
  name?: string | null;
684
+ handle?: string | null;
685
+ display_name?: string | null;
686
+ avatar_url?: string | null;
687
+ display_identity?: Record<string, any> | null;
688
+ runtime?: string | null;
689
+ managed?: boolean | null;
690
+ is_launchable?: boolean;
691
+ gateway_id?: string | null;
692
+ runtime_key_alias?: string | null;
693
+ relay_key?: AgentRelayKey | null;
277
694
  cpu?: number;
278
695
  memory?: number;
279
696
  hostname?: string | null;
@@ -282,7 +699,9 @@ export interface AgentHydrationData {
282
699
  jwt_expires_at?: string | null;
283
700
  started_at?: string | null;
284
701
  stopped_at?: string | null;
285
- last_error?: string | null;
702
+ archived_at?: string | null;
703
+ cluster_id?: string | null;
704
+ launch_epoch?: number;
286
705
  created_at?: string | null;
287
706
  updated_at?: string | null;
288
707
  launch_config?: Record<string, any> | null;
@@ -292,27 +711,46 @@ export interface AgentHydrationData {
292
711
  routes?: Record<string, AgentRouteConfig> | null;
293
712
  command?: string[] | null;
294
713
  entrypoint?: string[] | null;
295
- ports?: Record<string, any>[] | null;
296
714
  dry_run?: boolean;
297
715
  openclaw_url?: string | null;
298
716
  gateway_url?: string | null;
299
- gateway_token?: string | null;
300
717
  [key: string]: any;
301
718
  }
719
+ export declare function flattenLaunchConfig(launchConfig: unknown): LaunchConfigFlatMap;
720
+ export declare function getLaunchConfigValue(launchConfig: unknown, path: string | Array<string | number>): unknown;
721
+ export declare function routesHaveDesktop(routes: unknown): boolean;
722
+ export declare function launchConfigHasDesktop(launchConfig: unknown): boolean;
723
+ export declare function agentConfigHasDesktop(source: AgentDesktopConfigSource | null | undefined): boolean;
724
+ export declare function buildBrowserDesktopUrl(desktopBaseUrl: string, token: string, options?: BrowserDesktopUrlOptions): string;
302
725
  export declare function resolveAgentsApiBase(apiBase: string): string;
303
726
  export declare function buildAgentConfig(config?: Record<string, any>, options?: BuildAgentConfigOptions): {
304
727
  config: Record<string, any>;
305
- gatewayToken: string;
728
+ gatewayToken: string | null;
306
729
  };
730
+ export declare function startSlackOAuth(options: SlackOAuthStartOptions): Promise<SlackOAuthStartResult>;
731
+ export declare function getSlackInstallStatus(options: SlackInstallStatusOptions): Promise<SlackInstallStatus>;
732
+ export declare function listSlackDirectoryConversations(options: SlackDirectoryConversationsOptions): Promise<SlackDirectoryConversationsResult>;
733
+ export declare function listSlackDirectoryUsers(options: SlackDirectoryOptions): Promise<SlackDirectoryUsersResult>;
734
+ export declare function attachSlackRelayAgent(options: AttachSlackRelayAgentOptions): Promise<AttachSlackRelayAgentResult>;
307
735
  export declare function buildOpenClawRoutes(options?: OpenClawRouteOptions): Record<string, AgentRouteConfig>;
736
+ export declare function buildHermesAgentRoutes(options?: HermesAgentRouteOptions): Record<string, AgentRouteConfig>;
308
737
  export declare function buildOpenClawMemoryIndexEnv(memoryIndex?: OpenClawMemoryIndexOptions | null): Record<string, string>;
738
+ export declare function buildOpenClawWorkspacesSyncEnv(workspacesSync?: OpenClawWorkspacesSyncOptions | boolean | null): Record<string, string>;
309
739
  export declare class Agent {
310
740
  readonly id: string;
311
741
  readonly userId: string;
312
- readonly podId: string;
313
- readonly podName: string;
314
742
  readonly state: string;
315
743
  readonly name: string | null;
744
+ readonly handle: string | null;
745
+ readonly displayName: string | null;
746
+ readonly avatarUrl: string | null;
747
+ readonly displayIdentity: Record<string, any> | null;
748
+ readonly runtime: string | null;
749
+ readonly managed: boolean | null;
750
+ readonly isLaunchable: boolean;
751
+ readonly gatewayId: string | null;
752
+ readonly runtimeKeyAlias: string | null;
753
+ readonly relayKey: AgentRelayKey | null;
316
754
  readonly cpu: number;
317
755
  readonly memory: number;
318
756
  readonly hostname: string | null;
@@ -321,7 +759,9 @@ export declare class Agent {
321
759
  jwtExpiresAt: Date | null;
322
760
  readonly startedAt: Date | null;
323
761
  readonly stoppedAt: Date | null;
324
- readonly lastError: string | null;
762
+ readonly archivedAt: Date | null;
763
+ readonly clusterId: string | null;
764
+ readonly launchEpoch: number;
325
765
  readonly createdAt: Date | null;
326
766
  readonly updatedAt: Date | null;
327
767
  launchConfig: Record<string, any> | null;
@@ -329,7 +769,6 @@ export declare class Agent {
329
769
  routes: Record<string, AgentRouteConfig>;
330
770
  command: string[];
331
771
  entrypoint: string[];
332
- ports: Record<string, any>[];
333
772
  readonly dryRun: boolean;
334
773
  _deployments: Deployments | null;
335
774
  constructor(fields: AgentStateFields);
@@ -339,9 +778,15 @@ export declare class Agent {
339
778
  routeUrl(routeName: string, defaultPrefix?: string | null): string | null;
340
779
  get desktopUrl(): string | null;
341
780
  get vncUrl(): string | null;
781
+ browserDesktopUrl(token: string, options?: BrowserDesktopUrlOptions): string | null;
342
782
  get shellUrl(): string | null;
343
- get executorUrl(): string | null;
344
783
  get isRunning(): boolean;
784
+ get isTransitioning(): boolean;
785
+ /** True when the agent is cold-restorable from its verified archive. */
786
+ get isArchived(): boolean;
787
+ /** True only for an explicitly included deletion tombstone. */
788
+ get isDeleted(): boolean;
789
+ get hasDesktop(): boolean;
345
790
  protected requireDeployments(): Deployments;
346
791
  routeRequiresAuth(routeName: string, defaultValue?: boolean): boolean;
347
792
  refreshToken(): Promise<AgentTokenResponse>;
@@ -349,19 +794,120 @@ export declare class Agent {
349
794
  update(options: UpdateAgentOptions): Promise<Agent>;
350
795
  resize(options: Pick<UpdateAgentOptions, 'size'>): Promise<Agent>;
351
796
  env(): Promise<Record<string, string>>;
797
+ secretNames(): Promise<string[]>;
798
+ secret(key: string): Promise<string>;
352
799
  exec(command: string, options?: AgentExecOptions): Promise<AgentExecResult>;
353
- health(): Promise<Record<string, any>>;
354
- filesList(path?: string, source?: 'auto' | 'pod' | 's3'): Promise<AgentFileEntry[]>;
355
- fileReadBytes(path: string, source?: 'auto' | 'pod' | 's3'): Promise<Uint8Array>;
356
- fileRead(path: string, source?: 'auto' | 'pod' | 's3'): Promise<string>;
357
- fileWriteBytes(path: string, content: Uint8Array | ArrayBuffer | string, destination?: 'auto' | 'pod' | 's3'): Promise<Record<string, any>>;
358
- fileWrite(path: string, content: string, destination?: 'auto' | 'pod' | 's3'): Promise<Record<string, any>>;
800
+ /**
801
+ * The gateway file writer a subclass supplies — the seam that enables the
802
+ * `gateway` source. The base agent has none (gateway calls throw); an agent
803
+ * type that speaks a gateway file protocol (e.g. OpenClaw's `agents.files.*`)
804
+ * overloads this. Kept on the base so the *calling* is standardized through
805
+ * the superclass even though each agent's gateway differs.
806
+ */
807
+ protected gatewayFileHooks(): AgentFilesGatewayHooks | undefined;
808
+ /**
809
+ * The single file client for this agent — one `source` switch (`agent` |
810
+ * `backup` | `gateway`) routes to the three underlying APIs (pod sidecar / S3
811
+ * backup / gateway), with the SDK owning the roots. One implementation; a
812
+ * subclass only supplies its gateway via {@link gatewayFileHooks}.
813
+ */
814
+ get files(): AgentFiles;
815
+ filesList(path?: string, source?: AgentFileSource): Promise<AgentFileEntry[]>;
816
+ fileReadBytes(path: string, source?: AgentFileSource, options?: AgentFileReadOptions): Promise<Uint8Array>;
817
+ fileReadBytesWithMetadata(path: string, source?: AgentFileSource, options?: AgentFileReadOptions): Promise<AgentFileReadBytesResult>;
818
+ fileRead(path: string, source?: AgentFileSource, options?: AgentFileReadOptions): Promise<string>;
819
+ fileWriteBytes(path: string, content: Uint8Array | ArrayBuffer | string, destination?: AgentFileSource): Promise<Record<string, any>>;
820
+ fileWrite(path: string, content: string, destination?: AgentFileSource): Promise<Record<string, any>>;
359
821
  fileDelete(path: string, options?: {
360
822
  recursive?: boolean;
823
+ source?: AgentFileSource;
361
824
  }): Promise<Record<string, any>>;
362
825
  cpTo(localPath: string, remotePath: string): Promise<Record<string, any>>;
363
826
  cpFrom(remotePath: string, localPath: string): Promise<string>;
364
- shellConnect(shell?: string): Promise<WebSocket>;
827
+ shellConnect(shell?: string, options?: AgentShellConnectOptions): Promise<WebSocket>;
828
+ }
829
+ export declare class RuntimeLoginSession {
830
+ private readonly authClient;
831
+ readonly socket: WebSocket;
832
+ private readonly requiresDeviceChallenge;
833
+ output: string;
834
+ verificationUrl: string | null;
835
+ userCode: string | null;
836
+ interactiveRequired: boolean;
837
+ private rawOutput;
838
+ private exitCode;
839
+ private readonly marker;
840
+ private readonly completion;
841
+ private readonly ready;
842
+ private complete;
843
+ private markReady;
844
+ private constructor();
845
+ static start(authClient: RuntimeAuthClient, command: string[], challengeTimeoutMs?: number, requiresDeviceChallenge?: boolean): Promise<RuntimeLoginSession>;
846
+ private consume;
847
+ send(text: string): void;
848
+ wait(timeoutMs?: number): Promise<RuntimeAuthStatus>;
849
+ cancel(): void;
850
+ }
851
+ export declare class RuntimeAuthClient {
852
+ readonly agent: CodingAgent;
853
+ private readonly config;
854
+ constructor(agent: CodingAgent);
855
+ methods(): Promise<RuntimeAuthMethod[]>;
856
+ status(): Promise<RuntimeAuthStatus>;
857
+ login(options?: RuntimeAuthLoginOptions): Promise<RuntimeLoginSession>;
858
+ logout(provider?: string): Promise<RuntimeAuthStatus>;
859
+ }
860
+ export declare class CodingAgent extends Agent {
861
+ readonly runtime: CodingAgentRuntime;
862
+ static readonly defaultSyncInclude: readonly string[] | null;
863
+ get auth(): RuntimeAuthClient;
864
+ }
865
+ export declare class BuzzAgent extends CodingAgent {
866
+ readonly runtime: 'buzz-agent';
867
+ static readonly defaultSyncInclude: readonly string[];
868
+ static fromDict(data: AgentHydrationData): BuzzAgent;
869
+ }
870
+ export declare class OpenCodeAgent extends CodingAgent {
871
+ readonly runtime: 'opencode';
872
+ static readonly defaultSyncInclude: readonly string[];
873
+ static fromDict(data: AgentHydrationData): OpenCodeAgent;
874
+ }
875
+ export declare class CodexAgent extends CodingAgent {
876
+ readonly runtime: 'codex';
877
+ static readonly defaultSyncInclude: readonly string[];
878
+ static fromDict(data: AgentHydrationData): CodexAgent;
879
+ }
880
+ export declare class ClaudeCodeAgent extends CodingAgent {
881
+ readonly runtime: 'claude-code';
882
+ static readonly defaultSyncInclude: readonly string[];
883
+ static fromDict(data: AgentHydrationData): ClaudeCodeAgent;
884
+ }
885
+ export declare class GooseAgent extends CodingAgent {
886
+ readonly runtime: 'goose';
887
+ static readonly defaultSyncInclude: readonly string[];
888
+ static fromDict(data: AgentHydrationData): GooseAgent;
889
+ }
890
+ export declare class KimiCodeAgent extends CodingAgent {
891
+ readonly runtime: 'kimi-code';
892
+ static readonly defaultSyncInclude: readonly string[];
893
+ static fromDict(data: AgentHydrationData): KimiCodeAgent;
894
+ }
895
+ export declare class HermesAgent extends Agent {
896
+ readonly runtime: 'hermes-agent';
897
+ readonly apiUrl: string | null;
898
+ readonly openaiBaseUrl: string | null;
899
+ /** Available only on the instance returned by createHermesAgent/startHermesAgent. */
900
+ apiServerKey: string | null;
901
+ constructor(fields: AgentStateFields & {
902
+ apiUrl?: string | null;
903
+ apiServerKey?: string | null;
904
+ });
905
+ static fromDict(data: AgentHydrationData): HermesAgent;
906
+ /** Create a client for this agent's authenticated Hermes API. */
907
+ get api(): HermesApiClient | null;
908
+ /** Require a ready URL and the one-time SDK-retained API server key. */
909
+ apiClient(): HermesApiClient;
910
+ waitRunning(timeoutMs?: number, pollIntervalMs?: number): Promise<HermesAgent>;
365
911
  }
366
912
  export declare class OpenClawAgent extends Agent {
367
913
  gatewayUrl: string | null;
@@ -371,46 +917,67 @@ export declare class OpenClawAgent extends Agent {
371
917
  gatewayToken?: string | null;
372
918
  });
373
919
  static fromDict(data: AgentHydrationData): OpenClawAgent;
374
- private static gatewayUrlFromHostname;
375
- private currentGatewayHostname;
376
- /**
377
- * Resolve gateway context through the deployment record plus `/env`.
378
- *
379
- * Agent startup is eventually consistent: the deployment record may lag
380
- * behind hostname attachment, and runtime env can lag behind both. The SDK
381
- * derives the gateway URL from the attached hostname and reads the gateway
382
- * token from `OPENCLAW_GATEWAY_TOKEN` in the agent env route.
383
- */
920
+ protected static gatewayUrlFromHostname(hostname: string | null | undefined): string | null;
921
+ /** Resolve OpenClaw connection context from the generic Agent and Secret APIs. */
384
922
  waitForGatewayContext(options?: GatewayContextWaitOptions): Promise<AgentGatewayContext>;
385
923
  resolveGatewayToken(): Promise<string | null>;
386
924
  gateway(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): GatewayClient;
387
925
  connect(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<GatewayClient>;
926
+ /** Run a fn against a connected gateway client, then close it. */
927
+ private withGateway;
928
+ private _gatewayAgentId?;
929
+ /**
930
+ * The in-gateway agent id for `agents.files.*` — NOT the deployment id. A
931
+ * deployment's gateway hosts an agent named `main` (or a named agent);
932
+ * matches the existing fileGet/fileSet/workspaceFiles convention.
933
+ */
934
+ private resolveGatewayAgentId;
935
+ /**
936
+ * Overload the base gateway seam with OpenClaw's `agents.files.*` — the actual
937
+ * OpenClaw gateway file methods. The base `files`/`fileX` calling surface is
938
+ * inherited unchanged; only the gateway writer is supplied here.
939
+ */
940
+ protected gatewayFileHooks(): AgentFilesGatewayHooks;
388
941
  gatewayStatus(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<Record<string, any>>;
389
942
  waitReady(timeoutMs?: number, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & GatewayWaitReadyOptions): Promise<Record<string, any>>;
390
943
  configGet(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<Record<string, any>>;
391
944
  configSchema(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<OpenClawConfigSchemaResponse>;
392
945
  configPatch(patch: Record<string, any>, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<void>;
946
+ configureSlackRelay(options: (Omit<OpenClawSlackRelayOptions, 'gatewayId'> & {
947
+ gatewayId?: string;
948
+ }) | OpenClawSlackRelayConfiguration, gatewayOptions?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & {
949
+ accountId?: string;
950
+ }): Promise<void>;
951
+ configureSlackSocket(config: OpenClawSlackSocketConfiguration, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & {
952
+ accountId?: string;
953
+ }): Promise<void>;
954
+ configureSlackHttp(config: OpenClawSlackHttpConfiguration, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & {
955
+ accountId?: string;
956
+ }): Promise<void>;
957
+ configureTelegram(config: OpenClawTelegramConfigPatch, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & {
958
+ accountId?: string;
959
+ }): Promise<void>;
960
+ configureWhatsapp(config: OpenClawWhatsAppConfigPatch, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & {
961
+ accountId?: string;
962
+ }): Promise<void>;
393
963
  configApply(config: Record<string, any>, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<void>;
394
964
  modelsList(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<any[]>;
395
965
  sessionsList(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<any[]>;
966
+ sessionsListResult(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<GatewaySessionsListResult>;
967
+ operationsSnapshot(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<OpenClawOperationsSnapshot>;
396
968
  chatSend(message: string, sessionKey: string, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & {
397
969
  attachments?: ChatAttachment[];
398
970
  }): AsyncGenerator<ChatEvent>;
399
971
  channelsStatus(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & {
400
972
  probe?: boolean;
401
973
  timeoutMs?: number;
974
+ channel?: string;
402
975
  }): Promise<Record<string, any>>;
976
+ channelsStart(channel: string, accountId?: string, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<Record<string, any>>;
977
+ channelsStop(channel: string, accountId?: string, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<Record<string, any>>;
403
978
  channelsLogout(channel: string, accountId?: string, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<Record<string, any>>;
404
- webLoginStart(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & {
405
- force?: boolean;
406
- timeoutMs?: number;
407
- verbose?: boolean;
408
- accountId?: string;
409
- }): Promise<Record<string, any>>;
410
- webLoginWait(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & {
411
- timeoutMs?: number;
412
- accountId?: string;
413
- }): Promise<Record<string, any>>;
979
+ webLoginStart(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & GatewayWebLoginStartOptions): Promise<GatewayWebLoginStartResult>;
980
+ webLoginWait(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'> & GatewayWebLoginWaitOptions): Promise<GatewayWebLoginWaitResult>;
414
981
  integrationsAuthStart(params: GatewayIntegrationAuthStartParams, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<GatewayIntegrationAuthStartResult>;
415
982
  integrationsAuthStatus(params: GatewayIntegrationAuthStatusParams, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<GatewayIntegrationAuthStatusResult>;
416
983
  integrationsStatus(params?: GatewayIntegrationStatusParams, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<GatewayIntegrationStatusResult>;
@@ -456,6 +1023,9 @@ export declare class OpenClawAgent extends Agent {
456
1023
  accountId?: string;
457
1024
  }): Promise<Record<string, any>>;
458
1025
  cronList(options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<any[]>;
1026
+ cronAdd(job: Record<string, any>, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<any>;
1027
+ cronRemove(jobId: string, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<void>;
1028
+ cronRun(jobId: string, options?: Omit<Partial<GatewayOptions>, 'url' | 'token'>): Promise<any>;
459
1029
  }
460
1030
  export declare class OpenClawProAgent extends OpenClawAgent {
461
1031
  static fromDict(data: AgentHydrationData): OpenClawProAgent;
@@ -466,52 +1036,90 @@ export declare class Deployments {
466
1036
  private readonly apiBase;
467
1037
  private readonly agentsWsUrl;
468
1038
  private readonly agentHttp;
469
- constructor(http: HTTPClient, agentApiKey?: string, agentApiBase?: string, agentsWsUrl?: string);
1039
+ constructor(http: HTTPClient, agentApiKey?: string, agentApiBase?: string, agentsWsUrl?: string, requestTimeout?: number);
470
1040
  get agentApiKey(): string;
471
1041
  get agentApiBase(): string;
472
1042
  private hydrateAgent;
1043
+ private getById;
1044
+ resolveAgent(agentIdOrName: string, requestOptions?: RequestOverrides): Promise<Agent>;
1045
+ resolveAgentId(agentIdOrName: string, requestOptions?: RequestOverrides, allowSelf?: boolean): Promise<string>;
473
1046
  private agentIdFor;
474
1047
  private fetchRaw;
475
1048
  create(options?: CreateAgentOptions): Promise<Agent>;
476
1049
  createOpenClaw(options?: OpenClawCreateAgentOptions): Promise<Agent>;
1050
+ createHermesAgent(options?: HermesAgentCreateOptions): Promise<HermesAgent>;
477
1051
  createOpenClawPro(options?: OpenClawCreateAgentOptions): Promise<Agent>;
1052
+ private createCodingAgent;
1053
+ createOpenCode(options?: CodingAgentCreateOptions): Promise<OpenCodeAgent>;
1054
+ createBuzzAgent(options?: CodingAgentCreateOptions): Promise<BuzzAgent>;
1055
+ createCodex(options?: CodingAgentCreateOptions): Promise<CodexAgent>;
1056
+ createClaudeCode(options?: CodingAgentCreateOptions): Promise<ClaudeCodeAgent>;
1057
+ createGoose(options?: CodingAgentCreateOptions): Promise<GooseAgent>;
1058
+ createKimiCode(options?: CodingAgentCreateOptions): Promise<KimiCodeAgent>;
478
1059
  budget(): Promise<Record<string, any>>;
479
- metrics(agentId: string): Promise<Record<string, any>>;
480
- list(): Promise<Agent[]>;
481
- get(agentId: string): Promise<Agent>;
482
- waitRunning(agentId: string, timeoutMs?: number, pollIntervalMs?: number): Promise<Agent>;
483
- start(agentId: string, options?: StartAgentOptions): Promise<Agent>;
484
- startOpenClaw(agentId: string, options?: OpenClawStartAgentOptions): Promise<Agent>;
485
- startOpenClawPro(agentId: string, options?: OpenClawStartAgentOptions): Promise<Agent>;
486
- update(agentId: string, options?: UpdateAgentOptions): Promise<Agent>;
1060
+ bootstrapInference(messages: BootstrapInferenceMessage[], responseFormat?: BootstrapInferenceResponseFormat, requestOptions?: RequestOverrides): Promise<BootstrapInferenceResult>;
1061
+ metrics(agentIdOrName: string): Promise<Record<string, any>>;
1062
+ list(options?: ListAgentsOptions): Promise<Agent[]>;
1063
+ listWithCapacity(options?: ListAgentsOptions): Promise<AgentCapacity>;
1064
+ get(agentIdOrName: string, requestOptions?: RequestOverrides): Promise<Agent>;
1065
+ createExternalAgent(options: CreateExternalAgentOptions): Promise<Agent>;
1066
+ updateExternalAgent(externalAgentId: string, options: UpdateExternalAgentOptions): Promise<Agent>;
1067
+ getExternalAgent(externalAgentId: string): Promise<Agent>;
1068
+ uploadExternalAgentProfileImage(externalAgentId: string, content: Blob | ArrayBuffer | ArrayBufferView, contentType?: string): Promise<AgentProfileImageUploadResult>;
1069
+ deleteExternalAgentProfileImage(externalAgentId: string): Promise<AgentProfileImageUploadResult>;
1070
+ rotateExternalAgentKey(agentIdOrName: string): Promise<Record<string, any>>;
1071
+ attachSlackRelayAgent(agentIdOrName: string, options: AttachDeploymentSlackRelayAgentOptions): Promise<AttachSlackRelayAgentResult>;
1072
+ subscribe(handler: (event: DeploymentEvent) => void | Promise<void>, options?: DeploymentSubscribeOptions): Promise<void>;
1073
+ waitForState(agentIdOrName: string, states: readonly AgentState[], timeoutMs?: number, failureStates?: readonly AgentState[], minimumLaunchEpoch?: number, pollIntervalMs?: number): Promise<Agent>;
1074
+ waitRunning(agentIdOrName: string, timeoutMs?: number, pollIntervalMs?: number, minimumLaunchEpoch?: number): Promise<Agent>;
1075
+ start(agentIdOrName: string, options?: StartAgentOptions): Promise<Agent>;
1076
+ startOpenClaw(agentIdOrName: string, options?: OpenClawStartAgentOptions): Promise<Agent>;
1077
+ startHermesAgent(agentIdOrName: string, options?: HermesAgentStartOptions): Promise<HermesAgent>;
1078
+ startOpenClawPro(agentIdOrName: string, options?: OpenClawStartAgentOptions): Promise<Agent>;
1079
+ update(agentIdOrName: string, options?: UpdateAgentOptions): Promise<Agent>;
1080
+ uploadProfileImage(agentId: string, content: Blob | ArrayBuffer | ArrayBufferView, contentType?: string): Promise<AgentProfileImageUploadResult>;
1081
+ deleteProfileImage(agentId: string): Promise<AgentProfileImageUploadResult>;
487
1082
  resize(agentId: string, options: Pick<UpdateAgentOptions, 'size'>): Promise<Agent>;
488
- stop(agentId: string): Promise<Agent>;
489
- delete(agentId: string): Promise<Record<string, any>>;
490
- refreshToken(agentId: string): Promise<AgentTokenResponse>;
491
- createScopedKey(agentId: string, name?: string): Promise<Record<string, any>>;
1083
+ /**
1084
+ * Request an agent stop.
1085
+ *
1086
+ * The returned agent remains `STOPPING` while runtime cleanup is in
1087
+ * progress. Fetch it again until it becomes `STOPPED` before treating its
1088
+ * deployment slot as released.
1089
+ */
1090
+ stop(agentIdOrName: string): Promise<Agent>;
1091
+ /** Restore durable storage. The accepted snapshot is `RESTORING`; completion is `STOPPED`. */
1092
+ restore(agentIdOrName: string): Promise<Agent>;
1093
+ getRoutes(agentIdOrName: string): Promise<AgentRoutesState>;
1094
+ setRoutes(agentIdOrName: string, routes: Record<string, AgentRouteConfig>): Promise<AgentRoutesState>;
1095
+ setRoute(agentIdOrName: string, name: string, route: AgentRouteConfig): Promise<AgentRoutesState>;
1096
+ removeRoute(agentIdOrName: string, name: string): Promise<AgentRoutesState>;
1097
+ delete(agentIdOrName: string): Promise<Record<string, any>>;
1098
+ refreshToken(agentIdOrName: string): Promise<AgentTokenResponse>;
1099
+ createScopedKey(agentIdOrName: string, name?: string): Promise<Record<string, any>>;
492
1100
  webSearch(query: string, options?: BraveWebSearchOptions): Promise<BraveWebSearchResponse>;
493
- logsToken(agentId: string): Promise<AgentLogsTokenResponse>;
494
- env(agentId: string): Promise<{
495
- agent_id: string;
496
- env: Record<string, string>;
497
- }>;
1101
+ logsToken(agentIdOrName: string): Promise<AgentLogsTokenResponse>;
1102
+ env(agentIdOrName: string, requestOptions?: RequestOverrides): Promise<AgentEnvResponse>;
1103
+ secretNames(agentIdOrName: string, requestOptions?: RequestOverrides): Promise<AgentSecretNamesResponse>;
1104
+ secret(agentIdOrName: string, key: string, requestOptions?: RequestOverrides): Promise<AgentSecretResponse>;
498
1105
  exec(target: Agent | string, command: string, options?: AgentExecOptions): Promise<AgentExecResult>;
499
- health(target: Agent): Promise<Record<string, any>>;
500
1106
  filesList(target: Agent | string, path?: string, source?: 'auto' | 'pod' | 's3'): Promise<AgentFileEntry[]>;
501
- fileReadBytes(target: Agent | string, path: string, source?: 'auto' | 'pod' | 's3'): Promise<Uint8Array>;
502
- fileRead(target: Agent | string, path: string, source?: 'auto' | 'pod' | 's3'): Promise<string>;
1107
+ fileReadBytesWithMetadata(target: Agent | string, path: string, source?: 'auto' | 'pod' | 's3', options?: AgentFileReadOptions): Promise<AgentFileReadBytesResult>;
1108
+ fileReadBytes(target: Agent | string, path: string, source?: 'auto' | 'pod' | 's3', options?: AgentFileReadOptions): Promise<Uint8Array>;
1109
+ fileRead(target: Agent | string, path: string, source?: 'auto' | 'pod' | 's3', options?: AgentFileReadOptions): Promise<string>;
503
1110
  fileWriteBytes(target: Agent | string, path: string, content: Uint8Array | ArrayBuffer | string, destination?: 'auto' | 'pod' | 's3'): Promise<Record<string, any>>;
504
1111
  fileWrite(target: Agent | string, path: string, content: string, destination?: 'auto' | 'pod' | 's3'): Promise<Record<string, any>>;
505
1112
  fileDelete(target: Agent | string, path: string, options?: {
506
1113
  recursive?: boolean;
1114
+ source?: 'auto' | 'pod' | 's3';
507
1115
  }): Promise<Record<string, any>>;
508
1116
  cpTo(target: Agent | string, localPath: string, remotePath: string): Promise<Record<string, any>>;
509
1117
  cpFrom(target: Agent | string, remotePath: string, localPath: string): Promise<string>;
510
- logsConnect(agentId: string, options?: {
1118
+ logsConnect(agentIdOrName: string, options?: {
511
1119
  tailLines?: number;
512
1120
  container?: string;
513
1121
  }): Promise<WebSocket>;
514
- shellToken(agentId: string, shell?: string, dryRun?: boolean): Promise<AgentShellTokenResponse>;
515
- shellConnect(agentId: string, shell?: string): Promise<WebSocket>;
1122
+ shellToken(agentIdOrName: string, shell?: string, dryRun?: boolean, requestOptions?: RequestOverrides): Promise<AgentShellTokenResponse>;
1123
+ shellConnect(agentIdOrName: string, shell?: string, options?: AgentShellConnectOptions): Promise<WebSocket>;
516
1124
  }
517
1125
  //# sourceMappingURL=agents.d.ts.map