@ellipsis-dev/sdk 0.25.0 → 0.27.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 { c as components } from './types-DJzmFABi.js';
2
- export { A as AttributionType, B as BudgetSource, C as ClaudeSessionRecord, a as CodexEvent, b as CodexItem, d as CodexSessionRecord, e as CreateReviewRequest, D as DeltaFrame, f as DoneFrame, E as ErrorFrame, F as Finding, G as GithubAccountSnippet, g as GithubAccountType, H as Harness, h as HeartbeatFrame, L as LifecycleSessionRecord, P as ParentKind, i as PromptBlockedReason, R as RecordsAppendFrame, j as ResolvedReviewScope, k as Review, l as ReviewConfiguration, m as ReviewCounters, n as ReviewFinding, o as ReviewRequester, p as ReviewScope, q as ReviewScopeKind, r as ReviewStage, s as ReviewedCommit, t as ReviewsListResponse, S as SdkAssistantRecord, u as SdkContentBlock, v as SdkRateLimitRecord, w as SdkRecord, x as SdkResultRecord, y as SdkSystemRecord, z as SdkUserRecord, I as SendSessionMessageRequest, J as Session, K as SessionExitStatus, M as SessionFrame, N as SessionGit, O as SessionLiveness, Q as SessionMessage, T as SessionMessageResponse, U as SessionMessageStatus, V as SessionPrompting, W as SessionRecord, X as SessionRecordsListResponse, Y as SessionResponse, Z as SessionSource, _ as SessionState, $ as SessionStatus, a0 as SessionStreamFrame, a1 as SessionSurface, a2 as SessionsListResponse, a3 as SnapshotFrame, a4 as StreamFrame, a5 as TokensInfo, a6 as paths } from './types-DJzmFABi.js';
1
+ import { c as components } from './types-ClEF_IA9.js';
2
+ export { A as AttributionType, B as BudgetSource, C as ClaudeSessionRecord, a as CodexEvent, b as CodexItem, d as CodexSessionRecord, e as CreateReviewRequest, D as DeltaFrame, f as DoneFrame, E as ErrorFrame, F as Finding, G as GithubAccountSnippet, g as GithubAccountType, H as Harness, h as HeartbeatFrame, L as LifecycleSessionRecord, P as ParentKind, i as PromptBlockedReason, R as RecordsAppendFrame, j as ResolvedReviewScope, k as Review, l as ReviewConfiguration, m as ReviewCounters, n as ReviewFinding, o as ReviewRequester, p as ReviewScope, q as ReviewScopeKind, r as ReviewStage, s as ReviewedCommit, t as ReviewsListResponse, S as SdkAssistantRecord, u as SdkContentBlock, v as SdkRateLimitRecord, w as SdkRecord, x as SdkResultRecord, y as SdkSystemRecord, z as SdkUserRecord, I as SendSessionMessageRequest, J as Session, K as SessionExitStatus, M as SessionFrame, N as SessionGit, O as SessionLiveness, Q as SessionMessage, T as SessionMessageResponse, U as SessionMessageStatus, V as SessionPrompting, W as SessionRecord, X as SessionRecordsListResponse, Y as SessionResponse, Z as SessionSource, _ as SessionState, $ as SessionStatus, a0 as SessionStreamFrame, a1 as SessionSurface, a2 as SessionsListResponse, a3 as SnapshotFrame, a4 as StreamFrame, a5 as TokensInfo, a6 as paths } from './types-ClEF_IA9.js';
3
3
 
