jg-agent-hq 6.1.0 → 7.0.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/CHANGELOG.md +5 -0
- package/api/README.md +1 -1
- package/dist/contracts/constants.d.ts +1 -1
- package/dist/contracts/constants.js +1 -1
- package/dist/contracts/types.js +1 -1
- package/dist/sessions/images.d.ts +2 -2
- package/dist/sessions/images.js +2 -2
- package/dist/sessions/utilities.d.ts +2 -2
- package/dist/sessions/utilities.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
- Return an item's image only when it is at most 4 MiB, instead of 8 MiB, so one read holds less memory in a host that runs the runtime in its own process. An image over 4 MiB fails with `image-unavailable`. Its base64 now fits in one IPC response, so the CLI reads every image `item-image` returns.
|
|
6
|
+
- Keep 6.x's storage schema, so databases and snapshots written by 5.x and 6.x open as they are.
|
|
7
|
+
|
|
3
8
|
## 6.1.0
|
|
4
9
|
|
|
5
10
|
- Run HQ's own agent tools in Claude sessions without asking. A permission request for a tool of the session's agent bridge, named `mcp__<bridge server>__<tool>`, is allowed with its input unchanged and records no approval; every other tool still asks.
|
package/api/README.md
CHANGED
|
@@ -144,7 +144,7 @@ Paged commands accept `limit` (default 32, maximum 128) and an opaque `cursor`.
|
|
|
144
144
|
|
|
145
145
|
`item-detail` returns `IItemDetail` for one item of a turn, or null for a hidden or unknown item, or one outside that turn. `item` is the item as an `items` read of it returns it. `command` is `{ command, output, isOutputStartCut, exitCode, durationMs }` or null: a Codex `commandExecution` gives every field, a Claude `Bash` call its command, its result the command and its output, from the result's stdout and stderr or else its text, and a `!` shell input or output the same; Claude records no exit code or duration. `tool` is `{ server, name, input, result, isResultStartCut }` or null, with `input` and `result` as text: JSON for Codex `mcpToolCall` and `dynamicToolCall`, and for a Claude call its input as JSON and for its result the text of its content, an MCP tool's name split into its server and tool. A Claude result takes its command or tool name from the call it answers, which HQ looks for among its 32 nearest ancestors in its turn. `files` lists each changed file with `path`, `added`, `removed` and its unified `diff`, from Codex `fileChange` and Claude Edit and Write results; a created or deleted file without hunks is its whole content, every line added or removed. `images` lists every image the item holds or names, at most 64, in order: `{ index, mediaType, byteCount }`, where `mediaType` is `image/png`, `image/jpeg`, `image/gif` or `image/webp` when its first bytes are one of them, and both are null for an image the item only names, such as a Codex `imageView` or `localImage` path or a URL. Output and results longer than 65,536 UTF-16 code units keep their last 65,536, on a code-point boundary, with `isOutputStartCut` or `isResultStartCut` set.
|
|
146
146
|
|
|
147
|
-
`item-image` returns the image at `index`, from 0 to 63, in the item's `images`, as `{ mediaType, data }` with its bytes in base64. A Claude image comes from an `image` block with a `base64` source, in the record's message or in a tool result's content. A Codex image comes from an `imageView` item's path, a user message's `localImage` path, or an `image` part's base64 `data:` URL; no other URL is fetched. A path must be absolute. Its file is opened without following it when it is itself a symbolic link, and without waiting on a pipe, and it is read only when it is a regular file; directories in the path are resolved as usual. An image is returned only when its first bytes are PNG, JPEG, GIF or WebP, which set `mediaType`, and it is at most
|
|
147
|
+
`item-image` returns the image at `index`, from 0 to 63, in the item's `images`, as `{ mediaType, data }` with its bytes in base64. A Claude image comes from an `image` block with a `base64` source, in the record's message or in a tool result's content. A Codex image comes from an `imageView` item's path, a user message's `localImage` path, or an `image` part's base64 `data:` URL; no other URL is fetched. A path must be absolute. Its file is opened without following it when it is itself a symbolic link, and without waiting on a pipe, and it is read only when it is a regular file; directories in the path are resolved as usual. An image is returned only when its first bytes are PNG, JPEG, GIF or WebP, which set `mediaType`, and it is at most 4 MiB, so its base64 fits in one IPC response. Anything else, including a hidden or unknown item, one outside that turn, or an index past its images, fails with the `image-unavailable` kind.
|
|
148
148
|
|
|
149
149
|
Threads expose native state, the live session `state` described under [session states](#session-states), `historyState` (`available` or `unavailable`), ownership (`external`, `managed` or `uncertain`) and nullable `managedId`. A managed thread uses its HQ name; an external thread retains its nullable native name. Timestamps use Unix milliseconds. Discovery projections are not authoritative transcript history and never cache a conversation body. Repeated Codex history reads go to its native APIs so a completed turn whose items have not flushed can be read again later. There is no resume-to-read behavior or Codex transcript-file parser.
|
|
150
150
|
|
|
@@ -2,7 +2,7 @@ export declare const DEFAULT_PAGE_SIZE = 32;
|
|
|
2
2
|
export declare const MAX_PAGE_SIZE = 128;
|
|
3
3
|
export declare const MAX_ITEM_TEXT_LENGTH = 65536;
|
|
4
4
|
export declare const MAX_ITEM_IMAGES = 64;
|
|
5
|
-
export declare const MAX_ITEM_IMAGE_BYTES =
|
|
5
|
+
export declare const MAX_ITEM_IMAGE_BYTES = 4194304;
|
|
6
6
|
export declare const PUBLIC_ERROR_CODES: {
|
|
7
7
|
readonly 'invalid-request': "JG_AGENT_HQ_CLIENT_INVALID_REQUEST";
|
|
8
8
|
readonly 'authentication-required': "JG_AGENT_HQ_CLIENT_AUTHENTICATION_REQUIRED";
|
|
@@ -5,7 +5,7 @@ export const MAX_PAGE_SIZE = 128;
|
|
|
5
5
|
export const MAX_ITEM_TEXT_LENGTH = 65_536;
|
|
6
6
|
// the most images one item's detail lists, and the largest one HQ returns, in bytes
|
|
7
7
|
export const MAX_ITEM_IMAGES = 64;
|
|
8
|
-
export const MAX_ITEM_IMAGE_BYTES =
|
|
8
|
+
export const MAX_ITEM_IMAGE_BYTES = 4_194_304;
|
|
9
9
|
// stable client codes for failures translated at IPC and browser boundaries
|
|
10
10
|
export const PUBLIC_ERROR_CODES = {
|
|
11
11
|
'invalid-request': 'JG_AGENT_HQ_CLIENT_INVALID_REQUEST',
|
package/dist/contracts/types.js
CHANGED
|
@@ -256,7 +256,7 @@ export const ItemDetailSchema = z.object({
|
|
|
256
256
|
}))
|
|
257
257
|
.max(MAX_ITEM_IMAGES),
|
|
258
258
|
});
|
|
259
|
-
// an image's bytes in base64, recognized by its first bytes and at most
|
|
259
|
+
// an image's bytes in base64, recognized by its first bytes and at most 4 MiB
|
|
260
260
|
export const ItemImageSchema = z.object({
|
|
261
261
|
mediaType: ItemImageMediaTypeSchema,
|
|
262
262
|
data: z
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type IItemImage } from '../contracts/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Reads an image file an item names. A file that is itself a symbolic link is refused, as the
|
|
4
|
-
* open doesn't follow it, a pipe is never waited on, and only a regular file of at most
|
|
5
|
-
* read; a file that grew past
|
|
4
|
+
* open doesn't follow it, a pipe is never waited on, and only a regular file of at most 4 MiB is
|
|
5
|
+
* read; a file that grew past 4 MiB since it was measured is refused.
|
|
6
6
|
* @param path The file's absolute path.
|
|
7
7
|
* @returns A promise that resolves to the image.
|
|
8
8
|
* @throws
|
package/dist/sessions/images.js
CHANGED
|
@@ -6,8 +6,8 @@ import { MAX_ITEM_IMAGE_BYTES } from '../contracts/index.js';
|
|
|
6
6
|
import { imageUnavailable, toItemImage } from './utilities.js';
|
|
7
7
|
/**
|
|
8
8
|
* Reads an image file an item names. A file that is itself a symbolic link is refused, as the
|
|
9
|
-
* open doesn't follow it, a pipe is never waited on, and only a regular file of at most
|
|
10
|
-
* read; a file that grew past
|
|
9
|
+
* open doesn't follow it, a pipe is never waited on, and only a regular file of at most 4 MiB is
|
|
10
|
+
* read; a file that grew past 4 MiB since it was measured is refused.
|
|
11
11
|
* @param path The file's absolute path.
|
|
12
12
|
* @returns A promise that resolves to the image.
|
|
13
13
|
* @throws
|
|
@@ -56,14 +56,14 @@ export declare const describeBase64Image: (data: string) => {
|
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
58
58
|
* Refuses an image HQ doesn't return: one the item doesn't hold, one that isn't a recognized
|
|
59
|
-
* image or is over
|
|
59
|
+
* image or is over 4 MiB, a file that is a symbolic link or not a regular file, or a URL.
|
|
60
60
|
* @param cause The failure that made the image unreadable, when there is one.
|
|
61
61
|
* @throws
|
|
62
62
|
* - JG_AGENT_HQ_IMAGE_UNAVAILABLE: The HQ image is unavailable
|
|
63
63
|
*/
|
|
64
64
|
export declare const imageUnavailable: (cause?: unknown) => never;
|
|
65
65
|
/**
|
|
66
|
-
* Returns an image's bytes when they are a recognized image of at most
|
|
66
|
+
* Returns an image's bytes when they are a recognized image of at most 4 MiB.
|
|
67
67
|
* @param bytes The image's bytes.
|
|
68
68
|
* @returns The image, its format set by its first bytes.
|
|
69
69
|
* @throws
|
|
@@ -123,7 +123,7 @@ export const describeBase64Image = (data) => ({
|
|
|
123
123
|
});
|
|
124
124
|
/**
|
|
125
125
|
* Refuses an image HQ doesn't return: one the item doesn't hold, one that isn't a recognized
|
|
126
|
-
* image or is over
|
|
126
|
+
* image or is over 4 MiB, a file that is a symbolic link or not a regular file, or a URL.
|
|
127
127
|
* @param cause The failure that made the image unreadable, when there is one.
|
|
128
128
|
* @throws
|
|
129
129
|
* - JG_AGENT_HQ_IMAGE_UNAVAILABLE: The HQ image is unavailable
|
|
@@ -136,7 +136,7 @@ export const imageUnavailable = (cause) => {
|
|
|
136
136
|
});
|
|
137
137
|
};
|
|
138
138
|
/**
|
|
139
|
-
* Returns an image's bytes when they are a recognized image of at most
|
|
139
|
+
* Returns an image's bytes when they are a recognized image of at most 4 MiB.
|
|
140
140
|
* @param bytes The image's bytes.
|
|
141
141
|
* @returns The image, its format set by its first bytes.
|
|
142
142
|
* @throws
|