@ellipsis-dev/sdk 0.7.0 → 0.8.1

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