@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/README.md
CHANGED
|
@@ -38,3 +38,28 @@ contract) is documented at https://www.ellipsis.dev/docs. The compatibility
|
|
|
38
38
|
rule clients must follow: **ignore unknown frame types and unknown
|
|
39
39
|
`source`/`record_type`/`kind` values** — additive server changes are not a
|
|
40
40
|
protocol break.
|
|
41
|
+
|
|
42
|
+
## Shared chat work sections
|
|
43
|
+
|
|
44
|
+
Web and CLI renderers can use `splitLedger(groupRecordsToChatTurns(records))`
|
|
45
|
+
and `entryBody(entry, { live, now, liveText, liveSummary })` from `@ellipsis-dev/sdk/store`.
|
|
46
|
+
`now` is epoch milliseconds. The returned `items` are the collapsed view:
|
|
47
|
+
one `isWorkFold(item)` section for progress, thinking and tools, with final
|
|
48
|
+
replies, turn outcome and closing notices kept visible.
|
|
49
|
+
`members.get(item.key)` contains
|
|
50
|
+
that section's rows; nested tool folds use the same map and `isToolFold`.
|
|
51
|
+
Renderers own expansion state and can recursively display the members.
|
|
52
|
+
|
|
53
|
+
The work key stays stable as records stream in and after replay. The live
|
|
54
|
+
label advances from `Preparing environment` to `Starting agent` to `Working`
|
|
55
|
+
as the platform and native turn events arrive. While the agent works, the heading
|
|
56
|
+
from `store.getSnapshot().liveSummary` replaces `Working` when available.
|
|
57
|
+
Pass the summary only to the entry being answered (`loading: true`, add a loading
|
|
58
|
+
indicator in the renderer). The returned `seconds` uses platform turn start
|
|
59
|
+
and completion timestamps, even before the first content item arrives. It is
|
|
60
|
+
null before a turn starts; omit the clock then. `entry.progress.phase` identifies
|
|
61
|
+
each message's activity independently of the latest message or session status.
|
|
62
|
+
The settled label is `Worked for 4m 43s`. Only the work header is loading; partial
|
|
63
|
+
text stays inside it. Codex message phases identify final answers; for records
|
|
64
|
+
without phases, the final message of a settled turn stays outside the fold.
|
|
65
|
+
No DOM, React, or terminal dependencies are required.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/stream/index.ts
|
|
2
|
-
var SESSION_STREAM_PROTOCOL_VERSION =
|
|
2
|
+
var SESSION_STREAM_PROTOCOL_VERSION = 6;
|
|
3
3
|
var WS_CLOSE_NORMAL = 1e3;
|
|
4
4
|
var WS_CLOSE_GOING_AWAY = 1001;
|
|
5
5
|
var WS_CLOSE_UNSUPPORTED_PROTOCOL_VERSION = 1002;
|
|
@@ -8,7 +8,7 @@ var WS_CLOSE_AUTH_FAILED = 1008;
|
|
|
8
8
|
var WS_CLOSE_SERVER_ERROR = 1011;
|
|
9
9
|
var WS_CLOSE_OVER_CAPACITY = 1013;
|
|
10
10
|
function sessionStatusWord(session) {
|
|
11
|
-
return session.
|
|
11
|
+
return session.turn?.status ?? "none";
|
|
12
12
|
}
|
|
13
13
|
var StreamUnavailableError = class extends Error {
|
|
14
14
|
constructor(message) {
|
|
@@ -136,7 +136,7 @@ async function streamSession(opts) {
|
|
|
136
136
|
let everReceivedFrame = false;
|
|
137
137
|
let attempt = 0;
|
|
138
138
|
let lastStatusWord = "";
|
|
139
|
-
let
|
|
139
|
+
let lastReason = null;
|
|
140
140
|
const emit = (frame) => {
|
|
141
141
|
everReceivedFrame = true;
|
|
142
142
|
attempt = 0;
|
|
@@ -150,7 +150,7 @@ async function streamSession(opts) {
|
|
|
150
150
|
} else if (frame.type === "snapshot" || frame.type === "session") {
|
|
151
151
|
const session = frame.session;
|
|
152
152
|
lastStatusWord = sessionStatusWord(session);
|
|
153
|
-
|
|
153
|
+
lastReason = session.turn?.reason ?? null;
|
|
154
154
|
}
|
|
155
155
|
opts.onFrame(frame);
|
|
156
156
|
};
|
|
@@ -171,11 +171,7 @@ async function streamSession(opts) {
|
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
173
|
if (res.kind === "done") {
|
|
174
|
-
return {
|
|
175
|
-
type: "done",
|
|
176
|
-
status: lastStatusWord,
|
|
177
|
-
exitStatus: lastExitStatus
|
|
178
|
-
};
|
|
174
|
+
return { type: "done", status: lastStatusWord, reason: lastReason };
|
|
179
175
|
}
|
|
180
176
|
if (res.kind === "frameError")
|
|
181
177
|
return { type: "error", message: res.message };
|