jg-agent-hq 6.0.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +2 -2
  3. package/api/README.md +7 -1
  4. package/dist/cli/cli.js +6 -1
  5. package/dist/contracts/constants.d.ts +4 -0
  6. package/dist/contracts/constants.js +5 -0
  7. package/dist/contracts/index.d.ts +3 -3
  8. package/dist/contracts/index.js +2 -2
  9. package/dist/contracts/types.d.ts +313 -0
  10. package/dist/contracts/types.js +78 -1
  11. package/dist/ipc/client.d.ts +1 -0
  12. package/dist/ipc/client.js +1 -0
  13. package/dist/providers/claude/claude.d.ts +1 -0
  14. package/dist/providers/claude/claude.js +1 -0
  15. package/dist/providers/claude/control/permissions.d.ts +9 -0
  16. package/dist/providers/claude/control/permissions.js +22 -0
  17. package/dist/providers/claude/control/stream.js +18 -1
  18. package/dist/providers/claude/history/history.model.d.ts +17 -0
  19. package/dist/providers/claude/history/history.model.js +100 -3
  20. package/dist/providers/claude/history/types.d.ts +92 -0
  21. package/dist/providers/claude/history/utilities.d.ts +31 -1
  22. package/dist/providers/claude/history/utilities.js +164 -6
  23. package/dist/providers/codex/adapter.js +10 -0
  24. package/dist/providers/codex/codex.js +44 -1
  25. package/dist/providers/codex/transformers.d.ts +25 -1
  26. package/dist/providers/codex/transformers.js +107 -2
  27. package/dist/providers/codex/types.d.ts +16 -1
  28. package/dist/providers/registry/validations.js +12 -0
  29. package/dist/runtime/types.d.ts +1 -0
  30. package/dist/sessions/images.d.ts +11 -0
  31. package/dist/sessions/images.js +44 -0
  32. package/dist/sessions/index.d.ts +2 -1
  33. package/dist/sessions/index.js +4 -2
  34. package/dist/sessions/sessions.d.ts +1 -0
  35. package/dist/sessions/sessions.js +15 -2
  36. package/dist/sessions/types.d.ts +1 -1
  37. package/dist/sessions/utilities.d.ts +57 -1
  38. package/dist/sessions/utilities.js +96 -0
  39. package/dist/store/types.d.ts +33 -0
  40. package/errors/README.md +2 -0
  41. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
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
+
8
+ ## 6.1.0
9
+
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.
11
+ - Add `item-detail`, which returns one item of a turn with what a developer inspects in it: `command` with its output, exit code and duration, `tool` with its server, name, input and result, `files` with each changed file's diff, and `images`, every image it holds or names. Output and results longer than 65,536 UTF-16 code units keep their last 65,536. A Claude tool result takes its command or tool name from the call it answers.
12
+ - Add `item-image`, which returns one of an item's images in base64 when its first bytes are PNG, JPEG, GIF or WebP and it is at most 8 MiB: a Claude `base64` image block, or a Codex image view's or attached image's file, which is refused when it is a symbolic link or not a regular file, or its `data:` URL. No URL is fetched. Anything else fails with the new `image-unavailable` kind, `JG_AGENT_HQ_CLIENT_IMAGE_UNAVAILABLE`.
13
+ - Both reads are also CLI commands. A provider's `readHistory` receives them, and an answer of another kind fails the read with `JG_AGENT_HQ_PROVIDER_FAILED`; its other reads are unchanged.
14
+ - Keep 6.0.0's storage schema, so databases and snapshots written by 5.x and 6.0.0 open as they are.
15
+
3
16
  ## 6.0.0
4
17
 
5
18
  - List `threads` by last activity, newest first, for Claude and Codex, with cursors that continue in that order; they were listed by creation time.
package/README.md CHANGED
@@ -37,7 +37,7 @@ Intentional failures use `Exception` from `jg-exception`, with the named string
37
37
 
38
38
  ## Local controller
39
39
 
40
- Install the providers you want and sign in through their native CLIs, then start `jg-agent-hq serve --state-root .runtime --workspace-root /path/to/workspace`. Run `jg-agent-hq status --state-root .runtime` in a client. `threads`, `thread`, `turns`, `items` and `usage` read native information, and each item carries its time as `createdAt`; `stop` waits for confirmed runtime shutdown.
40
+ Install the providers you want and sign in through their native CLIs, then start `jg-agent-hq serve --state-root .runtime --workspace-root /path/to/workspace`. Run `jg-agent-hq status --state-root .runtime` in a client. `threads`, `thread`, `turns`, `items` and `usage` read native information, and each item carries its time as `createdAt`. `item-detail` reads what a developer inspects in one item: its command and output, tool call, file diffs and images, and `item-image` returns one of its images. `stop` waits for confirmed runtime shutdown.
41
41
 
42
42
  The Node API exposes `createAgentHq({ stateRoot, allowedRoots })` and `requestAgentHq(stateRoot, command)`. Configuration comes from these trusted operator inputs. Coding-instruction files are not runtime configuration.
43
43
 
@@ -79,7 +79,7 @@ Use `jg-agent-hq request --state-root <directory>` with a closed HQ command on s
79
79
 
