jg-agent-hq 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/api/README.md +2 -0
- 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/store/types.d.ts +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
- Add safe publication observations for the host's System view, with separate pending, blocked, failed and uncertain states, timestamps and exact commit identity.
|
|
6
|
+
- 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.
|
|
7
|
+
|
|
3
8
|
## 0.4.0
|
|
4
9
|
|
|
5
10
|
- Add closed browser host commands and bounded session/repository/plan read contracts, without exposing private handlers through standalone IPC.
|
package/api/README.md
CHANGED
|
@@ -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';
|
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;
|