@ellipsis-dev/sdk 0.28.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/dist/{chunk-YJC53TA7.js → chunk-G2AEYZW2.js} +5 -9
- package/dist/index.d.ts +1853 -757
- package/dist/index.js +1236 -365
- package/dist/store/index.d.ts +68 -23
- package/dist/store/index.js +637 -330
- package/dist/stream/index.d.ts +3 -3
- package/dist/stream/index.js +1 -1
- package/dist/{types-B-jIFh4_.d.ts → types-BQxZcD0_.d.ts} +6342 -6117
- package/package.json +1 -1
- package/schema/collection_frames.schema.json +1485 -933
- package/schema/frames.schema.json +3379 -4844
- package/schema/lifecycle.schema.json +182 -323
- package/schema/openapi.v1.json +18809 -12100
- package/schema/trigger_fields.schema.json +1 -1
package/dist/store/index.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { q as CodexAgentMessage, cn as SessionRecord, K as CodexFileChangeItem, I as CodexEvent, X as CodexMcpToolCallItem, bM as SdkRecord, bZ as Session, ch as SessionMessage, cG as StreamFrame } from '../types-BQxZcD0_.js';
|
|
2
|
+
|
|
3
|
+
type WorkPhase = 'queued' | 'preparing' | 'starting' | 'working';
|
|
4
|
+
interface TurnTiming {
|
|
5
|
+
id: string;
|
|
6
|
+
startedAt: string | null;
|
|
7
|
+
completedAt: string | null;
|
|
8
|
+
}
|
|
9
|
+
interface MessageProgress {
|
|
10
|
+
phase: WorkPhase | null;
|
|
11
|
+
turns: TurnTiming[];
|
|
12
|
+
}
|
|
2
13
|
|
|
3
14
|
interface ChatToolNode {
|
|
4
15
|
key: string;
|
|
@@ -7,6 +18,7 @@ interface ChatToolNode {
|
|
|
7
18
|
input: Record<string, unknown> | null;
|
|
8
19
|
summary: string;
|
|
9
20
|
result: string | null;
|
|
21
|
+
resultDetails?: unknown;
|
|
10
22
|
isError: boolean;
|
|
11
23
|
startedAt: string | null;
|
|
12
24
|
completedAt: string | null;
|
|
@@ -15,10 +27,13 @@ type ChatNode = {
|
|
|
15
27
|
key: string;
|
|
16
28
|
kind: 'assistant';
|
|
17
29
|
text: string;
|
|
30
|
+
createdAt?: string;
|
|
31
|
+
phase?: CodexAgentMessage['phase'];
|
|
18
32
|
} | {
|
|
19
33
|
key: string;
|
|
20
34
|
kind: 'thinking';
|
|
21
35
|
text: string;
|
|
36
|
+
createdAt?: string;
|
|
22
37
|
} | {
|
|
23
38
|
key: string;
|
|
24
39
|
kind: 'user';
|
|
@@ -34,6 +49,8 @@ type ChatNode = {
|
|
|
34
49
|
} | ChatToolNode;
|
|
35
50
|
interface ChatTurn {
|
|
36
51
|
key: string;
|
|
52
|
+
messageId?: string;
|
|
53
|
+
turnId?: string;
|
|
37
54
|
role: 'assistant' | 'user' | 'lifecycle';
|
|
38
55
|
nodes: ChatNode[];
|
|
39
56
|
startedAt: string | null;
|
|
@@ -43,19 +60,32 @@ interface ChatTurn {
|
|
|
43
60
|
tokens: number | null;
|
|
44
61
|
resumed: boolean;
|
|
45
62
|
isError: boolean;
|
|
63
|
+
progress?: MessageProgress;
|
|
46
64
|
}
|
|
47
|
-
declare function groupRecordsToChatTurns(records: readonly SessionRecord[]
|
|
65
|
+
declare function groupRecordsToChatTurns(records: readonly SessionRecord[], session?: {
|
|
66
|
+
claude_code?: {
|
|
67
|
+
prompt?: string | null;
|
|
68
|
+
} | null;
|
|
69
|
+
codex?: {
|
|
70
|
+
prompt?: string | null;
|
|
71
|
+
} | null;
|
|
72
|
+
created_at: string;
|
|
73
|
+
turn?: {
|
|
74
|
+
id: string;
|
|
75
|
+
index: number;
|
|
76
|
+
} | null;
|
|
77
|
+
} | null): ChatTurn[];
|
|
48
78
|
|
|
49
79
|
type RecordSlice = {
|
|
50
80
|
feed_seq: number;
|
|
51
81
|
source: string;
|
|
52
82
|
record_type: string;
|
|
53
83
|
payload: Record<string, unknown>;
|
|
84
|
+
turn_id?: string | null;
|
|
54
85
|
session_message_id?: string | null;
|
|
55
86
|
};
|
|
56
87
|
declare function recordSlice(records: readonly SessionRecord[]): readonly RecordSlice[];
|
|
57
88
|
declare function humanDuration(seconds: number): string;
|
|
58
|
-
declare const SESSION_WAKING = "Session waking";
|
|
59
89
|
declare function sessionLogText(recordType: string, payload: Record<string, unknown>): string | null;
|
|
60
90
|
declare function awaitingAgentPhase(records: readonly RecordSlice[]): 'boot' | 'turn' | null;
|
|
61
91
|
declare function deliveredUnechoedSends(records: readonly RecordSlice[]): {
|
|
@@ -63,34 +93,31 @@ declare function deliveredUnechoedSends(records: readonly RecordSlice[]): {
|
|
|
63
93
|
body: string;
|
|
64
94
|
cancelled: boolean;
|
|
65
95
|
}[];
|
|
66
|
-
type
|
|
67
|
-
type
|
|
96
|
+
type EnvironmentLogKind = 'step' | 'output' | 'done' | 'failed';
|
|
97
|
+
type EnvironmentLogLine = {
|
|
68
98
|
key: string;
|
|
69
|
-
kind:
|
|
99
|
+
kind: EnvironmentLogKind;
|
|
70
100
|
text: string;
|
|
71
101
|
loading?: boolean;
|
|
72
102
|
};
|
|
73
|
-
type
|
|
74
|
-
headline: string;
|
|
103
|
+
type EnvironmentState = {
|
|
75
104
|
done: boolean;
|
|
76
105
|
readySeconds: number | null;
|
|
77
|
-
|
|
78
|
-
configName: string | null;
|
|
79
|
-
configCommitSha: string | null;
|
|
80
|
-
log: SandboxLogLine[];
|
|
106
|
+
log: EnvironmentLogLine[];
|
|
81
107
|
};
|
|
82
108
|
declare function hookPhrase(step: string): string;
|
|
83
|
-
declare function
|
|
84
|
-
declare function startupSettled(
|
|
85
|
-
declare function startupHeadline(
|
|
86
|
-
declare function
|
|
87
|
-
declare function lastLines(log: readonly
|
|
109
|
+
declare function deriveEnvironmentState(records: readonly RecordSlice[], minFeedSeq: number): EnvironmentState | null;
|
|
110
|
+
declare function startupSettled(environment: EnvironmentState | null, status: string): boolean;
|
|
111
|
+
declare function startupHeadline(environment: EnvironmentState | null, status: string): string;
|
|
112
|
+
declare function environmentSummary(environment: EnvironmentState | null): string;
|
|
113
|
+
declare function lastLines(log: readonly EnvironmentLogLine[], max: number): EnvironmentLogLine[];
|
|
88
114
|
|
|
89
115
|
type ItemKind = 'assistant' | 'thinking' | 'tool' | 'tool_result' | 'summary' | 'system' | 'user' | 'notice' | 'error';
|
|
90
116
|
interface TranscriptItem {
|
|
91
117
|
key: string;
|
|
92
118
|
kind: ItemKind;
|
|
93
119
|
text: string;
|
|
120
|
+
createdAt?: string | null;
|
|
94
121
|
detail?: string;
|
|
95
122
|
gutter?: string;
|
|
96
123
|
spaceBefore?: boolean;
|
|
@@ -155,8 +182,10 @@ declare function toolRunMembers(items: readonly TranscriptItem[]): Map<string, T
|
|
|
155
182
|
interface LedgerEntry {
|
|
156
183
|
key: string;
|
|
157
184
|
prompt: string;
|
|
185
|
+
createdAt?: string | null;
|
|
158
186
|
cancelled: boolean;
|
|
159
187
|
turns: ChatTurn[];
|
|
188
|
+
progress?: MessageProgress;
|
|
160
189
|
}
|
|
161
190
|
declare function splitLedger(turns: readonly ChatTurn[]): {
|
|
162
191
|
preamble: ChatTurn[];
|
|
@@ -166,18 +195,31 @@ declare function entrySeconds(entry: LedgerEntry, now: number): number;
|
|
|
166
195
|
type EntryBody = {
|
|
167
196
|
items: TranscriptItem[];
|
|
168
197
|
members: Map<string, TranscriptItem[]>;
|
|
198
|
+
seconds: number | null;
|
|
169
199
|
};
|
|
170
|
-
declare function
|
|
200
|
+
declare function isWorkFold(item: TranscriptItem): boolean;
|
|
201
|
+
declare function reasoningSummaryTitle(summary: string): string;
|
|
202
|
+
declare function entryBody(entry: LedgerEntry, { live, now, liveText, liveSummary, }: {
|
|
171
203
|
live: boolean;
|
|
172
204
|
now: number;
|
|
173
205
|
liveText?: string;
|
|
206
|
+
liveSummary?: string;
|
|
174
207
|
}): EntryBody;
|
|
175
208
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
209
|
+
interface ToolActivity {
|
|
210
|
+
kind: 'read' | 'search' | 'list' | 'edit' | 'command' | 'web' | 'tool';
|
|
211
|
+
label: string;
|
|
212
|
+
detail: string;
|
|
213
|
+
}
|
|
214
|
+
declare function toolActivities(item: TranscriptItem): ToolActivity[];
|
|
215
|
+
declare function activitySummary(activities: readonly ToolActivity[]): string;
|
|
216
|
+
|
|
217
|
+
declare function environmentOutputStep(payload: Record<string, unknown>): string;
|
|
218
|
+
declare function environmentOutputLines(payload: Record<string, unknown>): string[];
|
|
219
|
+
declare function environmentOutputLine(payload: Record<string, unknown>): string | null;
|
|
179
220
|
declare function cacheTierLabel(tier: unknown): string | null;
|
|
180
|
-
declare function
|
|
221
|
+
declare function environmentPhaseLabel(phase: unknown): string;
|
|
222
|
+
declare function turnEndedText(payload: Record<string, unknown>): string | null;
|
|
181
223
|
declare function lifecycleText(recordType: string, payload: Record<string, unknown>): string | null;
|
|
182
224
|
|
|
183
225
|
declare function claudePayload(record: SessionRecord): SdkRecord | null;
|
|
@@ -190,6 +232,7 @@ interface SessionTranscriptSnapshot {
|
|
|
190
232
|
acknowledgedMessageIds: ReadonlySet<string>;
|
|
191
233
|
historyTruncated: boolean;
|
|
192
234
|
liveText: string;
|
|
235
|
+
liveSummary: string;
|
|
193
236
|
liveOutputTokens: number | null;
|
|
194
237
|
lastEventAt: number | null;
|
|
195
238
|
conversationOver: boolean;
|
|
@@ -208,7 +251,9 @@ declare class SessionTranscriptStore {
|
|
|
208
251
|
private inbox;
|
|
209
252
|
private cursorSeq;
|
|
210
253
|
private turnsFor;
|
|
254
|
+
private turnsSession;
|
|
211
255
|
private turnsCache;
|
|
256
|
+
private summaryTurnId;
|
|
212
257
|
get cursor(): number;
|
|
213
258
|
subscribe: (listener: () => void) => (() => void);
|
|
214
259
|
getSnapshot: () => SessionTranscriptSnapshot;
|
|
@@ -218,4 +263,4 @@ declare class SessionTranscriptStore {
|
|
|
218
263
|
ingest: (rawFrame: StreamFrame) => void;
|
|
219
264
|
}
|
|
220
265
|
|
|
221
|
-
export { BRANCH_GLYPH, type ChatNode, type ChatToolNode, type ChatTurn, type EntryBody, type
|
|
266
|
+
export { BRANCH_GLYPH, type ChatNode, type ChatToolNode, type ChatTurn, type EntryBody, type EnvironmentLogKind, type EnvironmentLogLine, type EnvironmentState, type EventToItemsOptions, type ItemKind, LIVE_GLYPH, type LedgerEntry, type MessageProgress, type PlacedItem, type RecordSlice, type SessionTranscriptSnapshot, SessionTranscriptStore, StreamFrame, type ToolActivity, type TranscriptItem, type TurnTiming, USER_BAR, type WorkPhase, activitySummary, awaitingAgentPhase, cacheTierLabel, chatTurnsToItems, clampLines, claudePayload, codexChangedPaths, codexEventToItems, codexMcpToolName, collapseToolRuns, deliveredUnechoedSends, deriveEnvironmentState, emptySessionTranscriptSnapshot, entryBody, entrySeconds, environmentOutputLine, environmentOutputLines, environmentOutputStep, environmentPhaseLabel, environmentSummary, eventToItems, foldCosts, foldGutter, foldRun, formatDuration, groupRecordsToChatTurns, gutterFor, hookPhrase, humanDuration, isConnectVisibleRecord, isConversationOver, isFoldable, isToolActivity, isToolFold, isWorkFold, lastLines, layOutItems, lifecycleText, oneLine, pendingToolCalls, reasoningSummaryTitle, recordSlice, recordToItems, resultCostUsd, seedTranscriptStore, sessionLogText, splitLedger, startupHeadline, startupSettled, statusActivityText, summarizeToolInput, tailLines, toolActivities, toolResultText, toolRunMembers, turnEndedText };
|