jg-agent-hq 13.2.0 → 13.2.1

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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 13.2.1
4
+
5
+ - Confirm a submitted or uncertain Claude steer from saved native input when its exact action UUID, session, workspace, turn and original-text fingerprint match. History, details, evidence and the existing turn-completion flush can resolve delivery even when Claude never echoes a live user-message replay, including after runtime restart.
6
+ - Wake receipt waits and refresh live provenance after confirmation. Preserve control ownership, completion, queued work, storage schema and action keys; no input is resent.
7
+
3
8
  ## 13.2.0
4
9
 
5
10
  - Allow an exact-turn `steer` to carry optional workspace files through the existing file integrity and size checks. Codex reuses its turn-start encoding; Claude sends text files as labeled text blocks and images as native image blocks. Claude rejects PDF steers before writing; ordinary PDF and text-document turn starts retain their encoding.
package/README.md CHANGED
@@ -67,6 +67,8 @@ Use `--provider claude` for Claude history and usage; the default is `codex`, wh
67
67
 
68
68
  Explicit actions create, name, adopt, resume, close and delete threads; send idle messages; steer an exact running turn; queue the next message; interrupt; and answer native questions, permissions or MCP elicitation. A create can carry the session's first message and a close can interrupt a running turn first, each as one action. `thread-delete` deletes a session no process runs from its CLI's storage, and the runtime's records of it, within its request. Actions have stable UUIDs and durable receipts, and the `actions` page carries each queued input's text. `action-wait` returns a receipt once it has its native thread ID or settles, woken by the runtime's own changes rather than polling, or as it stands when its timeout of at most 30 seconds passes. Repeating the same request returns its receipt; changing that UUID's payload conflicts. A lost acknowledgement stays uncertain until the exact native response arrives or the operator makes an explicit recovery choice. The runtime never resends uncertain input.
69
69
 
