@ellipsis-dev/sdk 0.8.0 → 0.9.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/dist/index.d.ts CHANGED
@@ -1,32 +1,937 @@
1
- import { A as AgentSessionWire, L as ListSessionRecordsResponse, a as ListSessionTurnsResponse, b as ListSessionExecutionsResponse, S as SessionMessageWire, C as CreateReviewRequest, R as Review, c as ListReviewsResponse } from './types-rf-NzI8E.js';
2
- export { d as AgentSessionExitStatus, e as AgentSessionPr, f as AgentSessionSource, g as AgentSessionStatus, h as AgentTurn, i as AgentTurnStatus, j as AttributionType, B as BudgetSource, D as DefaultResolution, k as DeltaFrame, l as DoneFrame, E as ErrorFrame, F as Finding, G as GithubAccountSnippet, m as GithubAccountType, H as Harness, n as HeartbeatFrame, P as ParentKind, o as PromptBlockedReason, p as RecordsAppendFrame, q as ResolvedReviewScope, r as ReviewConfiguration, s as ReviewCounters, t as ReviewFinding, u as ReviewRequester, v as ReviewScope, w as ReviewScopeKind, x as ReviewStage, y as ReviewedCommit, z as SendSessionMessageRequest, I as SessionExecutionWire, J as SessionFrame, K as SessionLiveness, M as SessionMessageStatus, N as SessionPrompting, O as SessionRecordWire, Q as SessionState, T as SessionStreamFrame, U as SessionSurface, V as SnapshotFrame, W as StreamFrame, X as TokensInfo, Y as components, Z as paths } from './types-rf-NzI8E.js';
1
+ import { c as components } from './types-CStmnKVu.js';
2
+ export { A as AttributionType, B as BudgetSource, C as CreateReviewRequest, D as DefaultResolution, a as DeltaFrame, b as DoneFrame, E as ErrorFrame, F as Finding, G as GithubAccountSnippet, d as GithubAccountType, H as Harness, e as HeartbeatFrame, P as ParentKind, f as PromptBlockedReason, R as RecordsAppendFrame, g as ResolvedReviewScope, h as Review, i as ReviewConfiguration, j as ReviewCounters, k as ReviewFinding, l as ReviewRequester, m as ReviewScope, n as ReviewScopeKind, o as ReviewStage, p as ReviewedCommit, q as ReviewsListResponse, S as SendSessionMessageRequest, r as Session, s as SessionExecution, t as SessionExecutionsListResponse, u as SessionExitStatus, v as SessionFrame, w as SessionLiveness, x as SessionMessage, y as SessionMessageResponse, z as SessionMessageStatus, I as SessionPr, J as SessionPrompting, K as SessionRecord, L as SessionRecordsListResponse, M as SessionResponse, N as SessionSource, O as SessionState, Q as SessionStatus, T as SessionStreamFrame, U as SessionSurface, V as SessionsListResponse, W as SnapshotFrame, X as StreamFrame, Y as TokensInfo, Z as paths } from './types-CStmnKVu.js';
3
3
 
