jg-agent-hq 10.5.1 → 10.5.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 10.5.2
4
+
5
+ - Show a Claude tool result made of content blocks, such as a browser tool's caption and screenshot, as its text, with each image as `[Image]`. Such results used to read `[Native tool_result]`.
6
+
3
7
  ## 10.5.1
4
8
 
5
9
  - Read a compacted Claude session to the start of its conversation. A compaction starts a new chain whose boundary has no parent and names the record before it as its logical parent, and history used to stop there. Every indexed transcript is indexed again after the upgrade.
package/api/README.md CHANGED
@@ -241,7 +241,7 @@ The existing SQLite worker incrementally records file identity, complete-line of
241
241
 
242
242
  Current-chain membership and turn starts are indexed as metadata. Ordinary item and turn continuations seek those indexes; they do not walk the full chain per page. A changed branch rebuilds membership before exposing that revision. Repeated native message identities can replace content while retaining their parent; a changed parent for the same identity is an unsupported format.
243
243
 
244
- Selected history reads refresh only that file, retain incomplete tails, and detect truncation or replaced identity. Changed branch/file revisions invalidate item and turn continuations. Only the current parent-linked conversation chain is returned. Text is reread from the native file for the selected page and normalized as plain text. Thinking blocks are left out, and a record holding only thinking is hidden, as are `<task-notification>` records. Compaction summaries, `<local-command-stdout>` output and interruption markers are `notice` items, and a slash command is a `user-message` reading `/name args`. A `!` shell input and its output are `command` items, the output's `callId` being the input's UUID. A tool call shows its native name and input, with the block's ID as `callId`, which is null for a record calling several tools; its result is a `tool` item carrying that ID, `failed` when it has `is_error` and `succeeded` otherwise. An Edit or Write result whose metadata has a `filePath` and a `structuredPatch` is a `file-change` item reading the path and its patch lines, or a created file's content, every line of which counts as added. A result Claude Code saved to a file reads `Output too large (<size>), saved to a file` followed by its preview, without the file's path. Other non-text content has explicit native block labels. The index stores each entry's presented kind and visibility, so evidence kind filters match `items` and hidden records never shorten a page. An unknown record containing content is returned as an `unsupported` item when its identity and chain are trustworthy; it cannot imply an agent response, idle state or completion. Each selected page reads at most 4 MiB of record bytes beyond its first record and returns at most 4 MiB of serialized item presentation, so a large-text page can contain fewer rows than its requested limit.
244
+ Selected history reads refresh only that file, retain incomplete tails, and detect truncation or replaced identity. Changed branch/file revisions invalidate item and turn continuations. Only the current parent-linked conversation chain is returned. Text is reread from the native file for the selected page and normalized as plain text. Thinking blocks are left out, and a record holding only thinking is hidden, as are `<task-notification>` records. Compaction summaries, `<local-command-stdout>` output and interruption markers are `notice` items, and a slash command is a `user-message` reading `/name args`. A `!` shell input and its output are `command` items, the output's `callId` being the input's UUID. A tool call shows its native name and input, with the block's ID as `callId`, which is null for a record calling several tools; its result is a `tool` item carrying that ID, `failed` when it has `is_error` and `succeeded` otherwise. An Edit or Write result whose metadata has a `filePath` and a `structuredPatch` is a `file-change` item reading the path and its patch lines, or a created file's content, every line of which counts as added. A result Claude Code saved to a file reads `Output too large (<size>), saved to a file` followed by its preview, without the file's path. A result made of content blocks, such as a screenshot with its caption, reads as its text blocks, each image as `[Image]`. Other non-text content has explicit native block labels. The index stores each entry's presented kind and visibility, so evidence kind filters match `items` and hidden records never shorten a page. An unknown record containing content is returned as an `unsupported` item when its identity and chain are trustworthy; it cannot imply an agent response, idle state or completion. Each selected page reads at most 4 MiB of record bytes beyond its first record and returns at most 4 MiB of serialized item presentation, so a large-text page can contain fewer rows than its requested limit.
245
245
 
246
246
  File timestamps and records do not prove that a native process is idle or a turn completed. Claude file-backed thread and turn states are therefore `unknown`, with no invented completion timestamp. Explicit native custom titles are preserved; a missing title remains null. A turn starts at a message the operator sends, including a slash command; task notifications, compaction summaries, local command output, interruption markers and `!` shell records belong to the turn before them. Grouping follows parent links and is not an authoritative execution boundary. A compaction starts a new chain whose first record names the record before it, so history reads on past the compaction to the start of the conversation.
247
247
 
@@ -161,8 +161,23 @@ const COMMAND = /^<command-(?:message|name)>/;
161
161
  const COMMAND_NAME = /<command-name>\/?([^<]*)<\/command-name>/;
162
162
  const COMMAND_ARGS = /<command-args>([\s\S]*?)<\/command-args>/;
163
163
  const PERSISTED_OUTPUT = /^<persisted-output>\nOutput too large \(([^)\n]{1,64})\)\. Full output saved to: [^\n]*\n\nPreview \([^)\n]*\):\n([\s\S]*?)\n?<\/persisted-output>([\s\S]*)$/;
164
- /** Shows a result saved to a file as its size and preview, without the file's path. */
164
+ // a part of a tool result made of content blocks, as the CLI shows it, with an image as [Image]
165
+ const toResultPartText = (part) => {
166
+ const block = BlockSchema.safeParse(part).data;
167
+ if (!block)
168
+ return UNSUPPORTED;
169
+ if (block.type === 'text')
170
+ return block.text ?? '';
171
+ return block.type === 'image' ? '[Image]' : `[Native ${block.type}]`;
172
+ };
173
+ /**
174
+ * Shows a tool result as the CLI does: its text, the parts of one made of content blocks, such as
175
+ * a screenshot's caption and image, and one saved to a file as its size and preview, without the
176
+ * file's path.
177
+ */
165
178
  const toResultText = (block) => {
179
+ if (Array.isArray(block.content))
180
+ return block.content.map(toResultPartText).join('\n');
166
181
  if (typeof block.content !== 'string')
167
182
  return `[Native ${block.type}]`;
168
183
  const persisted = PERSISTED_OUTPUT.exec(block.content);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jg-agent-hq",
3
- "version": "10.5.1",
3
+ "version": "10.5.2",
4
4
  "description": "Native Claude Code and Codex session control, history, usage and recoverable local storage for Node.js apps.",
5
5
  "type": "module",
6
6
  "license": "MIT",