jg-agent-hq 2.0.0 → 4.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 +18 -0
- package/README.md +14 -14
- package/api/README.md +97 -65
- package/dist/actions/actions.js +15 -0
- package/dist/cli/cli.js +28 -5
- package/dist/cli/utilities.d.ts +3 -0
- package/dist/cli/utilities.js +13 -0
- package/dist/collaboration/dispatch/types.d.ts +2 -2
- package/dist/contracts/actions/types.d.ts +4 -4
- package/dist/contracts/browser/index.d.ts +1 -3
- package/dist/contracts/browser/index.js +1 -3
- package/dist/contracts/browser/types.d.ts +15 -1447
- package/dist/contracts/browser/types.js +3 -112
- package/dist/contracts/index.d.ts +9 -11
- package/dist/contracts/index.js +6 -8
- package/dist/contracts/plans/index.d.ts +4 -6
- package/dist/contracts/plans/index.js +2 -4
- package/dist/contracts/plans/types.d.ts +38 -905
- package/dist/contracts/plans/types.js +13 -139
- package/dist/contracts/sessions/index.d.ts +2 -0
- package/dist/contracts/sessions/index.js +2 -0
- package/dist/contracts/sessions/types.d.ts +101 -0
- package/dist/contracts/sessions/types.js +43 -0
- package/dist/contracts/types.d.ts +551 -1035
- package/dist/contracts/types.js +32 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/plans/admission.d.ts +6 -6
- package/dist/plans/admission.js +1 -1
- package/dist/plans/authority.d.ts +2 -0
- package/dist/plans/authority.js +23 -13
- package/dist/plans/documents.d.ts +20 -17
- package/dist/plans/documents.js +29 -63
- package/dist/plans/files.d.ts +2 -2
- package/dist/plans/files.js +5 -5
- package/dist/plans/finalization.d.ts +6 -8
- package/dist/plans/finalization.js +25 -26
- package/dist/plans/index.d.ts +2 -3
- package/dist/plans/index.js +1 -2
- package/dist/plans/plans.d.ts +8 -8
- package/dist/plans/plans.js +36 -83
- package/dist/plans/projections.d.ts +2 -2
- package/dist/plans/projections.js +44 -82
- package/dist/plans/revisions.d.ts +4 -5
- package/dist/plans/revisions.js +5 -44
- package/dist/plans/types.d.ts +5 -281
- package/dist/plans/types.js +2 -30
- package/dist/plans/utilities.js +2 -11
- package/dist/providers/claude/agents/agents.d.ts +16 -0
- package/dist/providers/claude/agents/agents.js +80 -0
- package/dist/providers/claude/agents/constants.d.ts +3 -0
- package/dist/providers/claude/agents/constants.js +4 -0
- package/dist/providers/claude/agents/index.d.ts +1 -0
- package/dist/providers/claude/agents/index.js +2 -0
- package/dist/providers/claude/agents/types.d.ts +14 -0
- package/dist/providers/claude/agents/types.js +9 -0
- package/dist/providers/claude/claude.js +2 -0
- package/dist/providers/claude/history/history.model.js +2 -0
- package/dist/providers/claude/history/types.d.ts +115 -368
- package/dist/providers/claude/index.d.ts +1 -0
- package/dist/providers/claude/index.js +2 -0
- package/dist/providers/claude/transformers.js +14 -1
- package/dist/providers/codex/adapter.d.ts +1 -1
- package/dist/providers/codex/adapter.js +26 -3
- package/dist/providers/codex/codex.js +51 -18
- package/dist/providers/codex/events.d.ts +2 -1
- package/dist/providers/codex/events.js +8 -3
- package/dist/providers/codex/index.d.ts +1 -1
- package/dist/providers/codex/index.js +1 -1
- package/dist/providers/codex/rpc.d.ts +9 -4
- package/dist/providers/codex/rpc.js +109 -47
- package/dist/providers/codex/skill-roots/constants.d.ts +4 -0
- package/dist/providers/codex/skill-roots/constants.js +7 -0
- package/dist/providers/codex/skill-roots/index.d.ts +2 -0
- package/dist/providers/codex/skill-roots/index.js +4 -0
- package/dist/providers/codex/skill-roots/skill-roots.d.ts +35 -0
- package/dist/providers/codex/skill-roots/skill-roots.js +93 -0
- package/dist/providers/codex/transformers.d.ts +3 -1
- package/dist/providers/codex/transformers.js +41 -3
- package/dist/providers/codex/types.d.ts +38 -1
- package/dist/providers/codex/types.js +15 -3
- package/dist/providers/codex/websocket/constants.d.ts +11 -0
- package/dist/providers/codex/websocket/constants.js +18 -0
- package/dist/providers/codex/websocket/index.d.ts +1 -0
- package/dist/providers/codex/websocket/index.js +2 -0
- package/dist/providers/codex/websocket/websocket.d.ts +7 -0
- package/dist/providers/codex/websocket/websocket.js +219 -0
- package/dist/providers/index.d.ts +2 -2
- package/dist/providers/index.js +1 -1
- package/dist/providers/process.d.ts +2 -2
- package/dist/providers/process.js +37 -4
- package/dist/providers/registry/registry.js +2 -1
- package/dist/providers/types.d.ts +25 -2
- package/dist/runtime/runtime.js +11 -3
- package/dist/runtime/state/index.d.ts +1 -1
- package/dist/runtime/state/index.js +1 -1
- package/dist/runtime/state/state.d.ts +15 -0
- package/dist/runtime/state/state.js +92 -1
- package/dist/runtime/types.d.ts +0 -2
- package/dist/runtime/types.js +0 -3
- package/dist/sessions/sessions.js +2 -0
- package/dist/snapshots/archive/archive.d.ts +29 -0
- package/dist/snapshots/archive/archive.js +342 -0
- package/dist/snapshots/archive/constants.d.ts +5 -0
- package/dist/snapshots/archive/constants.js +8 -0
- package/dist/snapshots/archive/index.d.ts +1 -0
- package/dist/snapshots/archive/index.js +2 -0
- package/dist/snapshots/artifacts.d.ts +10 -1
- package/dist/snapshots/artifacts.js +38 -13
- package/dist/snapshots/capture.d.ts +15 -0
- package/dist/snapshots/capture.js +158 -0
- package/dist/snapshots/database.d.ts +2 -0
- package/dist/snapshots/database.js +35 -55
- package/dist/snapshots/fences.d.ts +10 -0
- package/dist/snapshots/fences.js +51 -0
- package/dist/snapshots/index.d.ts +1 -0
- package/dist/snapshots/index.js +2 -0
- package/dist/snapshots/snapshots.d.ts +7 -3
- package/dist/snapshots/snapshots.js +31 -117
- package/dist/snapshots/snapshots.worker.js +5 -1
- package/dist/snapshots/types.d.ts +35 -3
- package/dist/snapshots/types.js +19 -4
- package/dist/storage/index.d.ts +2 -1
- package/dist/storage/index.js +2 -1
- package/dist/storage/schema/constants.d.ts +2 -0
- package/dist/storage/schema/constants.js +9 -0
- package/dist/storage/schema/index.d.ts +3 -0
- package/dist/storage/schema/index.js +6 -0
- package/dist/storage/schema/schema.d.ts +18 -0
- package/dist/storage/schema/schema.js +59 -0
- package/dist/storage/schema/types.d.ts +7 -0
- package/dist/storage/schema/types.js +8 -0
- package/dist/storage/storage.d.ts +1 -1
- package/dist/storage/storage.js +2 -2
- package/dist/storage/types.d.ts +0 -5
- package/dist/storage/types.js +0 -6
- package/dist/store/collaboration/collaboration.model.d.ts +2 -2
- package/dist/store/control/types.d.ts +16 -16
- package/dist/store/plans/plans.model.d.ts +3 -105
- package/dist/store/plans/plans.model.js +6 -46
- package/dist/store/schema.js +7 -35
- package/dist/store/schema.sql +91 -16
- package/dist/store/sessions/index.d.ts +1 -0
- package/dist/store/sessions/index.js +2 -0
- package/dist/store/sessions/sessions.model.d.ts +28 -0
- package/dist/store/sessions/sessions.model.js +105 -0
- package/dist/store/store.js +13 -7
- package/dist/store/store.worker.js +16 -11
- package/dist/store/types.d.ts +134 -513
- package/dist/store/types.js +21 -7
- package/docs/recovery.md +8 -4
- package/errors/README.md +3 -3
- package/package.json +2 -2
- package/dist/plans/reconciliation.d.ts +0 -34
- package/dist/plans/reconciliation.js +0 -246
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isException } from 'jg-exception';
|
|
2
|
+
import { toPublicError } from '../errors/index.js';
|
|
3
|
+
// the only storage diagnosis shown: which package version wrote the storage, never its cause
|
|
4
|
+
const WRITER_MESSAGE = /^The HQ storage is invalid: written by (?:jg-agent-hq [0-9A-Za-z.+-]{1,64}|another jg-agent-hq version)(?=$|; \[CAUSE\]: )/;
|
|
5
|
+
/** Presents static storage diagnoses without exposing diagnostic paths, suffixes or causes. */
|
|
6
|
+
export const toCliError = (error) => {
|
|
7
|
+
if (isException(error) && error.code === 'JG_AGENT_HQ_STORAGE_INVALID')
|
|
8
|
+
return {
|
|
9
|
+
kind: 'state-conflict',
|
|
10
|
+
message: WRITER_MESSAGE.exec(error.message)?.[0] ?? 'The HQ storage is invalid',
|
|
11
|
+
};
|
|
12
|
+
return toPublicError(error);
|
|
13
|
+
};
|
|
@@ -410,8 +410,8 @@ export declare const DispatchJobSchema: z.ZodObject<{
|
|
|
410
410
|
name: z.ZodString;
|
|
411
411
|
workspaceRoot: z.ZodString;
|
|
412
412
|
ownership: z.ZodEnum<{
|
|
413
|
-
uncertain: "uncertain";
|
|
414
413
|
managed: "managed";
|
|
414
|
+
uncertain: "uncertain";
|
|
415
415
|
}>;
|
|
416
416
|
runtimeEpoch: z.ZodNullable<z.ZodUUID>;
|
|
417
417
|
activeTurnId: z.ZodNullable<z.ZodString>;
|
|
@@ -422,10 +422,10 @@ export declare const DispatchJobSchema: z.ZodObject<{
|
|
|
422
422
|
failed: "failed";
|
|
423
423
|
interrupted: "interrupted";
|
|
424
424
|
"waiting-input": "waiting-input";
|
|
425
|
+
running: "running";
|
|
425
426
|
creating: "creating";
|
|
426
427
|
inactive: "inactive";
|
|
427
428
|
starting: "starting";
|
|
428
|
-
running: "running";
|
|
429
429
|
"waiting-approval": "waiting-approval";
|
|
430
430
|
stopping: "stopping";
|
|
431
431
|
}>;
|
|
@@ -634,10 +634,10 @@ export declare const ActionReceiptSchema: z.ZodObject<{
|
|
|
634
634
|
delivery: z.ZodEnum<{
|
|
635
635
|
failed: "failed";
|
|
636
636
|
canceled: "canceled";
|
|
637
|
+
uncertain: "uncertain";
|
|
637
638
|
queued: "queued";
|
|
638
639
|
submitted: "submitted";
|
|
639
640
|
acknowledged: "acknowledged";
|
|
640
|
-
uncertain: "uncertain";
|
|
641
641
|
}>;
|
|
642
642
|
completion: z.ZodNullable<z.ZodEnum<{
|
|
643
643
|
completed: "completed";
|
|
@@ -784,10 +784,10 @@ export declare const ActionSummarySchema: z.ZodObject<{
|
|
|
784
784
|
delivery: z.ZodEnum<{
|
|
785
785
|
failed: "failed";
|
|
786
786
|
canceled: "canceled";
|
|
787
|
+
uncertain: "uncertain";
|
|
787
788
|
queued: "queued";
|
|
788
789
|
submitted: "submitted";
|
|
789
790
|
acknowledged: "acknowledged";
|
|
790
|
-
uncertain: "uncertain";
|
|
791
791
|
}>;
|
|
792
792
|
digest: z.ZodString;
|
|
793
793
|
controlState: z.ZodNullable<z.ZodEnum<{
|
|
@@ -837,8 +837,8 @@ export declare const ManagedThreadSchema: z.ZodObject<{
|
|
|
837
837
|
name: z.ZodString;
|
|
838
838
|
workspaceRoot: z.ZodString;
|
|
839
839
|
ownership: z.ZodEnum<{
|
|
840
|
-
uncertain: "uncertain";
|
|
841
840
|
managed: "managed";
|
|
841
|
+
uncertain: "uncertain";
|
|
842
842
|
}>;
|
|
843
843
|
runtimeEpoch: z.ZodNullable<z.ZodUUID>;
|
|
844
844
|
activeTurnId: z.ZodNullable<z.ZodString>;
|
|
@@ -849,10 +849,10 @@ export declare const ManagedThreadSchema: z.ZodObject<{
|
|
|
849
849
|
failed: "failed";
|
|
850
850
|
interrupted: "interrupted";
|
|
851
851
|
"waiting-input": "waiting-input";
|
|
852
|
+
running: "running";
|
|
852
853
|
creating: "creating";
|
|
853
854
|
inactive: "inactive";
|
|
854
855
|
starting: "starting";
|
|
855
|
-
running: "running";
|
|
856
856
|
"waiting-approval": "waiting-approval";
|
|
857
857
|
stopping: "stopping";
|
|
858
858
|
}>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export { BrowserCommandSchema, BrowserActionSchema, BrowserReceiptSchema } from './types.js';
|
|
2
2
|
export type { IBrowserAction, IBrowserReceipt } from './types.js';
|
|
3
|
-
export {
|
|
4
|
-
export { BrowserRepositoryPageSchema, BrowserSystemSchema, BrowserThreadDetailSchema, PublicationStatusSchema, } from './types.js';
|
|
5
|
-
export type { IPublicationStatus } from './types.js';
|
|
3
|
+
export { BrowserThreadDetailSchema } from './types.js';
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// browser requests and durable reconciliation
|
|
2
2
|
export { BrowserCommandSchema, BrowserActionSchema, BrowserReceiptSchema } from './types.js';
|
|
3
|
-
// host read models
|
|
4
|
-
export { BrowserRepositorySchema, BrowserPlanSummarySchema, BrowserPlanPageSchema, BrowserPlanDetailSchema, BrowserSessionSchema, } from './types.js';
|
|
5
3
|
// bounded host views
|
|
6
|
-
export {
|
|
4
|
+
export { BrowserThreadDetailSchema } from './types.js';
|