@ellipsis-dev/sdk 0.2.3 → 0.3.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,5 +1,5 @@
1
- import { A as AgentSessionWire, L as ListSessionRecordsResponse, a as ListSessionTurnsResponse, b as ListSessionExecutionsResponse, S as SessionMessageWire } from './types-CNx-q_eN.js';
2
- export { c as AgentSessionExitStatus, d as AgentSessionPr, e as AgentSessionSource, f as AgentSessionStatus, g as AgentTurn, h as AgentTurnStatus, i as AttributionType, B as BudgetSource, D as DefaultResolution, j as DeltaFrame, k as DoneFrame, E as ErrorFrame, G as GithubAccountSnippet, l as GithubAccountType, H as Harness, m as HeartbeatFrame, M as ModelTokensInfo, P as ParentKind, n as PromptBlockedReason, R as RecordsAppendFrame, o as SendSessionMessageRequest, p as SessionExecutionWire, q as SessionFrame, r as SessionLiveness, s as SessionMessageStatus, t as SessionPrompting, u as SessionRecordWire, v as SessionState, w as SessionStreamFrame, x as SessionSurface, y as SnapshotFrame, z as StreamFrame, T as TokensInfo, C as TurnTokensInfo, F as components, I as paths } from './types-CNx-q_eN.js';
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-C63IVgov.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, M as ModelTokensInfo, P as ParentKind, o as PromptBlockedReason, p as RecordsAppendFrame, q as ResolvedReviewScope, r as ReviewCounters, s as ReviewScope, t as ReviewScopeKind, u as SendSessionMessageRequest, v as SessionExecutionWire, w as SessionFrame, x as SessionLiveness, y as SessionMessageStatus, z as SessionPrompting, I as SessionRecordWire, J as SessionState, K as SessionStreamFrame, N as SessionSurface, O as SnapshotFrame, Q as StreamFrame, T as TokensInfo, U as TurnTokensInfo, V as components, W as paths } from './types-C63IVgov.js';
3
3
 
4
4
  type FetchJson = (path: string, init?: {
5
5
  method?: string;
@@ -18,6 +18,15 @@ declare class EllipsisClient {
18
18
  sendSessionMessage(sessionId: string, message: string, options?: {
19
19
  idempotencyKey?: string;
20
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;
28
+ limit?: number;
29
+ }): Promise<ListReviewsResponse>;
21
30
  }
22
31
 
23
- export { AgentSessionWire, EllipsisClient, type FetchJson, ListSessionExecutionsResponse, ListSessionRecordsResponse, ListSessionTurnsResponse, SessionMessageWire };
32
+ export { AgentSessionWire, CreateReviewRequest, EllipsisClient, type FetchJson, ListReviewsResponse, ListSessionExecutionsResponse, ListSessionRecordsResponse, ListSessionTurnsResponse, Review, SessionMessageWire };
package/dist/index.js CHANGED
@@ -57,6 +57,40 @@ var EllipsisClient = class {
57
57
  }
58
58
  );
59
59
  }
60
+ // Trigger a code review on a pull request, or on a pushed branch (the
61
+ // platform finds-or-creates a draft PR for it). A review's `id` IS a session
62
+ // id, so callers stream it with the stream client and then re-read it below
63
+ // for the findings — which only exist once the review finalizes. A review
64
+ // with nothing new to look at comes back with `status: 'skipped'`, not an
65
+ // error.
66
+ async createReview(request) {
67
+ return await this.fetchJson("/v1/reviews", {
68
+ method: "POST",
69
+ body: request
70
+ });
71
+ }
72
+ // One review: scope, findings, parser counters, and the posting outcome.
73
+ async getReview(reviewId) {
74
+ return await this.fetchJson(
75
+ `/v1/reviews/${encodeURIComponent(reviewId)}`
76
+ );
77
+ }
78
+ // Reviews newest first, `findings` omitted (counters only). Includes
79
+ // webhook-triggered reviews, so this is the full review history of a PR —
80
+ // the chain the incremental watermark walks.
81
+ async listReviews(options = {}) {
82
+ const params = new URLSearchParams();
83
+ if (options.owner != null) params.set("owner", options.owner);
84
+ if (options.repo != null) params.set("repo", options.repo);
85
+ if (options.pullRequestNumber != null)
86
+ params.set("pull_request_number", String(options.pullRequestNumber));
87
+ if (options.status != null) params.set("status", options.status);
88
+ if (options.limit != null) params.set("limit", String(options.limit));
89
+ const query = params.toString();
90
+ return await this.fetchJson(
91
+ "/v1/reviews" + (query ? `?${query}` : "")
92
+ );
93
+ }
60
94
  };
61
95
  export {
62
96
  EllipsisClient
@@ -1,4 +1,4 @@
1
- import { u as SessionRecordWire, A as AgentSessionWire, S as SessionMessageWire, z as StreamFrame } from '../types-CNx-q_eN.js';
1
+ import { I as SessionRecordWire, A as AgentSessionWire, S as SessionMessageWire, Q as StreamFrame } from '../types-C63IVgov.js';
2
2
 
3
3
  interface ChatToolNode {
4
4
  key: string;
@@ -1,4 +1,4 @@
1
- import { z as StreamFrame, A as AgentSessionWire } from '../types-CNx-q_eN.js';
1
+ import { Q as StreamFrame, A as AgentSessionWire } from '../types-C63IVgov.js';
2
2
 
3
3
  declare const SESSION_STREAM_PROTOCOL_VERSION = 3;
4
4
  declare const WS_CLOSE_NORMAL = 1000;