jg-agent-hq 0.4.0 → 0.5.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 +9 -0
- package/README.md +2 -2
- package/api/README.md +4 -2
- package/dist/contracts/browser/index.d.ts +2 -1
- package/dist/contracts/browser/index.js +1 -1
- package/dist/contracts/browser/types.d.ts +75 -3
- package/dist/contracts/browser/types.js +43 -2
- package/dist/contracts/index.d.ts +2 -1
- package/dist/contracts/index.js +1 -1
- package/dist/providers/claude/claude.js +2 -2
- package/dist/providers/claude/history/history.model.js +5 -4
- package/dist/providers/claude/types.d.ts +4 -1
- package/dist/providers/claude/types.js +2 -2
- package/dist/store/types.d.ts +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
- Qualify Claude Code 2.1.306 history alongside 2.1.304, including transcripts spanning both versions. Continue to reject unqualified CLI and transcript versions.
|
|
6
|
+
|
|
7
|
+
## 0.5.0
|
|
8
|
+
|
|
9
|
+
- Add safe publication observations for the host's System view, with separate pending, blocked, failed and uncertain states, timestamps and exact commit identity.
|
|
10
|
+
- Bind publication retries to a receipt UUID and nullable expected commit, including failures that happened before a commit existed. The host continues to own scheduling, Git operations and storage.
|
|
11
|
+
|
|
3
12
|
## 0.4.0
|
|
4
13
|
|
|
5
14
|
- Add closed browser host commands and bounded session/repository/plan read contracts, without exposing private handlers through standalone IPC.
|
package/README.md
CHANGED
|
@@ -39,9 +39,9 @@ The Node API exposes `createAgentHq({ stateRoot, allowedRoots })` and `requestAg
|
|
|
39
39
|
|
|
40
40
|
The controller owns its SQLite worker and native connections independently of client connections. Private state contains the lifetime owner, Unix socket and SQLite discovery metadata. Conversation bodies remain in the native providers' storage. Browsing never resumes an external session or starts inference. Quota windows come from native account observations, with explicit stale and unavailable states.
|
|
41
41
|
|
|
42
|
-
The current read contracts were exercised against Codex 0.163.0 and Claude Code 2.1.304 on Linux. Unsupported native responses fail explicitly. `jg-agent-hq/contracts` contains browser-safe schemas and types; importing it does not import the host runtime.
|
|
42
|
+
The current read contracts were exercised against Codex 0.163.0 and Claude Code versions 2.1.304 and 2.1.306 on Linux. Unsupported native responses fail explicitly. `jg-agent-hq/contracts` contains browser-safe schemas and types; importing it does not import the host runtime.
|
|
43
43
|
|
|
44
|
-
Use `--provider claude` for Claude history and usage; the default is `codex`. Claude connects lazily through its native structured CLI, with normal settings enabled and no user prompt. Usage requests explicitly disable the optional transcript-behavior scan. Its local history reader
|
|
44
|
+
Use `--provider claude` for Claude history and usage; the default is `codex`. Claude connects lazily through its native structured CLI, with normal settings enabled and no user prompt. Usage requests explicitly disable the optional transcript-behavior scan. Its local history reader accepts only the qualified 2.1.304 and 2.1.306 versions, including transcripts containing both, keeps byte locations rather than conversation bodies in SQLite, and reports unsupported history as unavailable. File history cannot establish current execution state. See the [reader limits and freshness contract](api/README.md#claude-history).
|
|
45
45
|
|
|
46
46
|
Explicit actions create, name, adopt, resume and close threads; send idle messages; steer an exact running turn; queue the next message; interrupt; and answer native questions or permissions. Actions have stable UUIDs and durable receipts. 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. HQ never resends uncertain input.
|
|
47
47
|
|
package/api/README.md
CHANGED
|
@@ -48,7 +48,7 @@ Threads expose native state, `historyState` (`available` or `unavailable`), owne
|
|
|
48
48
|
|
|
49
49
|
Claude connects on its first read through `claude --print --input-format stream-json --output-format stream-json --verbose`. No user prompt, bare mode, permission bypass or SDK dependency is used. Runtime status reports this adapter as `idle`, `ready` or `unavailable`, with its observed CLI version. An unavailable native lane requires restarting the host after resolving the native problem.
|
|
50
50
|
|
|
51
|
-
The qualified CLI interface has no session-history listing operation. The Claude-owned reader therefore uses direct UUID JSONL files in the native project's directory beneath `CLAUDE_CONFIG_DIR`, or the normal `.claude` directory.
|
|
51
|
+
The qualified CLI interface has no session-history listing operation. The Claude-owned reader therefore uses direct UUID JSONL files in the native project's directory beneath `CLAUDE_CONFIG_DIR`, or the normal `.claude` directory. The CLI and each versioned transcript record must independently match a qualified version: 2.1.304 or 2.1.306. A transcript may contain both qualified versions. Other formats, encoded project keys longer than 200 characters, directory/file links, malformed records and records larger than 1 MiB report unavailable. Discovery never recurses into subdirectories, including excluded directories. Unsupported discovered sessions have `historyState: unavailable`; they do not prevent supported sessions from being listed.
|
|
52
52
|
|
|
53
53
|
Discovery verifies the workspace recorded inside each transcript before returning its identity or title. A matching native directory name alone is insufficient because punctuation replacement can produce colliding directory keys. Foreign workspaces are omitted. If a file's workspace cannot be established, discovery reports unavailable rather than inventing an empty result.
|
|
54
54
|
|
|
@@ -100,7 +100,7 @@ Prompts expose `replyActionId` as soon as a reply is admitted, so reconnecting c
|
|
|
100
100
|
|
|
101
101
|
### Claude native control
|
|
102
102
|
|
|
103
|
-
Each controlled session has one persistent native `claude` process in the authorized workspace. HQ adds structured input/output, replayed user-message acknowledgements, partial-message output and `--permission-prompt-tool=stdio`. It does not set a model, replace instructions/settings, disable session persistence, bypass permissions or enable a bare mode. Native skills remain available. Control was exercised against CLI 2.1.304. Native idle initialization, session identity and matching acknowledgements establish capability; a changed version label alone does not disable compatible controls. File history retains its separate
|
|
103
|
+
Each controlled session has one persistent native `claude` process in the authorized workspace. HQ adds structured input/output, replayed user-message acknowledgements, partial-message output and `--permission-prompt-tool=stdio`. It does not set a model, replace instructions/settings, disable session persistence, bypass permissions or enable a bare mode. Native skills remain available. Control was exercised against CLI 2.1.304. Native idle initialization, session identity and matching acknowledgements establish capability; a changed version label alone does not disable compatible controls. File history retains its separate qualified-version check.
|
|
104
104
|
|
|
105
105
|
Creation chooses a native UUID without inference, then names that exact session. Resume uses native `--resume` and verifies the session-id fence on the name control before marking the session idle. The operator's handoff confirmation establishes that another CLI controller is closed; file timestamps and file-backed unknown states do not establish this. Independently running CLIs are outside HQ's state-directory coordination boundary.
|
|
106
106
|
|
|
@@ -266,6 +266,8 @@ SQLite records an HMAC digest and receipt before invoking the dispatcher. The sa
|
|
|
266
266
|
|
|
267
267
|
The dispatcher receives a server-owned `nativeActionId`; use this ID for a native child action, preserving the validated runtime and command. `readBrowserAction(id, operatorId)` returns only that operator's receipt and joins its exact native receipt. Host acknowledgement means the handler completed, not that a native turn completed. An unknown or differently owned ID returns null. Receipts retain metadata rather than message bodies or arbitrary handler output. Subsequent domain reads provide the result. At most 32 host jobs are admitted concurrently. Runtime close rejects new host work and waits for admitted work before closing its worker.
|
|
268
268
|
|
|
269
|
+
`PublicationStatusSchema` is a browser-safe observation supplied by the host, independent of native execution and quota states. It contains the receipt UUID, state/reason, due/attempt/success timestamps, nullable pending and published commit hashes, and bounded queued/selected file counts. It contains no artifact bodies, paths, credentials or deployment configuration. `publication-retry` requires `publicationId` and `expectedCommit` (null before a commit exists). The host must compare both against its current receipt before acting and reconcile or retry only its recorded verified commit. The public runtime supplies no Git publisher, service installer or publication storage.
|
|
270
|
+
|
|
269
271
|
Live reads accept `afterRevision`. A matching revision returns `unchanged: true` with an empty data array; retain the displayed window. A changed revision returns the complete bounded window. Revisions belong to one runtime. After reconnect to a new runtime, discard the revision and refresh native history. Token bodies stay in the existing bounded memory window and are never copied into lifecycle or browser-action tables.
|
|
270
272
|
|
|
271
273
|
`thread-plan` accepts a managed `threadId` and returns its nullable `ActionPlanContextSchema`. The host verifies the thread's registered checkout before exposing it. It is read-only and grants no execution authority.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { BrowserCommandSchema, BrowserActionSchema, BrowserReceiptSchema } from './types.js';
|
|
2
2
|
export type { IBrowserAction, IBrowserReceipt } from './types.js';
|
|
3
3
|
export { BrowserRepositorySchema, BrowserPlanSummarySchema, BrowserPlanPageSchema, BrowserPlanDetailSchema, BrowserSessionSchema, } from './types.js';
|
|
4
|
-
export { BrowserRepositoryPageSchema, BrowserSystemSchema, BrowserThreadDetailSchema, } from './types.js';
|
|
4
|
+
export { BrowserRepositoryPageSchema, BrowserSystemSchema, BrowserThreadDetailSchema, PublicationStatusSchema, } from './types.js';
|
|
5
|
+
export type { IPublicationStatus } from './types.js';
|
|
@@ -3,4 +3,4 @@ export { BrowserCommandSchema, BrowserActionSchema, BrowserReceiptSchema } from
|
|
|
3
3
|
// host read models
|
|
4
4
|
export { BrowserRepositorySchema, BrowserPlanSummarySchema, BrowserPlanPageSchema, BrowserPlanDetailSchema, BrowserSessionSchema, } from './types.js';
|
|
5
5
|
// bounded host views
|
|
6
|
-
export { BrowserRepositoryPageSchema, BrowserSystemSchema, BrowserThreadDetailSchema, } from './types.js';
|
|
6
|
+
export { BrowserRepositoryPageSchema, BrowserSystemSchema, BrowserThreadDetailSchema, PublicationStatusSchema, } from './types.js';
|
|
@@ -479,7 +479,8 @@ export declare const BrowserCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
479
479
|
release: z.ZodBoolean;
|
|
480
480
|
}, z.core.$strict>, z.ZodObject<{
|
|
481
481
|
kind: z.ZodLiteral<"publication-retry">;
|
|
482
|
-
|
|
482
|
+
publicationId: z.ZodUUID;
|
|
483
|
+
expectedCommit: z.ZodNullable<z.ZodString>;
|
|
483
484
|
}, z.core.$strict>], "kind">;
|
|
484
485
|
export declare const BrowserActionSchema: z.ZodObject<{
|
|
485
486
|
id: z.ZodUUID;
|
|
@@ -964,7 +965,8 @@ export declare const BrowserActionSchema: z.ZodObject<{
|
|
|
964
965
|
release: z.ZodBoolean;
|
|
965
966
|
}, z.core.$strict>, z.ZodObject<{
|
|
966
967
|
kind: z.ZodLiteral<"publication-retry">;
|
|
967
|
-
|
|
968
|
+
publicationId: z.ZodUUID;
|
|
969
|
+
expectedCommit: z.ZodNullable<z.ZodString>;
|
|
968
970
|
}, z.core.$strict>], "kind">;
|
|
969
971
|
}, z.core.$strict>;
|
|
970
972
|
export type IBrowserAction = z.infer<typeof BrowserActionSchema>;
|
|
@@ -2244,6 +2246,43 @@ export declare const BrowserRepositoryPageSchema: z.ZodObject<{
|
|
|
2244
2246
|
}, z.core.$strip>>;
|
|
2245
2247
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
2246
2248
|
}, z.core.$strip>;
|
|
2249
|
+
export declare const PublicationStatusSchema: z.ZodObject<{
|
|
2250
|
+
id: z.ZodNullable<z.ZodUUID>;
|
|
2251
|
+
state: z.ZodEnum<{
|
|
2252
|
+
pending: "pending";
|
|
2253
|
+
blocked: "blocked";
|
|
2254
|
+
uncertain: "uncertain";
|
|
2255
|
+
failed: "failed";
|
|
2256
|
+
idle: "idle";
|
|
2257
|
+
publishing: "publishing";
|
|
2258
|
+
published: "published";
|
|
2259
|
+
}>;
|
|
2260
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
2261
|
+
owner: "owner";
|
|
2262
|
+
editing: "editing";
|
|
2263
|
+
clean: "clean";
|
|
2264
|
+
enrolled: "enrolled";
|
|
2265
|
+
changed: "changed";
|
|
2266
|
+
git: "git";
|
|
2267
|
+
signing: "signing";
|
|
2268
|
+
verification: "verification";
|
|
2269
|
+
transport: "transport";
|
|
2270
|
+
rejected: "rejected";
|
|
2271
|
+
"remote-changed": "remote-changed";
|
|
2272
|
+
unpublished: "unpublished";
|
|
2273
|
+
staged: "staged";
|
|
2274
|
+
configuration: "configuration";
|
|
2275
|
+
cleanup: "cleanup";
|
|
2276
|
+
}>>;
|
|
2277
|
+
dueAt: z.ZodNumber;
|
|
2278
|
+
attemptedAt: z.ZodNullable<z.ZodNumber>;
|
|
2279
|
+
succeededAt: z.ZodNullable<z.ZodNumber>;
|
|
2280
|
+
commit: z.ZodNullable<z.ZodString>;
|
|
2281
|
+
publishedCommit: z.ZodNullable<z.ZodString>;
|
|
2282
|
+
queuedFiles: z.ZodNumber;
|
|
2283
|
+
selectedFiles: z.ZodNumber;
|
|
2284
|
+
}, z.core.$strip>;
|
|
2285
|
+
export type IPublicationStatus = z.infer<typeof PublicationStatusSchema>;
|
|
2247
2286
|
export declare const BrowserSystemSchema: z.ZodObject<{
|
|
2248
2287
|
runtime: z.ZodObject<{
|
|
2249
2288
|
runtimeEpoch: z.ZodUUID;
|
|
@@ -2272,7 +2311,40 @@ export declare const BrowserSystemSchema: z.ZodObject<{
|
|
|
2272
2311
|
}, z.core.$strip>;
|
|
2273
2312
|
}, z.core.$strip>;
|
|
2274
2313
|
publication: z.ZodObject<{
|
|
2275
|
-
|
|
2314
|
+
id: z.ZodNullable<z.ZodUUID>;
|
|
2315
|
+
state: z.ZodEnum<{
|
|
2316
|
+
pending: "pending";
|
|
2317
|
+
blocked: "blocked";
|
|
2318
|
+
uncertain: "uncertain";
|
|
2319
|
+
failed: "failed";
|
|
2320
|
+
idle: "idle";
|
|
2321
|
+
publishing: "publishing";
|
|
2322
|
+
published: "published";
|
|
2323
|
+
}>;
|
|
2324
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
2325
|
+
owner: "owner";
|
|
2326
|
+
editing: "editing";
|
|
2327
|
+
clean: "clean";
|
|
2328
|
+
enrolled: "enrolled";
|
|
2329
|
+
changed: "changed";
|
|
2330
|
+
git: "git";
|
|
2331
|
+
signing: "signing";
|
|
2332
|
+
verification: "verification";
|
|
2333
|
+
transport: "transport";
|
|
2334
|
+
rejected: "rejected";
|
|
2335
|
+
"remote-changed": "remote-changed";
|
|
2336
|
+
unpublished: "unpublished";
|
|
2337
|
+
staged: "staged";
|
|
2338
|
+
configuration: "configuration";
|
|
2339
|
+
cleanup: "cleanup";
|
|
2340
|
+
}>>;
|
|
2341
|
+
dueAt: z.ZodNumber;
|
|
2342
|
+
attemptedAt: z.ZodNullable<z.ZodNumber>;
|
|
2343
|
+
succeededAt: z.ZodNullable<z.ZodNumber>;
|
|
2344
|
+
commit: z.ZodNullable<z.ZodString>;
|
|
2345
|
+
publishedCommit: z.ZodNullable<z.ZodString>;
|
|
2346
|
+
queuedFiles: z.ZodNumber;
|
|
2347
|
+
selectedFiles: z.ZodNumber;
|
|
2276
2348
|
}, z.core.$strip>;
|
|
2277
2349
|
resources: z.ZodObject<{
|
|
2278
2350
|
state: z.ZodLiteral<"unavailable">;
|
|
@@ -24,7 +24,11 @@ export const BrowserCommandSchema = z.discriminatedUnion('kind', [
|
|
|
24
24
|
}),
|
|
25
25
|
z.strictObject({
|
|
26
26
|
kind: z.literal('publication-retry'),
|
|
27
|
-
|
|
27
|
+
publicationId: z.uuid(),
|
|
28
|
+
expectedCommit: z
|
|
29
|
+
.string()
|
|
30
|
+
.regex(/^[a-f0-9]{40}(?:[a-f0-9]{24})?$/)
|
|
31
|
+
.nullable(),
|
|
28
32
|
}),
|
|
29
33
|
]);
|
|
30
34
|
export const BrowserActionSchema = z
|
|
@@ -91,9 +95,46 @@ export const BrowserRepositoryPageSchema = z.object({
|
|
|
91
95
|
data: z.array(BrowserRepositorySchema).max(128),
|
|
92
96
|
nextCursor: z.string().nullable(),
|
|
93
97
|
});
|
|
98
|
+
// publication state is independent of native execution, account quota and repository resources
|
|
99
|
+
export const PublicationStatusSchema = z.object({
|
|
100
|
+
id: z.uuid().nullable(),
|
|
101
|
+
state: z.enum(['idle', 'pending', 'publishing', 'published', 'blocked', 'failed', 'uncertain']),
|
|
102
|
+
reason: z
|
|
103
|
+
.enum([
|
|
104
|
+
'clean',
|
|
105
|
+
'enrolled',
|
|
106
|
+
'editing',
|
|
107
|
+
'changed',
|
|
108
|
+
'git',
|
|
109
|
+
'signing',
|
|
110
|
+
'verification',
|
|
111
|
+
'transport',
|
|
112
|
+
'rejected',
|
|
113
|
+
'remote-changed',
|
|
114
|
+
'unpublished',
|
|
115
|
+
'staged',
|
|
116
|
+
'configuration',
|
|
117
|
+
'owner',
|
|
118
|
+
'cleanup',
|
|
119
|
+
])
|
|
120
|
+
.nullable(),
|
|
121
|
+
dueAt: z.number().int().nonnegative(),
|
|
122
|
+
attemptedAt: z.number().int().nonnegative().nullable(),
|
|
123
|
+
succeededAt: z.number().int().nonnegative().nullable(),
|
|
124
|
+
commit: z
|
|
125
|
+
.string()
|
|
126
|
+
.regex(/^[a-f0-9]{40}(?:[a-f0-9]{24})?$/)
|
|
127
|
+
.nullable(),
|
|
128
|
+
publishedCommit: z
|
|
129
|
+
.string()
|
|
130
|
+
.regex(/^[a-f0-9]{40}(?:[a-f0-9]{24})?$/)
|
|
131
|
+
.nullable(),
|
|
132
|
+
queuedFiles: z.number().int().min(0).max(1024),
|
|
133
|
+
selectedFiles: z.number().int().min(0).max(1024),
|
|
134
|
+
});
|
|
94
135
|
export const BrowserSystemSchema = z.object({
|
|
95
136
|
runtime: RuntimeStatusSchema,
|
|
96
|
-
publication:
|
|
137
|
+
publication: PublicationStatusSchema,
|
|
97
138
|
resources: z.object({ state: z.literal('unavailable') }),
|
|
98
139
|
service: z.object({ state: z.literal('unavailable') }),
|
|
99
140
|
});
|
|
@@ -20,4 +20,5 @@ export type { IHandoffCommand, IHandoffPhase, IHandoffSource, IHandoffFindings,
|
|
|
20
20
|
export { BrowserCommandSchema, BrowserActionSchema, BrowserReceiptSchema, } from './browser/index.js';
|
|
21
21
|
export type { IBrowserAction, IBrowserReceipt } from './browser/index.js';
|
|
22
22
|
export { BrowserRepositorySchema, BrowserPlanSummarySchema, BrowserPlanPageSchema, BrowserPlanDetailSchema, BrowserSessionSchema, } from './browser/index.js';
|
|
23
|
-
export { BrowserRepositoryPageSchema, BrowserSystemSchema, BrowserThreadDetailSchema, } from './browser/index.js';
|
|
23
|
+
export { BrowserRepositoryPageSchema, BrowserSystemSchema, BrowserThreadDetailSchema, PublicationStatusSchema, } from './browser/index.js';
|
|
24
|
+
export type { IPublicationStatus } from './browser/index.js';
|
package/dist/contracts/index.js
CHANGED
|
@@ -23,4 +23,4 @@ export { BrowserCommandSchema, BrowserActionSchema, BrowserReceiptSchema, } from
|
|
|
23
23
|
// host read models
|
|
24
24
|
export { BrowserRepositorySchema, BrowserPlanSummarySchema, BrowserPlanPageSchema, BrowserPlanDetailSchema, BrowserSessionSchema, } from './browser/index.js';
|
|
25
25
|
// bounded host views
|
|
26
|
-
export { BrowserRepositoryPageSchema, BrowserSystemSchema, BrowserThreadDetailSchema, } from './browser/index.js';
|
|
26
|
+
export { BrowserRepositoryPageSchema, BrowserSystemSchema, BrowserThreadDetailSchema, PublicationStatusSchema, } from './browser/index.js';
|
|
@@ -2,7 +2,7 @@ import { Exception } from 'error-message-utils';
|
|
|
2
2
|
import { scheduler } from 'node:timers/promises';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { createClaudeRpc } from './rpc.js';
|
|
5
|
-
import {
|
|
5
|
+
import { ClaudeHistoryVersionSchema, ClaudeUsageSchema } from './types.js';
|
|
6
6
|
import { toClaudeUsageSnapshot } from './transformers.js';
|
|
7
7
|
/**
|
|
8
8
|
* Lazily connects read-only Claude capabilities; Codex needs no Claude installation.
|
|
@@ -61,7 +61,7 @@ export const createClaudeProvider = (store) => {
|
|
|
61
61
|
async readHistory(command) {
|
|
62
62
|
const deadline = Date.now() + 30_000;
|
|
63
63
|
const native = await open();
|
|
64
|
-
if (native.version
|
|
64
|
+
if (!ClaudeHistoryVersionSchema.safeParse(native.version).success)
|
|
65
65
|
throw new Exception('The Claude history is unavailable', undefined, {
|
|
66
66
|
kind: 'agent-unavailable',
|
|
67
67
|
});
|
|
@@ -4,7 +4,7 @@ import { Exception, extractMessage, hasErrorCode } from 'error-message-utils';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { HqResponseSchema, } from '../../../contracts/index.js';
|
|
6
6
|
import { decodeHistoryCursor, encodeHistoryCursor, } from '../../../sessions/index.js';
|
|
7
|
-
import {
|
|
7
|
+
import { ClaudeHistoryVersionSchema } from '../types.js';
|
|
8
8
|
import { EntryRowSchema, EntrySeekSchema, FileRowSchema, RecordSchema, SeekSchema, } from './types.js';
|
|
9
9
|
import { openTranscript, projectDirectory, toClaudeItem } from './utilities.js';
|
|
10
10
|
const MAX_RECORD_BYTES = 1_048_576;
|
|
@@ -189,7 +189,7 @@ export class ClaudeHistoryModel {
|
|
|
189
189
|
this.__unavailable();
|
|
190
190
|
const record = RecordSchema.parse(JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes)));
|
|
191
191
|
if (record.uuid !== entry.uuid ||
|
|
192
|
-
record.version
|
|
192
|
+
!ClaudeHistoryVersionSchema.safeParse(record.version).success ||
|
|
193
193
|
record.cwd !== root)
|
|
194
194
|
this.__unavailable();
|
|
195
195
|
const item = toClaudeItem(record, entry.turn_id);
|
|
@@ -403,14 +403,15 @@ export class ClaudeHistoryModel {
|
|
|
403
403
|
row.name = record.customTitle;
|
|
404
404
|
return;
|
|
405
405
|
}
|
|
406
|
-
if (record.version !== undefined &&
|
|
406
|
+
if (record.version !== undefined &&
|
|
407
|
+
!ClaudeHistoryVersionSchema.safeParse(record.version).success)
|
|
407
408
|
this.__unavailable();
|
|
408
409
|
if (record.isSidechain || !record.uuid)
|
|
409
410
|
return;
|
|
410
411
|
if ((record.type === 'user' || record.type === 'assistant') &&
|
|
411
412
|
record.message?.role !== record.type)
|
|
412
413
|
this.__unavailable();
|
|
413
|
-
if (record.version
|
|
414
|
+
if (!ClaudeHistoryVersionSchema.safeParse(record.version).success ||
|
|
414
415
|
record.sessionId !== nativeId ||
|
|
415
416
|
record.cwd !== root ||
|
|
416
417
|
record.timestamp === undefined ||
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ClaudeHistoryVersionSchema: z.ZodEnum<{
|
|
3
|
+
"2.1.304": "2.1.304";
|
|
4
|
+
"2.1.306": "2.1.306";
|
|
5
|
+
}>;
|
|
3
6
|
export declare const ClaudeInitializeSchema: z.ZodObject<{
|
|
4
7
|
claude_code_version: z.ZodString;
|
|
5
8
|
commands: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
//
|
|
3
|
-
export const
|
|
2
|
+
// only explicitly qualified CLI and transcript versions may use the local reader
|
|
3
|
+
export const ClaudeHistoryVersionSchema = z.enum(['2.1.304', '2.1.306']);
|
|
4
4
|
export const ClaudeInitializeSchema = z.object({
|
|
5
5
|
claude_code_version: z.string().min(1).max(128),
|
|
6
6
|
commands: z.unknown().optional(),
|
package/dist/store/types.d.ts
CHANGED
|
@@ -494,7 +494,8 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
494
494
|
release: z.ZodBoolean;
|
|
495
495
|
}, z.core.$strict>, z.ZodObject<{
|
|
496
496
|
kind: z.ZodLiteral<"publication-retry">;
|
|
497
|
-
|
|
497
|
+
publicationId: z.ZodUUID;
|
|
498
|
+
expectedCommit: z.ZodNullable<z.ZodString>;
|
|
498
499
|
}, z.core.$strict>], "kind">;
|
|
499
500
|
}, z.core.$strict>;
|
|
500
501
|
operatorId: z.ZodString;
|
|
@@ -2590,7 +2591,8 @@ export declare const StoreRequestSchema: z.ZodObject<{
|
|
|
2590
2591
|
release: z.ZodBoolean;
|
|
2591
2592
|
}, z.core.$strict>, z.ZodObject<{
|
|
2592
2593
|
kind: z.ZodLiteral<"publication-retry">;
|
|
2593
|
-
|
|
2594
|
+
publicationId: z.ZodUUID;
|
|
2595
|
+
expectedCommit: z.ZodNullable<z.ZodString>;
|
|
2594
2596
|
}, z.core.$strict>], "kind">;
|
|
2595
2597
|
}, z.core.$strict>;
|
|
2596
2598
|
operatorId: z.ZodString;
|