jg-agent-hq 8.0.2 → 9.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 +16 -0
- package/README.md +18 -37
- package/api/README.md +51 -243
- package/dist/actions/actions.d.ts +5 -50
- package/dist/actions/actions.js +49 -190
- package/dist/actions/reads.d.ts +3 -2
- package/dist/actions/reads.js +12 -5
- package/dist/actions/waits/index.d.ts +1 -0
- package/dist/actions/waits/index.js +2 -0
- package/dist/actions/waits/waits.d.ts +37 -0
- package/dist/actions/waits/waits.js +107 -0
- package/dist/cli/cli.js +6 -56
- package/dist/contracts/actions/index.d.ts +2 -4
- package/dist/contracts/actions/index.js +1 -3
- package/dist/contracts/actions/types.d.ts +135 -142
- package/dist/contracts/actions/types.js +12 -22
- package/dist/contracts/browser/types.d.ts +12 -605
- package/dist/contracts/browser/types.js +2 -5
- package/dist/contracts/evidence/types.d.ts +4 -7
- package/dist/contracts/evidence/types.js +2 -8
- package/dist/contracts/index.d.ts +5 -16
- package/dist/contracts/index.js +4 -15
- package/dist/contracts/locks/index.d.ts +2 -0
- package/dist/contracts/locks/index.js +2 -0
- package/dist/contracts/locks/types.d.ts +50 -0
- package/dist/contracts/locks/types.js +36 -0
- package/dist/contracts/providers/types.d.ts +0 -38
- package/dist/contracts/providers/types.js +0 -1
- package/dist/contracts/results/types.js +1 -1
- package/dist/contracts/sessions/types.d.ts +2 -0
- package/dist/contracts/sessions/types.js +7 -1
- package/dist/contracts/skills/types.d.ts +1 -0
- package/dist/contracts/skills/types.js +5 -0
- package/dist/contracts/types.d.ts +4526 -12307
- package/dist/contracts/types.js +13 -12
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -2
- package/dist/providers/claude/adapter.js +1 -11
- package/dist/providers/claude/claude.d.ts +6 -3
- package/dist/providers/claude/claude.js +49 -9
- package/dist/providers/claude/control/control.d.ts +2 -20
- package/dist/providers/claude/control/control.js +88 -155
- package/dist/providers/claude/control/permissions.d.ts +0 -9
- package/dist/providers/claude/control/permissions.js +0 -22
- package/dist/providers/claude/control/skills.js +1 -0
- package/dist/providers/claude/control/stream.js +1 -34
- package/dist/providers/claude/control/types.d.ts +0 -3
- package/dist/providers/claude/history/history.model.d.ts +9 -0
- package/dist/providers/claude/history/history.model.js +77 -43
- package/dist/providers/claude/history/types.d.ts +284 -3045
- package/dist/providers/claude/history/types.js +1 -0
- package/dist/providers/claude/rpc.d.ts +0 -5
- package/dist/providers/claude/rpc.js +0 -3
- package/dist/providers/codex/adapter.js +2 -12
- package/dist/providers/codex/codex.d.ts +1 -2
- package/dist/providers/codex/codex.js +2 -100
- package/dist/providers/codex/types.d.ts +2 -4
- package/dist/providers/registry/registry.d.ts +0 -2
- package/dist/providers/registry/registry.js +0 -7
- package/dist/providers/types.d.ts +4 -6
- package/dist/providers/types.js +3 -2
- package/dist/runtime/runtime.js +10 -81
- package/dist/runtime/types.d.ts +1 -18
- package/dist/runtime/types.js +0 -1
- package/dist/sessions/sessions.js +0 -1
- package/dist/skills/skills.js +3 -0
- package/dist/snapshots/archive/archive.js +2 -23
- package/dist/snapshots/capture.d.ts +2 -5
- package/dist/snapshots/capture.js +4 -85
- package/dist/snapshots/constants.d.ts +0 -1
- package/dist/snapshots/constants.js +1 -6
- package/dist/snapshots/database.d.ts +2 -3
- package/dist/snapshots/database.js +9 -114
- package/dist/snapshots/fences.d.ts +3 -5
- package/dist/snapshots/fences.js +3 -15
- package/dist/snapshots/files.d.ts +3 -1
- package/dist/snapshots/files.js +15 -4
- package/dist/snapshots/snapshots.d.ts +6 -7
- package/dist/snapshots/snapshots.js +9 -16
- package/dist/snapshots/types.d.ts +5 -81
- package/dist/snapshots/types.js +7 -30
- package/dist/storage/constants.d.ts +1 -0
- package/dist/storage/constants.js +5 -1
- package/dist/storage/types.d.ts +1 -0
- package/dist/storage/types.js +1 -0
- package/dist/store/control/constants.d.ts +3 -2
- package/dist/store/control/constants.js +3 -1
- package/dist/store/control/control.model.d.ts +1 -11
- package/dist/store/control/control.model.js +10 -131
- package/dist/store/control/transformers.d.ts +6 -3
- package/dist/store/control/transformers.js +6 -5
- package/dist/store/control/types.d.ts +91 -170
- package/dist/store/control/types.js +5 -7
- package/dist/store/schema.js +1 -1
- package/dist/store/schema.sql +3 -360
- package/dist/store/sessions/sessions.model.d.ts +10 -6
- package/dist/store/sessions/sessions.model.js +19 -2
- package/dist/store/snapshot.d.ts +10 -0
- package/dist/store/snapshot.js +37 -0
- package/dist/store/store.js +1 -54
- package/dist/store/store.worker.js +5 -97
- package/dist/store/types.d.ts +241 -4802
- package/dist/store/types.js +1 -44
- package/docs/recovery.md +10 -6
- package/errors/README.md +29 -39
- package/package.json +3 -4
- package/dist/agent-tools/agent-tools.d.ts +0 -6
- package/dist/agent-tools/agent-tools.js +0 -181
- package/dist/agent-tools/constants.d.ts +0 -7
- package/dist/agent-tools/constants.js +0 -45
- package/dist/agent-tools/index.d.ts +0 -4
- package/dist/agent-tools/index.js +0 -4
- package/dist/agent-tools/mcp/index.d.ts +0 -1
- package/dist/agent-tools/mcp/index.js +0 -2
- package/dist/agent-tools/mcp/mcp.d.ts +0 -7
- package/dist/agent-tools/mcp/mcp.js +0 -50
- package/dist/agent-tools/types.d.ts +0 -64
- package/dist/agent-tools/types.js +0 -1
- package/dist/agent-tools/utilities.d.ts +0 -13
- package/dist/agent-tools/utilities.js +0 -37
- package/dist/collaboration/collaboration.d.ts +0 -7
- package/dist/collaboration/collaboration.js +0 -119
- package/dist/collaboration/constants.d.ts +0 -2
- package/dist/collaboration/constants.js +0 -3
- package/dist/collaboration/dispatch/dispatch.d.ts +0 -12
- package/dist/collaboration/dispatch/dispatch.js +0 -148
- package/dist/collaboration/dispatch/index.d.ts +0 -3
- package/dist/collaboration/dispatch/index.js +0 -4
- package/dist/collaboration/dispatch/types.d.ts +0 -632
- package/dist/collaboration/dispatch/types.js +0 -44
- package/dist/collaboration/grants/grants.d.ts +0 -45
- package/dist/collaboration/grants/grants.js +0 -131
- package/dist/collaboration/grants/index.d.ts +0 -1
- package/dist/collaboration/grants/index.js +0 -2
- package/dist/collaboration/identity/credentials.d.ts +0 -17
- package/dist/collaboration/identity/credentials.js +0 -182
- package/dist/collaboration/identity/index.d.ts +0 -4
- package/dist/collaboration/identity/index.js +0 -4
- package/dist/collaboration/identity/types.d.ts +0 -171
- package/dist/collaboration/identity/types.js +0 -87
- package/dist/collaboration/index.d.ts +0 -3
- package/dist/collaboration/index.js +0 -3
- package/dist/collaboration/types.d.ts +0 -25
- package/dist/collaboration/types.js +0 -1
- package/dist/contracts/agent-tools/index.d.ts +0 -2
- package/dist/contracts/agent-tools/index.js +0 -2
- package/dist/contracts/agent-tools/types.d.ts +0 -697
- package/dist/contracts/agent-tools/types.js +0 -125
- package/dist/contracts/collaboration/index.d.ts +0 -4
- package/dist/contracts/collaboration/index.js +0 -4
- package/dist/contracts/collaboration/reports/constants.d.ts +0 -1
- package/dist/contracts/collaboration/reports/constants.js +0 -2
- package/dist/contracts/collaboration/reports/index.d.ts +0 -3
- package/dist/contracts/collaboration/reports/index.js +0 -3
- package/dist/contracts/collaboration/reports/types.d.ts +0 -69
- package/dist/contracts/collaboration/reports/types.js +0 -53
- package/dist/contracts/collaboration/types.d.ts +0 -6734
- package/dist/contracts/collaboration/types.js +0 -696
- package/dist/contracts/plans/index.d.ts +0 -6
- package/dist/contracts/plans/index.js +0 -6
- package/dist/contracts/plans/types.d.ts +0 -1788
- package/dist/contracts/plans/types.js +0 -278
- package/dist/plans/admission.d.ts +0 -288
- package/dist/plans/admission.js +0 -393
- package/dist/plans/authority.d.ts +0 -21
- package/dist/plans/authority.js +0 -207
- package/dist/plans/documents.d.ts +0 -80
- package/dist/plans/documents.js +0 -238
- package/dist/plans/evidence.d.ts +0 -11
- package/dist/plans/evidence.js +0 -211
- package/dist/plans/files.d.ts +0 -55
- package/dist/plans/files.js +0 -264
- package/dist/plans/finalization.d.ts +0 -11
- package/dist/plans/finalization.js +0 -30
- package/dist/plans/index.d.ts +0 -5
- package/dist/plans/index.js +0 -6
- package/dist/plans/plans.d.ts +0 -325
- package/dist/plans/plans.js +0 -803
- package/dist/plans/projections.d.ts +0 -13
- package/dist/plans/projections.js +0 -67
- package/dist/plans/revisions.d.ts +0 -50
- package/dist/plans/revisions.js +0 -181
- package/dist/plans/types.d.ts +0 -114
- package/dist/plans/types.js +0 -43
- package/dist/plans/utilities.d.ts +0 -36
- package/dist/plans/utilities.js +0 -62
- package/dist/snapshots/artifacts.d.ts +0 -16
- package/dist/snapshots/artifacts.js +0 -75
- package/dist/store/collaboration/authority.d.ts +0 -228
- package/dist/store/collaboration/authority.js +0 -128
- package/dist/store/collaboration/collaboration.model.d.ts +0 -412
- package/dist/store/collaboration/collaboration.model.js +0 -254
- package/dist/store/collaboration/constants.d.ts +0 -13
- package/dist/store/collaboration/constants.js +0 -14
- package/dist/store/collaboration/dispatch.d.ts +0 -19
- package/dist/store/collaboration/dispatch.js +0 -197
- package/dist/store/collaboration/identity.d.ts +0 -21
- package/dist/store/collaboration/identity.js +0 -146
- package/dist/store/collaboration/index.d.ts +0 -3
- package/dist/store/collaboration/index.js +0 -5
- package/dist/store/collaboration/invocation.d.ts +0 -21
- package/dist/store/collaboration/invocation.js +0 -162
- package/dist/store/collaboration/messages.d.ts +0 -54
- package/dist/store/collaboration/messages.js +0 -157
- package/dist/store/collaboration/outcomes.d.ts +0 -11
- package/dist/store/collaboration/outcomes.js +0 -216
- package/dist/store/collaboration/queries.d.ts +0 -23
- package/dist/store/collaboration/queries.js +0 -259
- package/dist/store/collaboration/reports.d.ts +0 -37
- package/dist/store/collaboration/reports.js +0 -117
- package/dist/store/collaboration/requests.d.ts +0 -22
- package/dist/store/collaboration/requests.js +0 -111
- package/dist/store/collaboration/search.d.ts +0 -13
- package/dist/store/collaboration/search.js +0 -58
- package/dist/store/collaboration/spawn.d.ts +0 -33
- package/dist/store/collaboration/spawn.js +0 -96
- package/dist/store/collaboration/streams.d.ts +0 -13
- package/dist/store/collaboration/streams.js +0 -100
- package/dist/store/collaboration/tasks.d.ts +0 -20
- package/dist/store/collaboration/tasks.js +0 -169
- package/dist/store/collaboration/transformers.d.ts +0 -56
- package/dist/store/collaboration/transformers.js +0 -179
- package/dist/store/collaboration/types.d.ts +0 -25
- package/dist/store/collaboration/types.js +0 -8
- package/dist/store/collaboration/utilities.d.ts +0 -23
- package/dist/store/collaboration/utilities.js +0 -77
- package/dist/store/collaboration/waits.d.ts +0 -26
- package/dist/store/collaboration/waits.js +0 -114
- package/dist/store/plans/index.d.ts +0 -1
- package/dist/store/plans/index.js +0 -2
- package/dist/store/plans/plans.model.d.ts +0 -47
- package/dist/store/plans/plans.model.js +0 -179
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ActionEnvelopeSchema, ActionReceiptSchema, ActionSummarySchema,
|
|
2
|
+
import { ActionEnvelopeSchema, ActionReceiptSchema, ActionSummarySchema, ManagedThreadSchema, NativeApprovalSchema, } from '../actions/index.js';
|
|
3
3
|
import { LiveItemsSchema } from '../types.js';
|
|
4
|
-
import { PlanCommandSchema } from '../plans/index.js';
|
|
5
4
|
// the browser surface is closed; hosts resolve every supplied identity against their registry
|
|
6
5
|
export const BrowserCommandSchema = z.discriminatedUnion('kind', [
|
|
7
6
|
z.strictObject({ kind: z.literal('native'), action: ActionEnvelopeSchema }),
|
|
8
|
-
z.strictObject({ kind: z.literal('plan'), command: PlanCommandSchema }),
|
|
9
7
|
]);
|
|
10
8
|
export const BrowserActionSchema = z
|
|
11
9
|
.strictObject({
|
|
@@ -25,10 +23,9 @@ export const BrowserReceiptSchema = z.object({
|
|
|
25
23
|
updatedAt: z.number().int(),
|
|
26
24
|
native: ActionReceiptSchema.nullable(),
|
|
27
25
|
});
|
|
28
|
-
// one managed thread with its
|
|
26
|
+
// one managed thread with its pending approvals, live items and recent actions
|
|
29
27
|
export const BrowserThreadDetailSchema = z.object({
|
|
30
28
|
thread: ManagedThreadSchema,
|
|
31
|
-
plan: ActionPlanContextSchema.nullable(),
|
|
32
29
|
approvals: z.array(NativeApprovalSchema).max(128),
|
|
33
30
|
live: LiveItemsSchema,
|
|
34
31
|
actions: z.object({
|
|
@@ -20,7 +20,6 @@ export declare const HistoryProvenanceSchema: z.ZodObject<{
|
|
|
20
20
|
"native-kind": "native-kind";
|
|
21
21
|
"host-action": "host-action";
|
|
22
22
|
"authenticated-host-action": "authenticated-host-action";
|
|
23
|
-
"agent-input": "agent-input";
|
|
24
23
|
}>;
|
|
25
24
|
nativeInputId: z.ZodNullable<z.ZodString>;
|
|
26
25
|
nativeInputSha256: z.ZodNullable<z.ZodString>;
|
|
@@ -32,8 +31,8 @@ export type IHistoryProvenance = z.infer<typeof HistoryProvenanceSchema>;
|
|
|
32
31
|
export declare const HistoryKindSchema: z.ZodEnum<{
|
|
33
32
|
command: "command";
|
|
34
33
|
unsupported: "unsupported";
|
|
35
|
-
"user-message": "user-message";
|
|
36
34
|
tool: "tool";
|
|
35
|
+
"user-message": "user-message";
|
|
37
36
|
"agent-message": "agent-message";
|
|
38
37
|
"file-change": "file-change";
|
|
39
38
|
notice: "notice";
|
|
@@ -48,8 +47,8 @@ export declare const EvidenceRequestSchema: z.ZodObject<{
|
|
|
48
47
|
kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
49
48
|
command: "command";
|
|
50
49
|
unsupported: "unsupported";
|
|
51
|
-
"user-message": "user-message";
|
|
52
50
|
tool: "tool";
|
|
51
|
+
"user-message": "user-message";
|
|
53
52
|
"agent-message": "agent-message";
|
|
54
53
|
"file-change": "file-change";
|
|
55
54
|
notice: "notice";
|
|
@@ -69,8 +68,8 @@ export declare const EvidenceItemSchema: z.ZodObject<{
|
|
|
69
68
|
kind: z.ZodEnum<{
|
|
70
69
|
command: "command";
|
|
71
70
|
unsupported: "unsupported";
|
|
72
|
-
"user-message": "user-message";
|
|
73
71
|
tool: "tool";
|
|
72
|
+
"user-message": "user-message";
|
|
74
73
|
"agent-message": "agent-message";
|
|
75
74
|
"file-change": "file-change";
|
|
76
75
|
notice: "notice";
|
|
@@ -89,7 +88,6 @@ export declare const EvidenceItemSchema: z.ZodObject<{
|
|
|
89
88
|
"native-kind": "native-kind";
|
|
90
89
|
"host-action": "host-action";
|
|
91
90
|
"authenticated-host-action": "authenticated-host-action";
|
|
92
|
-
"agent-input": "agent-input";
|
|
93
91
|
}>;
|
|
94
92
|
nativeInputId: z.ZodNullable<z.ZodString>;
|
|
95
93
|
nativeInputSha256: z.ZodNullable<z.ZodString>;
|
|
@@ -120,8 +118,8 @@ export declare const EvidencePageSchema: z.ZodObject<{
|
|
|
120
118
|
kind: z.ZodEnum<{
|
|
121
119
|
command: "command";
|
|
122
120
|
unsupported: "unsupported";
|
|
123
|
-
"user-message": "user-message";
|
|
124
121
|
tool: "tool";
|
|
122
|
+
"user-message": "user-message";
|
|
125
123
|
"agent-message": "agent-message";
|
|
126
124
|
"file-change": "file-change";
|
|
127
125
|
notice: "notice";
|
|
@@ -140,7 +138,6 @@ export declare const EvidencePageSchema: z.ZodObject<{
|
|
|
140
138
|
"native-kind": "native-kind";
|
|
141
139
|
"host-action": "host-action";
|
|
142
140
|
"authenticated-host-action": "authenticated-host-action";
|
|
143
|
-
"agent-input": "agent-input";
|
|
144
141
|
}>;
|
|
145
142
|
nativeInputId: z.ZodNullable<z.ZodString>;
|
|
146
143
|
nativeInputSha256: z.ZodNullable<z.ZodString>;
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE } from '../constants.js';
|
|
3
3
|
import { CursorSchema, NativeIdSchema } from '../identities/index.js';
|
|
4
4
|
import { ProviderIdSchema } from '../providers/index.js';
|
|
5
|
-
// session discovery
|
|
5
|
+
// session discovery for trusted hosts
|
|
6
6
|
export const SessionDiscoveryRequestSchema = z.strictObject({
|
|
7
7
|
kind: z.literal('sessions'),
|
|
8
8
|
provider: ProviderIdSchema,
|
|
@@ -18,13 +18,7 @@ export const SessionDiscoveryRequestSchema = z.strictObject({
|
|
|
18
18
|
*/
|
|
19
19
|
export const HistoryProvenanceSchema = z.object({
|
|
20
20
|
origin: z.enum(['operator', 'agent', 'tool', 'system', 'unknown']),
|
|
21
|
-
source: z.enum([
|
|
22
|
-
'native-kind',
|
|
23
|
-
'host-action',
|
|
24
|
-
'authenticated-host-action',
|
|
25
|
-
'agent-input',
|
|
26
|
-
'unknown',
|
|
27
|
-
]),
|
|
21
|
+
source: z.enum(['native-kind', 'host-action', 'authenticated-host-action', 'unknown']),
|
|
28
22
|
nativeInputId: NativeIdSchema.nullable(),
|
|
29
23
|
nativeInputSha256: z
|
|
30
24
|
.string()
|
|
@@ -11,18 +11,10 @@ export { NativeLineageSchema } from './identities/index.js';
|
|
|
11
11
|
export type { INativeLineage } from './identities/index.js';
|
|
12
12
|
export { ProviderModelSchema, ProviderModelsRequestSchema, ProviderModelPageSchema, } from './models/index.js';
|
|
13
13
|
export type { IProviderModel, IProviderModelsRequest, IProviderModelPage } from './models/index.js';
|
|
14
|
-
export { PreparedInputSchema, ActionCommandSchema, ActionEnvelopeSchema, ActionReceiptSchema, ActionSummarySchema, ManagedThreadSchema, NativeApprovalSchema, NativeApprovalSummarySchema, ApprovalPresentationSchema, NativeElicitationSchema, LifecycleEventSchema, } from './actions/index.js';
|
|
15
|
-
export type { IPreparedInput, IActionCommand, IActionEnvelope, IActionReceipt, IActionSummary, IManagedThread, INativeApproval, INativeApprovalSummary, IApprovalPresentation, INativeElicitation, ILifecycleEvent, } from './actions/index.js';
|
|
14
|
+
export { PreparedInputSchema, ActionCommandSchema, ActionEnvelopeSchema, ActionReceiptSchema, ActionSummarySchema, ActionWaitSchema, ManagedThreadSchema, NativeApprovalSchema, NativeApprovalSummarySchema, ApprovalPresentationSchema, NativeElicitationSchema, LifecycleEventSchema, } from './actions/index.js';
|
|
15
|
+
export type { IPreparedInput, IActionCommand, IActionEnvelope, IActionReceipt, IActionSummary, IActionWait, IManagedThread, INativeApproval, INativeApprovalSummary, IApprovalPresentation, INativeElicitation, ILifecycleEvent, } from './actions/index.js';
|
|
16
16
|
export { SkillIdSchema, NativeSkillInputSchema, SkillSchema, SkillPageSchema, SkillPreviewSchema, MessageInputSchema, } from './skills/index.js';
|
|
17
17
|
export type { INativeSkillInput, ISkill, ISkillPage, ISkillPreview, IMessageInput, } from './skills/index.js';
|
|
18
|
-
export { PlanDigestSchema, PlanRevisionSchema, PlanMetadataSchema, PlanTargetSchema, PlanOperatorActionSchema, PlanCommandSchema, PlanApprovalSchema, PlanExecutionSchema, PlanFinalizationSchema, PlanCoordinationSchema, PlanMilestoneSchema, PlanStatusSchema, PlanResultSchema, } from './plans/index.js';
|
|
19
|
-
export type { IPlanRevision, IPlanMetadata, IPlanTarget, IPlanOperatorAction, IPlanCommand, IPlanCommandInput, IPlanCoordination, IPlanMilestone, IPlanStatus, IPlanResult, } from './plans/index.js';
|
|
20
|
-
export { PlanCheckSchema, PlanCheckoutSchema, PlanWorktreeProofSchema, PlanCompletionSchema, PlanSnapshotMilestoneSchema, PlanRevisionWorkflowSchema, PlanCoordinationSummarySchema, } from './plans/index.js';
|
|
21
|
-
export type { IPlanCheckout, IPlanWorktreeProof, IPlanCompletion, IPlanSnapshotMilestone, IPlanRevisionWorkflow, } from './plans/index.js';
|
|
22
|
-
export { PlanCheckpointSchema } from './plans/index.js';
|
|
23
|
-
export type { IPlanCheckpoint } from './plans/index.js';
|
|
24
|
-
export { PlanActionScopeSchema, ActionPlanContextSchema } from './actions/index.js';
|
|
25
|
-
export type { IPlanActionScope, IActionPlanContext } from './actions/index.js';
|
|
26
18
|
export { BrowserCommandSchema, BrowserActionSchema, BrowserReceiptSchema, } from './browser/index.js';
|
|
27
19
|
export type { IBrowserAction, IBrowserReceipt } from './browser/index.js';
|
|
28
20
|
export { TurnSettingsSchema, SessionSettingsSchema, ConfigurationRequestSchema, ConfigurationChoiceSchema, SessionConfigurationSchema, } from './configuration/index.js';
|
|
@@ -36,12 +28,9 @@ export { AccountRequestSchema, AccountObservationSchema } from './accounts/index
|
|
|
36
28
|
export type { IAccountRequest, IAccountObservation } from './accounts/index.js';
|
|
37
29
|
export { MAX_MCP_ITEMS, MAX_MCP_CATALOG_BYTES, McpRequestSchema, McpServerSchema, McpToolSchema, McpResourceSchema, McpServerPageSchema, McpToolPageSchema, McpResourcePageSchema, } from './extensions/index.js';
|
|
38
30
|
export type { IMcpRequest, IMcpServer, IMcpTool, IMcpResource, IMcpServerPage, IMcpToolPage, IMcpResourcePage, } from './extensions/index.js';
|
|
39
|
-
export { EvidenceRequestSchema, EvidencePageSchema, EvidenceItemSchema, HistoryProvenanceSchema, } from './evidence/index.js';
|
|
31
|
+
export { EvidenceRequestSchema, EvidencePageSchema, EvidenceItemSchema, HistoryProvenanceSchema, SessionDiscoveryRequestSchema, } from './evidence/index.js';
|
|
40
32
|
export type { IEvidenceRequest, IEvidencePage, IEvidenceItem, IHistoryProvenance, } from './evidence/index.js';
|
|
41
|
-
export { COLLABORATION_LIMITS, CollaborationActorSchema, MessageAuthorSchema, DispatchFailureSchema, DispatchBlockedSchema, InvocationSchema, DispatchCollectionSchema, ContinuationSchema, MAX_REPORT_BYTES, DispatchResponseSchema, DISPATCH_OUTPUT_SCHEMA, ReportSummarySchema, ReportReadSchema, CollaborationEffectSchema, AgentPermissionsSchema, TaskPolicySchema, CollaborationPlanSchema, PathScopeSchema, ArtifactReferenceSchema, SkillSelectionSchema, SkillGrantSchema, RequestSpecificationSchema, CollaborationLifecycleSchema, CollaborationTaskSchema, TaskAgentSchema, StreamSchema, SubscriptionSchema, MessageSummarySchema, MessageReadSchema, CollaborationRequestRecordSchema, DeliverySchema, CollaborationCommandSchema, CollaborationRequestSchema, TaskSummarySchema, TaskAgentSummarySchema, SkillGrantSummarySchema, RequestSummarySchema, CollaborationStatusSchema, CollaborationResultSchema, CollaborationOperationSchema, CollaborationResponseSchema, } from './collaboration/index.js';
|
|
42
|
-
export type { ICollaborationActor, IMessageAuthor, IDispatchFailure, IDispatchBlocked, IInvocation, IDispatchCollection, IContinuation, IDispatchResponse, IReportSummary, IReportRead, IAgentPermissions, ITaskPolicy, ICollaborationPlan, IPathScope, IArtifactReference, ISkillGrant, IRequestSpecification, ICollaborationTask, ITaskAgent, IStream, ISubscription, IMessageSummary, IMessageRead, ICollaborationRequestRecord, IDelivery, ICollaborationCommand, ICollaborationRequest, IRequestSummary, ICollaborationStatus, ICollaborationResult, ICollaborationOperation, ICollaborationResponse, } from './collaboration/index.js';
|
|
43
|
-
export { AgentIdentityArgumentsSchema, AgentSpawnArgumentsSchema, AgentToolCallSchema, AgentToolRequestSchema, AgentToolResultSchema, } from './agent-tools/index.js';
|
|
44
|
-
export type { IAgentSpawnArguments, IAgentToolCall, IAgentToolName, IAgentToolRequest, IAgentToolResult, } from './agent-tools/index.js';
|
|
45
|
-
export { SessionDiscoveryRequestSchema } from './evidence/index.js';
|
|
46
33
|
export { SessionStateSchema, SessionTransitionReasonSchema, SessionTransitionSchema, SessionTransitionPageSchema, ObservationPaceSchema, } from './sessions/index.js';
|
|
47
34
|
export type { ISessionState, ISessionTransitionReason, ISessionTransition, IObservationPace, } from './sessions/index.js';
|
|
35
|
+
export { LockStateSchema, LocksSchema } from './locks/index.js';
|
|
36
|
+
export type { ILockState, ILocks } from './locks/index.js';
|
package/dist/contracts/index.js
CHANGED
|
@@ -12,17 +12,9 @@ export { NativeLineageSchema } from './identities/index.js';
|
|
|
12
12
|
// native model discovery
|
|
13
13
|
export { ProviderModelSchema, ProviderModelsRequestSchema, ProviderModelPageSchema, } from './models/index.js';
|
|
14
14
|
// managed control and durable delivery
|
|
15
|
-
export { PreparedInputSchema, ActionCommandSchema, ActionEnvelopeSchema, ActionReceiptSchema, ActionSummarySchema, ManagedThreadSchema, NativeApprovalSchema, NativeApprovalSummarySchema, ApprovalPresentationSchema, NativeElicitationSchema, LifecycleEventSchema, } from './actions/index.js';
|
|
15
|
+
export { PreparedInputSchema, ActionCommandSchema, ActionEnvelopeSchema, ActionReceiptSchema, ActionSummarySchema, ActionWaitSchema, ManagedThreadSchema, NativeApprovalSchema, NativeApprovalSummarySchema, ApprovalPresentationSchema, NativeElicitationSchema, LifecycleEventSchema, } from './actions/index.js';
|
|
16
16
|
// native skills and explicit message input
|
|
17
17
|
export { SkillIdSchema, NativeSkillInputSchema, SkillSchema, SkillPageSchema, SkillPreviewSchema, MessageInputSchema, } from './skills/index.js';
|
|
18
|
-
// plan revisions and explicit authority
|
|
19
|
-
export { PlanDigestSchema, PlanRevisionSchema, PlanMetadataSchema, PlanTargetSchema, PlanOperatorActionSchema, PlanCommandSchema, PlanApprovalSchema, PlanExecutionSchema, PlanFinalizationSchema, PlanCoordinationSchema, PlanMilestoneSchema, PlanStatusSchema, PlanResultSchema, } from './plans/index.js';
|
|
20
|
-
// revision checkpoints and retained verification
|
|
21
|
-
export { PlanCheckSchema, PlanCheckoutSchema, PlanWorktreeProofSchema, PlanCompletionSchema, PlanSnapshotMilestoneSchema, PlanRevisionWorkflowSchema, PlanCoordinationSummarySchema, } from './plans/index.js';
|
|
22
|
-
// saved revision baseline
|
|
23
|
-
export { PlanCheckpointSchema } from './plans/index.js';
|
|
24
|
-
// guided plan scope
|
|
25
|
-
export { PlanActionScopeSchema, ActionPlanContextSchema } from './actions/index.js';
|
|
26
18
|
// authenticated host actions
|
|
27
19
|
export { BrowserCommandSchema, BrowserActionSchema, BrowserReceiptSchema, } from './browser/index.js';
|
|
28
20
|
// native session configuration
|
|
@@ -36,11 +28,8 @@ export { MAX_RESULT_BYTES, OutputSchemaSchema, TurnUsageSchema, TurnResultSchema
|
|
|
36
28
|
export { AccountRequestSchema, AccountObservationSchema } from './accounts/index.js';
|
|
37
29
|
export { MAX_MCP_ITEMS, MAX_MCP_CATALOG_BYTES, McpRequestSchema, McpServerSchema, McpToolSchema, McpResourceSchema, McpServerPageSchema, McpToolPageSchema, McpResourcePageSchema, } from './extensions/index.js';
|
|
38
30
|
// bounded historical evidence
|
|
39
|
-
export { EvidenceRequestSchema, EvidencePageSchema, EvidenceItemSchema, HistoryProvenanceSchema, } from './evidence/index.js';
|
|
40
|
-
// durable task collaboration
|
|
41
|
-
export { COLLABORATION_LIMITS, CollaborationActorSchema, MessageAuthorSchema, DispatchFailureSchema, DispatchBlockedSchema, InvocationSchema, DispatchCollectionSchema, ContinuationSchema, MAX_REPORT_BYTES, DispatchResponseSchema, DISPATCH_OUTPUT_SCHEMA, ReportSummarySchema, ReportReadSchema, CollaborationEffectSchema, AgentPermissionsSchema, TaskPolicySchema, CollaborationPlanSchema, PathScopeSchema, ArtifactReferenceSchema, SkillSelectionSchema, SkillGrantSchema, RequestSpecificationSchema, CollaborationLifecycleSchema, CollaborationTaskSchema, TaskAgentSchema, StreamSchema, SubscriptionSchema, MessageSummarySchema, MessageReadSchema, CollaborationRequestRecordSchema, DeliverySchema, CollaborationCommandSchema, CollaborationRequestSchema, TaskSummarySchema, TaskAgentSummarySchema, SkillGrantSummarySchema, RequestSummarySchema, CollaborationStatusSchema, CollaborationResultSchema, CollaborationOperationSchema, CollaborationResponseSchema, } from './collaboration/index.js';
|
|
42
|
-
// native agent tools
|
|
43
|
-
export { AgentIdentityArgumentsSchema, AgentSpawnArgumentsSchema, AgentToolCallSchema, AgentToolRequestSchema, AgentToolResultSchema, } from './agent-tools/index.js';
|
|
44
|
-
export { SessionDiscoveryRequestSchema } from './evidence/index.js';
|
|
31
|
+
export { EvidenceRequestSchema, EvidencePageSchema, EvidenceItemSchema, HistoryProvenanceSchema, SessionDiscoveryRequestSchema, } from './evidence/index.js';
|
|
45
32
|
// session states and transitions
|
|
46
33
|
export { SessionStateSchema, SessionTransitionReasonSchema, SessionTransitionSchema, SessionTransitionPageSchema, ObservationPaceSchema, } from './sessions/index.js';
|
|
34
|
+
// machine-wide jg-locks locks
|
|
35
|
+
export { LockStateSchema, LocksSchema } from './locks/index.js';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LockStateSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
state: z.ZodEnum<{
|
|
5
|
+
free: "free";
|
|
6
|
+
held: "held";
|
|
7
|
+
"owner-gone": "owner-gone";
|
|
8
|
+
ownerless: "ownerless";
|
|
9
|
+
"other-host": "other-host";
|
|
10
|
+
"recovery-in-progress": "recovery-in-progress";
|
|
11
|
+
"unexpected-entries": "unexpected-entries";
|
|
12
|
+
}>;
|
|
13
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
14
|
+
pid: z.ZodNumber;
|
|
15
|
+
nonce: z.ZodString;
|
|
16
|
+
hostname: z.ZodString;
|
|
17
|
+
program: z.ZodNullable<z.ZodString>;
|
|
18
|
+
cwd: z.ZodNullable<z.ZodString>;
|
|
19
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
20
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
isOwnerAlive: z.ZodNullable<z.ZodBoolean>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type ILockState = z.infer<typeof LockStateSchema>;
|
|
25
|
+
export declare const LocksSchema: z.ZodObject<{
|
|
26
|
+
data: z.ZodArray<z.ZodObject<{
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
state: z.ZodEnum<{
|
|
29
|
+
free: "free";
|
|
30
|
+
held: "held";
|
|
31
|
+
"owner-gone": "owner-gone";
|
|
32
|
+
ownerless: "ownerless";
|
|
33
|
+
"other-host": "other-host";
|
|
34
|
+
"recovery-in-progress": "recovery-in-progress";
|
|
35
|
+
"unexpected-entries": "unexpected-entries";
|
|
36
|
+
}>;
|
|
37
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
38
|
+
pid: z.ZodNumber;
|
|
39
|
+
nonce: z.ZodString;
|
|
40
|
+
hostname: z.ZodString;
|
|
41
|
+
program: z.ZodNullable<z.ZodString>;
|
|
42
|
+
cwd: z.ZodNullable<z.ZodString>;
|
|
43
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
44
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
isOwnerAlive: z.ZodNullable<z.ZodBoolean>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
isTruncated: z.ZodBoolean;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type ILocks = z.infer<typeof LocksSchema>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/*
|
|
3
|
+
* One machine-wide jg-locks lock and its holder, mirroring jg-locks' ILockState. `owner` is null
|
|
4
|
+
* when the lock is free or its owner.json can't be read, and `isOwnerAlive` is null when there is
|
|
5
|
+
* no owner or it runs on another host. jg-locks reads at most 4,096 bytes of owner.json, which
|
|
6
|
+
* bounds every owner string.
|
|
7
|
+
*/
|
|
8
|
+
export const LockStateSchema = z.object({
|
|
9
|
+
name: z.string().regex(/^[a-z0-9][a-z0-9._-]{0,127}$/),
|
|
10
|
+
state: z.enum([
|
|
11
|
+
'free',
|
|
12
|
+
'held',
|
|
13
|
+
'owner-gone',
|
|
14
|
+
'ownerless',
|
|
15
|
+
'other-host',
|
|
16
|
+
'recovery-in-progress',
|
|
17
|
+
'unexpected-entries',
|
|
18
|
+
]),
|
|
19
|
+
owner: z
|
|
20
|
+
.object({
|
|
21
|
+
pid: z.number().int().positive(),
|
|
22
|
+
nonce: z.string().min(1).max(4096),
|
|
23
|
+
hostname: z.string().max(4096),
|
|
24
|
+
program: z.string().max(4096).nullable(),
|
|
25
|
+
cwd: z.string().max(4096).nullable(),
|
|
26
|
+
startedAt: z.string().max(4096).nullable(),
|
|
27
|
+
metadata: z.record(z.string().max(4096), z.string().max(4096)),
|
|
28
|
+
})
|
|
29
|
+
.nullable(),
|
|
30
|
+
isOwnerAlive: z.boolean().nullable(),
|
|
31
|
+
});
|
|
32
|
+
// the present locks sorted by name, at most the 256 jg-locks lists, and whether more exist
|
|
33
|
+
export const LocksSchema = z.object({
|
|
34
|
+
data: z.array(LockStateSchema).max(256),
|
|
35
|
+
isTruncated: z.boolean(),
|
|
36
|
+
});
|
|
@@ -617,25 +617,6 @@ export declare const ProviderCapabilitySetSchema: z.ZodObject<{
|
|
|
617
617
|
message: z.ZodString;
|
|
618
618
|
}, z.core.$strip>;
|
|
619
619
|
}, z.core.$strip>], "state">;
|
|
620
|
-
agentTools: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
621
|
-
state: z.ZodLiteral<"supported">;
|
|
622
|
-
changeMode: z.ZodEnum<{
|
|
623
|
-
live: "live";
|
|
624
|
-
"idle-restart": "idle-restart";
|
|
625
|
-
}>;
|
|
626
|
-
reason: z.ZodNull;
|
|
627
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
628
|
-
state: z.ZodEnum<{
|
|
629
|
-
unknown: "unknown";
|
|
630
|
-
unsupported: "unsupported";
|
|
631
|
-
unavailable: "unavailable";
|
|
632
|
-
}>;
|
|
633
|
-
changeMode: z.ZodNull;
|
|
634
|
-
reason: z.ZodObject<{
|
|
635
|
-
code: z.ZodString;
|
|
636
|
-
message: z.ZodString;
|
|
637
|
-
}, z.core.$strip>;
|
|
638
|
-
}, z.core.$strip>], "state">;
|
|
639
620
|
}, z.core.$strip>;
|
|
640
621
|
inputSchema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
641
622
|
configurationSchema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
@@ -1232,25 +1213,6 @@ export declare const ProviderCapabilitiesSchema: z.ZodObject<{
|
|
|
1232
1213
|
message: z.ZodString;
|
|
1233
1214
|
}, z.core.$strip>;
|
|
1234
1215
|
}, z.core.$strip>], "state">;
|
|
1235
|
-
agentTools: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1236
|
-
state: z.ZodLiteral<"supported">;
|
|
1237
|
-
changeMode: z.ZodEnum<{
|
|
1238
|
-
live: "live";
|
|
1239
|
-
"idle-restart": "idle-restart";
|
|
1240
|
-
}>;
|
|
1241
|
-
reason: z.ZodNull;
|
|
1242
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1243
|
-
state: z.ZodEnum<{
|
|
1244
|
-
unknown: "unknown";
|
|
1245
|
-
unsupported: "unsupported";
|
|
1246
|
-
unavailable: "unavailable";
|
|
1247
|
-
}>;
|
|
1248
|
-
changeMode: z.ZodNull;
|
|
1249
|
-
reason: z.ZodObject<{
|
|
1250
|
-
code: z.ZodString;
|
|
1251
|
-
message: z.ZodString;
|
|
1252
|
-
}, z.core.$strip>;
|
|
1253
|
-
}, z.core.$strip>], "state">;
|
|
1254
1216
|
}, z.core.$strip>;
|
|
1255
1217
|
inputSchema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
1256
1218
|
configurationSchema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
@@ -58,7 +58,6 @@ export const ProviderCapabilitySetSchema = z.object({
|
|
|
58
58
|
accountLogin: ProviderCapabilitySchema,
|
|
59
59
|
accountLoginCancel: ProviderCapabilitySchema,
|
|
60
60
|
accountLogout: ProviderCapabilitySchema,
|
|
61
|
-
agentTools: ProviderCapabilitySchema,
|
|
62
61
|
}),
|
|
63
62
|
inputSchema: z.record(z.string(), z.json()).nullable(),
|
|
64
63
|
configurationSchema: z.record(z.string(), z.json()).nullable(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
// reserve 128 KiB in the 8 MiB frame for action
|
|
2
|
+
// reserve 128 KiB in the 8 MiB frame for action and transport metadata
|
|
3
3
|
export const MAX_RESULT_BYTES = 8_388_608 - 131_072;
|
|
4
4
|
/** Rejects pathological schema depth and size before recursive library validation. */
|
|
5
5
|
const boundSchema = (input) => {
|
|
@@ -38,8 +38,14 @@ export const SessionTransitionSchema = z.object({
|
|
|
38
38
|
reason: SessionTransitionReasonSchema,
|
|
39
39
|
recordedAt: z.number().int(),
|
|
40
40
|
});
|
|
41
|
-
|
|
41
|
+
/*
|
|
42
|
+
* Transitions after a sequence cursor; continue with the last returned sequence. `latestSequence`
|
|
43
|
+
* is the highest sequence ever issued, or 0, and `isReset` is true when the cursor can't continue
|
|
44
|
+
* exactly: it is past `latestSequence`, or its own transition was pruned.
|
|
45
|
+
*/
|
|
42
46
|
export const SessionTransitionPageSchema = z.object({
|
|
43
47
|
data: z.array(SessionTransitionSchema).max(128),
|
|
44
48
|
hasMore: z.boolean(),
|
|
49
|
+
latestSequence: z.number().int().nonnegative(),
|
|
50
|
+
isReset: z.boolean(),
|
|
45
51
|
});
|
|
@@ -26,8 +26,13 @@ export const SkillSchema = z.object({
|
|
|
26
26
|
.max(128)
|
|
27
27
|
.nullable(),
|
|
28
28
|
});
|
|
29
|
+
// the provider's invocation prefix, such as `/` or `$`, is null while its inventory is unavailable
|
|
29
30
|
export const SkillPageSchema = z.object({
|
|
30
31
|
state: z.enum(['available', 'partial', 'unavailable']),
|
|
32
|
+
invocationPrefix: z
|
|
33
|
+
.string()
|
|
34
|
+
.regex(/^[^\s\p{Cc}]{1,8}$/u)
|
|
35
|
+
.nullable(),
|
|
31
36
|
observedAt: z.number().int().nullable(),
|
|
32
37
|
data: z.array(SkillSchema).max(128),
|
|
33
38
|
unavailableCount: z.number().int().nonnegative(),
|