4
4
  interface CursorResponse {
5
5
  has_more: boolean;
@@ -23,6 +23,7 @@ interface SessionsApi {
23
23
  stop(sessionId: string): Promise<S$1['SessionResponse']>;
24
24
  sendMessage(sessionId: string, options: {
25
25
  message: string;
26
+ images?: S$1['ImageAttachment'][];
26
27
  idempotency_key?: string | null;
27
28
  }): Promise<S$1['SessionMessageResponse']>;
28
29
  records(sessionId: string, options?: {
@@ -42,6 +43,7 @@ declare class SessionHandle {
42
43
  pollIntervalMs?: number;
43
44
  }): Promise<S$1['Session']>;
44
45
  send(message: string, options?: {
46
+ images?: S$1['ImageAttachment'][];
45
47
  idempotencyKey?: string;
46
48
  }): Promise<S$1['SessionMessage']>;
47
49
  stop(): Promise<S$1['Session']>;
@@ -628,7 +630,8 @@ declare class EllipsisReviews {
628
630
  *
629
631
  * `findings` and `configuration` are omitted (counters only). Each
630
632
  * filter is a set: repeat `repository`, `pull_request_number`, or
631
- * `status` to match any of several values.
633
+ * `status` to match any of several values. `start` and `end` bound
634
+ * the review's creation time.
632
635
  *
633
636
  * Webhook-created reviews appear here too, so this answers "show
634
637
  * me every review on this PR".
@@ -637,6 +640,8 @@ declare class EllipsisReviews {
637
640
  repository?: (string)[];
638
641
  pull_request_number?: (number)[];
639
642
  status?: (S['CodeReviewRunStatus'])[];
643
+ start?: string | null;
644
+ end?: string | null;
640
645
  limit?: number;
641
646
  cursor?: string | null;
642
647
  }): Promise<Page<S['Review'], S['ReviewsListResponse']>>;
@@ -793,6 +798,7 @@ declare class EllipsisSessions {
793
798
  */
794
799
  sendMessage(session_id: string, options: {
795
800
  idempotency_key?: string | null;
801
+ images?: (S['ImageAttachment'])[];
796
802
  message: string;
797
803
  }): Promise<S['SessionMessageResponse']>;
798
804
  /**
@@ -802,8 +808,9 @@ declare class EllipsisSessions {
802
808
  *
803
809
  * The daily driver: a prompt, optionally where to run it
804
810
  * (`environment`) and the run's own settings, in the AutomationConfig
805
- * vocabulary. Anything omitted comes from the organization's
806
- * settings — default model, default environment, budget — so
811
+ * vocabulary. What you send is what runs: omit `environment` and the
812
+ * session runs in the built-in basic sandbox. A missing model or
813
+ * budget comes from the organization's settings, so
807
814
  * `{"prompt": "..."}` alone is a complete request. `prompt` is the
808
815
  * first message; omit it and the session starts idle, waiting for
809
816
  * one. 400 when `interactive` is false and there is no prompt, or
@@ -816,6 +823,7 @@ declare class EllipsisSessions {
816
823
  codex?: S['CodexConfig'] | null;
817
824
  environment?: string | S['EnvironmentConfig'] | null;
818
825
  force_rebuild?: boolean;
826
+ images?: (S['ImageAttachment'])[];
819
827
  interactive?: boolean;
820
828
  metadata?: Record<string, string>;
821
829
  output?: S['OutputConfig'] | null;
@@ -846,9 +854,9 @@ declare class EllipsisSettingsOrganization {
846
854
  *
847
855
  * Get the organization settings.
848
856
  *
849
- * The default model and default environment every session falls
850
- * back to when neither its request nor its automation names one,
851
- * and the per-session budget ceiling no session may exceed.
857
+ * The default model every session falls back to when neither its
858
+ * request nor its automation names one, and the per-session budget
859
+ * ceiling no session may exceed.
852
860
  */
853
861
  get(): Promise<S['OrganizationSettings']>;
854
862
  /**
@@ -856,16 +864,14 @@ declare class EllipsisSettingsOrganization {
856
864
  *
857
865
  * Set the organization settings.
858
866
  *
859
- * Replaces all three: `default_model` accepts an alias or canonical
860
- * id and is stored canonical; `default_environment` accepts a name
861
- * or `env_` id and is stored as the id; `budget_ceiling.session` is
862
- * in US dollars, at most the platform ceiling. Null clears each.
867
+ * Replaces both: `default_model` accepts an alias or canonical id
868
+ * and is stored canonical; `budget_ceiling.session` is in US
869
+ * dollars, at most the platform ceiling. Null clears each.
863
870
  * Refused for sandbox tokens (potentially prompt-injected code must
864
871
  * not repoint the organization's defaults).
865
872
  */
866
873
  set(options?: {
867
874
  budget_ceiling?: S['BudgetCeiling'];
868
- default_environment?: string | null;
869
875
  default_model?: string | null;
870
876
  }): Promise<S['OrganizationSettings']>;
871
877
  }
package/dist/index.js CHANGED
@@ -72,10 +72,12 @@ var SessionHandle = class {
72
72
  }
73
73
  }
74
74
  // Post into the session's inbox (delivered at the next turn boundary;
75
- // wakes a parked session).
75
+ // wakes a parked session). `images` ride the message as content blocks the
76
+ // model sees on that turn — a paste into Claude Code.
76
77
  async send(message, options = {}) {
77
78
  const response = await this.sessions.sendMessage(this.id, {
78
79
  message,
80
+ images: options.images,
79
81
  idempotency_key: options.idempotencyKey
80
82
  });
81
83
  return response.message;
@@ -914,14 +916,15 @@ var EllipsisReviews = class {
914
916
  *
915
917
  * `findings` and `configuration` are omitted (counters only). Each
916
918
  * filter is a set: repeat `repository`, `pull_request_number`, or
917
- * `status` to match any of several values.
919
+ * `status` to match any of several values. `start` and `end` bound
920
+ * the review's creation time.
918
921
  *
919
922
  * Webhook-created reviews appear here too, so this answers "show
920
923
  * me every review on this PR".
921
924
  */
922
925
  async list(options = {}) {
923
926
  const path = "/v1/reviews";
924
- const query = buildQuery({ repository: options.repository, pull_request_number: options.pull_request_number, status: options.status, limit: options.limit, cursor: options.cursor });
927
+ const query = buildQuery({ repository: options.repository, pull_request_number: options.pull_request_number, status: options.status, start: options.start, end: options.end, limit: options.limit, cursor: options.cursor });
925
928
  const response = await this.transport.request("GET", path, { query });
926
929
  return new Page(
927
930
  response,
@@ -1111,7 +1114,7 @@ var EllipsisSessions = class {
1111
1114
  */
1112
1115
  async sendMessage(session_id, options) {
1113
1116
  const path = `/v1/sessions/${enc(session_id)}/messages`;
1114
- const body = buildBody({ idempotency_key: options.idempotency_key, message: options.message });
1117
+ const body = buildBody({ idempotency_key: options.idempotency_key, images: options.images, message: options.message });
1115
1118
  return await this.transport.request("POST", path, { body });
1116
1119
  }
1117
1120
  /**
@@ -1121,8 +1124,9 @@ var EllipsisSessions = class {
1121
1124
  *
1122
1125
  * The daily driver: a prompt, optionally where to run it
1123
1126
  * (`environment`) and the run's own settings, in the AutomationConfig
1124
- * vocabulary. Anything omitted comes from the organization's
1125
- * settings — default model, default environment, budget — so
1127
+ * vocabulary. What you send is what runs: omit `environment` and the
1128
+ * session runs in the built-in basic sandbox. A missing model or
1129
+ * budget comes from the organization's settings, so
1126
1130
  * `{"prompt": "..."}` alone is a complete request. `prompt` is the
1127
1131
  * first message; omit it and the session starts idle, waiting for
1128
1132
  * one. 400 when `interactive` is false and there is no prompt, or
@@ -1131,7 +1135,7 @@ var EllipsisSessions = class {
1131
1135
  */
1132
1136
  async start(options = {}) {
1133
1137
  const path = "/v1/sessions";
1134
- const body = buildBody({ budget: options.budget, claude: options.claude, codex: options.codex, environment: options.environment, force_rebuild: options.force_rebuild, interactive: options.interactive, metadata: options.metadata, output: options.output, permissions: options.permissions, prompt: options.prompt, repositories: options.repositories, skills: options.skills });
1138
+ const body = buildBody({ budget: options.budget, claude: options.claude, codex: options.codex, environment: options.environment, force_rebuild: options.force_rebuild, images: options.images, interactive: options.interactive, metadata: options.metadata, output: options.output, permissions: options.permissions, prompt: options.prompt, repositories: options.repositories, skills: options.skills });
1135
1139
  return await this.transport.request("POST", path, { body });
1136
1140
  }
1137
1141
  /**
@@ -1168,9 +1172,9 @@ var EllipsisSettingsOrganization = class {
1168
1172
  *
1169
1173
  * Get the organization settings.
1170
1174
  *
1171
- * The default model and default environment every session falls
1172
- * back to when neither its request nor its automation names one,
1173
- * and the per-session budget ceiling no session may exceed.
1175
+ * The default model every session falls back to when neither its
1176
+ * request nor its automation names one, and the per-session budget
1177
+ * ceiling no session may exceed.
1174
1178
  */
1175
1179
  async get() {
1176
1180
  const path = "/v1/settings/organization";
@@ -1181,16 +1185,15 @@ var EllipsisSettingsOrganization = class {
1181
1185
  *
1182
1186
  * Set the organization settings.
1183
1187
  *
1184
- * Replaces all three: `default_model` accepts an alias or canonical
1185
- * id and is stored canonical; `default_environment` accepts a name
1186
- * or `env_` id and is stored as the id; `budget_ceiling.session` is
1187
- * in US dollars, at most the platform ceiling. Null clears each.
1188
+ * Replaces both: `default_model` accepts an alias or canonical id
1189
+ * and is stored canonical; `budget_ceiling.session` is in US
1190
+ * dollars, at most the platform ceiling. Null clears each.
1188
1191
  * Refused for sandbox tokens (potentially prompt-injected code must
1189
1192
  * not repoint the organization's defaults).
1190
1193
  */
1191
1194
  async set(options = {}) {
1192
1195
  const path = "/v1/settings/organization";
1193
- const body = buildBody({ budget_ceiling: options.budget_ceiling, default_environment: options.default_environment, default_model: options.default_model });
1196
+ const body = buildBody({ budget_ceiling: options.budget_ceiling, default_model: options.default_model });
1194
1197
  return await this.transport.request("PUT", path, { body });
1195
1198
  }
1196
1199
  };
@@ -1,4 +1,4 @@
1
- import { W as SessionRecord, a7 as CodexFileChangeItem, a as CodexEvent, a8 as CodexMcpToolCallItem, w as SdkRecord, J as Session, Q as SessionMessage, a4 as StreamFrame } from '../types-DJzmFABi.js';
1
+ import { W as SessionRecord, a7 as CodexFileChangeItem, a as CodexEvent, a8 as CodexMcpToolCallItem, w as SdkRecord, J as Session, Q as SessionMessage, a4 as StreamFrame } from '../types-ClEF_IA9.js';
2
2
 
3
3
  interface ChatToolNode {
4
4
  key: string;
@@ -55,6 +55,7 @@ type RecordSlice = {
55
55
  };
56
56
  declare function recordSlice(records: readonly SessionRecord[]): readonly RecordSlice[];
57
57
  declare function humanDuration(seconds: number): string;
58
+ declare const SESSION_WAKING = "Session waking";
58
59
  declare function sessionLogText(recordType: string, payload: Record<string, unknown>): string | null;
59
60
  declare function awaitingAgentPhase(records: readonly RecordSlice[]): 'boot' | 'turn' | null;
60
61
  declare function deliveredUnechoedSends(records: readonly RecordSlice[]): {
@@ -67,6 +68,7 @@ type SandboxLogLine = {
67
68
  key: string;
68
69
  kind: SandboxLogKind;
69
70
  text: string;
71
+ loading?: boolean;
70
72
  };
71
73
  type SandboxState = {
72
74
  headline: string;
@@ -79,6 +81,8 @@ type SandboxState = {
79
81
  };
80
82
  declare function hookPhrase(step: string): string;
81
83
  declare function deriveSandboxState(records: readonly RecordSlice[], minFeedSeq: number): SandboxState | null;
84
+ declare function startupSettled(sandbox: SandboxState | null, status: string): boolean;
85
+ declare function startupHeadline(sandbox: SandboxState | null, status: string): string;
82
86
  declare function sandboxSummary(sandbox: SandboxState | null): string;
83
87
  declare function lastLines(log: readonly SandboxLogLine[], max: number): SandboxLogLine[];
84
88
 
@@ -95,6 +99,7 @@ interface TranscriptItem {
95
99
  name: string;
96
100
  input?: Record<string, unknown>;
97
101
  };
102
+ loading?: boolean;
98
103
  }
99
104
  declare function oneLine(text: string, max: number): string;
100
105
  declare function summarizeToolInput(name: string, input: unknown): string;
@@ -110,7 +115,11 @@ declare function codexMcpToolName(item: CodexMcpToolCallItem): string;
110
115
  declare function recordToItems(record: SessionRecord, keyBase: string, options?: EventToItemsOptions): TranscriptItem[];
111
116
  declare function isConnectVisibleRecord(record: SessionRecord): boolean;
112
117
  declare function pendingToolCalls(items: TranscriptItem[]): TranscriptItem[];
113
- declare function collapseToolRuns(items: TranscriptItem[]): TranscriptItem[];
118
+ declare function isFoldable(item: TranscriptItem): boolean;
119
+ declare function foldRun(group: TranscriptItem[], loading: boolean): TranscriptItem;
120
+ declare function collapseToolRuns(items: TranscriptItem[], { working }?: {
121
+ working?: boolean;
122
+ }): TranscriptItem[];
114
123
  declare function clampLines(text: string, maxLines: number): {
115
124
  body: string;
116
125
  more: number;
@@ -129,7 +138,6 @@ declare function gutterFor(item: TranscriptItem): string;
129
138
  declare function chatTurnsToItems(turns: readonly ChatTurn[]): TranscriptItem[];
130
139
  declare function isToolFold(item: TranscriptItem): boolean;
131
140
  declare function isToolActivity(item: TranscriptItem): boolean;
132
- declare function isAgentSpeech(item: TranscriptItem): boolean;
133
141
  type PlacedItem = {
134
142
  item: TranscriptItem;
135
143
  nested: boolean;
@@ -143,6 +151,27 @@ declare function tailLines(text: string, maxLines: number): {
143
151
  };
144
152
  declare function toolRunMembers(items: readonly TranscriptItem[]): Map<string, TranscriptItem[]>;
145
153
 
154
+ interface LedgerEntry {
155
+ key: string;
156
+ prompt: string;
157
+ cancelled: boolean;
158
+ turns: ChatTurn[];
159
+ }
160
+ declare function splitLedger(turns: readonly ChatTurn[]): {
161
+ preamble: ChatTurn[];
162
+ entries: LedgerEntry[];
163
+ };
164
+ declare function entrySeconds(entry: LedgerEntry, now: number): number;
165
+ type EntryBody = {
166
+ items: TranscriptItem[];
167
+ members: Map<string, TranscriptItem[]>;
168
+ };
169
+ declare function entryBody(entry: LedgerEntry, { live, now, liveText, }: {
170
+ live: boolean;
171
+ now: number;
172
+ liveText?: string;
173
+ }): EntryBody;
174
+
146
175
  declare function sandboxOutputStep(payload: Record<string, unknown>): string;
147
176
  declare function sandboxOutputLines(payload: Record<string, unknown>): string[];
148
177
  declare function sandboxOutputLine(payload: Record<string, unknown>): string | null;
@@ -186,4 +215,4 @@ declare class SessionTranscriptStore {
186
215
  ingest: (rawFrame: StreamFrame) => void;
187
216
  }
188
217
 
189
- export { BRANCH_GLYPH, type ChatNode, type ChatToolNode, type ChatTurn, type EventToItemsOptions, type ItemKind, LIVE_GLYPH, type PlacedItem, type RecordSlice, type SandboxLogKind, type SandboxLogLine, type SandboxState, type SessionTranscriptSnapshot, SessionTranscriptStore, StreamFrame, type TranscriptItem, USER_BAR, awaitingAgentPhase, cacheTierLabel, chatTurnsToItems, clampLines, codexChangedPaths, codexEventToItems, codexMcpToolName, collapseToolRuns, deliveredUnechoedSends, deriveSandboxState, emptySessionTranscriptSnapshot, eventToItems, foldCosts, foldGutter, formatDuration, groupRecordsToChatTurns, gutterFor, hookPhrase, humanDuration, isAgentSpeech, isConnectVisibleRecord, isConversationOver, isToolActivity, isToolFold, lastLines, layOutItems, lifecycleText, oneLine, pendingToolCalls, recordSlice, recordToItems, resultCostUsd, sandboxOutputLine, sandboxOutputLines, sandboxOutputStep, sandboxPhaseLabel, sandboxSummary, seedTranscriptStore, sessionLogText, statusActivityText, summarizeToolInput, tailLines, toolResultText, toolRunMembers };
218
+ export { BRANCH_GLYPH, type ChatNode, type ChatToolNode, type ChatTurn, type EntryBody, type EventToItemsOptions, type ItemKind, LIVE_GLYPH, type LedgerEntry, type PlacedItem, type RecordSlice, SESSION_WAKING, type SandboxLogKind, type SandboxLogLine, type SandboxState, type SessionTranscriptSnapshot, SessionTranscriptStore, StreamFrame, type TranscriptItem, USER_BAR, awaitingAgentPhase, cacheTierLabel, chatTurnsToItems, clampLines, codexChangedPaths, codexEventToItems, codexMcpToolName, collapseToolRuns, deliveredUnechoedSends, deriveSandboxState, emptySessionTranscriptSnapshot, entryBody, entrySeconds, eventToItems, foldCosts, foldGutter, foldRun, formatDuration, groupRecordsToChatTurns, gutterFor, hookPhrase, humanDuration, isConnectVisibleRecord, isConversationOver, isFoldable, isToolActivity, isToolFold, lastLines, layOutItems, lifecycleText, oneLine, pendingToolCalls, recordSlice, recordToItems, resultCostUsd, sandboxOutputLine, sandboxOutputLines, sandboxOutputStep, sandboxPhaseLabel, sandboxSummary, seedTranscriptStore, sessionLogText, splitLedger, startupHeadline, startupSettled, statusActivityText, summarizeToolInput, tailLines, toolResultText, toolRunMembers };