@ellipsis-dev/sdk 0.30.0 → 0.32.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 CHANGED
@@ -45,14 +45,14 @@ Web and CLI renderers can use `splitLedger(groupRecordsToChatTurns(records))`
45
45
  and `entryBody(entry, { live, now, liveText, liveSummary })` from `@ellipsis-dev/sdk/store`.
46
46
  `now` is epoch milliseconds. The returned `items` are the collapsed view:
47
47
  one `isWorkFold(item)` section for progress, thinking and tools, with final
48
- replies, sleep and cancellation notices kept visible. Wake milestones stay
49
- inside the work section. `members.get(item.key)` contains
48
+ replies, turn outcome and closing notices kept visible.
49
+ `members.get(item.key)` contains
50
50
  that section's rows; nested tool folds use the same map and `isToolFold`.
51
51
  Renderers own expansion state and can recursively display the members.
52
52
 
53
53
  The work key stays stable as records stream in and after replay. The live
54
- label advances from `Waking session` to `Starting agent` to `Working` as
55
- the platform and native turn events arrive. While the agent works, the heading
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
56
  from `store.getSnapshot().liveSummary` replaces `Working` when available.
57
57
  Pass the summary only to the entry being answered (`loading: true`, add a loading
58
58
  indicator in the renderer). The returned `seconds` uses platform turn start
@@ -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.lifecycle.status;
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 lastExitStatus = null;
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
- lastExitStatus = session.lifecycle.last_execution_result?.completion_reason ?? null;
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 };