70
+ Claude can save a steer as a queued-command attachment without echoing a live user message. Reading that saved input through history, details or evidence confirms a submitted or uncertain delivery when its exact action, session, workspace, turn and original-text fingerprint match. The existing turn-completion history flush performs the same check. This also resolves receipts from an earlier runtime without restoring control or resending input.
71
+
70
72
  Use `models --provider <id>` for native model and effort choices, and `configuration --provider <id> --workspace-root <path> [--thread-id <id>]` for known effective settings and paged native agent/profile metadata. Creation and explicit resume accept typed startup settings; messages can select a model and effort for the next turn. Startup instructions, native Claude agents and permission settings require an idle session restart. Capability schemas describe supported selections and change modes. Unknown settings remain explicit, and native configuration files stay with each CLI. See the [configuration contract](api/README.md#native-configuration).
71
73
 
72
74
  Native execution settings, instructions, skills and tool permissions remain with each CLI. Claude uses an owned structured process per controlled session, closes it after 60 idle minutes and reopens it for the next input, and steers its active turn with a structured user message. Close other CLI controllers before confirming adoption, resume or recovery. The runtime coordinates sessions sharing one state directory; it cannot lock independently running native CLIs. Integrating browser hosts can use durable host-action admission and operator-scoped reconciliation through the programmatic API; see the [browser host contract](api/README.md#browser-host-integration). The standalone CLI advertises only commands it implements.
package/api/README.md CHANGED
@@ -121,19 +121,19 @@ An adapter reports normalized observations, items, deltas, prompts, outcomes, ob
121
121
 
122
122
  The current built-in surfaces map to these native entry points:
123
123
 
124
- | jg-agent-hq surface | Codex | Claude |
125
- | ------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------- |
126
- | Create/adopt/resume | `thread/start`, `thread/read`, `thread/resume` | Structured session creation/resume and idle/session-ID fences |
127
- | Rename | `thread/name/set` | `rename_session` control request |
128
- | Message/queue | `turn/start` with explicit native input | Structured user messages with matching acknowledgements |
129
- | Steer | `turn/steer` for the exact active turn | A structured user message into the exact active turn, acknowledged by its replay |
130
- | Interrupt | `turn/interrupt` | `interrupt` control request; completion remains separate |
131
- | Close/recover | Native background-terminal cleanup/verification and `thread/unsubscribe` | Confirmed process-group shutdown and explicit session release/resume |
132
- | Runtime restart | Sessions keep running, and the next runtime rejoins them | Turns stop with the runtime; sessions wait inactive for an explicit resume |
133
- | History | `thread/list`, `thread/read`, `thread/turns/list`, `thread/items/list` | Bounded worker-owned indexing of native transcripts |
134
- | Skills | `skills/list` and native skill input | Initialization command metadata and native invocation text |
135
- | Models/settings | `model/list`, `config/read`, native startup and next-turn parameters | `list_models`, `get_settings`, native startup flags and `apply_flag_settings` |
136
- | Usage | `account/rateLimits/read` | `get_usage` control request, with explicit unavailable observations |
124
+ | jg-agent-hq surface | Codex | Claude |
125
+ | ------------------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
126
+ | Create/adopt/resume | `thread/start`, `thread/read`, `thread/resume` | Structured session creation/resume and idle/session-ID fences |
127
+ | Rename | `thread/name/set` | `rename_session` control request |
128
+ | Message/queue | `turn/start` with explicit native input | Structured user messages with matching acknowledgements |
129
+ | Steer | `turn/steer` for the exact active turn | A structured user message into the exact active turn, confirmed by its replay or matching saved input |
130
+ | Interrupt | `turn/interrupt` | `interrupt` control request; completion remains separate |
131
+ | Close/recover | Native background-terminal cleanup/verification and `thread/unsubscribe` | Confirmed process-group shutdown and explicit session release/resume |
132
+ | Runtime restart | Sessions keep running, and the next runtime rejoins them | Turns stop with the runtime; sessions wait inactive for an explicit resume |
133
+ | History | `thread/list`, `thread/read`, `thread/turns/list`, `thread/items/list` | Bounded worker-owned indexing of native transcripts |
134
+ | Skills | `skills/list` and native skill input | Initialization command metadata and native invocation text |
135
+ | Models/settings | `model/list`, `config/read`, native startup and next-turn parameters | `list_models`, `get_settings`, native startup flags and `apply_flag_settings` |
136
+ | Usage | `account/rateLimits/read` | `get_usage` control request, with explicit unavailable observations |
137
137
 
138
138
  Availability depends on the selected native connection and, for session metadata, that session's initialization. Native settings, hooks, plugins and authentication remain with the harness. Codex protocol details are in the [official app-server reference](https://learn.chatgpt.com/docs/app-server); Claude flags and programmatic behavior are in the [CLI reference](https://code.claude.com/docs/en/cli-reference) and [programmatic guide](https://code.claude.com/docs/en/headless). Public-API integration tests exercise both native boundaries through the runtime's real persistence and IPC, including compatible version labels and missing-provider isolation.
139
139
 
@@ -285,7 +285,9 @@ Receipts separate `delivery` (`queued`, `submitted`, `acknowledged`, `uncertain`
285
285
 
286
286
  A missing acknowledgement never triggers an automatic resend. Exact late responses reconcile delivery, including completion that arrived first. Native output loss marks the affected provider controls and submitted work uncertain. A Claude process failure affects its own session; a Codex transport failure affects its Codex cohort. Restart quarantines controls from an interrupted runtime, except the Codex sessions the next runtime rejoins; explicit recovery preserves the managed identity and name. Successful shutdown proves native process-group exit before marking Claude controls inactive. Unknown creation without a native identity remains uncertain.
287
287
 
288
- Normal native turn completion may advance ready queued entries once, in creation/UUID order. Failure, interruption, explicit interrupt admission or restart pauses the queue. A rejoined Codex session's queue advances again once the turn it waits on completes. Permission prompts do not advance it. An unacknowledged start or metadata change blocks dependent starts until its outcome is reconciled or the stopped runtime is recovered explicitly. A turn's completion does not settle an unresolved steering receipt.
288
+ Saved Claude input can acknowledge a submitted or uncertain steer without a live replay, including after restart. Authorized `items`, `item-detail` and `session-evidence` reads and the existing bounded turn-completion history flush match the exact source/action UUID, provider, native session, workspace, original target turn (or the steer's own follow-up turn) and full original-text SHA-256. Failed/canceled actions, mismatches and live-only presentation never establish this confirmation. Confirmation wakes receipt waits and refreshes live provenance; it changes neither control ownership nor completion, dispatches no work and restores no queued readiness. It reuses selected history pages and indexed action lookups without new scans, caches, storage or polling.
289
+
290
+ Normal native turn completion may advance ready queued entries once, in creation/UUID order. Failure, interruption, explicit interrupt admission or restart pauses the queue. A rejoined Codex session's queue advances again once the turn it waits on completes. Permission prompts do not advance it. An unacknowledged start or metadata change blocks dependent starts until its outcome is reconciled or the stopped runtime is recovered explicitly. A turn's completion alone does not settle an unresolved steering receipt.
289
291
 
290
292
  Native replies use one of these closed response forms:
291
293
 
@@ -5,6 +5,7 @@ import { delay } from 'jg-utilities';
5
5
  import { MAX_ITEM_TEXT_LENGTH, MAX_PAGE_SIZE } from '../../contracts/index.js';
6
6
  import { HQ_ERRORS, getErrorKind } from '../../errors/index.js';
7
7
  import { capabilityUnavailable } from '../../providers/registry/index.js';
8
+ import { correlateEvidenceOrigins } from '../../sessions/index.js';
8
9
  import { RESYNC_REREAD_DELAY_SECONDS, Resyncs, decideResync, } from '../resync/index.js';
9
10
  import { agentUnavailable, keepsSessions } from '../utilities.js';
10
11
  import { TURN_FLUSH_PAGES } from './constants.js';
@@ -165,6 +166,13 @@ export const createEvents = (context, dispatcher, reconnect) => {
165
166
  });
166
167
  if (response.kind !== 'items')
167
168
  return;
169
+ await correlateEvidenceOrigins(response.result.data, provider, nativeId, store, {
170
+ workspaceRoot,
171
+ onAcknowledged: (threadId) => {
172
+ waits.notifyThread(threadId);
173
+ live.invalidateProvenance(liveKey);
174
+ },
175
+ });
168
176
  live.reconcile(liveKey, response.result.data);
169
177
  if (response.result.nextCursor === null)
170
178
  break;
@@ -85,7 +85,16 @@ export const createClaudeProviderFactory = (store, additionalDirectories) => ({
85
85
  });
86
86
  },
87
87
  listThreads: (workspaceRoot, page, call) => reader.listThreads(workspaceRoot, page, call.signal),
88
- readHistory: (command) => reader.readHistory(command),
88
+ async readHistory(command) {
89
+ const response = await reader.readHistory(command);
90
+ const items = response.kind === 'items' || response.kind === 'session-evidence'
91
+ ? response.result.data
92
+ : response.kind === 'item-detail' && response.result
93
+ ? [response.result.item]
94
+ : [];
95
+ control.confirmSavedSteers(command.nativeId, command.workspaceRoot, items);
96
+ return response;
97
+ },
89
98
  readModels: (command) => reader.readModels(command),
90
99
  readConfiguration: (command, nativeId, call) => nativeId
91
100
  ? control.readConfiguration(command, nativeId)
@@ -1,6 +1,6 @@
1
1
  import type { IConfigurationRequest, ISessionSettings, ITurnSettings } from '../../../contracts/index.js';
2
2
  import type { IProviderInputFile } from '../../inputs/index.js';
3
- import type { IClaudeControlEvents } from './types.js';
3
+ import type { IClaudeControlEvents, IClaudeSavedInput } from './types.js';
4
4
  /**
5
5
  * Owns one persistent native CLI per explicitly controlled Claude session.
6
6
  * @returns Controls whose processes outlive client connections and stop at runtime shutdown.
@@ -13,6 +13,8 @@ export declare const createClaudeControl: (additionalDirectories?: string[]) =>
13
13
  * Installs the runtime-owned evidence channel.
14
14
  */
15
15
  setEvents(handlers: IClaudeControlEvents): void;
16
+ /** Settles pending native waits from exact saved input without starting another turn. */
17
+ confirmSavedSteers(nativeId: string, workspaceRoot: string, items: IClaudeSavedInput[]): void;
16
18
  /**
17
19
  * Starts an idle native session with normal local instructions and settings.
18
20
  * @returns The exact native session identity and workspace.
@@ -1,4 +1,5 @@
1
1
  import { randomUUID } from 'node:crypto';
2
+ import { hashValue } from 'jg-crypto';
2
3
  import { Exception } from 'jg-exception';
3
4
  import { delay, isEqual } from 'jg-utilities';
4
5
  import { z } from 'zod';
@@ -322,6 +323,32 @@ export const createClaudeControl = (additionalDirectories = []) => {
322
323
  setEvents(handlers) {
323
324
  events = handlers;
324
325
  },
326
+ /** Settles pending native waits from exact saved input without starting another turn. */
327
+ confirmSavedSteers(nativeId, workspaceRoot, items) {
328
+ const session = sessions.get(nativeId);
329
+ if (!session || session.workspaceRoot !== workspaceRoot)
330
+ return;
331
+ for (const item of items) {
332
+ const inputId = item.provenance.nativeInputId;
333
+ const steer = inputId === null ? undefined : session.steers.get(inputId);
334
+ const turnId = 'reference' in item ? item.reference.turnId : item.turnId;
335
+ if (!steer ||
336
+ steer.isAcknowledged ||
337
+ item.kind !== 'user-message' ||
338
+ item.provenance.nativeInputSha256 !== steer.inputSha256 ||
339
+ (turnId !== steer.turnId && turnId !== steer.id))
340
+ continue;
341
+ // a later live replay still needs its exact identity to start its own native turn
342
+ steer.isAcknowledged = true;
343
+ steer.resolve(steer.turnId);
344
+ events?.outcome({
345
+ kind: 'steer-accepted',
346
+ actionId: steer.id,
347
+ phase: 'steer',
348
+ nativeTurnId: steer.turnId,
349
+ });
350
+ }
351
+ },
325
352
  /**
326
353
  * Starts an idle native session with normal local instructions and settings.
327
354
  * @returns The exact native session identity and workspace.
@@ -494,7 +521,14 @@ export const createClaudeControl = (additionalDirectories = []) => {
494
521
  unavailable();
495
522
  return new Promise((resolve, reject) => {
496
523
  const id = parsedId.data;
497
- session.steers.set(id, { id, turnId, resolve, reject });
524
+ session.steers.set(id, {
525
+ id,
526
+ turnId,
527
+ inputSha256: hashValue(text),
528
+ isAcknowledged: false,
529
+ resolve,
530
+ reject,
531
+ });
498
532
  void session
499
533
  .connection.write({
500
534
  type: 'user',
@@ -13,7 +13,7 @@ export declare const getActiveTurn: (session: IClaudeSession) => IClaudeTurn | u
13
13
  */
14
14
  export declare const setBackgroundCommands: (session: IClaudeSession, count: number, events: IClaudeControlEvents | undefined) => void;
15
15
  /**
16
- * Fails the steers Claude never replayed, as when its process stops, so no steer waits forever.
16
+ * Releases retained steering identities and rejects any input still unconfirmed when it stops.
17
17
  * @param session The session.
18
18
  * @param turnId The turn whose steers fail, or every pending steer when omitted.
19
19
  */
@@ -156,7 +156,7 @@ export const setBackgroundCommands = (session, count, events) => {
156
156
  events?.background(session.id, count);
157
157
  };
158
158
  /**
159
- * Fails the steers Claude never replayed, as when its process stops, so no steer waits forever.
159
+ * Releases retained steering identities and rejects any input still unconfirmed when it stops.
160
160
  * @param session The session.
161
161
  * @param turnId The turn whose steers fail, or every pending steer when omitted.
162
162
  */
@@ -166,7 +166,8 @@ export const failSteers = (session, turnId) => {
166
166
  continue;
167
167
  clearTimeout(steer.timer);
168
168
  session.steers.delete(steer.id);
169
- steer.reject(HQ_ERRORS.create('claudeFailed', { data: { kind: 'agent-unavailable' } }));
169
+ if (!steer.isAcknowledged)
170
+ steer.reject(HQ_ERRORS.create('claudeFailed', { data: { kind: 'agent-unavailable' } }));
170
171
  }
171
172
  };
172
173
  /*
@@ -1,4 +1,4 @@
1
- import type { IHistoryItem, ISessionSettings } from '../../../contracts/index.js';
1
+ import type { IEvidenceItem, IHistoryItem, ISessionSettings } from '../../../contracts/index.js';
2
2
  import type { INativeObservation } from '../../../store/control/index.js';
3
3
  import type { INativePrompt, IProviderSkills, IAgentProviderOutcome } from '../../index.js';
4
4
  export type IClaudeControlEvents = {
@@ -33,10 +33,13 @@ export type IClaudeNativeTurn = {
33
33
  export type IClaudeSteer = {
34
34
  id: string;
35
35
  turnId: string;
36
+ inputSha256: string;
37
+ isAcknowledged: boolean;
36
38
  resolve(turnId: string): void;
37
39
  reject(error: unknown): void;
38
40
  timer?: ReturnType<typeof setTimeout>;
39
41
  };
42
+ export type IClaudeSavedInput = Pick<IHistoryItem, 'kind' | 'provenance'> & (Pick<IHistoryItem, 'turnId'> | Pick<IEvidenceItem, 'reference'>);
40
43
  export type IClaudeTurn = IClaudeInput | IClaudeNativeTurn;
41
44
  export type IClaudeFastMode = {
42
45
  state: 'on' | 'cooldown' | 'off';
@@ -280,7 +280,10 @@ export const createAgentHq = async (options) => {
280
280
  return { kind: 'locks', result: { data: locks, isTruncated } };
281
281
  }
282
282
  default: {
283
- const response = await readNativeHistory(command, providers, projection, allowedRoots, claudeSessions);
283
+ const response = await readNativeHistory(command, providers, projection, allowedRoots, claudeSessions, (threadId, nativeId) => {
284
+ actions.waits.notifyThread(threadId);
285
+ actions.live.invalidateProvenance(JSON.stringify(['claude', nativeId]));
286
+ });
284
287
  if (command.kind !== 'items' || response.kind !== 'items')
285
288
  return response;
286
289
  // live items reconcile against the persisted text before it is cut
@@ -9,10 +9,14 @@ type IProvenanceItem = Pick<IHistoryItem, 'kind' | 'provenance'> & (Pick<IHistor
9
9
  * @param provider The provider whose native session supplied the rows.
10
10
  * @param nativeId The selected native session.
11
11
  * @param store The authoritative action ledger.
12
+ * @param persisted Authorized saved history can confirm an exact Claude steer without a replay.
12
13
  * @mutates Replaces provenance on the supplied presentation rows.
13
14
  * @returns Completion after the eligible user inputs have been correlated.
14
15
  * @throws
15
16
  * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
16
17
  */
17
- export declare const correlateEvidenceOrigins: (items: IProvenanceItem[], provider: IProviderId, nativeId: string, store: IStore) => Promise<void>;
18
+ export declare const correlateEvidenceOrigins: (items: IProvenanceItem[], provider: IProviderId, nativeId: string, store: IStore, persisted?: {
19
+ workspaceRoot: string;
20
+ onAcknowledged(threadId: string): void;
21
+ }) => Promise<void>;
18
22
  export {};
@@ -8,12 +8,13 @@ import { resetProvenance } from './utilities.js';
8
8
  * @param provider The provider whose native session supplied the rows.
9
9
  * @param nativeId The selected native session.
10
10
  * @param store The authoritative action ledger.
11
+ * @param persisted Authorized saved history can confirm an exact Claude steer without a replay.
11
12
  * @mutates Replaces provenance on the supplied presentation rows.
12
13
  * @returns Completion after the eligible user inputs have been correlated.
13
14
  * @throws
14
15
  * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
15
16
  */
16
- export const correlateEvidenceOrigins = async (items, provider, nativeId, store) => {
17
+ export const correlateEvidenceOrigins = async (items, provider, nativeId, store, persisted) => {
17
18
  for (const item of items)
18
19
  item.provenance = resetProvenance(item.kind, item.provenance);
19
20
  const inputs = items.filter(({ kind, provenance }) => kind === 'user-message' &&
@@ -21,7 +22,7 @@ export const correlateEvidenceOrigins = async (items, provider, nativeId, store)
21
22
  provenance.nativeInputSha256 !== null);
22
23
  if (inputs.length === 0)
23
24
  return;
24
- const origins = await store.call('reads', 'getEvidenceOrigins', {
25
+ const command = {
25
26
  provider,
26
27
  nativeId,
27
28
  items: inputs.map(({ provenance, ...item }) => ({
@@ -30,7 +31,16 @@ export const correlateEvidenceOrigins = async (items, provider, nativeId, store)
30
31
  turnId: 'reference' in item ? item.reference.turnId : item.turnId,
31
32
  sha256: provenance.nativeInputSha256,
32
33
  })),
33
- });
34
+ };
35
+ if (persisted && provider === 'claude') {
36
+ const threads = await store.call('outcomes', 'confirmClaudeSteers', {
37
+ ...command,
38
+ workspaceRoot: persisted.workspaceRoot,
39
+ });
40
+ for (const threadId of threads)
41
+ persisted.onAcknowledged(threadId);
42
+ }
43
+ const origins = await store.call('reads', 'getEvidenceOrigins', command);
34
44
  for (const [index, origin] of origins.entries())
35
45
  if (origin)
36
46
  inputs[index].provenance = origin;
@@ -19,7 +19,7 @@ import type { IClaudeSessions, IHistoryRequest } from './types.js';
19
19
  * - JG_AGENT_HQ_TRANSPORT_FAILED: The HQ transport failed
20
20
  * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
21
21
  */
22
- export declare const readNativeHistory: (command: IHistoryRequest, registry: ReturnType<typeof createProviderRegistry>, projection: IStore, allowedRoots: string[], claude: IClaudeSessions) => Promise<IHqResponse>;
22
+ export declare const readNativeHistory: (command: IHistoryRequest, registry: ReturnType<typeof createProviderRegistry>, projection: IStore, allowedRoots: string[], claude: IClaudeSessions, onInputAcknowledged: (threadId: string, nativeId: string) => void) => Promise<IHqResponse>;
23
23
  /**
24
24
  * Reads every running and waiting session, managed and observed, and every idle one that runs
25
25
  * background commands, newest state change first, each as the summary `threads` returns, without
@@ -21,7 +21,7 @@ import { correlateEvidenceOrigins } from './evidence/index.js';
21
21
  * - JG_AGENT_HQ_TRANSPORT_FAILED: The HQ transport failed
22
22
  * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
23
23
  */
24
- export const readNativeHistory = async (command, registry, projection, allowedRoots, claude) => {
24
+ export const readNativeHistory = async (command, registry, projection, allowedRoots, claude, onInputAcknowledged) => {
25
25
  const workspaceRoot = await resolveWorkspaceTarget(command.workspaceRoot, allowedRoots);
26
26
  // a thread HQ created has no native history until its first turn, so its record answers
27
27
  if (command.kind === 'thread' ||
@@ -71,7 +71,10 @@ export const readNativeHistory = async (command, registry, projection, allowedRo
71
71
  ? [response.result.item]
72
72
  : [];
73
73
  if (items.length && 'nativeId' in command)
74
- await correlateEvidenceOrigins(items, command.provider, command.nativeId, projection);
74
+ await correlateEvidenceOrigins(items, command.provider, command.nativeId, projection, {
75
+ workspaceRoot,
76
+ onAcknowledged: (threadId) => onInputAcknowledged(threadId, command.nativeId),
77
+ });
75
78
  if (response.kind === 'session-evidence' && Buffer.byteLength(JSON.stringify(response)) > 65_280)
76
79
  throw HQ_ERRORS.create('providerFailed', { data: { kind: 'agent-unavailable' } });
77
80
  return response;
@@ -1,8 +1,17 @@
1
1
  import type { IActionReceipt } from '../../../contracts/index.js';
2
+ import type { IEvidenceOriginsRequest } from '../../../sessions/evidence/index.js';
2
3
  import { ControlModel } from '../control.model.js';
3
4
  import type { INativeOutcome } from '../types.js';
4
5
  /** Applies native request outcomes to the actions whose phases they answer. */
5
6
  export declare class ControlOutcomes extends ControlModel {
7
+ /**
8
+ * Confirms saved Claude input against its exact admitted steer, including an earlier runtime's
9
+ * uncertain receipt. This changes delivery only; it never restores control or dispatches work.
10
+ * @returns The thread IDs whose receipt changed.
11
+ */
12
+ confirmClaudeSteers(command: IEvidenceOriginsRequest & {
13
+ workspaceRoot: string;
14
+ }): string[];
6
15
  /**
7
16
  * Applies an exact native request outcome without downgrading a known acknowledgement. An
8
17
  * outcome answers the phase its action takes now; one for a phase the action has left, or from
@@ -2,6 +2,33 @@ import { ControlModel } from '../control.model.js';
2
2
  import { toActionReceipt } from '../transformers.js';
3
3
  /** Applies native request outcomes to the actions whose phases they answer. */
4
4
  export class ControlOutcomes extends ControlModel {
5
+ /**
6
+ * Confirms saved Claude input against its exact admitted steer, including an earlier runtime's
7
+ * uncertain receipt. This changes delivery only; it never restores control or dispatches work.
8
+ * @returns The thread IDs whose receipt changed.
9
+ */
10
+ confirmClaudeSteers(command) {
11
+ if (command.provider !== 'claude')
12
+ return [];
13
+ return this._transaction(() => {
14
+ const threads = new Set();
15
+ for (const item of command.items) {
16
+ if (item.nativeInputId === null || item.sha256 === null)
17
+ continue;
18
+ const updated = this._statements.get(`UPDATE agent_hq_action SET delivery = 'acknowledged', failure = NULL, updated_at = ?
19
+ WHERE id = ? AND provider = 'claude' AND kind = 'steer' AND phase = 'steer'
20
+ AND delivery IN ('submitted', 'uncertain') AND input_sha256 = ?
21
+ AND native_turn_id IS NOT NULL AND native_turn_id = expected_turn_id
22
+ AND (native_turn_id = ? OR id = ?)
23
+ AND thread_id IN (SELECT id FROM agent_hq_thread
24
+ WHERE provider = 'claude' AND native_id = ? AND workspace_root = ?)
25
+ RETURNING thread_id`, Date.now(), item.nativeInputId, item.sha256, item.turnId, item.turnId, command.nativeId, command.workspaceRoot);
26
+ if (updated)
27
+ threads.add(updated.thread_id);
28
+ }
29
+ return [...threads];
30
+ });
31
+ }
5
32
  /**
6
33
  * Applies an exact native request outcome without downgrading a known acknowledgement. An
7
34
  * outcome answers the phase its action takes now; one for a phase the action has left, or from
package/docs/recovery.md CHANGED
@@ -20,6 +20,8 @@ The recovered runtime rebuilds the Claude history index from the transcripts on
20
20
 
21
21
  Recover repositories and native files separately. Source paths are retained as evidence; never blindly replace repository files. Reconcile native ownership before enabling execution. The snapshot does not promise path translation or restore authentication.
22
22
 
23
+ A saved Claude input can resolve an uncertain steering receipt when an authorized history, detail or evidence read verifies its exact action, session, workspace, turn and original-text fingerprint. This confirms delivery only. It does not recover ownership, resume a session, resend input or release queued work.
24
+
23
25
  ## Rollback
24
26
 
25
27
  Roll back by restoring an earlier snapshot into a new recovery workspace; never overwrite the current state root. A snapshot from another schema is refused with an error naming the package version that wrote it, so restore it with that version. Rollback accepts losing every change made after that snapshot, including host changes and later runtime receipts. Reconcile native ownership before enabling work.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jg-agent-hq",
3
- "version": "13.2.0",
3
+ "version": "13.2.1",
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",