@opengeni/sdk 0.1.0
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.
- package/README.md +157 -0
- package/dist/index.d.ts +1196 -0
- package/dist/index.js +955 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -0
- package/src/client.ts +846 -0
- package/src/errors.ts +40 -0
- package/src/index.ts +142 -0
- package/src/proxy.ts +171 -0
- package/src/sse.ts +90 -0
- package/src/stream.ts +192 -0
- package/src/types.ts +1036 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1196 @@
|
|
|
1
|
+
type SessionStatus = "queued" | "running" | "idle" | "requires_action" | "failed" | "cancelled";
|
|
2
|
+
type SandboxBackend = "docker" | "modal" | "local" | "none";
|
|
3
|
+
type ReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
4
|
+
type RepositoryResourceRef = {
|
|
5
|
+
kind: "repository";
|
|
6
|
+
uri: string;
|
|
7
|
+
ref: string;
|
|
8
|
+
mountPath?: string | undefined;
|
|
9
|
+
subpath?: string | undefined;
|
|
10
|
+
githubInstallationId?: number | undefined;
|
|
11
|
+
githubRepositoryId?: number | undefined;
|
|
12
|
+
};
|
|
13
|
+
type FileResourceRef = {
|
|
14
|
+
kind: "file";
|
|
15
|
+
fileId: string;
|
|
16
|
+
mountPath?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
type ResourceRef = RepositoryResourceRef | FileResourceRef;
|
|
19
|
+
type ToolRef = {
|
|
20
|
+
kind: "mcp";
|
|
21
|
+
id: string;
|
|
22
|
+
};
|
|
23
|
+
type GoalSpec = {
|
|
24
|
+
text: string;
|
|
25
|
+
successCriteria?: string | undefined;
|
|
26
|
+
maxAutoContinuations?: number | undefined;
|
|
27
|
+
};
|
|
28
|
+
type Session = {
|
|
29
|
+
id: string;
|
|
30
|
+
workspaceId: string;
|
|
31
|
+
accountId: string;
|
|
32
|
+
status: SessionStatus;
|
|
33
|
+
initialMessage: string;
|
|
34
|
+
resources: ResourceRef[];
|
|
35
|
+
tools: ToolRef[];
|
|
36
|
+
metadata: Record<string, unknown>;
|
|
37
|
+
model: string;
|
|
38
|
+
sandboxBackend: SandboxBackend;
|
|
39
|
+
environmentId: string | null;
|
|
40
|
+
firstPartyMcpPermissions: string[] | null;
|
|
41
|
+
createIdempotencyKey: string | null;
|
|
42
|
+
temporalWorkflowId: string | null;
|
|
43
|
+
activeTurnId: string | null;
|
|
44
|
+
lastSequence: number;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
};
|
|
48
|
+
type SessionTurnStatus = "queued" | "running" | "requires_action" | "completed" | "failed" | "cancelled";
|
|
49
|
+
type SessionTurnSource = "user" | "scheduled_task" | "api" | "goal";
|
|
50
|
+
type SessionTurn = {
|
|
51
|
+
id: string;
|
|
52
|
+
workspaceId: string;
|
|
53
|
+
sessionId: string;
|
|
54
|
+
triggerEventId: string;
|
|
55
|
+
temporalWorkflowId: string;
|
|
56
|
+
status: SessionTurnStatus;
|
|
57
|
+
source: SessionTurnSource;
|
|
58
|
+
position: number;
|
|
59
|
+
prompt: string;
|
|
60
|
+
resources: ResourceRef[];
|
|
61
|
+
tools: ToolRef[];
|
|
62
|
+
model: string;
|
|
63
|
+
reasoningEffort: ReasoningEffort;
|
|
64
|
+
sandboxBackend: SandboxBackend;
|
|
65
|
+
metadata: Record<string, unknown>;
|
|
66
|
+
startedAt: string | null;
|
|
67
|
+
finishedAt: string | null;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
updatedAt: string;
|
|
70
|
+
};
|
|
71
|
+
declare const SESSION_EVENT_TYPES: readonly ["session.created", "session.status.changed", "session.requiresAction", "session.context.compacted", "session.context.cleared", "user.message", "user.interrupt", "user.approvalDecision", "turn.queued", "turn.updated", "turn.started", "turn.completed", "turn.failed", "turn.cancelled", "turn.preempted", "agent.message.delta", "agent.message.completed", "agent.reasoning.delta", "agent.toolCall.created", "agent.toolCall.output", "agent.updated", "sandbox.operation.started", "sandbox.operation.completed", "sandbox.operation.failed", "sandbox.command.output.delta", "artifact.created", "goal.set", "goal.updated", "goal.completed", "goal.paused", "goal.resumed", "goal.continuation"];
|
|
72
|
+
type KnownSessionEventType = (typeof SESSION_EVENT_TYPES)[number];
|
|
73
|
+
/**
|
|
74
|
+
* Event types the SDK knows about today, kept open so a newer OpenGeni server
|
|
75
|
+
* can introduce event types without breaking older SDK consumers.
|
|
76
|
+
*/
|
|
77
|
+
type SessionEventType = KnownSessionEventType | (string & {});
|
|
78
|
+
type SessionEvent = {
|
|
79
|
+
id: string;
|
|
80
|
+
workspaceId: string;
|
|
81
|
+
sessionId: string;
|
|
82
|
+
/** Per-session sequence number: positive, contiguous, strictly increasing. */
|
|
83
|
+
sequence: number;
|
|
84
|
+
type: SessionEventType;
|
|
85
|
+
payload: unknown;
|
|
86
|
+
occurredAt: string;
|
|
87
|
+
clientEventId?: string | null | undefined;
|
|
88
|
+
turnId?: string | null | undefined;
|
|
89
|
+
};
|
|
90
|
+
type AgentTextDeltaPayload = {
|
|
91
|
+
text: string;
|
|
92
|
+
};
|
|
93
|
+
type AgentMessageCompletedPayload = {
|
|
94
|
+
text: string;
|
|
95
|
+
};
|
|
96
|
+
type AgentToolCallCreatedPayload = {
|
|
97
|
+
id: string | null;
|
|
98
|
+
name: string;
|
|
99
|
+
arguments: unknown;
|
|
100
|
+
raw?: unknown | undefined;
|
|
101
|
+
};
|
|
102
|
+
type AgentToolCallOutputPayload = {
|
|
103
|
+
id: string | null;
|
|
104
|
+
output: unknown;
|
|
105
|
+
};
|
|
106
|
+
type SessionStatusChangedPayload = {
|
|
107
|
+
status: SessionStatus;
|
|
108
|
+
};
|
|
109
|
+
type ScheduledTaskStatus = "active" | "paused";
|
|
110
|
+
type ScheduledTaskRunMode = "new_session_per_run" | "reusable_session";
|
|
111
|
+
type ScheduledTaskOverlapPolicy = "allow_concurrent" | "skip" | "buffer_one";
|
|
112
|
+
type ScheduledTaskDayOfWeek = "SUNDAY" | "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY" | "SATURDAY";
|
|
113
|
+
type ScheduledTaskScheduleSpec = {
|
|
114
|
+
type: "once";
|
|
115
|
+
runAt: string;
|
|
116
|
+
timeZone: string;
|
|
117
|
+
} | {
|
|
118
|
+
type: "interval";
|
|
119
|
+
everySeconds: number;
|
|
120
|
+
startAt?: string | undefined;
|
|
121
|
+
endAt?: string | undefined;
|
|
122
|
+
} | {
|
|
123
|
+
type: "calendar";
|
|
124
|
+
timeZone: string;
|
|
125
|
+
hour: number;
|
|
126
|
+
minute: number;
|
|
127
|
+
daysOfWeek?: ScheduledTaskDayOfWeek[] | undefined;
|
|
128
|
+
};
|
|
129
|
+
type ScheduledTaskAgentConfig = {
|
|
130
|
+
prompt: string;
|
|
131
|
+
resources: ResourceRef[];
|
|
132
|
+
tools: ToolRef[];
|
|
133
|
+
metadata: Record<string, unknown>;
|
|
134
|
+
model?: string | undefined;
|
|
135
|
+
reasoningEffort?: ReasoningEffort | undefined;
|
|
136
|
+
sandboxBackend?: SandboxBackend | undefined;
|
|
137
|
+
goal?: GoalSpec | undefined;
|
|
138
|
+
};
|
|
139
|
+
type ScheduledTask = {
|
|
140
|
+
id: string;
|
|
141
|
+
accountId: string;
|
|
142
|
+
workspaceId: string;
|
|
143
|
+
name: string;
|
|
144
|
+
status: ScheduledTaskStatus;
|
|
145
|
+
schedule: ScheduledTaskScheduleSpec;
|
|
146
|
+
temporalScheduleId: string;
|
|
147
|
+
runMode: ScheduledTaskRunMode;
|
|
148
|
+
overlapPolicy: ScheduledTaskOverlapPolicy;
|
|
149
|
+
agentConfig: ScheduledTaskAgentConfig;
|
|
150
|
+
reusableSessionId: string | null;
|
|
151
|
+
environmentId: string | null;
|
|
152
|
+
metadata: Record<string, unknown>;
|
|
153
|
+
createdAt: string;
|
|
154
|
+
updatedAt: string;
|
|
155
|
+
};
|
|
156
|
+
type CreateSessionRequest = {
|
|
157
|
+
initialMessage: string;
|
|
158
|
+
resources?: ResourceRef[] | undefined;
|
|
159
|
+
tools?: ToolRef[] | undefined;
|
|
160
|
+
metadata?: Record<string, unknown> | undefined;
|
|
161
|
+
model?: string | undefined;
|
|
162
|
+
reasoningEffort?: ReasoningEffort | undefined;
|
|
163
|
+
sandboxBackend?: SandboxBackend | undefined;
|
|
164
|
+
environmentId?: string | undefined;
|
|
165
|
+
goal?: GoalSpec | undefined;
|
|
166
|
+
clientEventId?: string | undefined;
|
|
167
|
+
idempotencyKey?: string | undefined;
|
|
168
|
+
firstPartyMcpPermissions?: string[] | undefined;
|
|
169
|
+
};
|
|
170
|
+
declare const KNOWN_PERMISSIONS: readonly ["account:read", "account:admin", "members:manage", "workspace:create", "billing:read", "billing:manage", "workspace:read", "workspace:admin", "sessions:create", "sessions:read", "sessions:control", "files:upload", "files:read", "documents:manage", "documents:search", "scheduled_tasks:manage", "scheduled_tasks:run", "github:manage", "github:use", "api_keys:manage", "environments:manage", "environments:use", "goals:manage"];
|
|
171
|
+
type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
|
|
172
|
+
/**
|
|
173
|
+
* Permissions the SDK knows about today, kept open so a newer OpenGeni server
|
|
174
|
+
* can introduce permissions without breaking older SDK consumers.
|
|
175
|
+
*/
|
|
176
|
+
type Permission = KnownPermission | (string & {});
|
|
177
|
+
type ProductAccessMode = "local" | "configured" | "managed";
|
|
178
|
+
type AccountRole = "owner" | "admin" | "member";
|
|
179
|
+
type AccountGrant = {
|
|
180
|
+
accountId: string;
|
|
181
|
+
subjectId: string;
|
|
182
|
+
subjectLabel?: string | undefined;
|
|
183
|
+
role?: AccountRole | undefined;
|
|
184
|
+
permissions: Permission[];
|
|
185
|
+
metadata?: Record<string, unknown> | undefined;
|
|
186
|
+
};
|
|
187
|
+
type AccessGrant = {
|
|
188
|
+
workspaceId: string;
|
|
189
|
+
accountId: string;
|
|
190
|
+
subjectId: string;
|
|
191
|
+
subjectLabel?: string | undefined;
|
|
192
|
+
permissions: Permission[];
|
|
193
|
+
metadata?: Record<string, unknown> | undefined;
|
|
194
|
+
};
|
|
195
|
+
type AccessContext = {
|
|
196
|
+
mode: ProductAccessMode;
|
|
197
|
+
subjectId: string;
|
|
198
|
+
subjectLabel?: string | undefined;
|
|
199
|
+
accountGrants: AccountGrant[];
|
|
200
|
+
workspaceGrants: AccessGrant[];
|
|
201
|
+
defaultAccountId: string | null;
|
|
202
|
+
defaultWorkspaceId: string | null;
|
|
203
|
+
};
|
|
204
|
+
type Workspace = {
|
|
205
|
+
id: string;
|
|
206
|
+
accountId: string;
|
|
207
|
+
name: string;
|
|
208
|
+
slug: string | null;
|
|
209
|
+
externalSource: string | null;
|
|
210
|
+
externalId: string | null;
|
|
211
|
+
agentInstructions: string | null;
|
|
212
|
+
createdAt: string;
|
|
213
|
+
updatedAt: string;
|
|
214
|
+
};
|
|
215
|
+
type CreateWorkspaceRequest = {
|
|
216
|
+
accountId?: string | undefined;
|
|
217
|
+
name: string;
|
|
218
|
+
slug?: string | undefined;
|
|
219
|
+
externalSource?: string | undefined;
|
|
220
|
+
externalId?: string | undefined;
|
|
221
|
+
agentInstructions?: string | null | undefined;
|
|
222
|
+
};
|
|
223
|
+
type UpdateWorkspaceRequest = {
|
|
224
|
+
name?: string | undefined;
|
|
225
|
+
slug?: string | null | undefined;
|
|
226
|
+
agentInstructions?: string | null | undefined;
|
|
227
|
+
};
|
|
228
|
+
type ApiKey = {
|
|
229
|
+
id: string;
|
|
230
|
+
accountId: string;
|
|
231
|
+
workspaceId: string | null;
|
|
232
|
+
name: string;
|
|
233
|
+
prefix: string;
|
|
234
|
+
permissions: Permission[];
|
|
235
|
+
expiresAt: string | null;
|
|
236
|
+
revokedAt: string | null;
|
|
237
|
+
lastUsedAt: string | null;
|
|
238
|
+
createdAt: string;
|
|
239
|
+
updatedAt: string;
|
|
240
|
+
};
|
|
241
|
+
type CreateApiKeyRequest = {
|
|
242
|
+
name: string;
|
|
243
|
+
permissions: Permission[];
|
|
244
|
+
expiresAt?: string | undefined;
|
|
245
|
+
};
|
|
246
|
+
type CreateApiKeyResponse = {
|
|
247
|
+
apiKey: ApiKey;
|
|
248
|
+
/** The full secret token — shown once at creation, never returned again. */
|
|
249
|
+
token: string;
|
|
250
|
+
};
|
|
251
|
+
type ListApiKeysResponse = {
|
|
252
|
+
apiKeys: ApiKey[];
|
|
253
|
+
};
|
|
254
|
+
type SessionGoalStatus = "active" | "paused" | "completed";
|
|
255
|
+
type SessionGoalCreatedBy = "api" | "agent" | "scheduled_task";
|
|
256
|
+
type SessionGoal = {
|
|
257
|
+
id: string;
|
|
258
|
+
accountId: string;
|
|
259
|
+
workspaceId: string;
|
|
260
|
+
sessionId: string;
|
|
261
|
+
status: SessionGoalStatus;
|
|
262
|
+
text: string;
|
|
263
|
+
successCriteria: string | null;
|
|
264
|
+
evidence: string | null;
|
|
265
|
+
rationale: string | null;
|
|
266
|
+
pausedReason: string | null;
|
|
267
|
+
createdBy: SessionGoalCreatedBy;
|
|
268
|
+
version: number;
|
|
269
|
+
autoContinuations: number;
|
|
270
|
+
noProgressStreak: number;
|
|
271
|
+
maxAutoContinuations: number | null;
|
|
272
|
+
metadata: Record<string, unknown>;
|
|
273
|
+
createdAt: string;
|
|
274
|
+
updatedAt: string;
|
|
275
|
+
};
|
|
276
|
+
type UpdateSessionGoalRequest = {
|
|
277
|
+
status: "paused" | "active";
|
|
278
|
+
rationale?: string | undefined;
|
|
279
|
+
};
|
|
280
|
+
/** Outcome of a manual /compact trigger. */
|
|
281
|
+
type CompactSessionContextResult = {
|
|
282
|
+
/**
|
|
283
|
+
* queued: a client-side (Azure) compaction will run before the next turn.
|
|
284
|
+
* noop: nothing to do (server-managed provider, mode off, or no history).
|
|
285
|
+
*/
|
|
286
|
+
status: "queued" | "noop";
|
|
287
|
+
message: string;
|
|
288
|
+
};
|
|
289
|
+
type UpdateSessionTurnRequest = {
|
|
290
|
+
prompt?: string | undefined;
|
|
291
|
+
resources?: ResourceRef[] | undefined;
|
|
292
|
+
tools?: ToolRef[] | undefined;
|
|
293
|
+
model?: string | undefined;
|
|
294
|
+
reasoningEffort?: ReasoningEffort | undefined;
|
|
295
|
+
sandboxBackend?: SandboxBackend | undefined;
|
|
296
|
+
metadata?: Record<string, unknown> | undefined;
|
|
297
|
+
};
|
|
298
|
+
/** Input shape for agent config on create/update (server applies defaults). */
|
|
299
|
+
type ScheduledTaskAgentConfigInput = {
|
|
300
|
+
prompt: string;
|
|
301
|
+
resources?: ResourceRef[] | undefined;
|
|
302
|
+
tools?: ToolRef[] | undefined;
|
|
303
|
+
metadata?: Record<string, unknown> | undefined;
|
|
304
|
+
model?: string | undefined;
|
|
305
|
+
reasoningEffort?: ReasoningEffort | undefined;
|
|
306
|
+
sandboxBackend?: SandboxBackend | undefined;
|
|
307
|
+
goal?: GoalSpec | undefined;
|
|
308
|
+
};
|
|
309
|
+
type CreateScheduledTaskRequest = {
|
|
310
|
+
name: string;
|
|
311
|
+
schedule: ScheduledTaskScheduleSpec;
|
|
312
|
+
runMode?: ScheduledTaskRunMode | undefined;
|
|
313
|
+
overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
|
|
314
|
+
agentConfig: ScheduledTaskAgentConfigInput;
|
|
315
|
+
status?: ScheduledTaskStatus | undefined;
|
|
316
|
+
environmentId?: string | null | undefined;
|
|
317
|
+
metadata?: Record<string, unknown> | undefined;
|
|
318
|
+
};
|
|
319
|
+
type UpdateScheduledTaskRequest = {
|
|
320
|
+
name?: string | undefined;
|
|
321
|
+
schedule?: ScheduledTaskScheduleSpec | undefined;
|
|
322
|
+
runMode?: ScheduledTaskRunMode | undefined;
|
|
323
|
+
overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
|
|
324
|
+
agentConfig?: ScheduledTaskAgentConfigInput | undefined;
|
|
325
|
+
status?: ScheduledTaskStatus | undefined;
|
|
326
|
+
environmentId?: string | null | undefined;
|
|
327
|
+
metadata?: Record<string, unknown> | undefined;
|
|
328
|
+
};
|
|
329
|
+
type ScheduledTaskRunStatus = "queued" | "dispatched" | "failed";
|
|
330
|
+
type ScheduledTaskTriggerType = "scheduled" | "manual";
|
|
331
|
+
type ScheduledTaskRun = {
|
|
332
|
+
id: string;
|
|
333
|
+
accountId: string;
|
|
334
|
+
workspaceId: string;
|
|
335
|
+
taskId: string;
|
|
336
|
+
status: ScheduledTaskRunStatus;
|
|
337
|
+
triggerType: ScheduledTaskTriggerType;
|
|
338
|
+
scheduledAt: string | null;
|
|
339
|
+
firedAt: string;
|
|
340
|
+
sessionId: string | null;
|
|
341
|
+
triggerEventId: string | null;
|
|
342
|
+
error: string | null;
|
|
343
|
+
createdAt: string;
|
|
344
|
+
updatedAt: string;
|
|
345
|
+
};
|
|
346
|
+
/**
|
|
347
|
+
* Variable values are write-only by design: the API never returns a value, so
|
|
348
|
+
* reads expose name + version metadata only. Values are decrypted exclusively
|
|
349
|
+
* inside the worker at sandbox materialization time.
|
|
350
|
+
*/
|
|
351
|
+
type WorkspaceEnvironmentVariableMetadata = {
|
|
352
|
+
name: string;
|
|
353
|
+
version: number;
|
|
354
|
+
createdAt: string;
|
|
355
|
+
updatedAt: string;
|
|
356
|
+
};
|
|
357
|
+
type WorkspaceEnvironment = {
|
|
358
|
+
id: string;
|
|
359
|
+
accountId: string;
|
|
360
|
+
workspaceId: string;
|
|
361
|
+
name: string;
|
|
362
|
+
description: string | null;
|
|
363
|
+
variables: WorkspaceEnvironmentVariableMetadata[];
|
|
364
|
+
createdAt: string;
|
|
365
|
+
updatedAt: string;
|
|
366
|
+
};
|
|
367
|
+
type CreateWorkspaceEnvironmentRequest = {
|
|
368
|
+
name: string;
|
|
369
|
+
description?: string | undefined;
|
|
370
|
+
/** Initial variables. Values are write-only: they never come back on reads. */
|
|
371
|
+
variables?: {
|
|
372
|
+
name: string;
|
|
373
|
+
value: string;
|
|
374
|
+
}[] | undefined;
|
|
375
|
+
};
|
|
376
|
+
type UpdateWorkspaceEnvironmentRequest = {
|
|
377
|
+
name?: string | undefined;
|
|
378
|
+
description?: string | null | undefined;
|
|
379
|
+
};
|
|
380
|
+
type FileStatus = "pending_upload" | "ready" | "failed" | "expired" | "deleted";
|
|
381
|
+
type FileAsset = {
|
|
382
|
+
id: string;
|
|
383
|
+
workspaceId: string;
|
|
384
|
+
status: FileStatus;
|
|
385
|
+
filename: string;
|
|
386
|
+
safeFilename: string;
|
|
387
|
+
contentType: string;
|
|
388
|
+
sizeBytes: number;
|
|
389
|
+
sha256: string | null;
|
|
390
|
+
bucket: string;
|
|
391
|
+
objectKey: string;
|
|
392
|
+
createdAt: string;
|
|
393
|
+
updatedAt: string;
|
|
394
|
+
};
|
|
395
|
+
type CreateFileUploadRequest = {
|
|
396
|
+
filename: string;
|
|
397
|
+
contentType: string;
|
|
398
|
+
sizeBytes: number;
|
|
399
|
+
sha256?: string | undefined;
|
|
400
|
+
};
|
|
401
|
+
type CreateFileUploadResponse = {
|
|
402
|
+
fileId: string;
|
|
403
|
+
uploadId: string;
|
|
404
|
+
/** Pre-signed PUT URL for the file bytes (direct to object storage). */
|
|
405
|
+
putUrl: string;
|
|
406
|
+
/** Headers that MUST be sent with the PUT for the signature to validate. */
|
|
407
|
+
requiredHeaders: Record<string, string>;
|
|
408
|
+
expiresAt: string;
|
|
409
|
+
maxSizeBytes: number;
|
|
410
|
+
};
|
|
411
|
+
type CompleteFileUploadResponse = {
|
|
412
|
+
file: FileAsset;
|
|
413
|
+
};
|
|
414
|
+
type FileDownloadUrlResponse = {
|
|
415
|
+
url: string;
|
|
416
|
+
expiresAt: string;
|
|
417
|
+
};
|
|
418
|
+
/** Bytes accepted by the `uploadFile` helper. */
|
|
419
|
+
type FileUploadData = Blob | ArrayBuffer | Uint8Array | string;
|
|
420
|
+
type UploadFileInput = {
|
|
421
|
+
filename: string;
|
|
422
|
+
contentType: string;
|
|
423
|
+
data: FileUploadData;
|
|
424
|
+
sha256?: string | undefined;
|
|
425
|
+
};
|
|
426
|
+
type DocumentStatus = "queued" | "indexing" | "ready" | "failed";
|
|
427
|
+
type DocumentBase = {
|
|
428
|
+
id: string;
|
|
429
|
+
workspaceId: string;
|
|
430
|
+
name: string;
|
|
431
|
+
description: string | null;
|
|
432
|
+
createdAt: string;
|
|
433
|
+
updatedAt: string;
|
|
434
|
+
};
|
|
435
|
+
type Document = {
|
|
436
|
+
id: string;
|
|
437
|
+
workspaceId: string;
|
|
438
|
+
baseId: string;
|
|
439
|
+
fileId: string;
|
|
440
|
+
status: DocumentStatus;
|
|
441
|
+
title: string;
|
|
442
|
+
parser: string;
|
|
443
|
+
chunkCount: number;
|
|
444
|
+
error: string | null;
|
|
445
|
+
createdAt: string;
|
|
446
|
+
updatedAt: string;
|
|
447
|
+
};
|
|
448
|
+
type DocumentSearchResult = {
|
|
449
|
+
chunkId: string;
|
|
450
|
+
workspaceId: string;
|
|
451
|
+
documentId: string;
|
|
452
|
+
baseId: string;
|
|
453
|
+
fileId: string;
|
|
454
|
+
title: string;
|
|
455
|
+
text: string;
|
|
456
|
+
score: number;
|
|
457
|
+
chunkIndex: number;
|
|
458
|
+
metadata: Record<string, unknown>;
|
|
459
|
+
};
|
|
460
|
+
type CreateDocumentBaseRequest = {
|
|
461
|
+
name: string;
|
|
462
|
+
description?: string | undefined;
|
|
463
|
+
};
|
|
464
|
+
type DocumentSearchRequest = {
|
|
465
|
+
query: string;
|
|
466
|
+
limit?: number | undefined;
|
|
467
|
+
};
|
|
468
|
+
type DocumentSearchResponse = {
|
|
469
|
+
results: DocumentSearchResult[];
|
|
470
|
+
};
|
|
471
|
+
type CapabilityPackConnectorAuthModel = "oauth2_authorization_code_pkce" | "oauth2_authorization_code" | "api_key" | "credential_ref";
|
|
472
|
+
type CapabilityPackConnector = {
|
|
473
|
+
id: string;
|
|
474
|
+
name: string;
|
|
475
|
+
category: string;
|
|
476
|
+
authModel: CapabilityPackConnectorAuthModel;
|
|
477
|
+
providers: string[];
|
|
478
|
+
scopes: string[];
|
|
479
|
+
required: boolean;
|
|
480
|
+
metadata: Record<string, unknown>;
|
|
481
|
+
};
|
|
482
|
+
type CapabilityPackKnowledge = {
|
|
483
|
+
type: "document_base";
|
|
484
|
+
id: string;
|
|
485
|
+
name: string;
|
|
486
|
+
description: string | null;
|
|
487
|
+
required: boolean;
|
|
488
|
+
};
|
|
489
|
+
type CapabilityPackScheduledTaskTemplate = {
|
|
490
|
+
id: string;
|
|
491
|
+
name: string;
|
|
492
|
+
description: string;
|
|
493
|
+
defaultSchedule: ScheduledTaskScheduleSpec;
|
|
494
|
+
defaultRunMode: ScheduledTaskRunMode;
|
|
495
|
+
defaultOverlapPolicy: ScheduledTaskOverlapPolicy;
|
|
496
|
+
prompt?: string | undefined;
|
|
497
|
+
};
|
|
498
|
+
type CapabilityPackSkillFile = {
|
|
499
|
+
path: string;
|
|
500
|
+
content: string;
|
|
501
|
+
};
|
|
502
|
+
type CapabilityPackSkill = {
|
|
503
|
+
name: string;
|
|
504
|
+
description?: string | undefined;
|
|
505
|
+
files: CapabilityPackSkillFile[];
|
|
506
|
+
};
|
|
507
|
+
type CapabilityPackEnvironmentSpec = {
|
|
508
|
+
description: string;
|
|
509
|
+
requiredVariables: string[];
|
|
510
|
+
required: boolean;
|
|
511
|
+
};
|
|
512
|
+
type CapabilityPack = {
|
|
513
|
+
id: string;
|
|
514
|
+
name: string;
|
|
515
|
+
description: string;
|
|
516
|
+
role: string;
|
|
517
|
+
category: string;
|
|
518
|
+
version: string;
|
|
519
|
+
sandboxImage?: string | undefined;
|
|
520
|
+
skills: CapabilityPackSkill[];
|
|
521
|
+
tools: ToolRef[];
|
|
522
|
+
connectors: CapabilityPackConnector[];
|
|
523
|
+
knowledge: CapabilityPackKnowledge[];
|
|
524
|
+
scheduledTaskTemplates: CapabilityPackScheduledTaskTemplate[];
|
|
525
|
+
environment?: CapabilityPackEnvironmentSpec | undefined;
|
|
526
|
+
metadata: Record<string, unknown>;
|
|
527
|
+
};
|
|
528
|
+
/** Input shape for registering a pack manifest (server applies defaults). */
|
|
529
|
+
type RegisterCapabilityPackRequest = {
|
|
530
|
+
id: string;
|
|
531
|
+
name: string;
|
|
532
|
+
description: string;
|
|
533
|
+
role: string;
|
|
534
|
+
category: string;
|
|
535
|
+
version: string;
|
|
536
|
+
sandboxImage?: string | undefined;
|
|
537
|
+
skills?: {
|
|
538
|
+
name: string;
|
|
539
|
+
description?: string | undefined;
|
|
540
|
+
files: CapabilityPackSkillFile[];
|
|
541
|
+
}[] | undefined;
|
|
542
|
+
tools?: ToolRef[] | undefined;
|
|
543
|
+
connectors?: {
|
|
544
|
+
id: string;
|
|
545
|
+
name: string;
|
|
546
|
+
category: string;
|
|
547
|
+
authModel: CapabilityPackConnectorAuthModel;
|
|
548
|
+
providers?: string[] | undefined;
|
|
549
|
+
scopes?: string[] | undefined;
|
|
550
|
+
required?: boolean | undefined;
|
|
551
|
+
metadata?: Record<string, unknown> | undefined;
|
|
552
|
+
}[] | undefined;
|
|
553
|
+
knowledge?: {
|
|
554
|
+
type: "document_base";
|
|
555
|
+
id: string;
|
|
556
|
+
name: string;
|
|
557
|
+
description?: string | null | undefined;
|
|
558
|
+
required?: boolean | undefined;
|
|
559
|
+
}[] | undefined;
|
|
560
|
+
scheduledTaskTemplates?: {
|
|
561
|
+
id: string;
|
|
562
|
+
name: string;
|
|
563
|
+
description: string;
|
|
564
|
+
defaultSchedule: ScheduledTaskScheduleSpec;
|
|
565
|
+
defaultRunMode?: ScheduledTaskRunMode | undefined;
|
|
566
|
+
defaultOverlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
|
|
567
|
+
prompt?: string | undefined;
|
|
568
|
+
}[] | undefined;
|
|
569
|
+
environment?: {
|
|
570
|
+
description: string;
|
|
571
|
+
requiredVariables?: string[] | undefined;
|
|
572
|
+
required?: boolean | undefined;
|
|
573
|
+
} | undefined;
|
|
574
|
+
metadata?: Record<string, unknown> | undefined;
|
|
575
|
+
};
|
|
576
|
+
type WorkspaceRegisteredPack = {
|
|
577
|
+
accountId: string;
|
|
578
|
+
workspaceId: string;
|
|
579
|
+
pack: CapabilityPack;
|
|
580
|
+
createdAt: string;
|
|
581
|
+
updatedAt: string;
|
|
582
|
+
};
|
|
583
|
+
type PackInstallationStatus = "active" | "disabled";
|
|
584
|
+
type PackInstallation = {
|
|
585
|
+
id: string;
|
|
586
|
+
accountId: string;
|
|
587
|
+
workspaceId: string;
|
|
588
|
+
packId: string;
|
|
589
|
+
status: PackInstallationStatus;
|
|
590
|
+
metadata: Record<string, unknown>;
|
|
591
|
+
enabledAt: string;
|
|
592
|
+
updatedAt: string;
|
|
593
|
+
};
|
|
594
|
+
type EnablePackRequest = {
|
|
595
|
+
environmentId?: string | undefined;
|
|
596
|
+
metadata?: Record<string, unknown> | undefined;
|
|
597
|
+
};
|
|
598
|
+
type ListPacksResponse = {
|
|
599
|
+
packs: CapabilityPack[];
|
|
600
|
+
installations: PackInstallation[];
|
|
601
|
+
};
|
|
602
|
+
type GetPackResponse = {
|
|
603
|
+
pack: CapabilityPack;
|
|
604
|
+
installation: PackInstallation | null;
|
|
605
|
+
};
|
|
606
|
+
type CapabilityKind = "pack" | "mcp" | "api" | "skill" | "plugin";
|
|
607
|
+
type CapabilitySource = "built_in" | "configured" | "public_registry" | "manual";
|
|
608
|
+
type CapabilityInstallationStatus = "active" | "disabled";
|
|
609
|
+
type CapabilityRuntime = {
|
|
610
|
+
available: boolean;
|
|
611
|
+
mcpServerId?: string | undefined;
|
|
612
|
+
transport?: string | undefined;
|
|
613
|
+
notes: string | null;
|
|
614
|
+
};
|
|
615
|
+
type CapabilityCatalogItem = {
|
|
616
|
+
id: string;
|
|
617
|
+
accountId?: string | undefined;
|
|
618
|
+
workspaceId?: string | undefined;
|
|
619
|
+
kind: CapabilityKind;
|
|
620
|
+
source: CapabilitySource;
|
|
621
|
+
name: string;
|
|
622
|
+
description: string | null;
|
|
623
|
+
category: string;
|
|
624
|
+
tags: string[];
|
|
625
|
+
homepageUrl: string | null;
|
|
626
|
+
endpointUrl: string | null;
|
|
627
|
+
installUrl: string | null;
|
|
628
|
+
authModel: string | null;
|
|
629
|
+
tools: ToolRef[];
|
|
630
|
+
runtime: CapabilityRuntime;
|
|
631
|
+
enabled: boolean;
|
|
632
|
+
enabledReason: string | null;
|
|
633
|
+
metadata: Record<string, unknown>;
|
|
634
|
+
createdAt?: string | undefined;
|
|
635
|
+
updatedAt?: string | undefined;
|
|
636
|
+
};
|
|
637
|
+
type CapabilityInstallation = {
|
|
638
|
+
id: string;
|
|
639
|
+
accountId: string;
|
|
640
|
+
workspaceId: string;
|
|
641
|
+
capabilityId: string;
|
|
642
|
+
kind: CapabilityKind;
|
|
643
|
+
status: CapabilityInstallationStatus;
|
|
644
|
+
config: Record<string, unknown>;
|
|
645
|
+
metadata: Record<string, unknown>;
|
|
646
|
+
enabledAt: string;
|
|
647
|
+
updatedAt: string;
|
|
648
|
+
};
|
|
649
|
+
type CapabilityCatalogResponse = {
|
|
650
|
+
items: CapabilityCatalogItem[];
|
|
651
|
+
installations: CapabilityInstallation[];
|
|
652
|
+
};
|
|
653
|
+
type CreateCapabilityCatalogItemRequest = {
|
|
654
|
+
id?: string | undefined;
|
|
655
|
+
kind: Exclude<CapabilityKind, "pack">;
|
|
656
|
+
source?: CapabilitySource | undefined;
|
|
657
|
+
name: string;
|
|
658
|
+
description?: string | undefined;
|
|
659
|
+
category?: string | undefined;
|
|
660
|
+
tags?: string[] | undefined;
|
|
661
|
+
homepageUrl?: string | undefined;
|
|
662
|
+
endpointUrl?: string | undefined;
|
|
663
|
+
installUrl?: string | undefined;
|
|
664
|
+
authModel?: string | undefined;
|
|
665
|
+
metadata?: Record<string, unknown> | undefined;
|
|
666
|
+
};
|
|
667
|
+
type EnableCapabilityRequest = {
|
|
668
|
+
config?: Record<string, unknown> | undefined;
|
|
669
|
+
metadata?: Record<string, unknown> | undefined;
|
|
670
|
+
/**
|
|
671
|
+
* Credential headers for remote MCP capabilities. Write-only: encrypted at
|
|
672
|
+
* rest, injected only into the runtime MCP client, never returned by the
|
|
673
|
+
* API (responses expose header names only).
|
|
674
|
+
*/
|
|
675
|
+
headers?: Record<string, string> | undefined;
|
|
676
|
+
/**
|
|
677
|
+
* Initial environment attachment for kind=pack capabilities — mirrors the
|
|
678
|
+
* dedicated POST /packs/:id/enable body. Required to enable an
|
|
679
|
+
* environment.required pack through this unified path; ignored otherwise.
|
|
680
|
+
*/
|
|
681
|
+
environmentId?: string | undefined;
|
|
682
|
+
};
|
|
683
|
+
type DiscoverMcpCapabilitiesResponse = {
|
|
684
|
+
items: CapabilityCatalogItem[];
|
|
685
|
+
source: "official_mcp_registry";
|
|
686
|
+
sourceUrl: string;
|
|
687
|
+
};
|
|
688
|
+
type GitHubRepository = {
|
|
689
|
+
id: number;
|
|
690
|
+
installationId: number;
|
|
691
|
+
fullName: string;
|
|
692
|
+
name: string;
|
|
693
|
+
private: boolean;
|
|
694
|
+
htmlUrl: string;
|
|
695
|
+
cloneUrl: string;
|
|
696
|
+
defaultBranch: string;
|
|
697
|
+
accountLogin: string;
|
|
698
|
+
accountType: string | null;
|
|
699
|
+
};
|
|
700
|
+
type GitHubAppInfo = {
|
|
701
|
+
configured: boolean;
|
|
702
|
+
appId: string | null;
|
|
703
|
+
clientId: string | null;
|
|
704
|
+
appSlug: string | null;
|
|
705
|
+
/** Ready-to-open GitHub install URL (carries the signed state), if configured. */
|
|
706
|
+
installUrl: string | null;
|
|
707
|
+
/** Setting names still missing when `configured` is false. */
|
|
708
|
+
missing: string[];
|
|
709
|
+
};
|
|
710
|
+
type GitHubRepositoriesResponse = {
|
|
711
|
+
repositories: GitHubRepository[];
|
|
712
|
+
};
|
|
713
|
+
type CreateGitHubAppManifestRequest = {
|
|
714
|
+
appName?: string | undefined;
|
|
715
|
+
organization?: string | undefined;
|
|
716
|
+
public?: boolean | undefined;
|
|
717
|
+
includeCiPermissions?: boolean | undefined;
|
|
718
|
+
};
|
|
719
|
+
type CreateGitHubAppManifestResponse = {
|
|
720
|
+
/** GitHub URL to POST the manifest to (personal or organization flow). */
|
|
721
|
+
actionUrl: string;
|
|
722
|
+
state: string;
|
|
723
|
+
manifest: Record<string, unknown>;
|
|
724
|
+
};
|
|
725
|
+
type BillingMode = "disabled" | "stripe";
|
|
726
|
+
type EntitlementsMode = "none" | "static" | "managed";
|
|
727
|
+
type BillingBalance = {
|
|
728
|
+
accountId: string;
|
|
729
|
+
balanceMicros: number;
|
|
730
|
+
currency: "usd";
|
|
731
|
+
updatedAt: string;
|
|
732
|
+
};
|
|
733
|
+
declare const KNOWN_USAGE_EVENT_TYPES: readonly ["agent_run.created", "agent_run.completed", "model.tokens", "model.cost", "file.uploaded", "file.deleted", "document.indexed", "scheduled_task.fired", "api_key.request"];
|
|
734
|
+
type KnownUsageEventType = (typeof KNOWN_USAGE_EVENT_TYPES)[number];
|
|
735
|
+
type UsageEventType = KnownUsageEventType | (string & {});
|
|
736
|
+
type UsageEvent = {
|
|
737
|
+
id: string;
|
|
738
|
+
workspaceId: string;
|
|
739
|
+
accountId: string;
|
|
740
|
+
subjectId: string | null;
|
|
741
|
+
eventType: UsageEventType;
|
|
742
|
+
quantity: number;
|
|
743
|
+
unit: string;
|
|
744
|
+
sourceResourceType: string | null;
|
|
745
|
+
sourceResourceId: string | null;
|
|
746
|
+
idempotencyKey: string;
|
|
747
|
+
occurredAt: string;
|
|
748
|
+
recordedAt: string;
|
|
749
|
+
exportedToBillingAt: string | null;
|
|
750
|
+
billingProviderEventId: string | null;
|
|
751
|
+
};
|
|
752
|
+
type EntitlementValue = boolean | string | number | string[];
|
|
753
|
+
type Entitlements = Record<string, EntitlementValue>;
|
|
754
|
+
type BillingSummary = {
|
|
755
|
+
mode: BillingMode;
|
|
756
|
+
balance: BillingBalance;
|
|
757
|
+
};
|
|
758
|
+
type BillingUsageResponse = {
|
|
759
|
+
balance: BillingBalance;
|
|
760
|
+
usage: UsageEvent[];
|
|
761
|
+
};
|
|
762
|
+
type BillingEntitlementsResponse = {
|
|
763
|
+
accountId: string;
|
|
764
|
+
mode: EntitlementsMode;
|
|
765
|
+
entitlements: Entitlements;
|
|
766
|
+
};
|
|
767
|
+
type CreateCheckoutRequest = {
|
|
768
|
+
accountId?: string | undefined;
|
|
769
|
+
/** USD amount with cent precision (server enforces min/max). */
|
|
770
|
+
amountUsd: number;
|
|
771
|
+
successUrl?: string | undefined;
|
|
772
|
+
cancelUrl?: string | undefined;
|
|
773
|
+
};
|
|
774
|
+
type CreateCheckoutResponse = {
|
|
775
|
+
checkoutSessionId: string;
|
|
776
|
+
url: string;
|
|
777
|
+
};
|
|
778
|
+
type UserMessageEventInput = {
|
|
779
|
+
type: "user.message";
|
|
780
|
+
clientEventId?: string | undefined;
|
|
781
|
+
payload: {
|
|
782
|
+
text: string;
|
|
783
|
+
resources?: ResourceRef[] | undefined;
|
|
784
|
+
tools?: ToolRef[] | undefined;
|
|
785
|
+
model?: string | undefined;
|
|
786
|
+
reasoningEffort?: ReasoningEffort | undefined;
|
|
787
|
+
};
|
|
788
|
+
};
|
|
789
|
+
type UserInterruptEventInput = {
|
|
790
|
+
type: "user.interrupt";
|
|
791
|
+
clientEventId?: string | undefined;
|
|
792
|
+
payload?: {
|
|
793
|
+
reason?: string | undefined;
|
|
794
|
+
} | undefined;
|
|
795
|
+
};
|
|
796
|
+
type UserApprovalDecisionEventInput = {
|
|
797
|
+
type: "user.approvalDecision";
|
|
798
|
+
clientEventId?: string | undefined;
|
|
799
|
+
payload: {
|
|
800
|
+
approvalId: string;
|
|
801
|
+
decision: "approve" | "reject";
|
|
802
|
+
message?: string | undefined;
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
/** Control/user events a client may POST to a session's event log. */
|
|
806
|
+
type ClientSessionEventInput = UserMessageEventInput | UserInterruptEventInput | UserApprovalDecisionEventInput;
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* Transport boundary for the streaming core. The client implements it with
|
|
810
|
+
* `fetch`; unit tests script it directly.
|
|
811
|
+
*/
|
|
812
|
+
type SessionEventStreamTransport = {
|
|
813
|
+
/** Open the SSE stream, replaying durable events after `after` first. */
|
|
814
|
+
openStream: (after: number, signal: AbortSignal | undefined) => Promise<ReadableStream<Uint8Array>>;
|
|
815
|
+
/** Replay durable events by sequence (`GET .../events?after=&limit=`). */
|
|
816
|
+
listEvents: (after: number, limit: number) => Promise<SessionEvent[]>;
|
|
817
|
+
};
|
|
818
|
+
type StreamConnectionState = "connecting" | "live" | "reconnecting";
|
|
819
|
+
type StreamSessionEventsOptions = {
|
|
820
|
+
/** Resume after this sequence number (exclusive). Defaults to 0 (full replay). */
|
|
821
|
+
after?: number;
|
|
822
|
+
/** Aborting ends the stream gracefully (the generator returns). */
|
|
823
|
+
signal?: AbortSignal;
|
|
824
|
+
/** Reconnect on transient drops. Defaults to true. */
|
|
825
|
+
reconnect?: boolean;
|
|
826
|
+
/** Initial reconnect backoff. Defaults to 500ms. */
|
|
827
|
+
reconnectDelayMs?: number;
|
|
828
|
+
/** Backoff ceiling. Defaults to 10s. */
|
|
829
|
+
maxReconnectDelayMs?: number;
|
|
830
|
+
/**
|
|
831
|
+
* Give up after this many consecutive failed reconnect attempts (i.e. N
|
|
832
|
+
* reconnects = N+1 total open-stream calls). Defaults to unlimited.
|
|
833
|
+
*/
|
|
834
|
+
maxReconnectAttempts?: number;
|
|
835
|
+
onStateChange?: (state: StreamConnectionState) => void;
|
|
836
|
+
};
|
|
837
|
+
/**
|
|
838
|
+
* Stream a session's events with exactly-once, in-order delivery.
|
|
839
|
+
*
|
|
840
|
+
* Guarantees, anchored on the per-session contiguous `sequence`:
|
|
841
|
+
* - **No duplicates**: events at or below the cursor are dropped, so server
|
|
842
|
+
* replay overlap and reconnect overlap never re-yield.
|
|
843
|
+
* - **No gaps**: each reconnect resumes from the last seen sequence, and a
|
|
844
|
+
* gap observed inside one connection is backfilled from the durable replay
|
|
845
|
+
* endpoint before the newer event is yielded (events are durable before
|
|
846
|
+
* they are published live, so the backfill always finds them).
|
|
847
|
+
* - **Ordered**: sequences are yielded strictly ascending.
|
|
848
|
+
*
|
|
849
|
+
* The generator ends when `signal` aborts, when the server closes and
|
|
850
|
+
* `reconnect` is false, or with an error for non-retryable failures.
|
|
851
|
+
*/
|
|
852
|
+
declare function streamSessionEvents(transport: SessionEventStreamTransport, options?: StreamSessionEventsOptions): AsyncGenerator<SessionEvent, void, void>;
|
|
853
|
+
|
|
854
|
+
type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
855
|
+
type OpenGeniClientOptions = {
|
|
856
|
+
/** Base URL of the OpenGeni API, e.g. `https://api.example.com`. */
|
|
857
|
+
baseUrl: string;
|
|
858
|
+
/** OpenGeni API key, sent as `Authorization: Bearer <apiKey>`. */
|
|
859
|
+
apiKey?: string;
|
|
860
|
+
/** Extra headers (static or computed per request) merged into every call. */
|
|
861
|
+
headers?: Record<string, string> | (() => Record<string, string>);
|
|
862
|
+
/** Custom fetch implementation. Defaults to the global `fetch`. */
|
|
863
|
+
fetch?: FetchLike;
|
|
864
|
+
};
|
|
865
|
+
type SendMessageInput = {
|
|
866
|
+
text: string;
|
|
867
|
+
resources?: ResourceRef[];
|
|
868
|
+
tools?: ToolRef[];
|
|
869
|
+
model?: string;
|
|
870
|
+
reasoningEffort?: ReasoningEffort;
|
|
871
|
+
clientEventId?: string;
|
|
872
|
+
};
|
|
873
|
+
type SteerMessageResult = {
|
|
874
|
+
/** The accepted `user.message` event. */
|
|
875
|
+
accepted: SessionEvent;
|
|
876
|
+
/**
|
|
877
|
+
* The turn created for the message, when it could be located — usually
|
|
878
|
+
* still queued, but already claimed (running/requires_action or even
|
|
879
|
+
* finished) when the worker picked it up mid-call.
|
|
880
|
+
*/
|
|
881
|
+
turn: SessionTurn | null;
|
|
882
|
+
/** True when the running turn was interrupted to make way for the message. */
|
|
883
|
+
interrupted: boolean;
|
|
884
|
+
};
|
|
885
|
+
/**
|
|
886
|
+
* Typed client for the OpenGeni public API. Framework-agnostic: only needs
|
|
887
|
+
* WHATWG `fetch` + streams, so it runs in Node 18+, Bun, Deno, browsers, and
|
|
888
|
+
* edge runtimes.
|
|
889
|
+
*/
|
|
890
|
+
declare class OpenGeniClient {
|
|
891
|
+
private readonly baseUrl;
|
|
892
|
+
private readonly options;
|
|
893
|
+
private readonly fetchImpl;
|
|
894
|
+
constructor(options: OpenGeniClientOptions);
|
|
895
|
+
createSession(workspaceId: string, request: CreateSessionRequest): Promise<Session>;
|
|
896
|
+
getSession(workspaceId: string, sessionId: string): Promise<Session>;
|
|
897
|
+
listSessions(workspaceId: string, options?: {
|
|
898
|
+
limit?: number;
|
|
899
|
+
}): Promise<Session[]>;
|
|
900
|
+
listTurns(workspaceId: string, sessionId: string, options?: {
|
|
901
|
+
limit?: number;
|
|
902
|
+
}): Promise<SessionTurn[]>;
|
|
903
|
+
listScheduledTasks(workspaceId: string, options?: {
|
|
904
|
+
limit?: number;
|
|
905
|
+
}): Promise<ScheduledTask[]>;
|
|
906
|
+
getScheduledTask(workspaceId: string, taskId: string): Promise<ScheduledTask>;
|
|
907
|
+
/** Replay durable events by sequence: events with `sequence > after`, ascending. */
|
|
908
|
+
listEvents(workspaceId: string, sessionId: string, options?: {
|
|
909
|
+
after?: number;
|
|
910
|
+
limit?: number;
|
|
911
|
+
}): Promise<SessionEvent[]>;
|
|
912
|
+
/** POST a user/control event to the session. Returns the accepted event. */
|
|
913
|
+
sendEvent(workspaceId: string, sessionId: string, event: ClientSessionEventInput): Promise<SessionEvent>;
|
|
914
|
+
sendMessage(workspaceId: string, sessionId: string, message: string | SendMessageInput): Promise<SessionEvent>;
|
|
915
|
+
interrupt(workspaceId: string, sessionId: string, options?: {
|
|
916
|
+
reason?: string;
|
|
917
|
+
clientEventId?: string;
|
|
918
|
+
}): Promise<SessionEvent>;
|
|
919
|
+
sendApprovalDecision(workspaceId: string, sessionId: string, decision: {
|
|
920
|
+
approvalId: string;
|
|
921
|
+
decision: "approve" | "reject";
|
|
922
|
+
message?: string;
|
|
923
|
+
clientEventId?: string;
|
|
924
|
+
}): Promise<SessionEvent>;
|
|
925
|
+
/**
|
|
926
|
+
* Live-stream a session's events with automatic reconnect, resume from the
|
|
927
|
+
* last seen sequence, gap backfill, and duplicate suppression. See
|
|
928
|
+
* {@link streamSessionEvents} for the delivery guarantees.
|
|
929
|
+
*/
|
|
930
|
+
streamEvents(workspaceId: string, sessionId: string, options?: StreamSessionEventsOptions): AsyncGenerator<SessionEvent, void, void>;
|
|
931
|
+
/** The transport `streamEvents` runs on; useful for custom streaming layers. */
|
|
932
|
+
eventStreamTransport(workspaceId: string, sessionId: string): SessionEventStreamTransport;
|
|
933
|
+
/** Open one raw SSE connection (no reconnect). Most callers want `streamEvents`. */
|
|
934
|
+
openEventStream(workspaceId: string, sessionId: string, options?: {
|
|
935
|
+
after?: number;
|
|
936
|
+
signal?: AbortSignal;
|
|
937
|
+
}): Promise<ReadableStream<Uint8Array>>;
|
|
938
|
+
/** Edit a still-queued turn (prompt, model, resources, tools, ...). */
|
|
939
|
+
updateQueuedTurn(workspaceId: string, sessionId: string, turnId: string, update: UpdateSessionTurnRequest): Promise<SessionTurn>;
|
|
940
|
+
/**
|
|
941
|
+
* Reorder the queued turns. `turnIds` must all reference queued turns; the
|
|
942
|
+
* server assigns positions in the given order and returns the queue.
|
|
943
|
+
*/
|
|
944
|
+
reorderQueuedTurns(workspaceId: string, sessionId: string, turnIds: string[]): Promise<SessionTurn[]>;
|
|
945
|
+
/** Cancel a queued turn before it is claimed. Returns the cancelled turn. */
|
|
946
|
+
deleteQueuedTurn(workspaceId: string, sessionId: string, turnId: string): Promise<SessionTurn>;
|
|
947
|
+
/**
|
|
948
|
+
* Steer: deliver a message *now* instead of behind the queue. Sends the
|
|
949
|
+
* message, promotes its queued turn to the front, and interrupts the
|
|
950
|
+
* running turn so the session picks the steer turn up next. On a session
|
|
951
|
+
* that is not running this degrades gracefully to a plain queued message.
|
|
952
|
+
*
|
|
953
|
+
* The steer turn is located by `triggerEventId` across ALL turns (retried
|
|
954
|
+
* briefly in case the server is still materializing it) — not just the
|
|
955
|
+
* queued ones, because the worker can claim the steer turn before it is
|
|
956
|
+
* ever observed queued, and a claimed steer turn means the message is
|
|
957
|
+
* already being delivered: interrupting then would cancel the very message
|
|
958
|
+
* being steered. If the turn cannot be found while other turns are queued,
|
|
959
|
+
* the interrupt is also skipped — stopping the running turn would otherwise
|
|
960
|
+
* promote someone else's queued work over this message — and the call
|
|
961
|
+
* degrades to a plain queued send (`interrupted: false`).
|
|
962
|
+
*/
|
|
963
|
+
steerMessage(workspaceId: string, sessionId: string, message: string | SendMessageInput): Promise<SteerMessageResult>;
|
|
964
|
+
/** The session's goal. 404s when the session never had one. */
|
|
965
|
+
getGoal(workspaceId: string, sessionId: string): Promise<SessionGoal>;
|
|
966
|
+
updateGoal(workspaceId: string, sessionId: string, request: UpdateSessionGoalRequest): Promise<SessionGoal>;
|
|
967
|
+
/** Pause the goal loop: the session stops self-continuing until resumed. */
|
|
968
|
+
pauseGoal(workspaceId: string, sessionId: string, options?: {
|
|
969
|
+
rationale?: string;
|
|
970
|
+
}): Promise<SessionGoal>;
|
|
971
|
+
/** Resume a paused goal: resets counters and re-arms the continuation loop. */
|
|
972
|
+
resumeGoal(workspaceId: string, sessionId: string): Promise<SessionGoal>;
|
|
973
|
+
/**
|
|
974
|
+
* Clear the session's conversation context. Destructive and audit-preserving:
|
|
975
|
+
* the server supersedes (never deletes) the live history and emits a
|
|
976
|
+
* `session.context.cleared` event. Refused (409) while a turn is in flight or
|
|
977
|
+
* awaiting action. `confirm:true` is sent so an accidental call cannot wipe
|
|
978
|
+
* context — the destructive intent is explicit on the wire.
|
|
979
|
+
*/
|
|
980
|
+
clearSessionContext(workspaceId: string, sessionId: string): Promise<void>;
|
|
981
|
+
/**
|
|
982
|
+
* Trigger conversation compaction now. On the client-managed (Azure) path this
|
|
983
|
+
* queues a forced compaction the worker honors before the next turn
|
|
984
|
+
* (`status:"queued"`); on a server-managed provider or when compaction is off
|
|
985
|
+
* it is a no-op (`status:"noop"`) with an explanatory message.
|
|
986
|
+
*/
|
|
987
|
+
compactSessionContext(workspaceId: string, sessionId: string): Promise<CompactSessionContextResult>;
|
|
988
|
+
/** The caller's access context: subject, account + workspace grants, defaults. */
|
|
989
|
+
getAccessContext(): Promise<AccessContext>;
|
|
990
|
+
listWorkspaces(): Promise<Workspace[]>;
|
|
991
|
+
createWorkspace(request: CreateWorkspaceRequest): Promise<Workspace>;
|
|
992
|
+
getWorkspace(workspaceId: string): Promise<Workspace>;
|
|
993
|
+
updateWorkspace(workspaceId: string, request: UpdateWorkspaceRequest): Promise<Workspace>;
|
|
994
|
+
createScheduledTask(workspaceId: string, request: CreateScheduledTaskRequest): Promise<ScheduledTask>;
|
|
995
|
+
updateScheduledTask(workspaceId: string, taskId: string, request: UpdateScheduledTaskRequest): Promise<ScheduledTask>;
|
|
996
|
+
pauseScheduledTask(workspaceId: string, taskId: string): Promise<ScheduledTask>;
|
|
997
|
+
resumeScheduledTask(workspaceId: string, taskId: string): Promise<ScheduledTask>;
|
|
998
|
+
/**
|
|
999
|
+
* Fire the task immediately (manual trigger), independent of its schedule.
|
|
1000
|
+
* Pass a stable `triggerId` to make a retried trigger idempotent — the same
|
|
1001
|
+
* token charges once and starts one run. Omit it and each call is distinct.
|
|
1002
|
+
*/
|
|
1003
|
+
triggerScheduledTask(workspaceId: string, taskId: string, options?: {
|
|
1004
|
+
triggerId?: string;
|
|
1005
|
+
}): Promise<ScheduledTask>;
|
|
1006
|
+
deleteScheduledTask(workspaceId: string, taskId: string): Promise<void>;
|
|
1007
|
+
listScheduledTaskRuns(workspaceId: string, taskId: string, options?: {
|
|
1008
|
+
limit?: number;
|
|
1009
|
+
}): Promise<ScheduledTaskRun[]>;
|
|
1010
|
+
listEnvironments(workspaceId: string): Promise<WorkspaceEnvironment[]>;
|
|
1011
|
+
createEnvironment(workspaceId: string, request: CreateWorkspaceEnvironmentRequest): Promise<WorkspaceEnvironment>;
|
|
1012
|
+
getEnvironment(workspaceId: string, environmentId: string): Promise<WorkspaceEnvironment>;
|
|
1013
|
+
updateEnvironment(workspaceId: string, environmentId: string, request: UpdateWorkspaceEnvironmentRequest): Promise<WorkspaceEnvironment>;
|
|
1014
|
+
deleteEnvironment(workspaceId: string, environmentId: string): Promise<void>;
|
|
1015
|
+
/** Create or rotate a variable. The value never comes back on any read. */
|
|
1016
|
+
setEnvironmentVariable(workspaceId: string, environmentId: string, name: string, value: string): Promise<WorkspaceEnvironmentVariableMetadata>;
|
|
1017
|
+
deleteEnvironmentVariable(workspaceId: string, environmentId: string, name: string): Promise<void>;
|
|
1018
|
+
/** Step 1 of the upload flow: returns the pre-signed PUT target. */
|
|
1019
|
+
beginFileUpload(workspaceId: string, request: CreateFileUploadRequest): Promise<CreateFileUploadResponse>;
|
|
1020
|
+
/** Step 3 of the upload flow: server verifies the object and marks it ready. */
|
|
1021
|
+
completeFileUpload(workspaceId: string, uploadId: string): Promise<FileAsset>;
|
|
1022
|
+
/**
|
|
1023
|
+
* The whole upload flow as one call: begin -> PUT the bytes to the signed
|
|
1024
|
+
* URL (with its required headers; no API auth is sent to object storage)
|
|
1025
|
+
* -> complete. Returns the ready `FileAsset`.
|
|
1026
|
+
*/
|
|
1027
|
+
uploadFile(workspaceId: string, input: UploadFileInput): Promise<FileAsset>;
|
|
1028
|
+
getFile(workspaceId: string, fileId: string): Promise<FileAsset>;
|
|
1029
|
+
/** Mint a short-lived signed download URL for a ready file. */
|
|
1030
|
+
createFileDownloadUrl(workspaceId: string, fileId: string): Promise<FileDownloadUrlResponse>;
|
|
1031
|
+
createDocumentBase(workspaceId: string, request: CreateDocumentBaseRequest): Promise<DocumentBase>;
|
|
1032
|
+
listDocumentBases(workspaceId: string): Promise<DocumentBase[]>;
|
|
1033
|
+
getDocumentBase(workspaceId: string, baseId: string): Promise<DocumentBase>;
|
|
1034
|
+
/** Index an uploaded file into the base. The file must be `ready`. */
|
|
1035
|
+
addDocument(workspaceId: string, baseId: string, request: {
|
|
1036
|
+
fileId: string;
|
|
1037
|
+
}): Promise<Document>;
|
|
1038
|
+
listDocuments(workspaceId: string, baseId: string): Promise<Document[]>;
|
|
1039
|
+
/** Retry indexing for a failed document. */
|
|
1040
|
+
reindexDocument(workspaceId: string, baseId: string, documentId: string): Promise<Document>;
|
|
1041
|
+
searchDocuments(workspaceId: string, baseId: string, request: {
|
|
1042
|
+
query: string;
|
|
1043
|
+
limit?: number;
|
|
1044
|
+
}): Promise<DocumentSearchResponse>;
|
|
1045
|
+
/** Built-in + registered packs, with the workspace's installations. */
|
|
1046
|
+
listPacks(workspaceId: string): Promise<ListPacksResponse>;
|
|
1047
|
+
/** Register (or replace) a workspace-scoped pack from a manifest. */
|
|
1048
|
+
registerPack(workspaceId: string, manifest: RegisterCapabilityPackRequest): Promise<WorkspaceRegisteredPack>;
|
|
1049
|
+
getPack(workspaceId: string, packId: string): Promise<GetPackResponse>;
|
|
1050
|
+
enablePack(workspaceId: string, packId: string, request?: EnablePackRequest): Promise<PackInstallation>;
|
|
1051
|
+
/** Unregister a workspace-scoped pack (built-in packs cannot be deleted). */
|
|
1052
|
+
deletePack(workspaceId: string, packId: string): Promise<void>;
|
|
1053
|
+
listPackInstallations(workspaceId: string): Promise<PackInstallation[]>;
|
|
1054
|
+
listCapabilities(workspaceId: string): Promise<CapabilityCatalogResponse>;
|
|
1055
|
+
/** Add a manual capability catalog item (e.g. a remote MCP server). */
|
|
1056
|
+
createCapability(workspaceId: string, request: CreateCapabilityCatalogItemRequest): Promise<CapabilityCatalogItem>;
|
|
1057
|
+
enableCapability(workspaceId: string, capabilityId: string, request?: EnableCapabilityRequest): Promise<CapabilityInstallation>;
|
|
1058
|
+
disableCapability(workspaceId: string, capabilityId: string): Promise<CapabilityInstallation>;
|
|
1059
|
+
/** Search the official MCP registry for installable capabilities. */
|
|
1060
|
+
discoverMcpCapabilities(workspaceId: string, options?: {
|
|
1061
|
+
query?: string;
|
|
1062
|
+
limit?: number;
|
|
1063
|
+
}): Promise<DiscoverMcpCapabilitiesResponse>;
|
|
1064
|
+
/** GitHub App configuration status + a signed install URL when configured. */
|
|
1065
|
+
getGitHubApp(workspaceId: string): Promise<GitHubAppInfo>;
|
|
1066
|
+
/**
|
|
1067
|
+
* Browser entry point that plants the CSRF cookie and forwards to GitHub's
|
|
1068
|
+
* install page. Open this in a browser (it redirects); `state` comes from
|
|
1069
|
+
* `getGitHubApp().installUrl` or a github_connect_link tool.
|
|
1070
|
+
*/
|
|
1071
|
+
githubConnectUrl(workspaceId: string, state: string): string;
|
|
1072
|
+
listGitHubRepositories(workspaceId: string): Promise<GitHubRepositoriesResponse>;
|
|
1073
|
+
/** Re-sync the installation's repository list from GitHub. */
|
|
1074
|
+
syncGitHubRepositories(workspaceId: string): Promise<GitHubRepositoriesResponse>;
|
|
1075
|
+
/** Build a GitHub App manifest + the GitHub URL to submit it to. */
|
|
1076
|
+
createGitHubAppManifest(workspaceId: string, request?: CreateGitHubAppManifestRequest): Promise<CreateGitHubAppManifestResponse>;
|
|
1077
|
+
listApiKeys(workspaceId: string): Promise<ApiKey[]>;
|
|
1078
|
+
/** The returned `token` is shown once; only its prefix is stored. */
|
|
1079
|
+
createApiKey(workspaceId: string, request: CreateApiKeyRequest): Promise<CreateApiKeyResponse>;
|
|
1080
|
+
/** Revoke an API key. Returns the revoked key. */
|
|
1081
|
+
deleteApiKey(workspaceId: string, apiKeyId: string): Promise<ApiKey>;
|
|
1082
|
+
getBilling(options?: {
|
|
1083
|
+
accountId?: string;
|
|
1084
|
+
}): Promise<BillingSummary>;
|
|
1085
|
+
getBillingUsage(options?: {
|
|
1086
|
+
accountId?: string;
|
|
1087
|
+
workspaceId?: string;
|
|
1088
|
+
}): Promise<BillingUsageResponse>;
|
|
1089
|
+
getBillingEntitlements(options?: {
|
|
1090
|
+
accountId?: string;
|
|
1091
|
+
}): Promise<BillingEntitlementsResponse>;
|
|
1092
|
+
/** Start a Stripe checkout for prepaid credits. */
|
|
1093
|
+
createBillingCheckout(request: CreateCheckoutRequest): Promise<CreateCheckoutResponse>;
|
|
1094
|
+
private headers;
|
|
1095
|
+
private url;
|
|
1096
|
+
private requestJson;
|
|
1097
|
+
/** Like `requestJson` for endpoints that respond with no body (204). */
|
|
1098
|
+
private requestVoid;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
/** Error for a non-2xx OpenGeni API response. */
|
|
1102
|
+
declare class OpenGeniApiError extends Error {
|
|
1103
|
+
readonly status: number;
|
|
1104
|
+
readonly body: string;
|
|
1105
|
+
constructor(status: number, body: string);
|
|
1106
|
+
}
|
|
1107
|
+
/** Error for an unrecoverable event-stream condition (not a transient drop). */
|
|
1108
|
+
declare class OpenGeniStreamError extends Error {
|
|
1109
|
+
constructor(message: string);
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* Transient conditions worth a reconnect: network-level failures (`fetch`
|
|
1113
|
+
* rejects with `TypeError`) and HTTP statuses that signal a temporary server
|
|
1114
|
+
* or contention condition. Auth/validation failures (401/403/404/...) are
|
|
1115
|
+
* permanent and surface to the caller instead.
|
|
1116
|
+
*/
|
|
1117
|
+
declare function isRetryableStreamError(error: unknown): boolean;
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* Proxy-through-your-own-API helpers.
|
|
1121
|
+
*
|
|
1122
|
+
* The intended pattern: a customer's server consumes the OpenGeni event
|
|
1123
|
+
* stream with its own API key (`client.streamEvents(...)`) and re-emits it to
|
|
1124
|
+
* its browser clients over its own authenticated endpoint — the OpenGeni key
|
|
1125
|
+
* never reaches the browser. The re-emitted wire format is identical to
|
|
1126
|
+
* OpenGeni's own SSE stream (`id: <sequence>`, `event: <type>`,
|
|
1127
|
+
* `data: <event JSON>`), so the browser side can consume it with this same
|
|
1128
|
+
* SDK's streaming core (or a plain `EventSource`), including resume via
|
|
1129
|
+
* `?after=` / `Last-Event-ID`.
|
|
1130
|
+
*/
|
|
1131
|
+
/** Format one event exactly as OpenGeni's API emits it over SSE. */
|
|
1132
|
+
declare function formatSseEvent(event: SessionEvent): string;
|
|
1133
|
+
type SseReStreamOptions = {
|
|
1134
|
+
/**
|
|
1135
|
+
* Emit `: ping` comment lines at this interval, keeping intermediaries from
|
|
1136
|
+
* idling the connection out. Disabled when omitted.
|
|
1137
|
+
*/
|
|
1138
|
+
heartbeatMs?: number;
|
|
1139
|
+
/**
|
|
1140
|
+
* Called when the downstream consumer cancels (e.g. the browser
|
|
1141
|
+
* disconnected). Use it to abort the upstream OpenGeni stream — an async
|
|
1142
|
+
* iterator that is mid-`await` cannot be interrupted by `return()` alone.
|
|
1143
|
+
*/
|
|
1144
|
+
onCancel?: () => void;
|
|
1145
|
+
};
|
|
1146
|
+
/**
|
|
1147
|
+
* Re-emit a stream of session events as an SSE byte stream. Pull-based, so
|
|
1148
|
+
* upstream consumption follows downstream demand; cancelling the returned
|
|
1149
|
+
* stream fires `onCancel` and ends the upstream iterator.
|
|
1150
|
+
*/
|
|
1151
|
+
declare function sessionEventsToSseStream(events: AsyncIterable<SessionEvent>, options?: SseReStreamOptions): ReadableStream<Uint8Array>;
|
|
1152
|
+
/** Wrap an event stream in a ready-to-return SSE `Response`. */
|
|
1153
|
+
declare function sessionEventsToSseResponse(events: AsyncIterable<SessionEvent>, options?: SseReStreamOptions): Response;
|
|
1154
|
+
/**
|
|
1155
|
+
* Read the resume cursor a reconnecting SSE client sent: the `after` query
|
|
1156
|
+
* parameter, or the standard `Last-Event-ID` header (the re-emitted stream
|
|
1157
|
+
* sets `id:` to the sequence). Returns 0 (full replay) when absent.
|
|
1158
|
+
*/
|
|
1159
|
+
declare function resumeSequenceFromRequest(request: Request): number;
|
|
1160
|
+
type ProxySessionEventStreamOptions = Omit<StreamSessionEventsOptions, "after"> & {
|
|
1161
|
+
/**
|
|
1162
|
+
* Resume cursor. Pass a number, or the incoming browser `Request` to
|
|
1163
|
+
* honor its `?after=` / `Last-Event-ID` automatically.
|
|
1164
|
+
*/
|
|
1165
|
+
after?: number | Request;
|
|
1166
|
+
/** See {@link SseReStreamOptions.heartbeatMs}. */
|
|
1167
|
+
heartbeatMs?: number;
|
|
1168
|
+
};
|
|
1169
|
+
/**
|
|
1170
|
+
* One-call proxy: consume the OpenGeni stream server-side and return an SSE
|
|
1171
|
+
* `Response` for your own browser clients. Works anywhere WHATWG `Response`
|
|
1172
|
+
* is the handler return type (Hono, Next.js route handlers, Bun.serve,
|
|
1173
|
+
* Cloudflare Workers, ...).
|
|
1174
|
+
*
|
|
1175
|
+
* The upstream OpenGeni connection is torn down when the downstream client
|
|
1176
|
+
* disconnects, and also when `options.signal` (e.g. the incoming request's
|
|
1177
|
+
* signal) aborts.
|
|
1178
|
+
*/
|
|
1179
|
+
declare function proxySessionEventStream(client: OpenGeniClient, workspaceId: string, sessionId: string, options?: ProxySessionEventStreamOptions): Response;
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* Minimal incremental Server-Sent Events parser over a byte stream.
|
|
1183
|
+
*
|
|
1184
|
+
* Implements the parts of the SSE wire format OpenGeni uses: `id`, `event`,
|
|
1185
|
+
* and `data` fields, multi-line data, comment lines, and both LF and CRLF
|
|
1186
|
+
* line endings. Messages without any `data` (comments, id-only blocks) are
|
|
1187
|
+
* not emitted.
|
|
1188
|
+
*/
|
|
1189
|
+
type SseMessage = {
|
|
1190
|
+
id?: string;
|
|
1191
|
+
event?: string;
|
|
1192
|
+
data: string;
|
|
1193
|
+
};
|
|
1194
|
+
declare function parseSseStream(stream: ReadableStream<Uint8Array>): AsyncGenerator<SseMessage, void, void>;
|
|
1195
|
+
|
|
1196
|
+
export { type AccessContext, type AccessGrant, type AccountGrant, type AccountRole, type AgentMessageCompletedPayload, type AgentTextDeltaPayload, type AgentToolCallCreatedPayload, type AgentToolCallOutputPayload, type ApiKey, type BillingBalance, type BillingEntitlementsResponse, type BillingMode, type BillingSummary, type BillingUsageResponse, type CapabilityCatalogItem, type CapabilityCatalogResponse, type CapabilityInstallation, type CapabilityInstallationStatus, type CapabilityKind, type CapabilityPack, type CapabilityPackConnector, type CapabilityPackConnectorAuthModel, type CapabilityPackEnvironmentSpec, type CapabilityPackKnowledge, type CapabilityPackScheduledTaskTemplate, type CapabilityPackSkill, type CapabilityPackSkillFile, type CapabilityRuntime, type CapabilitySource, type ClientSessionEventInput, type CompactSessionContextResult, type CompleteFileUploadResponse, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateCapabilityCatalogItemRequest, type CreateCheckoutRequest, type CreateCheckoutResponse, type CreateDocumentBaseRequest, type CreateFileUploadRequest, type CreateFileUploadResponse, type CreateGitHubAppManifestRequest, type CreateGitHubAppManifestResponse, type CreateScheduledTaskRequest, type CreateSessionRequest, type CreateWorkspaceEnvironmentRequest, type CreateWorkspaceRequest, type DiscoverMcpCapabilitiesResponse, type Document, type DocumentBase, type DocumentSearchRequest, type DocumentSearchResponse, type DocumentSearchResult, type DocumentStatus, type EnableCapabilityRequest, type EnablePackRequest, type EntitlementValue, type Entitlements, type EntitlementsMode, type FetchLike, type FileAsset, type FileDownloadUrlResponse, type FileResourceRef, type FileStatus, type FileUploadData, type GetPackResponse, type GitHubAppInfo, type GitHubRepositoriesResponse, type GitHubRepository, type GoalSpec, KNOWN_PERMISSIONS, KNOWN_USAGE_EVENT_TYPES, type KnownPermission, type KnownSessionEventType, type KnownUsageEventType, type ListApiKeysResponse, type ListPacksResponse, OpenGeniApiError, OpenGeniClient, type OpenGeniClientOptions, OpenGeniStreamError, type PackInstallation, type PackInstallationStatus, type Permission, type ProductAccessMode, type ProxySessionEventStreamOptions, type ReasoningEffort, type RegisterCapabilityPackRequest, type RepositoryResourceRef, type ResourceRef, SESSION_EVENT_TYPES, type SandboxBackend, type ScheduledTask, type ScheduledTaskAgentConfig, type ScheduledTaskAgentConfigInput, type ScheduledTaskDayOfWeek, type ScheduledTaskOverlapPolicy, type ScheduledTaskRun, type ScheduledTaskRunMode, type ScheduledTaskRunStatus, type ScheduledTaskScheduleSpec, type ScheduledTaskStatus, type ScheduledTaskTriggerType, type SendMessageInput, type Session, type SessionEvent, type SessionEventStreamTransport, type SessionEventType, type SessionGoal, type SessionGoalCreatedBy, type SessionGoalStatus, type SessionStatus, type SessionStatusChangedPayload, type SessionTurn, type SessionTurnSource, type SessionTurnStatus, type SseMessage, type SseReStreamOptions, type SteerMessageResult, type StreamConnectionState, type StreamSessionEventsOptions, type ToolRef, type UpdateScheduledTaskRequest, type UpdateSessionGoalRequest, type UpdateSessionTurnRequest, type UpdateWorkspaceEnvironmentRequest, type UpdateWorkspaceRequest, type UploadFileInput, type UsageEvent, type UsageEventType, type UserApprovalDecisionEventInput, type UserInterruptEventInput, type UserMessageEventInput, type Workspace, type WorkspaceEnvironment, type WorkspaceEnvironmentVariableMetadata, type WorkspaceRegisteredPack, formatSseEvent, isRetryableStreamError, parseSseStream, proxySessionEventStream, resumeSequenceFromRequest, sessionEventsToSseResponse, sessionEventsToSseStream, streamSessionEvents };
|