jg-agent-hq 11.1.1 → 12.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 +63 -0
- package/README.md +32 -38
- package/api/README.md +231 -221
- package/dist/actions/actions.d.ts +10 -20
- package/dist/actions/actions.js +71 -1153
- package/dist/actions/admission/admission.d.ts +10 -0
- package/dist/actions/admission/admission.js +259 -0
- package/dist/actions/admission/index.d.ts +1 -0
- package/dist/actions/admission/index.js +2 -0
- package/dist/actions/dispatch/constants.d.ts +2 -0
- package/dist/actions/dispatch/constants.js +12 -0
- package/dist/actions/dispatch/dispatch.d.ts +16 -0
- package/dist/actions/dispatch/dispatch.js +275 -0
- package/dist/actions/dispatch/index.d.ts +1 -0
- package/dist/actions/dispatch/index.js +2 -0
- package/dist/actions/events/constants.d.ts +1 -0
- package/dist/actions/events/constants.js +2 -0
- package/dist/actions/events/events.d.ts +15 -0
- package/dist/actions/events/events.js +432 -0
- package/dist/actions/events/index.d.ts +1 -0
- package/dist/actions/events/index.js +2 -0
- package/dist/actions/live/live.d.ts +10 -3
- package/dist/actions/live/live.js +30 -23
- package/dist/actions/reads.d.ts +4 -7
- package/dist/actions/reads.js +43 -79
- package/dist/actions/reattach/index.d.ts +1 -0
- package/dist/actions/reattach/index.js +2 -0
- package/dist/actions/reattach/reattach.d.ts +10 -0
- package/dist/actions/reattach/reattach.js +84 -0
- package/dist/actions/resync/resync.d.ts +3 -2
- package/dist/actions/types.d.ts +50 -0
- package/dist/actions/types.js +1 -0
- package/dist/actions/utilities.d.ts +14 -0
- package/dist/actions/utilities.js +21 -0
- package/dist/actions/waits/index.d.ts +1 -1
- package/dist/actions/waits/index.js +2 -2
- package/dist/actions/waits/waits.d.ts +33 -2
- package/dist/actions/waits/waits.js +90 -48
- package/dist/cli/cli.js +62 -88
- package/dist/contracts/actions/index.d.ts +2 -2
- package/dist/contracts/actions/index.js +1 -1
- package/dist/contracts/actions/types.d.ts +167 -207
- package/dist/contracts/actions/types.js +22 -37
- package/dist/contracts/browser/types.d.ts +148 -165
- package/dist/contracts/configuration/types.d.ts +8 -2
- package/dist/contracts/constants.d.ts +4 -0
- package/dist/contracts/constants.js +24 -0
- package/dist/contracts/evidence/index.d.ts +1 -1
- package/dist/contracts/evidence/index.js +1 -1
- package/dist/contracts/evidence/types.d.ts +16 -15
- package/dist/contracts/evidence/types.js +0 -10
- package/dist/contracts/index.d.ts +9 -17
- package/dist/contracts/index.js +6 -12
- package/dist/contracts/models/types.d.ts +8 -2
- package/dist/contracts/providers/index.d.ts +1 -1
- package/dist/contracts/providers/index.js +1 -1
- package/dist/contracts/providers/types.d.ts +32 -708
- package/dist/contracts/providers/types.js +2 -26
- package/dist/contracts/sessions/types.d.ts +10 -2
- package/dist/contracts/sessions/types.js +2 -0
- package/dist/contracts/skills/index.d.ts +2 -2
- package/dist/contracts/skills/index.js +1 -1
- package/dist/contracts/skills/types.d.ts +2 -32
- package/dist/contracts/skills/types.js +0 -5
- package/dist/contracts/types.d.ts +1221 -2674
- package/dist/contracts/types.js +56 -95
- package/dist/errors/constants.d.ts +91 -0
- package/dist/errors/constants.js +73 -0
- package/dist/errors/index.d.ts +2 -1
- package/dist/errors/index.js +3 -1
- package/dist/errors/utilities.d.ts +14 -1
- package/dist/errors/utilities.js +21 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +6 -4
- package/dist/ipc/client.d.ts +4 -3
- package/dist/ipc/client.js +15 -37
- package/dist/ipc/framing.js +4 -14
- package/dist/ipc/server.js +9 -18
- package/dist/pending/index.d.ts +1 -0
- package/dist/pending/index.js +2 -0
- package/dist/pending/pending.d.ts +30 -0
- package/dist/pending/pending.js +62 -0
- package/dist/providers/claude/adapter.js +30 -170
- package/dist/providers/claude/agents/agents.d.ts +6 -7
- package/dist/providers/claude/agents/agents.js +18 -15
- package/dist/providers/claude/claude.d.ts +14 -28
- package/dist/providers/claude/claude.js +49 -63
- package/dist/providers/claude/control/control.d.ts +5 -104
- package/dist/providers/claude/control/control.js +28 -194
- package/dist/providers/claude/control/permissions.js +3 -6
- package/dist/providers/claude/control/skills.js +4 -8
- package/dist/providers/claude/control/stream.js +64 -56
- package/dist/providers/claude/history/history.model.d.ts +47 -5
- package/dist/providers/claude/history/history.model.js +262 -216
- package/dist/providers/claude/history/index.d.ts +1 -3
- package/dist/providers/claude/history/index.js +2 -5
- package/dist/providers/claude/history/types.d.ts +32 -2275
- package/dist/providers/claude/history/types.js +2 -33
- package/dist/providers/claude/history/utilities.d.ts +13 -0
- package/dist/providers/claude/history/utilities.js +66 -38
- package/dist/providers/claude/models/models.js +9 -23
- package/dist/providers/claude/rpc.d.ts +0 -2
- package/dist/providers/claude/rpc.js +50 -92
- package/dist/providers/claude/transformers.js +3 -6
- package/dist/providers/claude/types.d.ts +0 -1
- package/dist/providers/claude/types.js +0 -1
- package/dist/providers/codex/adapter.js +44 -149
- package/dist/providers/codex/approvals/utilities.js +2 -5
- package/dist/providers/codex/codex.d.ts +1 -1
- package/dist/providers/codex/codex.js +37 -136
- package/dist/providers/codex/constants.d.ts +1 -0
- package/dist/providers/codex/constants.js +2 -0
- package/dist/providers/codex/events.js +25 -35
- package/dist/providers/codex/rpc.js +30 -62
- package/dist/providers/codex/transformers.d.ts +2 -2
- package/dist/providers/codex/transformers.js +2 -1
- package/dist/providers/codex/types.d.ts +23 -49
- package/dist/providers/codex/types.js +7 -0
- package/dist/providers/codex/websocket/websocket.js +2 -5
- package/dist/providers/configuration/configuration.js +10 -30
- package/dist/providers/constants.d.ts +3 -0
- package/dist/providers/constants.js +35 -1
- package/dist/providers/elicitation/elicitation.js +2 -5
- package/dist/providers/index.d.ts +3 -4
- package/dist/providers/index.js +2 -2
- package/dist/providers/inputs/inputs.js +7 -17
- package/dist/providers/lineage/lineage.js +2 -5
- package/dist/providers/process.js +2 -4
- package/dist/providers/registry/index.d.ts +1 -1
- package/dist/providers/registry/registry.d.ts +7 -10
- package/dist/providers/registry/registry.js +61 -306
- package/dist/providers/registry/types.d.ts +1 -6
- package/dist/providers/registry/utilities.d.ts +3 -3
- package/dist/providers/registry/utilities.js +8 -32
- package/dist/providers/types.d.ts +37 -43
- package/dist/providers/utilities.d.ts +31 -0
- package/dist/providers/utilities.js +39 -0
- package/dist/runtime/browser/browser.js +10 -19
- package/dist/runtime/runtime.d.ts +9 -5
- package/dist/runtime/runtime.js +82 -106
- package/dist/runtime/state/constants.d.ts +3 -1
- package/dist/runtime/state/constants.js +4 -2
- package/dist/runtime/state/index.d.ts +2 -2
- package/dist/runtime/state/index.js +3 -2
- package/dist/runtime/state/state.d.ts +43 -44
- package/dist/runtime/state/state.js +135 -289
- package/dist/runtime/types.d.ts +26 -16
- package/dist/runtime/types.js +1 -10
- package/dist/runtime/warm-up/constants.d.ts +1 -0
- package/dist/runtime/warm-up/constants.js +2 -0
- package/dist/runtime/warm-up/index.d.ts +1 -0
- package/dist/runtime/warm-up/index.js +2 -0
- package/dist/runtime/warm-up/warm-up.d.ts +19 -0
- package/dist/runtime/warm-up/warm-up.js +52 -0
- package/dist/sessions/discovery/constants.d.ts +3 -0
- package/dist/sessions/discovery/constants.js +7 -0
- package/dist/sessions/discovery/discovery.d.ts +28 -0
- package/dist/sessions/discovery/discovery.js +105 -0
- package/dist/sessions/discovery/index.d.ts +1 -0
- package/dist/sessions/discovery/index.js +2 -0
- package/dist/sessions/discovery/merge.d.ts +15 -0
- package/dist/sessions/discovery/merge.js +114 -0
- package/dist/sessions/discovery/types.d.ts +46 -0
- package/dist/sessions/discovery/types.js +22 -0
- package/dist/sessions/discovery/utilities.d.ts +30 -0
- package/dist/sessions/discovery/utilities.js +56 -0
- package/dist/sessions/evidence/index.d.ts +1 -2
- package/dist/sessions/evidence/index.js +1 -3
- package/dist/sessions/evidence/types.d.ts +15 -11
- package/dist/sessions/evidence/types.js +1 -17
- package/dist/sessions/evidence/utilities.d.ts +0 -16
- package/dist/sessions/evidence/utilities.js +16 -42
- package/dist/sessions/index.d.ts +3 -2
- package/dist/sessions/index.js +4 -2
- package/dist/sessions/sessions.d.ts +9 -20
- package/dist/sessions/sessions.js +82 -172
- package/dist/sessions/summaries.d.ts +28 -0
- package/dist/sessions/summaries.js +75 -0
- package/dist/sessions/types.d.ts +1 -1
- package/dist/sessions/utilities.d.ts +38 -2
- package/dist/sessions/utilities.js +63 -54
- package/dist/skills/skills.d.ts +19 -20
- package/dist/skills/skills.js +25 -61
- package/dist/snapshots/archive/archive.d.ts +1 -1
- package/dist/snapshots/archive/archive.js +3 -6
- package/dist/snapshots/database.js +4 -8
- package/dist/snapshots/fences.js +4 -4
- package/dist/snapshots/files.js +5 -8
- package/dist/snapshots/index.d.ts +1 -1
- package/dist/snapshots/index.js +1 -1
- package/dist/snapshots/snapshots.d.ts +6 -6
- package/dist/snapshots/snapshots.js +34 -53
- package/dist/snapshots/snapshots.worker.js +2 -1
- package/dist/snapshots/types.d.ts +0 -2
- package/dist/storage/database.d.ts +14 -0
- package/dist/storage/database.js +65 -0
- package/dist/storage/index.d.ts +1 -2
- package/dist/storage/index.js +2 -3
- package/dist/storage/schema/index.d.ts +0 -1
- package/dist/storage/schema/index.js +0 -2
- package/dist/storage/schema/schema.js +5 -8
- package/dist/storage/storage.js +4 -10
- package/dist/storage/types.d.ts +12 -14
- package/dist/storage/types.js +1 -15
- package/dist/store/browser/browser.model.d.ts +4 -4
- package/dist/store/browser/browser.model.js +34 -37
- package/dist/store/constants.d.ts +1 -0
- package/dist/store/constants.js +6 -0
- package/dist/store/control/admission/admission.model.d.ts +59 -0
- package/dist/store/control/admission/admission.model.js +374 -0
- package/dist/store/control/admission/constants.d.ts +3 -0
- package/dist/store/control/admission/constants.js +117 -0
- package/dist/store/control/admission/index.d.ts +1 -0
- package/dist/store/control/admission/index.js +2 -0
- package/dist/store/control/admission/types.d.ts +12 -0
- package/dist/store/control/admission/types.js +1 -0
- package/dist/store/control/constants.d.ts +6 -7
- package/dist/store/control/constants.js +13 -14
- package/dist/store/control/control.model.d.ts +26 -138
- package/dist/store/control/control.model.js +44 -1157
- package/dist/store/control/index.d.ts +6 -6
- package/dist/store/control/index.js +10 -7
- package/dist/store/control/lifecycle/index.d.ts +1 -0
- package/dist/store/control/lifecycle/index.js +2 -0
- package/dist/store/control/lifecycle/lifecycle.model.d.ts +45 -0
- package/dist/store/control/lifecycle/lifecycle.model.js +107 -0
- package/dist/store/control/observations/index.d.ts +1 -0
- package/dist/store/control/observations/index.js +2 -0
- package/dist/store/control/observations/observations.model.d.ts +27 -0
- package/dist/store/control/observations/observations.model.js +164 -0
- package/dist/store/control/outcomes/index.d.ts +1 -0
- package/dist/store/control/outcomes/index.js +2 -0
- package/dist/store/control/outcomes/outcomes.model.d.ts +24 -0
- package/dist/store/control/outcomes/outcomes.model.js +144 -0
- package/dist/store/control/reads/index.d.ts +1 -0
- package/dist/store/control/reads/index.js +2 -0
- package/dist/store/control/reads/reads.model.d.ts +54 -0
- package/dist/store/control/reads/reads.model.js +144 -0
- package/dist/store/control/transformers.d.ts +4 -4
- package/dist/store/control/transformers.js +16 -15
- package/dist/store/control/types.d.ts +176 -1310
- package/dist/store/control/types.js +1 -237
- package/dist/store/index.d.ts +2 -0
- package/dist/store/index.js +2 -0
- package/dist/store/schema.js +5 -11
- package/dist/store/schema.sql +103 -107
- package/dist/store/sessions/constants.d.ts +2 -0
- package/dist/store/sessions/constants.js +41 -0
- package/dist/store/sessions/index.d.ts +1 -2
- package/dist/store/sessions/index.js +0 -2
- package/dist/store/sessions/sessions.model.d.ts +19 -13
- package/dist/store/sessions/sessions.model.js +36 -118
- package/dist/store/sessions/types.d.ts +34 -69
- package/dist/store/sessions/types.js +1 -37
- package/dist/store/snapshot.d.ts +15 -9
- package/dist/store/snapshot.js +38 -30
- package/dist/store/store.d.ts +4 -3
- package/dist/store/store.js +56 -122
- package/dist/store/store.worker.js +57 -161
- package/dist/store/types.d.ts +65 -3161
- package/dist/store/types.js +1 -149
- package/dist/store/utilities.d.ts +18 -0
- package/dist/store/utilities.js +31 -0
- package/docs/recovery.md +6 -6
- package/errors/README.md +16 -32
- package/package.json +7 -7
- package/dist/accounts/accounts.d.ts +0 -21
- package/dist/accounts/accounts.js +0 -37
- package/dist/accounts/index.d.ts +0 -1
- package/dist/accounts/index.js +0 -2
- package/dist/contracts/accounts/index.d.ts +0 -4
- package/dist/contracts/accounts/index.js +0 -3
- package/dist/contracts/accounts/types.d.ts +0 -66
- package/dist/contracts/accounts/types.js +0 -57
- package/dist/contracts/extensions/index.d.ts +0 -4
- package/dist/contracts/extensions/index.js +0 -3
- package/dist/contracts/extensions/types.d.ts +0 -150
- package/dist/contracts/extensions/types.js +0 -93
- package/dist/extensions/extensions.d.ts +0 -25
- package/dist/extensions/extensions.js +0 -176
- package/dist/extensions/index.d.ts +0 -1
- package/dist/extensions/index.js +0 -2
- package/dist/locks/constants.d.ts +0 -6
- package/dist/locks/constants.js +0 -11
- package/dist/locks/index.d.ts +0 -4
- package/dist/locks/index.js +0 -6
- package/dist/locks/locks.d.ts +0 -102
- package/dist/locks/locks.js +0 -418
- package/dist/locks/types.d.ts +0 -31
- package/dist/locks/types.js +0 -19
- package/dist/providers/claude/accounts/accounts.d.ts +0 -6
- package/dist/providers/claude/accounts/accounts.js +0 -41
- package/dist/providers/claude/accounts/index.d.ts +0 -1
- package/dist/providers/claude/accounts/index.js +0 -2
- package/dist/providers/claude/authentication/authentication.d.ts +0 -23
- package/dist/providers/claude/authentication/authentication.js +0 -67
- package/dist/providers/claude/authentication/index.d.ts +0 -1
- package/dist/providers/claude/authentication/index.js +0 -2
- package/dist/providers/claude/extensions/extensions.d.ts +0 -18
- package/dist/providers/claude/extensions/extensions.js +0 -168
- package/dist/providers/claude/extensions/index.d.ts +0 -1
- package/dist/providers/claude/extensions/index.js +0 -2
- package/dist/providers/codex/accounts/accounts.d.ts +0 -10
- package/dist/providers/codex/accounts/accounts.js +0 -48
- package/dist/providers/codex/accounts/index.d.ts +0 -1
- package/dist/providers/codex/accounts/index.js +0 -2
- package/dist/providers/codex/authentication/authentication.d.ts +0 -37
- package/dist/providers/codex/authentication/authentication.js +0 -242
- package/dist/providers/codex/authentication/index.d.ts +0 -1
- package/dist/providers/codex/authentication/index.js +0 -2
- package/dist/providers/codex/extensions/extensions.d.ts +0 -14
- package/dist/providers/codex/extensions/extensions.js +0 -213
- package/dist/providers/codex/extensions/index.d.ts +0 -1
- package/dist/providers/codex/extensions/index.js +0 -2
- package/dist/providers/extensions/index.d.ts +0 -2
- package/dist/providers/extensions/index.js +0 -2
- package/dist/providers/extensions/types.d.ts +0 -66
- package/dist/providers/extensions/types.js +0 -16
- package/dist/providers/registry/constants.d.ts +0 -1
- package/dist/providers/registry/constants.js +0 -2
- package/dist/providers/registry/validations.d.ts +0 -30
- package/dist/providers/registry/validations.js +0 -150
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 12.0.0
|
|
4
|
+
|
|
5
|
+
To upgrade from 11.x:
|
|
6
|
+
|
|
7
|
+
- Start from a fresh state root. Startup refuses an 11.x database, and restore, packing and unpacking refuse an 11.x snapshot, with `JG_AGENT_HQ_STORAGE_INVALID`; jg-agent-hq never migrates storage.
|
|
8
|
+
- List sessions with `threads`, which now takes `workspaceRoots` and replaces `sessions`, `unstarted-threads` and the one-folder `threads` request.
|
|
9
|
+
- Capture with the runtime's `createSnapshot(destination)` instead of `createHqSnapshot`, and take locks of your own with [jg-locks](https://jg-packages.jesusgraterol.dev/packages/jg-locks/) instead of the removed lock exports.
|
|
10
|
+
- Run clients and the runtime on the same major version: the IPC envelope changed, and 11.x cursors are refused. Remove uses of the other exports, reads, actions and fields listed under Removed.
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
|
|
14
|
+
- Third-party providers: the `providerFactories` option and the adapter types `IAgentProvider`, `IAgentProviderFactory`, `IAgentProviderContext`, `IAgentProviderEvents`, `IAgentProviderOutcome`, `INativePrompt`, `IProviderCall`, `IProviderThread`, `IProviderInspection`, `IProviderReattachment`, `IResyncLoss`, `IProviderSkills`, `IProviderMcpServerPage`, `IProviderMcpTools`, `IProviderMcpResources` and `IProviderInputFile`. A provider ID is now exactly `claude` or `codex`, `ProviderIdSchema` is an enum and `MAX_PROVIDERS` is gone. The provider registry no longer parses the built-in adapters' output or streamed events a second time.
|
|
15
|
+
- Accounts: the `account` and `login` reads, the `account-login`, `account-login-cancel` and `account-logout` actions, the `account` CLI command, the capabilities `account`, `accountLogin`, `accountLoginCancel` and `accountLogout`, and the contracts `AccountRequestSchema`, `AccountObservationSchema`, `AccountControlCommandSchema`, `LoginRequestSchema`, `LoginObservationSchema` and `NativeControlResultSchema`.
|
|
16
|
+
- Extensions: the `mcp-servers`, `mcp-tools` and `mcp-resources` reads and CLI commands, the `mcp-reload`, `mcp-reconnect`, `mcp-set-enabled`, `mcp-login`, `plugins-reload` and `skills-reload` actions, the capabilities `mcpServers`, `mcpTools`, `mcpResources`, `mcpReload`, `mcpReconnect`, `mcpSetEnabled`, `mcpLogin`, `pluginsReload` and `skillsReload`, and the contracts `ExtensionControlCommandSchema`, `McpRequestSchema`, `McpServerSchema`, `McpToolSchema`, `McpResourceSchema`, `McpServerPageSchema`, `McpToolPageSchema`, `McpResourcePageSchema`, `MAX_MCP_ITEMS` and `MAX_MCP_CATALOG_BYTES`. Native MCP elicitation replies remain.
|
|
17
|
+
- Thread controls: the `thread-fork`, `thread-compact`, `thread-revert`, `thread-archive` and `thread-unarchive` actions, the capabilities `fork`, `compact`, `revert`, `archive` and `unarchive`, and the managed thread fields `forkedFromThreadId` and `isArchived`.
|
|
18
|
+
- Reads: `events` with `LifecycleEventSchema`, `provider-actions`, `turns` with `TurnSummarySchema`, `managed-thread-name`, `skill-preview` with `SkillPreviewSchema`, `sessions` with `SessionDiscoveryRequestSchema`, and `unstarted-threads` with `UnstartedThreadsSchema` and `IUnstartedThreads`. The CLI drops the `turns`, `sessions`, `unstarted-threads`, `managed-thread-name` and `skill-preview` commands and the `--name`, `--server-name`, `--skill-id` and `--arguments` flags. A skill input still resolves its exact invocation before it is sent.
|
|
19
|
+
- The one-folder `threads` request: its `provider` and `workspaceRoot` fields, the result's `source` field and the CLI's `codex` default. `threads` is now the discovery read described under Changed.
|
|
20
|
+
- `inspectHqSnapshot` and `createHqSnapshot(hq, destination)`. Capture is the runtime's `createSnapshot(destination)` method, and capture, `packHqSnapshot`, `unpackHqSnapshot` and `restoreHqSnapshot` still inspect the complete snapshot.
|
|
21
|
+
- The state-root lock exports `acquireHqLock`, `withHqLock`, `readHqLockState`, `releaseHqLock`, `getOwnerLiveness`, `RUNTIME_DIRECTORY`, `HQ_LOCK_FILE`, `IHqLockOwner`, `IOwnerLiveness`, `IHqLockOptions` and `IHqLockState`, with the `hq.lock` file they kept in the state root's `.runtime` folder and the runtime owner record `hq-owner.json`. The runtime's own locks are described under Changed.
|
|
22
|
+
- The error codes `JG_AGENT_HQ_LOCK_INVALID_ARGUMENTS`, `JG_AGENT_HQ_LOCK_UNSUPPORTED_PLATFORM`, `JG_AGENT_HQ_LOCK_FILE_INVALID`, `JG_AGENT_HQ_LOCK_FILE_PERMISSIONS`, `JG_AGENT_HQ_LOCK_OWNER_OVERSIZED`, `JG_AGENT_HQ_LOCK_OWNER_UNREADABLE`, `JG_AGENT_HQ_LOCK_OWNER_INCOMPLETE`, `JG_AGENT_HQ_LOCK_OWNER_INACTIVE`, `JG_AGENT_HQ_LOCK_OWNER_UNVERIFIABLE`, `JG_AGENT_HQ_LOCK_TIMEOUT`, `JG_AGENT_HQ_LOCK_OWNERSHIP_CHANGED`, `JG_AGENT_HQ_LOCK_NOT_HELD`, `JG_AGENT_HQ_LOCK_NONCE_MISMATCH`, `JG_AGENT_HQ_RUNTIME_DIRECTORY_INVALID` and `JG_AGENT_HQ_RUNTIME_DIRECTORY_PERMISSIONS`. A state root that can't be created as a private directory now fails with `JG_AGENT_HQ_STATE_DIRECTORY_UNSAFE`.
|
|
23
|
+
- The provider-wide admission fence, which held new execution while an account change or a Codex MCP reload was pending, and the receipt field `controlState`.
|
|
24
|
+
- The receipt and action summary field `nativeRequestId`. `phase` names the native step an action takes; the request ID the runtime sends the native CLI stays internal.
|
|
25
|
+
- The IPC envelope's `schemaVersion`: requests carry `id`, `runtimeEpoch` and `command`, and responses `id`, `success` and their `response` or `error`. The CLI's JSON output keeps its `schemaVersion: 1`.
|
|
26
|
+
- The `version` field of cursors. Cursors stay opaque, and every cursor an earlier version issued is refused with `JG_AGENT_HQ_CURSOR_INVALID`.
|
|
27
|
+
- Storage: the 11.x columns `hq_thread.fork_source_thread_id` and `hq_thread.is_archived`, `hq_action.control_state`, and the `hq_event` columns `thread_id`, `action_id`, `native_turn_id`, `native_item_id`, `kind` and `created_at`, which kept the lifecycle replay, and the indexes `hq_idx_a__provider_created_at_id_desc`, `hq_idx_a__provider_epoch_pending_control`, `hq_idx_e__thread_id_sequence` and `hq_idx_ce__workspace_native_turn_start_current`. The event table keeps only what recognizes a repeated native observation.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- `threads` is the discovery read: `{ kind: 'threads', workspaceRoots, providers?, search?, excludeContinued?, limit?, cursor? }` lists 1 to 64 folders' sessions of both providers, or the ones `providers` names, with the managed sessions the runtime created that no turn has started, by last activity, then provider, then native ID, each descending. A page returns `{ data, nextCursor, unavailable }`: `search` and `excludeContinued`, which leaves out sessions whose `continuedIn` names another, apply before the page is counted, `nextCursor` is null once no session is left, and a folder and provider that can't be read are left out of the page and named in `unavailable` instead of failing it. The cursor carries each source's native continuation, so a deep page re-reads at most one native page of each source instead of every page before it. The CLI's `threads` takes repeated `--workspace-root` and `--provider`, `--search`, `--exclude-continued`, `--limit` and `--cursor`, and lists both providers unless `--provider` names one. See [session discovery](api/README.md#session-discovery).
|
|
32
|
+
- `thread` returns the summary of a session whose history its provider can't read, with `historyState: 'unavailable'`, instead of failing: from a Claude transcript with unsupported records, or else from the runtime's managed record or `active-sessions` entry for the session in that folder. A session the runtime doesn't know still fails as its provider did. Adopting or resuming a Claude session whose transcript has unsupported records now conflicts with `JG_AGENT_HQ_ACTION_CONFLICT` instead of failing with `JG_AGENT_HQ_CLAUDE_HISTORY_UNAVAILABLE`.
|
|
33
|
+
- The runtime connects both CLIs as it starts, in the background: it connects to Codex's daemon, which starts observing its sessions, and brings Claude's history index up to date for the allowed roots and the folders it already holds. A missing CLI no longer waits for its first request to report `unavailable`, and `status` reports a Claude read process that is still starting as `idle` instead of `unavailable`.
|
|
34
|
+
- The runtime takes its locks through jg-locks under `<stateRoot>/.runtime/locks`: it holds the `runtime` lock for its lifetime, whose owner nonce is the runtime epoch, and capture holds the `snapshot` lock. A runtime that stopped without releasing the state root is taken over with jg-locks' `recoverFrom` only when its process is gone and the host's `isPreviousRuntimeStopped` resolves true, which now receives the `runtime` lock owner's process ID and start time; a `snapshot` lock the same process left is recovered with it. Any other dead holder stays until it is recovered with jg-locks. `createAgentHq` passes jg-locks' and jg-fs' errors for an unusable locks folder through unchanged, as the error reference lists them.
|
|
35
|
+
- Live items stay in the runtime's memory: an item's start or finish no longer goes to the store worker, writes an event row or counts toward a provider's lifecycle queue of 128. The event table keeps only the current runtime's lifecycle observations, by which a repeated one is recognized, and startup deletes the rows earlier runtimes left.
|
|
36
|
+
- Admitting a `steer` checks the provider's operation support against its fixed support instead of asking the native CLI, which listed models and, for Claude, started its read process. The `capabilities` read still asks the CLI for the model catalog and a Claude session's skills.
|
|
37
|
+
- One store worker call indexes at most 8 MiB of new Claude transcript bytes, down from 64 MiB, so it stays well under a second at the slowest measured indexing rate; `docs/architecture.md` records the measurement. A call's first record is still read whole, up to 32 MiB, and a history read continues across calls as before.
|
|
38
|
+
- `active-sessions` reads nothing from Codex. An observed Codex session's record keeps the workspace, name and creation time the runtime's first read of it found, and its summary comes from that record: `updatedAt` is its state's change time, `nativeState` is `unknown` and its `nativeLineage` fields are null, and a rename in another client doesn't show.
|
|
39
|
+
- The runtime's tables, indexes, unique indexes and named constraints use the `agent_hq_` prefix instead of `hq_`, such as `agent_hq_action`, `agent_hq_idx_a__native_turn_id` and the stamp table `agent_hq_schema`, and `IStorageDescriptor.reservedPrefix` is `agent_hq_`: a host keeps its own tables outside that prefix.
|
|
40
|
+
- Storage tables: `agent_hq_action` records an action's native step in a `phase` column, checked against the action phases, instead of a suffix of its `native_request_id` column, which is gone with its unique index, and keeps a create's first input as its `queued_input`; an action's ID, its primary key, keeps each native request unique. `agent_hq_browser_action` keeps a receipt's state, runtime epoch, kind, native action ID and timestamps in columns instead of a JSON `receipt` column, with a unique native action ID; browser receipts are unchanged. `agent_hq_session_transition` gains `workspace_root`, and `agent_hq_observed_session` gains `workspace_root`, `name` and `created_at`. The index `hq_idx_t__runtime_epoch_ownership` becomes `agent_hq_idx_t__runtime_epoch_ownership_bound`, a partial index of the threads a runtime binds, which the managed half of `active-sessions` and the startup quarantine use instead of scanning `agent_hq_thread`.
|
|
41
|
+
- The schema stamp changes with these tables. Startup refuses 11.x storage, whose stamp is in `hq_schema`, with `JG_AGENT_HQ_STORAGE_INVALID` as missing an `agent_hq_schema` stamp; a stamp from 12.0.0 on records the version that wrote it, which the error then names. jg-agent-hq never migrates storage.
|
|
42
|
+
- The refusals sent to Claude name the library: a control request the runtime can't present is answered with `jg-agent-hq couldn't present this request`, and a permission it can't answer is denied with `jg-agent-hq cannot answer this request`.
|
|
43
|
+
- Dependencies use caret ranges, so a consumer's package manager can share one copy of each: `jg-crypto` `^0.3.0`, `jg-exception` `^1.7.1`, `jg-fs` `^1.7.0`, `jg-locks` `^1.0.0`, `jg-utilities` `^1.8.0` and `zod` `^4.6.7`.
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- Receipts and action summaries carry `phase`, the native step the action takes now: `create`, `resume`, `name`, `turn`, `steer`, `interrupt`, `clean`, `close`, `delete` or `reply`, or null for an action that sends nothing native. `ACTION_PHASES` and `IActionPhase` in `jg-agent-hq/contracts` list them.
|
|
48
|
+
- `thread-create` takes an optional `input`, the session's first message, which the same action sends in its `turn` phase once the session is named; `thread-close` takes `interrupt: true`, which interrupts a running turn and closes once it ends, in one action.
|
|
49
|
+
- `thread-delete`, `{ provider, workspaceRoot, nativeId }`, deletes a session no process runs from its CLI's storage, through Codex's daemon or Claude's project directory, with the runtime's records of it, closing a session the runtime runs first, within its request. It refuses a session a process may run with `JG_AGENT_HQ_REQUEST_INVALID`, a folder outside the allowed roots with `JG_AGENT_HQ_TARGET_FORBIDDEN`, and reports a deletion that fails with `JG_AGENT_HQ_PROVIDER_FAILED`. See [thread deletion](api/README.md#thread-deletion).
|
|
50
|
+
- Long-polls: `session-states` and `live-items` take `waitMs`, at most 30,000, and wait for the next transition after `afterSequence`, or the window's next change after `afterRevision`, instead of answering with none; when the time passes they answer with an empty page, or `unchanged`. The runtime's own changes wake them, never a timer, at most 32 wait at once, another conflicting with `JG_AGENT_HQ_ACTION_CONFLICT`, and closing the runtime ends them with `JG_AGENT_HQ_RUNTIME_NOT_RUNNING`. The CLI's `session-states` takes `--wait-ms`. See [long-polls](api/README.md#long-polls).
|
|
51
|
+
- Each session transition carries `workspaceRoot`, the session's folder as the runtime knew it then, or null.
|
|
52
|
+
- `live-items` and `actions` take `textLimit`, from 1 to 65,536, which cuts item text and queued text as `items` cuts history; each action on an `actions` page carries `queuedText`, the text of its undelivered queued input, or null.
|
|
53
|
+
- `request` and `requestAgentHq` resolve to the response of their command's kind, `IHqResponseOf<kind>` in `jg-agent-hq/contracts`, without a cast.
|
|
54
|
+
- `getErrorKind(error)`; `openHostDatabase(storage)`, which opens a host connection with the required settings and refuses its writes to the runtime's tables; and the runtime's `runtimeEpoch` property and `createSnapshot(destination)` method.
|
|
55
|
+
- `ThreadsPageSchema`, `IThreadsPage`, `MAX_WORKSPACE_ROOTS` (64), `MAX_ACTION_BYTES` (32,768) and `MAX_WAIT_MS` (30,000) in `jg-agent-hq/contracts`.
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
|
|
59
|
+
- A first page of a Claude folder could continue a directory scan an earlier read had left open and miss the transcripts created since, which the start-time indexing made likely; a scan now starts over once the folder's transcripts were added or removed since it opened.
|
|
60
|
+
- Closing the runtime no longer waits, up to its 30-second deadline, for Claude's session-less read process to answer an initialization it never answers: closing stops it at once.
|
|
61
|
+
- A turn that streamed more than 128 live items faster than they were stored could overflow its provider's lifecycle queue, making that provider's sessions uncertain. Items no longer enter the queue.
|
|
62
|
+
- A Claude history read of a large transcript of short messages could hold the store worker for several seconds in one call, near the 5-second store request deadline. Each call now indexes one budgeted piece.
|
|
63
|
+
- An indexing batch that ended between a hidden Claude record and the parent written after it indexed the hidden record as a turn of its own, which split the records that follow it into another turn. Such a batch now leaves the hidden record to the next batch.
|
|
64
|
+
- Action admission records only a coded failure of a known kind as a failed action. Any other error during admission, such as a SQLite failure, rolls the admission back without recording the action and propagates as `JG_AGENT_HQ_STORE_FAILED`, its message carrying the cause, instead of recording an `operation-failed` action.
|
|
65
|
+
|
|
3
66
|
## 11.1.1
|
|
4
67
|
|
|
5
68
|
- Report the argument hint of every listed Codex skill whose `SKILL.md` declares a single-line `argument-hint`, whatever form its other frontmatter fields take. 11.1.0 read a listed skill's hint only when its `name` and `description` were single lines too, so a skill whose description is a YAML block, such as `description: >-`, showed no hint. A skill in the operator's extra roots still needs single-line `name` and `description` fields, which are its identity there.
|
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
A TypeScript library and local controller for applications that run coding agents. Create native Claude Code and Codex sessions, send work, handle permissions and follow results through one API.
|
|
4
4
|
|
|
5
|
-
Use it to build an agent dashboard, editor integration or automated development workflow.
|
|
5
|
+
Use it to build an agent dashboard, editor integration or automated development workflow. jg-agent-hq owns local session control. Your application owns its interface, authentication and off-machine backups. Native CLIs supply the coding harnesses, tools, skills and sign-in.
|
|
6
6
|
|
|
7
|
-
Requires Node.js 24.15.0 or later on Linux or macOS.
|
|
7
|
+
Requires Node.js 24.15.0 or later on Linux or macOS. State safety relies on POSIX ownership and private directories. Windows is outside the supported host contract.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -17,7 +17,7 @@ npx jg-agent-hq serve --state-root .runtime --workspace-root .
|
|
|
17
17
|
|
|
18
18
|
Install Claude Code and/or Codex separately and sign in through their native CLIs. Run the controller in your trusted workspace. The CLI examples below assume the installed executable is on PATH; prefix them with `npx` for a local npm installation.
|
|
19
19
|
|
|
20
|
-
This public package provides a local controller and browser-safe contracts. Applications own their UI, authentication and deployment. It does not include a hosted app or a
|
|
20
|
+
This public package provides a local controller and browser-safe contracts. Applications own their UI, authentication and deployment. It does not include a hosted app or a user interface.
|
|
21
21
|
|
|
22
22
|
## Development
|
|
23
23
|
|
|
@@ -37,11 +37,9 @@ Testing maintenance can reuse an existing version when only these six aggregate
|
|
|
37
37
|
|
|
38
38
|
## Lock ownership
|
|
39
39
|
|
|
40
|
-
Callers supply a trusted state root.
|
|
40
|
+
Callers supply a trusted state root. The runtime takes its locks through [jg-locks](https://jg-packages.jesusgraterol.dev/packages/jg-locks/) in the root's private `.runtime/locks` folder: `runtime` for the runtime's lifetime, whose owner nonce is the runtime epoch, and `snapshot` while a capture runs. A live holder of `runtime` refuses another startup, and capture waits up to 120 seconds for a live `snapshot` holder. A holder whose process is gone is never taken over automatically, because its child processes may remain alive. The one exception is a runtime that stopped without releasing the state root: when the host's `isPreviousRuntimeStopped` check proves no process of that runtime remains, the next runtime takes its `runtime` lock over with jg-locks' `recoverFrom`, together with a `snapshot` lock it left and its leftover socket. Recover any other dead holder with jg-locks after inspecting it. The locks coordinate cooperating processes and do not isolate hostile code running as the same OS user.
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Machine-wide locks are separate. The `locks` read and `jg-agent-hq locks` list the named locks that scripts, agents and apps on the machine take through [jg-locks](https://jg-packages.jesusgraterol.dev/packages/jg-locks/), each with its holder, so an application on HQ can show them. HQ only reads them; it never takes, waits for or recovers one. See [machine locks](api/README.md#machine-locks).
|
|
42
|
+
Machine-wide locks are separate. The `locks` read and `jg-agent-hq locks` list the named locks that scripts, agents and apps on the machine take through [jg-locks](https://jg-packages.jesusgraterol.dev/packages/jg-locks/), each with its holder, so an application built on jg-agent-hq can show them. The runtime only reads them; it never takes, waits for or recovers one. See [machine locks](api/README.md#machine-locks).
|
|
45
43
|
|
|
46
44
|
See the [API reference](api/README.md) and [error contracts](errors/README.md).
|
|
47
45
|
|
|
@@ -49,45 +47,41 @@ Intentional failures use `Exception` from `jg-exception`, with the named string
|
|
|
49
47
|
|
|
50
48
|
## Local controller
|
|
51
49
|
|
|
52
|
-
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
|
|
53
|
-
|
|
54
|
-
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.
|
|
55
|
-
|
|
56
|
-
The controller owns its SQLite worker and native connections independently of client connections. Its provider registry starts each native integration only when selected. Storage and managed-session reads work without an installed coding CLI; an unavailable provider does not disable another provider. Private state contains the lifetime owner, Unix socket and SQLite discovery metadata. Conversation histories remain in native storage; HQ retains complete bounded final results on their action receipts. Browsing never resumes an external session or starts inference. Quota windows come from native account observations, with explicit stale and unavailable states. Usage reads include Codex credit balances and available earned-reset counts when reported, plus Claude five-hour and seven-day meters with their model/surface scopes and reset times.
|
|
50
|
+
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` lists the sessions of several folders and both providers by last activity, with the sessions the runtime created before their first turn, in pages whose cursor resumes each source where it stopped; see [session discovery](api/README.md#session-discovery). `thread`, `items` and `usage` read native information, and each item carries its time as `createdAt`; `thread` answers from the runtime's records, its history unavailable, when its provider can't read it. `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.
|
|
57
51
|
|
|
58
|
-
|
|
52
|
+
The Node API exposes `createAgentHq({ stateRoot, allowedRoots })` and `requestAgentHq(stateRoot, command)`, whose results, like the runtime's `request`, are typed by their command's kind, and `getErrorKind(error)`, which reads an error's safe classification. The runtime's `runtimeEpoch` is the epoch actions name. Configuration comes from these trusted operator inputs. Coding-instruction files are not runtime configuration.
|
|
59
53
|
|
|
60
|
-
|
|
54
|
+
The controller owns its SQLite worker and native connections independently of client connections. As it starts, it connects to Codex and brings Claude's history index up to date in the background, without waiting for either or failing when a CLI is missing, which status then reports unavailable. Storage and managed-session reads work without an installed coding CLI; an unavailable provider does not disable another provider. Private state contains the runtime's locks, Unix socket and SQLite discovery metadata. Conversation histories remain in native storage; the runtime retains complete bounded final results on their action receipts. Browsing never resumes an external session or starts inference. Quota windows come from native account observations, with explicit stale and unavailable states. Usage reads include Codex credit balances and available earned-reset counts when reported, plus Claude five-hour and seven-day meters with their model/surface scopes and reset times.
|
|
61
55
|
|
|
62
|
-
|
|
56
|
+
Use `session-evidence` for newest-first historical evidence. It fits within 65,536 serialized bytes, retains exact native identities and content hashes, and continues large bodies in UTF-8 chunks. Select an item, turn or item kinds with filters. Provenance distinguishes native evidence from exact host submissions; historical text and quoted feedback never grant approval. See [bounded session evidence](api/README.md#bounded-session-evidence).
|
|
63
57
|
|
|
64
|
-
|
|
58
|
+
Trusted Node hosts can open the database described by `hq.storage` with `openHostDatabase(hq.storage)`, which applies the required connection settings, and keep application tables under their own prefix; the connection can't change the runtime's tables. jg-agent-hq reserves `agent_hq_`, validates its current schema stamp on startup, and leaves application schema ownership and `user_version` with the host. Use `hq.withStorageMaintenance(callback)` for host schema changes; it drains admitted work and rejects active native execution before the callback. The stamp records the package version that wrote the database, and startup refuses any other schema with an error naming that version; jg-agent-hq never migrates storage. See the [shared storage contract](api/README.md#shared-storage).
|
|
65
59
|
|
|
66
|
-
|
|
60
|
+
`hq.createSnapshot(destination)` captures local state through SQLite's backup API while agents keep working, including host tables and action.key, under the state root's `snapshot` lock; the host keeps its own connections from writing host tables until it resolves. It leaves out the index of Claude transcripts, which a restored runtime rebuilds from the transcripts on its first Claude history read, as a fresh one does. `restoreHqSnapshot({ snapshotDirectory, destination })` verifies the complete snapshot and stages it into a new private recovery workspace. `packHqSnapshot(snapshotDirectory, archivePath, key)` encrypts a snapshot into one AES-256-GCM file for off-machine copies, and `unpackHqSnapshot(archivePath, destination, key)` verifies and writes it back as a snapshot directory. Snapshots from another schema are refused by the package version that wrote them. Restored native ownership needs reconciliation and allowed roots must be selected explicitly. Hosts own the key and remote backups; a failed disk can lose changes since the last successful off-machine backup. See [snapshot and restore](api/README.md#snapshot-and-restore) and [recovery](docs/recovery.md).
|
|
67
61
|
|
|
68
|
-
|
|
62
|
+
Sessions started in a terminal show up too. Codex sessions on the shared daemon and Claude sessions from `claude agents --json` report a live state (`running`, `waiting`, `idle`, `closed`, `failed` or `unknown`) with external ownership. jg-agent-hq builds on what each CLI offers and never stops, wakes or drives a session a terminal runs: it adopts a Codex session the terminal holds between turns, through the shared daemon, and a Claude session only once no terminal runs it, while a Claude session's `terminal` field names the terminal that does. Every state change of a managed or observed session is recorded in order, with the session's folder; read them with `{ kind: 'session-states', afterSequence }` or `session-states`, and add `waitMs` to wait up to 30 seconds for the next one. `live-items` waits the same way for a window's next change, and cuts its text to `textLimit`; both long-polls are woken by the runtime's own changes, never a timer. `active-sessions` lists every running and waiting session with its workspace, and `observation-pace` polls Claude every 5 seconds instead of 30 while a client follows sessions live. See [session states](api/README.md#session-states).
|
|
69
63
|
|
|
70
|
-
|
|
64
|
+
The providers are `codex` and `claude`. Capabilities report current operation support, provider/session scope and unavailable reasons. Native version labels are diagnostic metadata and never determine admission. Unknown essential control data fails explicitly. `jg-agent-hq/contracts` contains browser-safe schemas and types; importing it does not import the host runtime.
|
|
71
65
|
|
|
72
|
-
|
|
66
|
+
Use `--provider claude` for Claude history and usage; the default is `codex`, while `threads` lists both unless `--provider` names one. Claude connects as the runtime starts through its native structured CLI, with normal settings enabled and no user prompt. History reads need that process only for the runtime's first check of the CLI, and a usage result answers reads for 60 seconds. Usage requests explicitly disable the optional transcript-behavior scan. Its local history reader validates required identity, workspace and chain fields, tolerates additive fields and mixed version labels, keeps byte locations rather than conversation bodies in SQLite, and writes nothing for a transcript that hasn't changed. History, live items and evidence present items as the CLI shows them, with `notice` items, tool calls paired with their results, and each file change's files; unknown ordered content is presented as unsupported, and untrustworthy identity or ordering makes the affected read unavailable. File history cannot establish current execution state. See the [reader limits and freshness contract](api/README.md#claude-history).
|
|
73
67
|
|
|
74
|
-
|
|
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.
|
|
75
69
|
|
|
76
70
|
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).
|
|
77
71
|
|
|
78
|
-
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.
|
|
72
|
+
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.
|
|
79
73
|
|
|
80
74
|
Approval reads return indexed, cursor-paginated pending, answered and expired metadata after reconnect or restart. Sensitive presentation is available only while the exact native request is live. Native permissions require explicit responses; unknown request kinds or scopes are denied. See [native replies and reconnect reads](api/README.md#thread-control-and-live-input).
|
|
81
75
|
|
|
82
76
|
Durable state includes `action.key`, which must stay private and accompany its SQLite database. Queued undelivered inputs and complete bounded final results are saved; ordinary input bodies and question answers are not.
|
|
83
77
|
|
|
84
|
-
Text and skill inputs can attach up to 8 workspace files by path and media type, 16 MiB in all and 256 KiB per text file.
|
|
78
|
+
Text and skill inputs can attach up to 8 workspace files by path and media type, 16 MiB in all and 256 KiB per text file. The runtime verifies their content hashes again before queued delivery. Output schemas use native Codex turn parameters or Claude's structured-session flag; complete validated results and known token usage remain available on selected receipts after reconnect. Live previews stay bounded and explicitly mark truncation. See [file inputs and complete results](api/README.md#file-inputs-and-complete-results).
|
|
85
79
|
|
|
86
|
-
Use `suggest-thread-name --topic "Build usage" --state-root <directory>` for an editable label
|
|
80
|
+
Use `suggest-thread-name --topic "Build usage" --state-root <directory>` for an editable label. Creation adds a short ordinal suffix when a name is occupied. Actions and relationships retain immutable IDs.
|
|
87
81
|
|
|
88
|
-
Use `skills --workspace-root <directory> --state-root <directory>` to browse the native skill catalog a session started in that folder would have, with `--provider` (default `codex`), and add `--thread-id <id>` for a controlled session's own catalog.
|
|
82
|
+
Use `skills --workspace-root <directory> --state-root <directory>` to browse the native skill catalog a session started in that folder would have, with `--provider` (default `codex`), and add `--thread-id <id>` for a controlled session's own catalog. A skill input resolves its exact invocation from that catalog before it is sent. Missing native metadata is explicitly unavailable. The CLI loads all skill content and retains its permissions and invocation rules.
|
|
89
83
|
|
|
90
|
-
Use `jg-agent-hq request --state-root <directory>` with
|
|
84
|
+
Use `jg-agent-hq request --state-root <directory>` with one closed request command on stdin for action and control reads. The [API reference](api/README.md) describes action envelopes, receipts and reconnect reads.
|
|
91
85
|
|
|
92
86
|
## Source examples
|
|
93
87
|
|
|
@@ -97,7 +91,7 @@ Follow the [complete session walkthrough](https://jg-agent-hq.jesusgraterol.dev/
|
|
|
97
91
|
|
|
98
92
|
These complete TypeScript examples use the public client and contracts. Start the local controller and sign in to the native CLIs first. The host supplies actual user decisions and keeps native permission handling separate. Retain request identities before submission; after an interrupted client call, inspect those receipts instead of rerunning a whole example. Examples are development sources, not package exports or automatic website actions.
|
|
99
93
|
|
|
100
|
-
`examples/shared-storage.ts` uses a trusted Node runtime to save a singleton application preference under the app\_ prefix
|
|
94
|
+
`examples/shared-storage.ts` uses a trusted Node runtime to save a singleton application preference under the app\_ prefix through `openHostDatabase`, capture shared SQLite storage with `createSnapshot`, and verify the value after offline restore. It closes its own SQL connections and preserves the host's user_version. Select absent output directories and pause every other writer first. The application write commits before capture; a later backup failure does not roll it back. The recovered state still requires explicit allowed roots before execution.
|
|
101
95
|
|
|
102
96
|
The [qualification matrix](api/README.md#qualification) records native journeys, host coverage and remaining interface limits.
|
|
103
97
|
|
|
@@ -105,20 +99,20 @@ The [qualification matrix](api/README.md#qualification) records native journeys,
|
|
|
105
99
|
|
|
106
100
|
- `src/index.ts`: the explicit public package boundary.
|
|
107
101
|
- `examples/`: public source helpers for sessions and shared host storage.
|
|
108
|
-
- `src/
|
|
109
|
-
- `src/runtime/`: trusted configuration and lifetime ownership.
|
|
102
|
+
- `src/runtime/`: trusted configuration, lifetime ownership through the state root's jg-locks `runtime` lock and the start-time warm-up of both CLIs.
|
|
110
103
|
- `src/ipc/` and `src/cli/`: private local commands and the installed executable.
|
|
111
|
-
- `src/providers/codex/`: the shared app-server daemon connection, native history and
|
|
112
|
-
- `src/providers/claude/`: native structured control and usage, the identity-validated, worker-owned local history reader, the active-session poll and the background-task counter it reads transcripts with.
|
|
113
|
-
- `src/providers/registry/`: lazy
|
|
104
|
+
- `src/providers/codex/`: the shared app-server daemon connection, native history, usage protocol and session deletion through the daemon.
|
|
105
|
+
- `src/providers/claude/`: native structured control and usage, the identity-validated, worker-owned local history reader and transcript deletion, the active-session poll and the background-task counter it reads transcripts with.
|
|
106
|
+
- `src/providers/registry/`: lazy creation of the built-in adapters, bounded operations and lifecycle, and source isolation.
|
|
114
107
|
- `src/providers/inputs/` and `src/providers/results/`: checked file delivery and complete native result validation.
|
|
115
108
|
- `src/providers/configuration/` and `src/providers/lineage/`: bounded native choices and confirmed immutable session relationships.
|
|
116
|
-
- `src/sessions/`: authorized discovery with live session states, the active-session list, bounded evidence and provenance, cursor-bound history reads and short label suggestions.
|
|
117
|
-
- `src/skills/`: bounded native catalogs
|
|
118
|
-
- `src/
|
|
119
|
-
- `src/
|
|
120
|
-
- `src/
|
|
121
|
-
- `src/
|
|
109
|
+
- `src/sessions/`: authorized discovery that merges folders' and providers' native pages with live session states, the active-session list, bounded evidence and provenance, cursor-bound history reads and short label suggestions.
|
|
110
|
+
- `src/skills/`: bounded native catalogs and explicit input preparation.
|
|
111
|
+
- `src/actions/`: durable action admission, phased native dispatch, ordered native events, rejoining kept sessions, bounded live presentation, and receipt waits and long-polls its own changes wake.
|
|
112
|
+
- `src/store/`: SQLite discovery metadata, observed sessions and state transitions, the action/control ledger and the snapshot's database copy in one worker, whose model methods the main thread calls with one typed `call`; `src/store/control/` splits the ledger into reads, rule-driven admission, native outcomes, native observations and runtime lifecycle.
|
|
113
|
+
- `src/pending/`: the request bookkeeping, deadlines and late-response detection shared by the store worker and native connections.
|
|
114
|
+
- `src/errors/`: the catalog of jg-agent-hq's coded errors and their safe boundary classifications.
|
|
115
|
+
- `src/storage/`: trusted host metadata and connections, exclusive maintenance and the current schema stamp.
|
|
122
116
|
- `src/snapshots/`: capture while agents work, manifest validation and offline recovery that releases native ownership.
|
|
123
117
|
- `src/contracts/`: browser-safe command and response contracts, including the jg-locks lock list.
|
|
124
118
|
- `scripts/package/`: build-output cleanup and packed-consumer checks.
|