80
80
  Trusted hosts can create collaboration tasks, add managed agents from any provider, and coordinate them through durable streams. Streams contain small indexed messages and optional directed or claimable requests. Subscription, reading, acknowledgement, assignment and completion are separate records. Metadata operations retain replay receipts and recover notification fan-out after restart. Directed requests can run through the existing native action ledger when the host enables automatic dispatch or explicitly selects a request. An assigned agent can publish direct child requests and yield with a bounded wait set. Exact child outcomes or requester clarifications continue the parent under its current authority; child completion never completes or approves the parent. Information, reads and acknowledgements do not start turns. HQ stores exact bounded outcome reports independently of native histories. Hosts issue exact task-scoped skill grants; role labels and message text grant no authority. See [task collaboration](api/README.md#task-collaboration).
81
81
 
82
- Controlled agents use `hq_identity` to recover their stable managed ID, task memberships, permissions and pending inbox counts. Codex uses experimental native dynamic tools; Claude uses a private session-specific stdio MCP bridge. Both use the same closed operations for streams, verified invocation context, requests, report chunks, session evidence and authorized managed spawning. Children can use either provider and inherit equal or narrower task permissions. The host sets a finite cumulative spawn budget. Native subagents share their owning HQ session identity. See [agent tools](api/README.md#agent-tools).
82
+ Controlled agents use `hq_identity` to recover their stable managed ID, task memberships, permissions and pending inbox counts. Codex uses experimental native dynamic tools; Claude uses a private session-specific stdio MCP bridge. Both use the same closed operations for streams, verified invocation context, requests, report chunks, session evidence and authorized managed spawning. Children can use either provider and inherit equal or narrower task permissions. The host sets a finite cumulative spawn budget. Native subagents share their owning HQ session identity. A Claude session runs these tools without asking for permission, and every other tool keeps native permission handling. See [agent tools](api/README.md#agent-tools).
83
83
 
84
84
  ## Plan coordination
85
85
 
package/api/README.md CHANGED
@@ -128,6 +128,8 @@ Import `HqRequestSchema`, `HqResponseSchema` and their inferred types from `jg-a
128
128
  | `thread` | `provider`, `workspaceRoot`, `nativeId` | One native thread's metadata |
129
129
  | `turns` | Same target fields | Paged native turn metadata without hydrating items |
130
130
  | `items` | Same target fields | Newest-first persisted native items; optional `turnId`, `textLimit` and `nativeItemId` |
131
+ | `item-detail` | Same target fields, `turnId`, `nativeItemId` | One item with its command, tool call, file diffs and images, or null |
132
+ | `item-image` | Same target fields, `turnId`, `nativeItemId`, `index` | One image of an item as `{ mediaType, data }`, its bytes in base64 |
131
133
  | `session-evidence` | Same target fields | Newest-first bounded evidence, exact references and full normalized text continuation |
132
134
  | `account` | `provider` | Safe native account metadata with explicit unavailable observations |
133
135
  | `mcp-servers` | Managed `threadId` | Paged configured native MCP server identity, connection and auth metadata |
@@ -140,6 +142,10 @@ Paged commands accept `limit` (default 32, maximum 128) and an opaque `cursor`.
140
142
 
141
143
  `items` reads newest first, its only order, and its cursor continues toward older items. `textLimit`, from 1 to 65,536 and 65,536 by default, cuts each item's `text` to that many UTF-16 code units on a code-point boundary and marks it `isTruncated`. `nativeItemId` with its `turnId`, and without a cursor, returns that item alone, cut at `textLimit` like any page; a hidden item, an unknown one, or one outside that turn returns an empty page. Codex has no lookup of one item, so it reads that turn's items, 128 at a time, until it finds the item.
142
144
 
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
+
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
+
143
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.
144
150
 
145
151
  ## Bounded session evidence
@@ -281,7 +287,7 @@ Creation chooses a native UUID without inference, then names that exact session.
281
287
 
282
288
  An ordinary message is submitted only while idle. Its native UUID becomes the turn identity. A matching native replay or result acknowledges delivery, and the native result establishes completion. A request-success envelope can acknowledge a name change or interruption without a response body. HQ never writes queued follow-up input into Claude's own busy queue; the shared HQ queue dispatches it only after the previous result. Interruption acknowledgement alone does not establish a stop. An error result is classified as interrupted only when the qualified native interruption marker was observed for an explicitly interrupted input. Other terminal errors remain failed.
283
289
 
284
- Claude questions use exact question text as their answer identity and expose whether multiple selections are supported. Claude can_use_tool permissions use response `{ kind: 'decision', decision: 'accept' | 'decline' }`; question replies use `{ kind: 'answers', answers }`. The response kind `permission` with a turn/session scope belongs to Codex additional permissions. Tool permissions offer `accept` or `decline` for the displayed input only. Complete request details include native policy hints and reasons as untrusted display data; none authorizes a response. Unsupported permission fields or interaction surfaces receive an unsupported-request error. Requests requiring a native interaction card cannot be answered with generic approval; supported `AskUserQuestion` cards use their typed answer contract. Session-wide permission changes are unavailable; HQ does not apply native permission suggestions automatically. A reply is written through the separate control channel and acknowledged only by the matching tool result. Tool execution can still fail after that acknowledgement. Reused raw request IDs in different CLI processes have distinct controller scopes. Prompt bodies and replies remain out of SQLite.
290
+ Claude questions use exact question text as their answer identity and expose whether multiple selections are supported. Claude can_use_tool permissions use response `{ kind: 'decision', decision: 'accept' | 'decline' }`; question replies use `{ kind: 'answers', answers }`. The response kind `permission` with a turn/session scope belongs to Codex additional permissions. Tool permissions offer `accept` or `decline` for the displayed input only. Complete request details include native policy hints and reasons as untrusted display data; none authorizes a response. Unsupported permission fields or interaction surfaces receive an unsupported-request error. Requests requiring a native interaction card cannot be answered with generic approval; supported `AskUserQuestion` cards use their typed answer contract. Session-wide permission changes are unavailable; HQ does not apply native permission suggestions automatically. A tool request for the session's own agent bridge, named `mcp__<bridge server>__<tool>`, is allowed at once with its unchanged input and records no approval. A reply is written through the separate control channel and acknowledged only by the matching tool result. Tool execution can still fail after that acknowledgement. Reused raw request IDs in different CLI processes have distinct controller scopes. Prompt bodies and replies remain out of SQLite.
285
291
 
286
292
  Both providers support turn-correlated MCP `form` and `url` elicitation. Forms use bounded local JSON Schema validation (8 KiB, 16 levels, 1,024 nodes); responses stay within the action envelope’s 32 KiB budget. Unknown modes, unsupported schemas and Codex requests without a native turn are denied. Elicitation URLs are HTTP(S) links without embedded credentials; applications decide how to display or open them. Never render native strings as HTML or terminal instructions, and never infer a permission decision from model output or form metadata. Codex acknowledges an elicitation reply through its exact native request-resolution event. Claude supplies no equivalent form-reply acknowledgement: a successful write stays submitted, and terminal completion or cancellation expires the request and makes its unresolved reply uncertain. Retrying that same action returns its receipt without sending again.
287
293
 
package/dist/cli/cli.js CHANGED
@@ -32,6 +32,7 @@ const main = async () => {
32
32
  'native-id': { type: 'string' },
33
33
  'turn-id': { type: 'string' },
34
34
  'native-item-id': { type: 'string' },
35
+ index: { type: 'string' },
35
36
  'text-limit': { type: 'string' },
36
37
  'evidence-kind': { type: 'string', multiple: true },
37
38
  'thread-id': { type: 'string' },
@@ -53,7 +54,7 @@ const main = async () => {
53
54
  });
54
55
  const [kind] = positionals;
55
56
  if (values.help || !kind || kind === 'help') {
56
- process.stdout.write('jg-agent-hq serve|status|stop|capabilities|threads|thread|turns|items|sessions|session-evidence|usage|account|models|configuration|mcp-servers|mcp-tools|mcp-resources|managed-thread-name|suggest-thread-name|skills|skill-preview|plan-status|plan-milestones|session-states|active-sessions|unstarted-threads|observation-pace|request --state-root <path> [--provider <provider-id>] [--workspace-root <path>] [--native-id <id>] [--limit <1..128>] [--cursor <cursor>] [--name <name>] [--topic <topic>] [--thread-id <id>] [--server-name <name>] [--skill-id <id>] [--arguments <text>] [--directory <path>] [--after-sequence <sequence>]\nserve accepts repeated --codex-extra-skill-root and --claude-additional-directory, and --coordination-root for a separate existing coordination directory.\nsession-evidence accepts --native-item-id and repeated --evidence-kind.\nitems reads newest first and accepts --text-limit <1..65536>, and --native-item-id with --turn-id for one item.\nobservation-pace takes --pace <live|background>.\nrequest reads one validated HQ command as JSON from stdin.\n');
57
+ process.stdout.write('jg-agent-hq serve|status|stop|capabilities|threads|thread|turns|items|item-detail|item-image|sessions|session-evidence|usage|account|models|configuration|mcp-servers|mcp-tools|mcp-resources|managed-thread-name|suggest-thread-name|skills|skill-preview|plan-status|plan-milestones|session-states|active-sessions|unstarted-threads|observation-pace|request --state-root <path> [--provider <provider-id>] [--workspace-root <path>] [--native-id <id>] [--limit <1..128>] [--cursor <cursor>] [--name <name>] [--topic <topic>] [--thread-id <id>] [--server-name <name>] [--skill-id <id>] [--arguments <text>] [--directory <path>] [--after-sequence <sequence>]\nserve accepts repeated --codex-extra-skill-root and --claude-additional-directory, and --coordination-root for a separate existing coordination directory.\nsession-evidence accepts --native-item-id and repeated --evidence-kind.\nitems reads newest first and accepts --text-limit <1..65536>, and --native-item-id with --turn-id for one item.\nitem-detail reads the detail of one item and takes --native-item-id and --turn-id.\nitem-image reads one image of an item and also takes --index <0..63>.\nobservation-pace takes --pace <live|background>.\nrequest reads one validated HQ command as JSON from stdin.\n');
57
58
  return;
58
59
  }
59
60
  if (positionals.length !== 1 || !values['state-root'])
@@ -111,6 +112,7 @@ const main = async () => {
111
112
  values['native-id'] ||
112
113
  values['turn-id'] ||
113
114
  values['native-item-id'] ||
115
+ values.index ||
114
116
  values['text-limit'] ||
115
117
  values['evidence-kind'] ||
116
118
  values['thread-id'] ||
@@ -252,6 +254,8 @@ const main = async () => {
252
254
  'thread',
253
255
  'turns',
254
256
  'items',
257
+ 'item-detail',
258
+ 'item-image',
255
259
  'sessions',
256
260
  'session-evidence',
257
261
  'usage',
@@ -268,6 +272,7 @@ const main = async () => {
268
272
  ['nativeId', values['native-id']],
269
273
  ['turnId', values['turn-id']],
270
274
  ['nativeItemId', values['native-item-id']],
275
+ ['index', values.index === undefined ? undefined : Number(values.index)],
271
276
  ['textLimit', values['text-limit'] === undefined ? undefined : Number(values['text-limit'])],
272
277
  ['kinds', values['evidence-kind']],
273
278
  ['threadId', values['thread-id']],
@@ -1,6 +1,8 @@
1
1
  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
+ export declare const MAX_ITEM_IMAGES = 64;
5
+ export declare const MAX_ITEM_IMAGE_BYTES = 4194304;
4
6
  export declare const PUBLIC_ERROR_CODES: {
5
7
  readonly 'invalid-request': "JG_AGENT_HQ_CLIENT_INVALID_REQUEST";
6
8
  readonly 'authentication-required': "JG_AGENT_HQ_CLIENT_AUTHENTICATION_REQUIRED";
@@ -9,6 +11,7 @@ export declare const PUBLIC_ERROR_CODES: {
9
11
  readonly 'state-conflict': "JG_AGENT_HQ_CLIENT_STATE_CONFLICT";
10
12
  readonly 'agent-unavailable': "JG_AGENT_HQ_CLIENT_AGENT_UNAVAILABLE";
11
13
  readonly 'operation-failed': "JG_AGENT_HQ_CLIENT_OPERATION_FAILED";
14
+ readonly 'image-unavailable': "JG_AGENT_HQ_CLIENT_IMAGE_UNAVAILABLE";
12
15
  };
13
16
  export declare const PUBLIC_ERROR_MESSAGES: {
14
17
  readonly 'invalid-request': "Request is invalid.";
@@ -18,4 +21,5 @@ export declare const PUBLIC_ERROR_MESSAGES: {
18
21
  readonly 'state-conflict': "State changed. Refresh before continuing.";
19
22
  readonly 'agent-unavailable': "Coding agent is unavailable.";
20
23
  readonly 'operation-failed': "Operation could not be completed.";
24
+ readonly 'image-unavailable': "Image is unavailable.";
21
25
  };
@@ -3,6 +3,9 @@ export const DEFAULT_PAGE_SIZE = 32;
3
3
  export const MAX_PAGE_SIZE = 128;
4
4
  // the most text one history item carries, in UTF-16 code units
5
5
  export const MAX_ITEM_TEXT_LENGTH = 65_536;
6
+ // the most images one item's detail lists, and the largest one HQ returns, in bytes
7
+ export const MAX_ITEM_IMAGES = 64;
8
+ export const MAX_ITEM_IMAGE_BYTES = 4_194_304;
6
9
  // stable client codes for failures translated at IPC and browser boundaries
7
10
  export const PUBLIC_ERROR_CODES = {
8
11
  'invalid-request': 'JG_AGENT_HQ_CLIENT_INVALID_REQUEST',
@@ -12,6 +15,7 @@ export const PUBLIC_ERROR_CODES = {
12
15
  'state-conflict': 'JG_AGENT_HQ_CLIENT_STATE_CONFLICT',
13
16
  'agent-unavailable': 'JG_AGENT_HQ_CLIENT_AGENT_UNAVAILABLE',
14
17
  'operation-failed': 'JG_AGENT_HQ_CLIENT_OPERATION_FAILED',
18
+ 'image-unavailable': 'JG_AGENT_HQ_CLIENT_IMAGE_UNAVAILABLE',
15
19
  };
16
20
  // safe messages at IPC and browser boundaries
17
21
  export const PUBLIC_ERROR_MESSAGES = {
@@ -22,4 +26,5 @@ export const PUBLIC_ERROR_MESSAGES = {
22
26
  'state-conflict': 'State changed. Refresh before continuing.',
23
27
  'agent-unavailable': 'Coding agent is unavailable.',
24
28
  'operation-failed': 'Operation could not be completed.',
29
+ 'image-unavailable': 'Image is unavailable.',
25
30
  };
@@ -2,11 +2,11 @@ export { AccountControlCommandSchema, LoginObservationSchema, LoginRequestSchema
2
2
  export type { IAccountControlCommand, ILoginObservation, INativeControlResult, } from './accounts/index.js';
3
3
  export { ExtensionControlCommandSchema } from './extensions/index.js';
4
4
  export type { IExtensionControlCommand } from './extensions/index.js';
5
- export { DEFAULT_PAGE_SIZE, MAX_ITEM_TEXT_LENGTH, MAX_PAGE_SIZE, PUBLIC_ERROR_CODES, PUBLIC_ERROR_MESSAGES, } from './constants.js';
6
- export { HqRequestSchema, SessionTerminalSchema, ThreadSummarySchema, ActiveSessionsSchema, UnstartedThreadsSchema, TurnSummarySchema, HistoryFileSchema, HistoryItemSchema, LiveItemsSchema, UsageWindowSchema, UsageSnapshotSchema, UsageCreditsSchema, UsageResetCreditsSchema, UsageWindowScopeSchema, RuntimeStatusSchema, HqResponseSchema, ErrorKindSchema, IpcRequestSchema, IpcResponseSchema, } from './types.js';
5
+ export { DEFAULT_PAGE_SIZE, MAX_ITEM_IMAGE_BYTES, MAX_ITEM_IMAGES, MAX_ITEM_TEXT_LENGTH, MAX_PAGE_SIZE, PUBLIC_ERROR_CODES, PUBLIC_ERROR_MESSAGES, } from './constants.js';
6
+ export { HqRequestSchema, SessionTerminalSchema, ThreadSummarySchema, ActiveSessionsSchema, UnstartedThreadsSchema, TurnSummarySchema, HistoryFileSchema, HistoryItemSchema, ItemImageMediaTypeSchema, ItemDetailSchema, ItemImageSchema, LiveItemsSchema, UsageWindowSchema, UsageSnapshotSchema, UsageCreditsSchema, UsageResetCreditsSchema, UsageWindowScopeSchema, RuntimeStatusSchema, HqResponseSchema, ErrorKindSchema, IpcRequestSchema, IpcResponseSchema, } from './types.js';
7
7
  export { ProviderIdSchema, ProviderCapabilitySchema, ProviderCapabilitySetSchema, ProviderCapabilitiesSchema, ProviderStatusSchema, MAX_PROVIDERS, } from './providers/index.js';
8
8
  export type { IProviderId, IProviderCapability, IProviderCapabilitySet, IProviderCapabilities, IProviderStatus, } from './providers/index.js';
9
- export type { IHqRequest, IHqRequestInput, ISessionTerminal, IThreadSummary, IActiveSessions, IUnstartedThreads, ITurnSummary, IHistoryFile, IHistoryItem, IUsageSnapshot, IUsageCredits, IUsageResetCredits, IUsageWindowScope, IRuntimeStatus, IHqResponse, IErrorKind, IIpcResponse, } from './types.js';
9
+ export type { IHqRequest, IHqRequestInput, ISessionTerminal, IThreadSummary, IActiveSessions, IUnstartedThreads, ITurnSummary, IHistoryFile, IHistoryItem, IItemImageMediaType, IItemDetail, IItemImage, IUsageSnapshot, IUsageCredits, IUsageResetCredits, IUsageWindowScope, IRuntimeStatus, IHqResponse, IErrorKind, IIpcResponse, } from './types.js';
10
10
  export { NativeLineageSchema } from './identities/index.js';
11
11
  export type { INativeLineage } from './identities/index.js';
12
12
  export { ProviderModelSchema, ProviderModelsRequestSchema, ProviderModelPageSchema, } from './models/index.js';
@@ -2,9 +2,9 @@
2
2
  export { AccountControlCommandSchema, LoginObservationSchema, LoginRequestSchema, NativeControlResultSchema, } from './accounts/index.js';
3
3
  export { ExtensionControlCommandSchema } from './extensions/index.js';
4
4
  // constants
5
- export { DEFAULT_PAGE_SIZE, MAX_ITEM_TEXT_LENGTH, MAX_PAGE_SIZE, PUBLIC_ERROR_CODES, PUBLIC_ERROR_MESSAGES, } from './constants.js';
5
+ export { DEFAULT_PAGE_SIZE, MAX_ITEM_IMAGE_BYTES, MAX_ITEM_IMAGES, MAX_ITEM_TEXT_LENGTH, MAX_PAGE_SIZE, PUBLIC_ERROR_CODES, PUBLIC_ERROR_MESSAGES, } from './constants.js';
6
6
  // wire contracts
7
- export { HqRequestSchema, SessionTerminalSchema, ThreadSummarySchema, ActiveSessionsSchema, UnstartedThreadsSchema, TurnSummarySchema, HistoryFileSchema, HistoryItemSchema, LiveItemsSchema, UsageWindowSchema, UsageSnapshotSchema, UsageCreditsSchema, UsageResetCreditsSchema, UsageWindowScopeSchema, RuntimeStatusSchema, HqResponseSchema, ErrorKindSchema, IpcRequestSchema, IpcResponseSchema, } from './types.js';
7
+ export { HqRequestSchema, SessionTerminalSchema, ThreadSummarySchema, ActiveSessionsSchema, UnstartedThreadsSchema, TurnSummarySchema, HistoryFileSchema, HistoryItemSchema, ItemImageMediaTypeSchema, ItemDetailSchema, ItemImageSchema, LiveItemsSchema, UsageWindowSchema, UsageSnapshotSchema, UsageCreditsSchema, UsageResetCreditsSchema, UsageWindowScopeSchema, RuntimeStatusSchema, HqResponseSchema, ErrorKindSchema, IpcRequestSchema, IpcResponseSchema, } from './types.js';
8
8
  // provider identity and capability discovery
9
9
  export { ProviderIdSchema, ProviderCapabilitySchema, ProviderCapabilitySetSchema, ProviderCapabilitiesSchema, ProviderStatusSchema, MAX_PROVIDERS, } from './providers/index.js';
10
10
  // native identities
@@ -1186,6 +1186,21 @@ export declare const HqRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1186
1186
  workspaceRoot: z.ZodString;
1187
1187
  nativeId: z.ZodString;
1188
1188
  kind: z.ZodLiteral<"items">;
1189
+ }, z.core.$strict>, z.ZodObject<{
1190
+ turnId: z.ZodString;
1191
+ nativeItemId: z.ZodString;
1192
+ provider: z.ZodString;
1193
+ workspaceRoot: z.ZodString;
1194
+ nativeId: z.ZodString;
1195
+ kind: z.ZodLiteral<"item-detail">;
1196
+ }, z.core.$strict>, z.ZodObject<{
1197
+ turnId: z.ZodString;
1198
+ nativeItemId: z.ZodString;
1199
+ index: z.ZodNumber;
1200
+ provider: z.ZodString;
1201
+ workspaceRoot: z.ZodString;
1202
+ nativeId: z.ZodString;
1203
+ kind: z.ZodLiteral<"item-image">;
1189
1204
  }, z.core.$strict>, z.ZodObject<{
1190
1205
  kind: z.ZodLiteral<"usage">;
1191
1206
  provider: z.ZodString;
@@ -1770,6 +1785,103 @@ export declare const HistoryItemSchema: z.ZodObject<{
1770
1785
  createdAt: z.ZodNullable<z.ZodNumber>;
1771
1786
  }, z.core.$strip>;
1772
1787
  export type IHistoryItem = z.infer<typeof HistoryItemSchema>;
1788
+ export declare const ItemImageMediaTypeSchema: z.ZodEnum<{
1789
+ "image/png": "image/png";
1790
+ "image/jpeg": "image/jpeg";
1791
+ "image/webp": "image/webp";
1792
+ "image/gif": "image/gif";
1793
+ }>;
1794
+ export type IItemImageMediaType = z.infer<typeof ItemImageMediaTypeSchema>;
1795
+ export declare const ItemDetailSchema: z.ZodObject<{
1796
+ item: z.ZodObject<{
1797
+ nativeId: z.ZodString;
1798
+ turnId: z.ZodString;
1799
+ nativeType: z.ZodString;
1800
+ kind: z.ZodEnum<{
1801
+ command: "command";
1802
+ unsupported: "unsupported";
1803
+ "user-message": "user-message";
1804
+ tool: "tool";
1805
+ "agent-message": "agent-message";
1806
+ "file-change": "file-change";
1807
+ notice: "notice";
1808
+ }>;
1809
+ provenance: z.ZodObject<{
1810
+ origin: z.ZodEnum<{
1811
+ unknown: "unknown";
1812
+ operator: "operator";
1813
+ agent: "agent";
1814
+ tool: "tool";
1815
+ system: "system";
1816
+ }>;
1817
+ source: z.ZodEnum<{
1818
+ unknown: "unknown";
1819
+ "native-kind": "native-kind";
1820
+ "host-action": "host-action";
1821
+ "authenticated-host-action": "authenticated-host-action";
1822
+ "agent-input": "agent-input";
1823
+ }>;
1824
+ nativeInputId: z.ZodNullable<z.ZodString>;
1825
+ actionId: z.ZodNullable<z.ZodUUID>;
1826
+ contentBoundary: z.ZodLiteral<"untrusted">;
1827
+ grantsAuthority: z.ZodLiteral<false>;
1828
+ }, z.core.$strip>;
1829
+ text: z.ZodString;
1830
+ isTruncated: z.ZodBoolean;
1831
+ callId: z.ZodNullable<z.ZodString>;
1832
+ outcome: z.ZodNullable<z.ZodEnum<{
1833
+ failed: "failed";
1834
+ succeeded: "succeeded";
1835
+ }>>;
1836
+ files: z.ZodArray<z.ZodObject<{
1837
+ path: z.ZodString;
1838
+ added: z.ZodNumber;
1839
+ removed: z.ZodNumber;
1840
+ }, z.core.$strip>>;
1841
+ createdAt: z.ZodNullable<z.ZodNumber>;
1842
+ }, z.core.$strip>;
1843
+ command: z.ZodNullable<z.ZodObject<{
1844
+ command: z.ZodNullable<z.ZodString>;
1845
+ output: z.ZodNullable<z.ZodString>;
1846
+ isOutputStartCut: z.ZodBoolean;
1847
+ exitCode: z.ZodNullable<z.ZodNumber>;
1848
+ durationMs: z.ZodNullable<z.ZodNumber>;
1849
+ }, z.core.$strip>>;
1850
+ tool: z.ZodNullable<z.ZodObject<{
1851
+ server: z.ZodNullable<z.ZodString>;
1852
+ name: z.ZodNullable<z.ZodString>;
1853
+ input: z.ZodNullable<z.ZodString>;
1854
+ result: z.ZodNullable<z.ZodString>;
1855
+ isResultStartCut: z.ZodBoolean;
1856
+ }, z.core.$strip>>;
1857
+ files: z.ZodArray<z.ZodObject<{
1858
+ path: z.ZodString;
1859
+ added: z.ZodNumber;
1860
+ removed: z.ZodNumber;
1861
+ diff: z.ZodString;
1862
+ }, z.core.$strip>>;
1863
+ images: z.ZodArray<z.ZodObject<{
1864
+ index: z.ZodNumber;
1865
+ mediaType: z.ZodNullable<z.ZodEnum<{
1866
+ "image/png": "image/png";
1867
+ "image/jpeg": "image/jpeg";
1868
+ "image/webp": "image/webp";
1869
+ "image/gif": "image/gif";
1870
+ }>>;
1871
+ byteCount: z.ZodNullable<z.ZodNumber>;
1872
+ }, z.core.$strip>>;
1873
+ }, z.core.$strip>;
1874
+ export type IItemDetail = z.infer<typeof ItemDetailSchema>;
1875
+ export declare const ItemImageSchema: z.ZodObject<{
1876
+ mediaType: z.ZodEnum<{
1877
+ "image/png": "image/png";
1878
+ "image/jpeg": "image/jpeg";
1879
+ "image/webp": "image/webp";
1880
+ "image/gif": "image/gif";
1881
+ }>;
1882
+ data: z.ZodString;
1883
+ }, z.core.$strip>;
1884
+ export type IItemImage = z.infer<typeof ItemImageSchema>;
1773
1885
  export declare const LiveItemsSchema: z.ZodObject<{
1774
1886
  revision: z.ZodNumber;
1775
1887
  unchanged: z.ZodBoolean;
@@ -5913,6 +6025,98 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5913
6025
  createdAt: z.ZodNullable<z.ZodNumber>;
5914
6026
  }, z.core.$strip>>;
5915
6027
  }, z.core.$strip>;
6028
+ }, z.core.$strip>, z.ZodObject<{
6029
+ kind: z.ZodLiteral<"item-detail">;
6030
+ result: z.ZodNullable<z.ZodObject<{
6031
+ item: z.ZodObject<{
6032
+ nativeId: z.ZodString;
6033
+ turnId: z.ZodString;
6034
+ nativeType: z.ZodString;
6035
+ kind: z.ZodEnum<{
6036
+ command: "command";
6037
+ unsupported: "unsupported";
6038
+ "user-message": "user-message";
6039
+ tool: "tool";
6040
+ "agent-message": "agent-message";
6041
+ "file-change": "file-change";
6042
+ notice: "notice";
6043
+ }>;
6044
+ provenance: z.ZodObject<{
6045
+ origin: z.ZodEnum<{
6046
+ unknown: "unknown";
6047
+ operator: "operator";
6048
+ agent: "agent";
6049
+ tool: "tool";
6050
+ system: "system";
6051
+ }>;
6052
+ source: z.ZodEnum<{
6053
+ unknown: "unknown";
6054
+ "native-kind": "native-kind";
6055
+ "host-action": "host-action";
6056
+ "authenticated-host-action": "authenticated-host-action";
6057
+ "agent-input": "agent-input";
6058
+ }>;
6059
+ nativeInputId: z.ZodNullable<z.ZodString>;
6060
+ actionId: z.ZodNullable<z.ZodUUID>;
6061
+ contentBoundary: z.ZodLiteral<"untrusted">;
6062
+ grantsAuthority: z.ZodLiteral<false>;
6063
+ }, z.core.$strip>;
6064
+ text: z.ZodString;
6065
+ isTruncated: z.ZodBoolean;
6066
+ callId: z.ZodNullable<z.ZodString>;
6067
+ outcome: z.ZodNullable<z.ZodEnum<{
6068
+ failed: "failed";
6069
+ succeeded: "succeeded";
6070
+ }>>;
6071
+ files: z.ZodArray<z.ZodObject<{
6072
+ path: z.ZodString;
6073
+ added: z.ZodNumber;
6074
+ removed: z.ZodNumber;
6075
+ }, z.core.$strip>>;
6076
+ createdAt: z.ZodNullable<z.ZodNumber>;
6077
+ }, z.core.$strip>;
6078
+ command: z.ZodNullable<z.ZodObject<{
6079
+ command: z.ZodNullable<z.ZodString>;
6080
+ output: z.ZodNullable<z.ZodString>;
6081
+ isOutputStartCut: z.ZodBoolean;
6082
+ exitCode: z.ZodNullable<z.ZodNumber>;
6083
+ durationMs: z.ZodNullable<z.ZodNumber>;
6084
+ }, z.core.$strip>>;
6085
+ tool: z.ZodNullable<z.ZodObject<{
6086
+ server: z.ZodNullable<z.ZodString>;
6087
+ name: z.ZodNullable<z.ZodString>;
6088
+ input: z.ZodNullable<z.ZodString>;
6089
+ result: z.ZodNullable<z.ZodString>;
6090
+ isResultStartCut: z.ZodBoolean;
6091
+ }, z.core.$strip>>;
6092
+ files: z.ZodArray<z.ZodObject<{
6093
+ path: z.ZodString;
6094
+ added: z.ZodNumber;
6095
+ removed: z.ZodNumber;
6096
+ diff: z.ZodString;
6097
+ }, z.core.$strip>>;
6098
+ images: z.ZodArray<z.ZodObject<{
6099
+ index: z.ZodNumber;
6100
+ mediaType: z.ZodNullable<z.ZodEnum<{
6101
+ "image/png": "image/png";
6102
+ "image/jpeg": "image/jpeg";
6103
+ "image/webp": "image/webp";
6104
+ "image/gif": "image/gif";
6105
+ }>>;
6106
+ byteCount: z.ZodNullable<z.ZodNumber>;
6107
+ }, z.core.$strip>>;
6108
+ }, z.core.$strip>>;
6109
+ }, z.core.$strip>, z.ZodObject<{
6110
+ kind: z.ZodLiteral<"item-image">;
6111
+ result: z.ZodObject<{
6112
+ mediaType: z.ZodEnum<{
6113
+ "image/png": "image/png";
6114
+ "image/jpeg": "image/jpeg";
6115
+ "image/webp": "image/webp";
6116
+ "image/gif": "image/gif";
6117
+ }>;
6118
+ data: z.ZodString;
6119
+ }, z.core.$strip>;
5916
6120
  }, z.core.$strip>, z.ZodObject<{
5917
6121
  kind: z.ZodLiteral<"usage">;
5918
6122
  result: z.ZodObject<{
@@ -6841,6 +7045,7 @@ export declare const ErrorKindSchema: z.ZodEnum<{
6841
7045
  "invalid-request": "invalid-request";
6842
7046
  "authentication-required": "authentication-required";
6843
7047
  "not-found": "not-found";
7048
+ "image-unavailable": "image-unavailable";
6844
7049
  }>;
6845
7050
  export type IErrorKind = z.infer<typeof ErrorKindSchema>;
6846
7051
  export declare const IpcRequestSchema: z.ZodObject<{
@@ -8034,6 +8239,21 @@ export declare const IpcRequestSchema: z.ZodObject<{
8034
8239
  workspaceRoot: z.ZodString;
8035
8240
  nativeId: z.ZodString;
8036
8241
  kind: z.ZodLiteral<"items">;
8242
+ }, z.core.$strict>, z.ZodObject<{
8243
+ turnId: z.ZodString;
8244
+ nativeItemId: z.ZodString;
8245
+ provider: z.ZodString;
8246
+ workspaceRoot: z.ZodString;
8247
+ nativeId: z.ZodString;
8248
+ kind: z.ZodLiteral<"item-detail">;
8249
+ }, z.core.$strict>, z.ZodObject<{
8250
+ turnId: z.ZodString;
8251
+ nativeItemId: z.ZodString;
8252
+ index: z.ZodNumber;
8253
+ provider: z.ZodString;
8254
+ workspaceRoot: z.ZodString;
8255
+ nativeId: z.ZodString;
8256
+ kind: z.ZodLiteral<"item-image">;
8037
8257
  }, z.core.$strict>, z.ZodObject<{
8038
8258
  kind: z.ZodLiteral<"usage">;
8039
8259
  provider: z.ZodString;
@@ -12379,6 +12599,98 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
12379
12599
  createdAt: z.ZodNullable<z.ZodNumber>;
12380
12600
  }, z.core.$strip>>;
12381
12601
  }, z.core.$strip>;
12602
+ }, z.core.$strip>, z.ZodObject<{
12603
+ kind: z.ZodLiteral<"item-detail">;
12604
+ result: z.ZodNullable<z.ZodObject<{
12605
+ item: z.ZodObject<{
12606
+ nativeId: z.ZodString;
12607
+ turnId: z.ZodString;
12608
+ nativeType: z.ZodString;
12609
+ kind: z.ZodEnum<{
12610
+ command: "command";
12611
+ unsupported: "unsupported";
12612
+ "user-message": "user-message";
12613
+ tool: "tool";
12614
+ "agent-message": "agent-message";
12615
+ "file-change": "file-change";
12616
+ notice: "notice";
12617
+ }>;
12618
+ provenance: z.ZodObject<{
12619
+ origin: z.ZodEnum<{
12620
+ unknown: "unknown";
12621
+ operator: "operator";
12622
+ agent: "agent";
12623
+ tool: "tool";
12624
+ system: "system";
12625
+ }>;
12626
+ source: z.ZodEnum<{
12627
+ unknown: "unknown";
12628
+ "native-kind": "native-kind";
12629
+ "host-action": "host-action";
12630
+ "authenticated-host-action": "authenticated-host-action";
12631
+ "agent-input": "agent-input";
12632
+ }>;
12633
+ nativeInputId: z.ZodNullable<z.ZodString>;
12634
+ actionId: z.ZodNullable<z.ZodUUID>;
12635
+ contentBoundary: z.ZodLiteral<"untrusted">;
12636
+ grantsAuthority: z.ZodLiteral<false>;
12637
+ }, z.core.$strip>;
12638
+ text: z.ZodString;
12639
+ isTruncated: z.ZodBoolean;
12640
+ callId: z.ZodNullable<z.ZodString>;
12641
+ outcome: z.ZodNullable<z.ZodEnum<{
12642
+ failed: "failed";
12643
+ succeeded: "succeeded";
12644
+ }>>;
12645
+ files: z.ZodArray<z.ZodObject<{
12646
+ path: z.ZodString;
12647
+ added: z.ZodNumber;
12648
+ removed: z.ZodNumber;
12649
+ }, z.core.$strip>>;
12650
+ createdAt: z.ZodNullable<z.ZodNumber>;
12651
+ }, z.core.$strip>;
12652
+ command: z.ZodNullable<z.ZodObject<{
12653
+ command: z.ZodNullable<z.ZodString>;
12654
+ output: z.ZodNullable<z.ZodString>;
12655
+ isOutputStartCut: z.ZodBoolean;
12656
+ exitCode: z.ZodNullable<z.ZodNumber>;
12657
+ durationMs: z.ZodNullable<z.ZodNumber>;
12658
+ }, z.core.$strip>>;
12659
+ tool: z.ZodNullable<z.ZodObject<{
12660
+ server: z.ZodNullable<z.ZodString>;
12661
+ name: z.ZodNullable<z.ZodString>;
12662
+ input: z.ZodNullable<z.ZodString>;
12663
+ result: z.ZodNullable<z.ZodString>;
12664
+ isResultStartCut: z.ZodBoolean;
12665
+ }, z.core.$strip>>;
12666
+ files: z.ZodArray<z.ZodObject<{
12667
+ path: z.ZodString;
12668
+ added: z.ZodNumber;
12669
+ removed: z.ZodNumber;
12670
+ diff: z.ZodString;
12671
+ }, z.core.$strip>>;
12672
+ images: z.ZodArray<z.ZodObject<{
12673
+ index: z.ZodNumber;
12674
+ mediaType: z.ZodNullable<z.ZodEnum<{
12675
+ "image/png": "image/png";
12676
+ "image/jpeg": "image/jpeg";
12677
+ "image/webp": "image/webp";
12678
+ "image/gif": "image/gif";
12679
+ }>>;
12680
+ byteCount: z.ZodNullable<z.ZodNumber>;
12681
+ }, z.core.$strip>>;
12682
+ }, z.core.$strip>>;
12683
+ }, z.core.$strip>, z.ZodObject<{
12684
+ kind: z.ZodLiteral<"item-image">;
12685
+ result: z.ZodObject<{
12686
+ mediaType: z.ZodEnum<{
12687
+ "image/png": "image/png";
12688
+ "image/jpeg": "image/jpeg";
12689
+ "image/webp": "image/webp";
12690
+ "image/gif": "image/gif";
12691
+ }>;
12692
+ data: z.ZodString;
12693
+ }, z.core.$strip>;
12382
12694
  }, z.core.$strip>, z.ZodObject<{
12383
12695
  kind: z.ZodLiteral<"usage">;
12384
12696
  result: z.ZodObject<{
@@ -13311,6 +13623,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
13311
13623
  "invalid-request": "invalid-request";
13312
13624
  "authentication-required": "authentication-required";
13313
13625
  "not-found": "not-found";
13626
+ "image-unavailable": "image-unavailable";
13314
13627
  }>;
13315
13628
  message: z.ZodString;
13316
13629
  }, z.core.$strip>;