@av-pi-studio/cli 0.0.99 → 0.0.100

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
@@ -11,7 +11,7 @@ pi-studio ui # serve the browser UI, connected to that daemon
11
11
  ```
12
12
 
13
13
  <p align="center">
14
- <img src="https://cdn.jsdelivr.net/npm/@av-pi-studio/cli@0.0.99/assets/screenshots/chat-workspace.webp" alt="Pi-Studio web UI — an agent reading, editing, and running shell commands, each as its own tool-call card" width="850">
14
+ <img src="https://cdn.jsdelivr.net/npm/@av-pi-studio/cli@0.0.100/assets/screenshots/chat-workspace.webp" alt="Pi-Studio web UI — an agent reading, editing, and running shell commands, each as its own tool-call card" width="850">
15
15
  </p>
16
16
 
17
17
  ---
@@ -68,20 +68,20 @@ own card, with live diff stats, right in the chat.
68
68
  Review what it changed without leaving the tab — a full diff view, line by line:
69
69
 
70
70
  <p align="center">
71
- <img src="https://cdn.jsdelivr.net/npm/@av-pi-studio/cli@0.0.99/assets/screenshots/git-diff.webp" alt="Pi-Studio web UI — git changes diff view" width="850">
71
+ <img src="https://cdn.jsdelivr.net/npm/@av-pi-studio/cli@0.0.100/assets/screenshots/git-diff.webp" alt="Pi-Studio web UI — git changes diff view" width="850">
72
72
  </p>
73
73
 
74
74
  Split the workspace into multiple panes — chat next to a live terminal (backed by `node-pty`), a
75
75
  file, or another session — and the layout persists across reloads:
76
76
 
77
77
  <p align="center">
78
- <img src="https://cdn.jsdelivr.net/npm/@av-pi-studio/cli@0.0.99/assets/screenshots/split-panes.webp" alt="Pi-Studio web UI — split panes with chat and a live terminal side by side" width="850">
78
+ <img src="https://cdn.jsdelivr.net/npm/@av-pi-studio/cli@0.0.100/assets/screenshots/split-panes.webp" alt="Pi-Studio web UI — split panes with chat and a live terminal side by side" width="850">
79
79
  </p>
80
80
 
81
81
  Every file opens with full syntax highlighting:
82
82
 
83
83
  <p align="center">
84
- <img src="https://cdn.jsdelivr.net/npm/@av-pi-studio/cli@0.0.99/assets/screenshots/code-viewer.webp" alt="Pi-Studio web UI — syntax-highlighted code viewer" width="850">
84
+ <img src="https://cdn.jsdelivr.net/npm/@av-pi-studio/cli@0.0.100/assets/screenshots/code-viewer.webp" alt="Pi-Studio web UI — syntax-highlighted code viewer" width="850">
85
85
  </p>
86
86
 
87
87
  See the [`ui`](#ui) command below for every flag, and
@@ -163,6 +163,30 @@ export async function inspectAgent(client, ctx, agentId, opts) {
163
163
  ctx.sink.write(opts.json ? renderJson(payload) : renderObject(payload));
164
164
  return EXIT_OK;
165
165
  }
166
+ /**
167
+ * `fetch_agent_timeline_request` returns projected items (`timeline-store.ts` `ProjectedItem`),
168
+ * not raw `AgentStreamEvent`s: `{kind:"other", event}` for a standalone row, or
169
+ * `{kind:"assistant"|"tool_call", events:[...]}` for a collapsed group (adjacent assistant/
170
+ * reasoning chunks, or a tool call's start/status/end rows sharing one `callId`). The wire
171
+ * contract only promises `items: unknown[]` (protocol has no strict union for this shape yet —
172
+ * `packages/web-client/src/lib/protocol/events.ts` documents and flattens the same shape for the
173
+ * web UI). Flatten to the underlying events here before formatting, or a grouped item's `kind`
174
+ * ("assistant"/"tool_call") gets mistaken for an `AgentStreamEvent` kind — `tool_call` then reads
175
+ * a nonexistent top-level `.tool` and throws `Cannot use 'in' operator to search for 'command' in
176
+ * undefined`, and `assistant` falls through `formatStreamEvent`'s default case as a raw JSON dump.
177
+ */
178
+ function flattenTimelineItem(item) {
179
+ if (!item || typeof item !== "object")
180
+ return [];
181
+ const t = item;
182
+ if (Array.isArray(t.events))
183
+ return t.events;
184
+ if (t.event)
185
+ return [t.event];
186
+ if ("kind" in item)
187
+ return [item];
188
+ return [];
189
+ }
166
190
  /** `logs` — fetch timeline history and print it. */
167
191
  export async function logsAgent(client, ctx, agentId, opts) {
168
192
  const payload = await client.request(AGENT_RPC.timeline, {
@@ -175,12 +199,13 @@ export async function logsAgent(client, ctx, agentId, opts) {
175
199
  return EXIT_OK;
176
200
  }
177
201
  for (const item of payload.items ?? []) {
178
- const event = item.event ?? item;
179
- const line = formatStreamEvent(event);
180
- // Textless events (`assistant_message.final` block-close markers, empty deltas) render to
181
- // nothing — don't punch a blank line into the log.
182
- if (line)
183
- ctx.sink.write(line);
202
+ for (const event of flattenTimelineItem(item)) {
203
+ const line = formatStreamEvent(event);
204
+ // Textless events (`assistant_message.final` block-close markers, empty deltas) render to
205
+ // nothing — don't punch a blank line into the log.
206
+ if (line)
207
+ ctx.sink.write(line);
208
+ }
184
209
  }
185
210
  return EXIT_OK;
186
211
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@av-pi-studio/cli",
3
- "version": "0.0.99",
3
+ "version": "0.0.100",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/avatsaev/pi-studio.git",
@@ -29,11 +29,11 @@
29
29
  "clean": "rm -rf dist *.tsbuildinfo"
30
30
  },
31
31
  "dependencies": {
32
- "@av-pi-studio/client": "^0.0.99",
33
- "@av-pi-studio/protocol": "^0.0.99",
34
- "@av-pi-studio/relay": "^0.0.99",
35
- "@av-pi-studio/server": "^0.0.99",
36
- "@av-pi-studio/web-client": "^0.0.99",
32
+ "@av-pi-studio/client": "^0.0.100",
33
+ "@av-pi-studio/protocol": "^0.0.100",
34
+ "@av-pi-studio/relay": "^0.0.100",
35
+ "@av-pi-studio/server": "^0.0.100",
36
+ "@av-pi-studio/web-client": "^0.0.100",
37
37
  "@earendil-works/pi-coding-agent": "^0.84.1",
38
38
  "@inquirer/prompts": "^8.5.2",
39
39
  "bcryptjs": "^3.0.3",