4
- type FetchJson = (path: string, init?: {
5
- method?: string;
6
- body?: unknown;
7
- }) => Promise<unknown>;
8
- declare class EllipsisClient {
9
- private readonly fetchJson;
10
- constructor(fetchJson: FetchJson);
11
- getSession(sessionId: string): Promise<AgentSessionWire>;
12
- getSessionRecords(sessionId: string, options?: {
13
- afterSeq?: number;
4
+ interface CursorResponse {
5
+ has_more: boolean;
6
+ next_cursor?: string | null;
7
+ }
8
+ declare class Page<ItemT, ResponseT extends CursorResponse> implements AsyncIterable<ItemT> {
9
+ readonly response: ResponseT;
10
+ private readonly itemsAttr;
11
+ private readonly fetchNext;
12
+ constructor(response: ResponseT, itemsAttr: keyof ResponseT, fetchNext: (cursor: string) => Promise<Page<ItemT, ResponseT>>);
13
+ get items(): ItemT[];
14
+ get hasMore(): boolean;
15
+ get nextCursor(): string | null;
16
+ [Symbol.asyncIterator](): AsyncIterator<ItemT>;
17
+ }
18
+
19
+ type S$1 = components['schemas'];
20
+ declare const TERMINAL_STATUSES: ReadonlySet<string>;
21
+ interface SessionsApi {
22
+ get(sessionId: string): Promise<S$1['SessionResponse']>;
23
+ stop(sessionId: string): Promise<S$1['SessionResponse']>;
24
+ sendMessage(sessionId: string, options: {
25
+ message: string;
26
+ idempotency_key?: string | null;
27
+ }): Promise<S$1['SessionMessageResponse']>;
28
+ records(sessionId: string, options?: {
29
+ cursor?: string;
14
30
  limit?: number;
15
- }): Promise<ListSessionRecordsResponse>;
16
- getSessionTurns(sessionId: string): Promise<ListSessionTurnsResponse>;
17
- getSessionExecutions(sessionId: string): Promise<ListSessionExecutionsResponse>;
18
- sendSessionMessage(sessionId: string, message: string, options?: {
31
+ }): Promise<unknown>;
32
+ }
33
+ declare function isSettled(session: S$1['Session']): boolean;
34
+ declare class SessionHandle {
35
+ private readonly sessions;
36
+ readonly id: string;
37
+ session: S$1['Session'];
38
+ constructor(sessions: SessionsApi, session: S$1['Session']);
39
+ refresh(): Promise<S$1['Session']>;
40
+ wait(options?: {
41
+ timeoutMs?: number;
42
+ pollIntervalMs?: number;
43
+ }): Promise<S$1['Session']>;
44
+ send(message: string, options?: {
19
45
  idempotencyKey?: string;
20
- }): Promise<SessionMessageWire>;
21
- createReview(request: CreateReviewRequest): Promise<Review>;
22
- getReview(reviewId: string): Promise<Review>;
23
- listReviews(options?: {
24
- owner?: string;
25
- repo?: string;
26
- pullRequestNumber?: number;
27
- status?: string;
46
+ }): Promise<S$1['SessionMessage']>;
47
+ stop(): Promise<S$1['Session']>;
48
+ }
49
+
50
+ declare const DEFAULT_BASE_URL = "https://api.ellipsis.dev";
51
+ interface TransportOptions {
52
+ apiKey: string;
53
+ baseUrl?: string;
54
+ timeoutMs?: number;
55
+ maxRetries?: number;
56
+ fetch?: typeof globalThis.fetch;
57
+ }
58
+ declare class Transport {
59
+ private readonly baseUrl;
60
+ private readonly headers;
61
+ private readonly timeoutMs;
62
+ private readonly maxRetries;
63
+ private readonly fetchImpl;
64
+ constructor(options: TransportOptions);
65
+ request<T>(method: string, path: string, options?: {
66
+ query?: string;
67
+ body?: unknown;
68
+ }): Promise<T>;
69
+ }
70
+
71
+ type S = components['schemas'];
72
+ declare class EllipsisAgentsConfigs {
73
+ private readonly transport;
74
+ constructor(transport: Transport);
75
+ /**
76
+ * Create Agent Config
77
+ *
78
+ * Create an agent config via pull request.
79
+ *
80
+ * The PR adds the config file to agents/ on the target
81
+ * repository; the agent goes live when it merges.
82
+ *
83
+ * Accepts an inline config or a gallery template slug. 409 when
84
+ * another live agent already holds the name.
85
+ */
86
+ create(options: {
87
+ config?: S['AgentConfig'] | null;
88
+ path?: string | null;
89
+ repository: string;
90
+ template_id?: string | null;
91
+ }): Promise<S['CreateAgentConfigResponse']>;
92
+ /**
93
+ * Get Agent Config
94
+ *
95
+ * Return one saved agent config, by id or by the agent's name.
96
+ */
97
+ get(config_id: string): Promise<S['AgentConfigResponse']>;
98
+ /**
99
+ * List Agent Configs
100
+ *
101
+ * List saved agent configs.
102
+ */
103
+ list(): Promise<S['AgentConfigsListResponse']>;
104
+ }
105
+ declare class EllipsisAgentsDefaults {
106
+ private readonly transport;
107
+ constructor(transport: Transport);
108
+ /**
109
+ * Delete Agent Default
110
+ *
111
+ * Clear a default agent config.
112
+ *
113
+ * Addressed by rung: the account rung (repository omitted) or a
114
+ * repository rung.
115
+ *
116
+ * Refused for sandbox tokens.
117
+ */
118
+ delete(options?: {
119
+ repository?: string | null;
120
+ }): Promise<void>;
121
+ /**
122
+ * List Agent Defaults
123
+ *
124
+ * List default agent configs.
125
+ *
126
+ * The account default and any per-repository defaults.
127
+ *
128
+ * Defaults are addressed by rung: the account rung is repository
129
+ * omitted, a repo rung is "owner/name" — never by row id.
130
+ */
131
+ list(): Promise<S['AgentDefaultsListResponse']>;
132
+ /**
133
+ * Put Agent Default
134
+ *
135
+ * Set a default agent config.
136
+ *
137
+ * Addressed by rung: the account rung (repository omitted) or a
138
+ * repository rung ("owner/name"); the config by id or by the
139
+ * agent's name.
140
+ *
141
+ * Refused for sandbox tokens (potentially prompt-injected code
142
+ * must not repoint the account's ambient default); an unknown or
143
+ * foreign repository is a 404.
144
+ */
145
+ set(options: {
146
+ config_id: string;
147
+ repository?: string | null;
148
+ }): Promise<S['AgentDefaultResponse']>;
149
+ }
150
+ declare class EllipsisAgentsTemplates {
151
+ private readonly transport;
152
+ constructor(transport: Transport);
153
+ /**
154
+ * Get Agent Template
155
+ *
156
+ * Return one built-in agent template by slug.
157
+ */
158
+ get(template_id: string): Promise<S['AgentTemplate']>;
159
+ /**
160
+ * List Agent Templates
161
+ *
162
+ * List the built-in starter agent templates.
163
+ *
164
+ * Behind auth but not account-scoped — the data is static
165
+ * product content shared by the dashboard, landing site, and CLI.
166
+ */
167
+ list(): Promise<S['AgentTemplatesListResponse']>;
168
+ }
169
+ declare class EllipsisAgents {
170
+ private readonly transport;
171
+ readonly configs: EllipsisAgentsConfigs;
172
+ readonly defaults: EllipsisAgentsDefaults;
173
+ readonly templates: EllipsisAgentsTemplates;
174
+ constructor(transport: Transport);
175
+ }
176
+ declare class EllipsisAlerts {
177
+ private readonly transport;
178
+ constructor(transport: Transport);
179
+ /**
180
+ * Dismiss Alert
181
+ *
182
+ * Dismiss an open alert and return it.
183
+ *
184
+ * 409 when the alert is not open; 404 when it doesn't exist.
185
+ */
186
+ dismiss(alert_id: string): Promise<S['AlertResponse']>;
187
+ /**
188
+ * Get Alert
189
+ *
190
+ * Return one alert by id.
191
+ *
192
+ * 404 if it doesn't exist or belongs to another organization.
193
+ */
194
+ get(alert_id: string): Promise<S['AlertResponse']>;
195
+ /**
196
+ * List Alerts
197
+ *
198
+ * List budget alerts for the organization, newest first.
199
+ *
200
+ * Optionally filtered by status and source.
201
+ *
202
+ * Available to all credential types, so an agent can check "is
203
+ * this org near budget?" mid-task.
204
+ */
205
+ list(options?: {
206
+ status?: S['AlertStatus'] | null;
207
+ source?: S['AlertSource'] | null;
28
208
  limit?: number;
29
- }): Promise<ListReviewsResponse>;
209
+ cursor?: string | null;
210
+ }): Promise<Page<S['Alert'], S['AlertsListResponse']>>;
211
+ }
212
+ declare class EllipsisAnalytics {
213
+ private readonly transport;
214
+ constructor(transport: Transport);
215
+ /**
216
+ * Get Analytics Metrics
217
+ *
218
+ * Return PR and review analytics metrics.
219
+ *
220
+ * The same data as the analytics dashboard.
221
+ *
222
+ * Windowing: pass explicit start/end, or days (default: the last
223
+ * 30 days). account_type in all|user|bot scopes the authors (bot =
224
+ * the apps/agents). Available to all credential types: the
225
+ * responses expose the organization's own GitHub PR/review activity,
226
+ * no secrets.
227
+ */
228
+ metrics(options?: {
229
+ days?: number | null;
230
+ start?: string | null;
231
+ end?: string | null;
232
+ repo?: (string)[] | null;
233
+ author?: (string)[] | null;
234
+ account_type?: string;
235
+ status?: (string)[] | null;
236
+ }): Promise<S['GetAnalyticsMetricsResponse']>;
237
+ /**
238
+ * Get Analytics Pull Requests
239
+ *
240
+ * Return pull-request analytics.
241
+ *
242
+ * Windowing: pass explicit start/end, or days (default: the last
243
+ * 30 days).
244
+ */
245
+ pullRequests(options?: {
246
+ days?: number | null;
247
+ start?: string | null;
248
+ end?: string | null;
249
+ account_type?: (string)[] | null;
250
+ repository_id?: (number)[] | null;
251
+ author_id?: (number)[] | null;
252
+ status?: (string)[] | null;
253
+ }): Promise<S['GetAnalyticsPullRequestsResponse']>;
254
+ /**
255
+ * Get Analytics Reviews
256
+ *
257
+ * Return code-review analytics.
258
+ *
259
+ * account_type scopes reviewers (bot|user|all) — e.g. "what apps
260
+ * review the most PRs?" is the reviewer facets here with
261
+ * account_type=bot. Windowing: pass explicit start/end, or days
262
+ * (default: the last 30 days).
263
+ */
264
+ reviews(options?: {
265
+ days?: number | null;
266
+ start?: string | null;
267
+ end?: string | null;
268
+ repo?: (string)[] | null;
269
+ author?: (string)[] | null;
270
+ account_type?: string;
271
+ review_state?: (string)[] | null;
272
+ }): Promise<S['GetAnalyticsReviewsResponse']>;
273
+ }
274
+ declare class EllipsisAuthCli {
275
+ private readonly transport;
276
+ constructor(transport: Transport);
277
+ /**
278
+ * Cli Auth Poll
279
+ *
280
+ * Poll a device-code auth flow for its token.
281
+ *
282
+ * Unauthenticated; the device code identifies the flow.
283
+ */
284
+ poll(options: {
285
+ device_code: string;
286
+ }): Promise<S['PollCliAuthResponse']>;
287
+ /**
288
+ * Cli Auth Start
289
+ *
290
+ * Start a device-code auth flow for the CLI.
291
+ *
292
+ * Unauthenticated: the CLI has no credential yet — that's what
293
+ * it's obtaining. The human authorizes out-of-band in the
294
+ * dashboard.
295
+ */
296
+ start(): Promise<S['StartCliAuthResponse']>;
297
+ }
298
+ declare class EllipsisAuth {
299
+ private readonly transport;
300
+ readonly cli: EllipsisAuthCli;
301
+ constructor(transport: Transport);
302
+ }
303
+ declare class EllipsisFiles {
304
+ private readonly transport;
305
+ constructor(transport: Transport);
306
+ /**
307
+ * Create File
308
+ *
309
+ * Upload a file that outlives the sandbox.
310
+ *
311
+ * v1: PNG images only, base64 in the JSON body, 10 MiB cap. The
312
+ * primary caller is the in-sandbox `agent file upload` CLI (an
313
+ * agent persisting a screenshot to link on a PR), but all
314
+ * credential types work. Returns the org-membership-gated
315
+ * dashboard URL so callers never hard-code URL shapes.
316
+ */
317
+ create(options: {
318
+ content_type: string;
319
+ data_b64: string;
320
+ filename: string;
321
+ }): Promise<S['CreateFileResponse']>;
322
+ /**
323
+ * Delete File
324
+ *
325
+ * Delete a file.
326
+ *
327
+ * A foreign, missing, or already-deleted id is an
328
+ * indistinguishable 404, so ids can't be enumerated. Sandbox
329
+ * tokens get a 403 (a sandbox token sits next to
330
+ * potentially-untrusted code and must not be able to destroy the
331
+ * account's files — uploading is fine, destruction is not); API
332
+ * keys and user tokens may delete.
333
+ */
334
+ delete(file_id: string): Promise<void>;
335
+ /**
336
+ * Get File
337
+ *
338
+ * Return one file's metadata and download link.
339
+ *
340
+ * Includes the gated dashboard URL and a short-lived presigned
341
+ * `download_url`.
342
+ *
343
+ * To fetch the bytes locally, call this and then GET download_url
344
+ * immediately — the JSON API never carries the file. The CLI's
345
+ * `agent file get` wraps exactly that two-step.
346
+ */
347
+ get(file_id: string): Promise<S['GetFileResponse']>;
348
+ /**
349
+ * List Files
350
+ *
351
+ * List uploaded files, newest first.
352
+ *
353
+ * Metadata only — download URLs are minted per explicit GET, not
354
+ * per row. session_id scopes the list to one run's uploads.
355
+ */
356
+ list(options?: {
357
+ session_id?: string | null;
358
+ limit?: number;
359
+ cursor?: string | null;
360
+ }): Promise<Page<S['File'], S['FilesListResponse']>>;
361
+ }
362
+ declare class EllipsisIntegrationsGithub {
363
+ private readonly transport;
364
+ constructor(transport: Transport);
365
+ /**
366
+ * List Github Members
367
+ *
368
+ * List the GitHub organization roster.
369
+ *
370
+ * (Or the account itself for a personal workspace) — the universe of author_id values for
371
+ * /sessions and /sessions/search.
372
+ *
373
+ * Members carry their linked Slack identity when a Slack-GitHub
374
+ * link exists, and /slack/members carries the reverse link.
375
+ */
376
+ members(): Promise<S['GithubMembersListResponse']>;
377
+ /**
378
+ * List Github Repositories
379
+ *
380
+ * List GitHub repositories connected to the installation.
381
+ */
382
+ repos(): Promise<S['GithubRepositoriesListResponse']>;
383
+ }
384
+ declare class EllipsisIntegrationsLinear {
385
+ private readonly transport;
386
+ constructor(transport: Transport);
387
+ /**
388
+ * List Linear Teams
389
+ *
390
+ * List the teams of the connected Linear workspace.
391
+ */
392
+ teams(): Promise<S['LinearTeamsListResponse']>;
393
+ }
394
+ declare class EllipsisIntegrationsSentry {
395
+ private readonly transport;
396
+ constructor(transport: Transport);
397
+ /**
398
+ * List Sentry Organizations
399
+ *
400
+ * List the connected Sentry organizations.
401
+ */
402
+ organizations(): Promise<S['SentryOrganizationsListResponse']>;
403
+ }
404
+ declare class EllipsisIntegrationsSlack {
405
+ private readonly transport;
406
+ constructor(transport: Transport);
407
+ /**
408
+ * List Slack Channels
409
+ *
410
+ * List the channels of the connected Slack workspace, fetched
411
+ * live from the Slack API.
412
+ */
413
+ channels(): Promise<S['SlackChannelsListResponse']>;
414
+ /**
415
+ * List Slack Members
416
+ *
417
+ * List the members of the connected Slack workspace, fetched
418
+ * live from the Slack API.
419
+ */
420
+ members(): Promise<S['SlackMembersListResponse']>;
421
+ }
422
+ declare class EllipsisIntegrations {
423
+ private readonly transport;
424
+ readonly github: EllipsisIntegrationsGithub;
425
+ readonly linear: EllipsisIntegrationsLinear;
426
+ readonly sentry: EllipsisIntegrationsSentry;
427
+ readonly slack: EllipsisIntegrationsSlack;
428
+ constructor(transport: Transport);
429
+ /**
430
+ * Get Integrations
431
+ *
432
+ * List connected integrations.
433
+ *
434
+ * A read-only view, so an agent authoring another agent's
435
+ * config can learn which repositories, channels, teams, and
436
+ * organizations it may name before POST /agents/configs.
437
+ *
438
+ * Available to all credential types including sandbox tokens: the
439
+ * responses never include OAuth tokens or any other secret.
440
+ */
441
+ list(): Promise<S['GetIntegrationsResponse']>;
442
+ }
443
+ declare class EllipsisMemories {
444
+ private readonly transport;
445
+ constructor(transport: Transport);
446
+ /**
447
+ * Create Memory
448
+ *
449
+ * Save a memory for future agent sessions.
450
+ *
451
+ * Memories are durable lessons shared across the whole
452
+ * organization — conventions, past decisions, known gotchas that an
453
+ * agent cannot derive from the repository itself. One concise fact
454
+ * per memory; the description is what a reader sees in the index.
455
+ *
456
+ * Creating never overwrites: a path that already exists is a 409, so
457
+ * correcting an existing memory is an explicit edit.
458
+ */
459
+ create(options: {
460
+ content: string;
461
+ description: string;
462
+ path: string;
463
+ }): Promise<S['MemoryResponse']>;
464
+ /**
465
+ * Delete Memory
466
+ *
467
+ * Delete a memory that is no longer true.
468
+ *
469
+ * Available to every credential type, agents included — a wrong
470
+ * memory is worse than a missing one. The deleted content is kept in
471
+ * the memory's history for forensics, not for an undo API.
472
+ */
473
+ delete(memory_id: string, options?: {
474
+ if_sha256?: string | null;
475
+ }): Promise<void>;
476
+ /**
477
+ * Edit Memory
478
+ *
479
+ * Correct an existing memory in place.
480
+ *
481
+ * Pass description, content, or both. This never creates a memory (an
482
+ * unknown id is a 404) and never moves one — the path is immutable, so
483
+ * relocating a memory is a delete plus a create.
484
+ *
485
+ * Pass `if_sha256` (from a previous read) to make a concurrent write
486
+ * a 409 instead of silently overwriting it.
487
+ */
488
+ edit(memory_id: string, options?: {
489
+ content?: string | null;
490
+ description?: string | null;
491
+ if_sha256?: string | null;
492
+ }): Promise<S['MemoryResponse']>;
493
+ /**
494
+ * Get Memory
495
+ *
496
+ * Read one memory's full content.
497
+ *
498
+ * The id comes from the index returned by listing memories.
499
+ */
500
+ get(memory_id: string): Promise<S['MemoryResponse']>;
501
+ /**
502
+ * List Memories
503
+ *
504
+ * List the organization's memories as a readable index.
505
+ *
506
+ * Returns the memories rendered as a markdown index (one line per
507
+ * memory, carrying its id, path, and description) plus the same
508
+ * entries structured, each with every field except `content`. Read
509
+ * the index, then fetch the ids whose content you want.
510
+ */
511
+ list(options?: {
512
+ prefix?: string | null;
513
+ }): Promise<S['MemoriesListResponse']>;
514
+ }
515
+ declare class EllipsisModels {
516
+ private readonly transport;
517
+ constructor(transport: Transport);
518
+ /**
519
+ * List Supported Models
520
+ *
521
+ * List selectable agent models.
522
+ *
523
+ * Most expensive first, with the platform default flagged.
524
+ *
525
+ * Reads the same registry as the dashboard's rate table, so a
526
+ * client's model picker can never drift from what's offered.
527
+ * Behind auth but not account-scoped — the selectable set is
528
+ * global.
529
+ */
530
+ list(): Promise<S['ModelsListResponse']>;
531
+ }
532
+ declare class EllipsisReviews {
533
+ private readonly transport;
534
+ constructor(transport: Transport);
535
+ /**
536
+ * Create Review
537
+ *
538
+ * Run a code review on demand.
539
+ *
540
+ * Reviews an existing PR or a pushed branch (for a branch, the
541
+ * platform finds or creates a draft PR for it, since a code
542
+ * review is structurally about a PR).
543
+ *
544
+ * A review is one pipeline run over one commit range, with one
545
+ * agent session per stage: `review.id` is the run id, and
546
+ * `stages[].session_id` is where a client streams
547
+ * (/sessions/{id}/stream on a stage session), since the review
548
+ * itself is a pipeline rather than one process.
549
+ */
550
+ create(options: {
551
+ owner: string;
552
+ post?: boolean;
553
+ pull_request_number: number;
554
+ repo: string;
555
+ scope?: S['ReviewScope'];
556
+ }): Promise<S['Review']>;
557
+ /**
558
+ * Get Review
559
+ *
560
+ * Return one review with findings and outcome.
561
+ *
562
+ * Includes its scope, the per-stage sessions, the parsed findings,
563
+ * the finding counters, and the posting outcome.
564
+ *
565
+ * Findings only exist after a stage session finalizes — a running
566
+ * review honestly reports [] / null, which is why a client
567
+ * streams a stage session and then re-fetches the review.
568
+ */
569
+ get(review_id: string): Promise<S['Review']>;
570
+ /**
571
+ * List Reviews
572
+ *
573
+ * List code reviews, newest first.
574
+ *
575
+ * `findings` is omitted (counters only).
576
+ *
577
+ * Webhook-created reviews appear here too, so this answers "show
578
+ * me every review on this PR".
579
+ */
580
+ list(options?: {
581
+ owner?: string | null;
582
+ repo?: string | null;
583
+ pull_request_number?: number | null;
584
+ status?: S['CodeReviewRunStatus'] | null;
585
+ limit?: number;
586
+ cursor?: string | null;
587
+ }): Promise<Page<S['Review'], S['ReviewsListResponse']>>;
588
+ }
589
+ declare class EllipsisSecrets {
590
+ private readonly transport;
591
+ constructor(transport: Transport);
592
+ /**
593
+ * Delete Secret
594
+ *
595
+ * Delete a secret by name.
596
+ *
597
+ * Refused for sandbox tokens; mutations require an API key or
598
+ * user token.
599
+ */
600
+ delete(name: string): Promise<void>;
601
+ /**
602
+ * List Secrets
603
+ *
604
+ * List secrets.
605
+ *
606
+ * Values are write-only: the response carries only names and
607
+ * timestamps, never the stored value.
608
+ */
609
+ list(): Promise<S['SecretsListResponse']>;
610
+ /**
611
+ * Put Secrets
612
+ *
613
+ * Upsert secrets.
614
+ *
615
+ * Returns only the secrets this call wrote, names and timestamps
616
+ * only — values are write-only. Refused for sandbox tokens (held by
617
+ * potentially-untrusted in-sandbox code); mutations require an
618
+ * API key or user token.
619
+ */
620
+ set(options: {
621
+ secrets: (S['SecretInput'])[];
622
+ }): Promise<S['SecretsListResponse']>;
623
+ }
624
+ declare class EllipsisSessions {
625
+ private readonly transport;
626
+ constructor(transport: Transport);
627
+ /**
628
+ * Get Agent Session Executions
629
+ *
630
+ * Return the session's executions and launch context.
631
+ *
632
+ * Most notably system_prompt_append, the text Ellipsis appends to
633
+ * Claude Code's default system prompt (platform section + response
634
+ * instructions + the config's own instructions).
635
+ *
636
+ * Per execution because each cold wake persists its own launch
637
+ * config (a config edit or replay override between wakes changes
638
+ * it).
639
+ */
640
+ executions(session_id: string): Promise<S['SessionExecutionsListResponse']>;
641
+ /**
642
+ * Export Agent Session
643
+ *
644
+ * Export the complete session history.
645
+ *
646
+ * The complete, ordered history of the session (agent output, tool calls, thinking,
647
+ * lifecycle events, sandbox output, message events) as an ordered
648
+ * manifest of presigned segment URLs.
649
+ *
650
+ * Segments are gzip members: download in order and concatenate
651
+ * for one file. The JSON API never carries the bytes (same
652
+ * two-step as files). /records is the paged live view of the
653
+ * same data.
654
+ */
655
+ export(session_id: string): Promise<S['GetSessionLogResponse']>;
656
+ /**
657
+ * Get Agent Session
658
+ *
659
+ * Return one session.
660
+ *
661
+ * The public wire shape — the same shape the stream's session
662
+ * frames carry, with attributed_user and stopped_by_user resolved
663
+ * at read time.
664
+ *
665
+ * The heavy near-static blobs (config snapshot, input/output)
666
+ * live on the detail endpoints, not here.
667
+ */
668
+ get(session_id: string): Promise<S['SessionResponse']>;
669
+ /**
670
+ * Get Agent Session Ide
671
+ *
672
+ * Return the IDE link for the session's sandbox.
673
+ *
674
+ * The membership-gated dashboard page, which performs the sandbox
675
+ * proxy handoff itself.
676
+ *
677
+ * No credential is minted here — the URL grants nothing by
678
+ * possession. 409 when the sandbox isn't running (send the
679
+ * session a message to wake it first). Backs the `agent session
680
+ * ide` CLI verb.
681
+ */
682
+ ide(session_id: string): Promise<S['GetSessionIdeResponse']>;
683
+ /**
684
+ * Ingest Agent Session Transcript
685
+ *
686
+ * Append transcript lines to a session's record.
687
+ *
688
+ * The in-sandbox tailer for interactive sessions.
689
+ *
690
+ * A sandbox token may only push its own session's transcript.
691
+ * Idempotent by transcript line uuid; tolerant of malformed lines.
692
+ */
693
+ ingestTranscript(session_id: string, options: {
694
+ lines: (string)[];
695
+ offset?: number;
696
+ }): Promise<S['TranscriptIngestResult']>;
697
+ /**
698
+ * List Agent Sessions
699
+ *
700
+ * List cloud agent sessions, newest first.
701
+ *
702
+ * Optionally filtered by config (id or `ellipsis.name`), source, time
703
+ * window, attributed author, repository, and whether the session is
704
+ * still going.
705
+ */
706
+ list(options?: {
707
+ config_id?: string | null;
708
+ source?: (S['SessionSource'])[] | null;
709
+ days?: number | null;
710
+ start?: string | null;
711
+ end?: string | null;
712
+ limit?: number;
713
+ cursor?: string | null;
714
+ author_id?: number | null;
715
+ repo?: string | null;
716
+ unfinished?: boolean;
717
+ }): Promise<Page<S['Session'], S['SessionsListResponse']>>;
718
+ /**
719
+ * Get Agent Session Output
720
+ *
721
+ * Return the session's typed output.
722
+ *
723
+ * The payload the agent submitted through its config-declared
724
+ * output.json_schema, as the raw JSON body with no envelope. 404
725
+ * while the session is still running (poll GET /sessions/{id}),
726
+ * when the agent declares no output block, or when no execution
727
+ * produced output.
728
+ */
729
+ output(session_id: string): Promise<void>;
730
+ /**
731
+ * Get Agent Session Port
732
+ *
733
+ * Return a preview link for a sandbox port.
734
+ *
735
+ * For a dev server running in the session's live sandbox: the
736
+ * same dashboard page as the IDE, deep-linked to the port.
737
+ *
738
+ * Backs `agent session port`.
739
+ */
740
+ port(session_id: string, port: number): Promise<S['GetSessionPortResponse']>;
741
+ /**
742
+ * Get Agent Session Records
743
+ *
744
+ * Return the session's stored transcript records, oldest first.
745
+ *
746
+ * Pagination is opt-in (cursor/limit); a bare call returns the
747
+ * full retained transcript. Available to sandbox tokens too: an
748
+ * agent answering "did X look into Y?" needs to read the session
749
+ * it found via /sessions/search, and any org member sees the same
750
+ * transcript in the dashboard (laptop transcripts are redacted
751
+ * client-side before they are ever uploaded).
752
+ */
753
+ records(session_id: string, options?: {
754
+ cursor?: string | null;
755
+ limit?: number | null;
756
+ }): Promise<Page<S['SessionRecord'], S['SessionRecordsListResponse']>>;
757
+ /**
758
+ * Replay Agent Session
759
+ *
760
+ * Replay a session as a new session.
761
+ *
762
+ * Reuses the original config snapshot unless config_id is given,
763
+ * and accepts the same config_override as session start — e.g.
764
+ * {"claude": {"model": ...}} to replay the same input on a
765
+ * different model.
766
+ */
767
+ replay(session_id: string, options?: {
768
+ config_id?: string | null;
769
+ config_override?: Record<string, unknown> | null;
770
+ config_override_yaml?: string | null;
771
+ prompt?: string | null;
772
+ }): Promise<S['SessionResponse']>;
773
+ /**
774
+ * Search Sessions
775
+ *
776
+ * Search sessions over steps, recaps, and pull requests.
777
+ *
778
+ * Grouped by session, over everything a session left behind: step text, recap text, created
779
+ * PRs, and recap-embedding similarity.
780
+ *
781
+ * This is how an agent answers "did Tony look into X?": resolve
782
+ * the author via /github/members, search, then read the winning
783
+ * session via /sessions/{id} (recap) and /sessions/{id}/records
784
+ * (transcript).
785
+ */
786
+ search(options?: {
787
+ q?: string;
788
+ scope?: S['SessionSearchScope'];
789
+ source?: (S['SessionSource'])[] | null;
790
+ author_id?: (number)[] | null;
791
+ config_id?: (string)[] | null;
792
+ session_ids?: (string)[] | null;
793
+ repo?: string | null;
794
+ status?: (S['SessionStatus'])[] | null;
795
+ start?: string | null;
796
+ end?: string | null;
797
+ limit?: number;
798
+ }): Promise<S['SessionSearchResponse']>;
799
+ /**
800
+ * Send Agent Session Message
801
+ *
802
+ * Send a message to a session.
803
+ *
804
+ * 409 for react/cron, non-interactive, and closed sessions.
805
+ * Returns the created message so the caller can track it by id; a
806
+ * retried send with the same idempotency_key returns the original
807
+ * message.
808
+ */
809
+ sendMessage(session_id: string, options: {
810
+ idempotency_key?: string | null;
811
+ message: string;
812
+ }): Promise<S['SessionMessageResponse']>;
813
+ /**
814
+ * Start Agent Session
815
+ *
816
+ * Start a cloud agent session.
817
+ *
818
+ * Provide at most one of config_id (an id or an agent name),
819
+ * config, or
820
+ * template_id; with none, the account's default-config ladder
821
+ * resolves the config. 400 when idle_start is combined with
822
+ * prompt, input, or handoff, or when a handoff is combined with
823
+ * any config source or override. 422 when the agent declares an
824
+ * input schema and the request's input is absent or invalid.
825
+ */
826
+ start(options?: {
827
+ config?: S['AgentConfig'] | null;
828
+ config_id?: string | null;
829
+ config_override?: Record<string, unknown> | null;
830
+ config_override_yaml?: string | null;
831
+ force_rebuild?: boolean;
832
+ handoff?: S['HandoffAgentSessionParams'] | null;
833
+ idle_start?: boolean;
834
+ input?: Record<string, unknown> | null;
835
+ metadata?: Record<string, string>;
836
+ prompt?: string | null;
837
+ repository?: string | null;
838
+ template_id?: string | null;
839
+ }): Promise<S['StartAgentSessionResponse']>;
840
+ /**
841
+ * Stop Agent Session
842
+ *
843
+ * Stop an in-flight session and return it.
844
+ *
845
+ * stopped_by is recorded only when the caller's credential maps
846
+ * to a GitHub account.
847
+ */
848
+ stop(session_id: string): Promise<S['SessionResponse']>;
849
+ /**
850
+ * Sync Agent Session
851
+ *
852
+ * Sync a local Claude Code session to Ellipsis.
853
+ *
854
+ * Requires a user token (device-flow `agent login`): the user is
855
+ * part of the sync's idempotency key, so API keys and sandbox
856
+ * tokens are rejected with a 403 rather than silently attributed.
857
+ */
858
+ sync(options: {
859
+ cc_session_id: string;
860
+ cwd?: string | null;
861
+ git_branch?: string | null;
862
+ reason?: "stop" | "session_end";
863
+ repo?: string | null;
864
+ transcript_gzip_b64: string;
865
+ }): Promise<S['SyncAgentSessionResponse']>;
866
+ /** Start a session and return a handle over it. */
867
+ run(options: Parameters<EllipsisSessions['start']>[0]): Promise<SessionHandle>;
868
+ /** A handle over an existing session. */
869
+ handle(sessionId: string): Promise<SessionHandle>;
870
+ }
871
+ declare class Ellipsis {
872
+ private readonly transport;
873
+ readonly agents: EllipsisAgents;
874
+ readonly alerts: EllipsisAlerts;
875
+ readonly analytics: EllipsisAnalytics;
876
+ readonly auth: EllipsisAuth;
877
+ readonly files: EllipsisFiles;
878
+ readonly integrations: EllipsisIntegrations;
879
+ readonly memories: EllipsisMemories;
880
+ readonly models: EllipsisModels;
881
+ readonly reviews: EllipsisReviews;
882
+ readonly secrets: EllipsisSecrets;
883
+ readonly sessions: EllipsisSessions;
884
+ constructor(options: TransportOptions);
885
+ /**
886
+ * Get Budget
887
+ *
888
+ * Return the caller's current budget summary.
889
+ */
890
+ budget(): Promise<S['BudgetSummary']>;
891
+ /**
892
+ * Whoami
893
+ *
894
+ * Return the identity behind the caller's credential.
895
+ */
896
+ me(): Promise<S['WhoAmIResponse']>;
897
+ /**
898
+ * Get Usage Endpoint
899
+ *
900
+ * Return the caller's usage dashboard data.
901
+ */
902
+ usage(): Promise<S['GetUsageDashboardResponse']>;
903
+ }
904
+
905
+ declare class EllipsisError extends Error {
906
+ }
907
+ declare class TransportError extends EllipsisError {
908
+ }
909
+ declare class APIError extends EllipsisError {
910
+ readonly status: number;
911
+ readonly code: string | null;
912
+ readonly requestId: string | null;
913
+ readonly body: unknown;
914
+ constructor(args: {
915
+ status: number;
916
+ code: string | null;
917
+ message: string;
918
+ requestId: string | null;
919
+ body?: unknown;
920
+ });
921
+ }
922
+ declare class AuthenticationError extends APIError {
923
+ }
924
+ declare class ForbiddenError extends APIError {
925
+ }
926
+ declare class NotFoundError extends APIError {
927
+ }
928
+ declare class ConflictError extends APIError {
929
+ }
930
+ declare class UnprocessableError extends APIError {
931
+ }
932
+ declare class RateLimitError extends APIError {
933
+ }
934
+ declare class ServerError extends APIError {
30
935
  }
31
936
 
32
- export { AgentSessionWire, CreateReviewRequest, EllipsisClient, type FetchJson, ListReviewsResponse, ListSessionExecutionsResponse, ListSessionRecordsResponse, ListSessionTurnsResponse, Review, SessionMessageWire };
937
+ export { APIError, AuthenticationError, ConflictError, DEFAULT_BASE_URL, Ellipsis, EllipsisError, ForbiddenError, NotFoundError, Page, RateLimitError, ServerError, SessionHandle, TERMINAL_STATUSES, Transport, TransportError, type TransportOptions, UnprocessableError, components, isSettled };