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.
Files changed (232) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +18 -37
  3. package/api/README.md +51 -243
  4. package/dist/actions/actions.d.ts +5 -50
  5. package/dist/actions/actions.js +49 -190
  6. package/dist/actions/reads.d.ts +3 -2
  7. package/dist/actions/reads.js +12 -5
  8. package/dist/actions/waits/index.d.ts +1 -0
  9. package/dist/actions/waits/index.js +2 -0
  10. package/dist/actions/waits/waits.d.ts +37 -0
  11. package/dist/actions/waits/waits.js +107 -0
  12. package/dist/cli/cli.js +6 -56
  13. package/dist/contracts/actions/index.d.ts +2 -4
  14. package/dist/contracts/actions/index.js +1 -3
  15. package/dist/contracts/actions/types.d.ts +135 -142
  16. package/dist/contracts/actions/types.js +12 -22
  17. package/dist/contracts/browser/types.d.ts +12 -605
  18. package/dist/contracts/browser/types.js +2 -5
  19. package/dist/contracts/evidence/types.d.ts +4 -7
  20. package/dist/contracts/evidence/types.js +2 -8
  21. package/dist/contracts/index.d.ts +5 -16
  22. package/dist/contracts/index.js +4 -15
  23. package/dist/contracts/locks/index.d.ts +2 -0
  24. package/dist/contracts/locks/index.js +2 -0
  25. package/dist/contracts/locks/types.d.ts +50 -0
  26. package/dist/contracts/locks/types.js +36 -0
  27. package/dist/contracts/providers/types.d.ts +0 -38
  28. package/dist/contracts/providers/types.js +0 -1
  29. package/dist/contracts/results/types.js +1 -1
  30. package/dist/contracts/sessions/types.d.ts +2 -0
  31. package/dist/contracts/sessions/types.js +7 -1
  32. package/dist/contracts/skills/types.d.ts +1 -0
  33. package/dist/contracts/skills/types.js +5 -0
  34. package/dist/contracts/types.d.ts +4526 -12307
  35. package/dist/contracts/types.js +13 -12
  36. package/dist/index.d.ts +0 -3
  37. package/dist/index.js +0 -2
  38. package/dist/providers/claude/adapter.js +1 -11
  39. package/dist/providers/claude/claude.d.ts +6 -3
  40. package/dist/providers/claude/claude.js +49 -9
  41. package/dist/providers/claude/control/control.d.ts +2 -20
  42. package/dist/providers/claude/control/control.js +88 -155
  43. package/dist/providers/claude/control/permissions.d.ts +0 -9
  44. package/dist/providers/claude/control/permissions.js +0 -22
  45. package/dist/providers/claude/control/skills.js +1 -0
  46. package/dist/providers/claude/control/stream.js +1 -34
  47. package/dist/providers/claude/control/types.d.ts +0 -3
  48. package/dist/providers/claude/history/history.model.d.ts +9 -0
  49. package/dist/providers/claude/history/history.model.js +77 -43
  50. package/dist/providers/claude/history/types.d.ts +284 -3045
  51. package/dist/providers/claude/history/types.js +1 -0
  52. package/dist/providers/claude/rpc.d.ts +0 -5
  53. package/dist/providers/claude/rpc.js +0 -3
  54. package/dist/providers/codex/adapter.js +2 -12
  55. package/dist/providers/codex/codex.d.ts +1 -2
  56. package/dist/providers/codex/codex.js +2 -100
  57. package/dist/providers/codex/types.d.ts +2 -4
  58. package/dist/providers/registry/registry.d.ts +0 -2
  59. package/dist/providers/registry/registry.js +0 -7
  60. package/dist/providers/types.d.ts +4 -6
  61. package/dist/providers/types.js +3 -2
  62. package/dist/runtime/runtime.js +10 -81
  63. package/dist/runtime/types.d.ts +1 -18
  64. package/dist/runtime/types.js +0 -1
  65. package/dist/sessions/sessions.js +0 -1
  66. package/dist/skills/skills.js +3 -0
  67. package/dist/snapshots/archive/archive.js +2 -23
  68. package/dist/snapshots/capture.d.ts +2 -5
  69. package/dist/snapshots/capture.js +4 -85
  70. package/dist/snapshots/constants.d.ts +0 -1
  71. package/dist/snapshots/constants.js +1 -6
  72. package/dist/snapshots/database.d.ts +2 -3
  73. package/dist/snapshots/database.js +9 -114
  74. package/dist/snapshots/fences.d.ts +3 -5
  75. package/dist/snapshots/fences.js +3 -15
  76. package/dist/snapshots/files.d.ts +3 -1
  77. package/dist/snapshots/files.js +15 -4
  78. package/dist/snapshots/snapshots.d.ts +6 -7
  79. package/dist/snapshots/snapshots.js +9 -16
  80. package/dist/snapshots/types.d.ts +5 -81
  81. package/dist/snapshots/types.js +7 -30
  82. package/dist/storage/constants.d.ts +1 -0
  83. package/dist/storage/constants.js +5 -1
  84. package/dist/storage/types.d.ts +1 -0
  85. package/dist/storage/types.js +1 -0
  86. package/dist/store/control/constants.d.ts +3 -2
  87. package/dist/store/control/constants.js +3 -1
  88. package/dist/store/control/control.model.d.ts +1 -11
  89. package/dist/store/control/control.model.js +10 -131
  90. package/dist/store/control/transformers.d.ts +6 -3
  91. package/dist/store/control/transformers.js +6 -5
  92. package/dist/store/control/types.d.ts +91 -170
  93. package/dist/store/control/types.js +5 -7
  94. package/dist/store/schema.js +1 -1
  95. package/dist/store/schema.sql +3 -360
  96. package/dist/store/sessions/sessions.model.d.ts +10 -6
  97. package/dist/store/sessions/sessions.model.js +19 -2
  98. package/dist/store/snapshot.d.ts +10 -0
  99. package/dist/store/snapshot.js +37 -0
  100. package/dist/store/store.js +1 -54
  101. package/dist/store/store.worker.js +5 -97
  102. package/dist/store/types.d.ts +241 -4802
  103. package/dist/store/types.js +1 -44
  104. package/docs/recovery.md +10 -6
  105. package/errors/README.md +29 -39
  106. package/package.json +3 -4
  107. package/dist/agent-tools/agent-tools.d.ts +0 -6
  108. package/dist/agent-tools/agent-tools.js +0 -181
  109. package/dist/agent-tools/constants.d.ts +0 -7
  110. package/dist/agent-tools/constants.js +0 -45
  111. package/dist/agent-tools/index.d.ts +0 -4
  112. package/dist/agent-tools/index.js +0 -4
  113. package/dist/agent-tools/mcp/index.d.ts +0 -1
  114. package/dist/agent-tools/mcp/index.js +0 -2
  115. package/dist/agent-tools/mcp/mcp.d.ts +0 -7
  116. package/dist/agent-tools/mcp/mcp.js +0 -50
  117. package/dist/agent-tools/types.d.ts +0 -64
  118. package/dist/agent-tools/types.js +0 -1
  119. package/dist/agent-tools/utilities.d.ts +0 -13
  120. package/dist/agent-tools/utilities.js +0 -37
  121. package/dist/collaboration/collaboration.d.ts +0 -7
  122. package/dist/collaboration/collaboration.js +0 -119
  123. package/dist/collaboration/constants.d.ts +0 -2
  124. package/dist/collaboration/constants.js +0 -3
  125. package/dist/collaboration/dispatch/dispatch.d.ts +0 -12
  126. package/dist/collaboration/dispatch/dispatch.js +0 -148
  127. package/dist/collaboration/dispatch/index.d.ts +0 -3
  128. package/dist/collaboration/dispatch/index.js +0 -4
  129. package/dist/collaboration/dispatch/types.d.ts +0 -632
  130. package/dist/collaboration/dispatch/types.js +0 -44
  131. package/dist/collaboration/grants/grants.d.ts +0 -45
  132. package/dist/collaboration/grants/grants.js +0 -131
  133. package/dist/collaboration/grants/index.d.ts +0 -1
  134. package/dist/collaboration/grants/index.js +0 -2
  135. package/dist/collaboration/identity/credentials.d.ts +0 -17
  136. package/dist/collaboration/identity/credentials.js +0 -182
  137. package/dist/collaboration/identity/index.d.ts +0 -4
  138. package/dist/collaboration/identity/index.js +0 -4
  139. package/dist/collaboration/identity/types.d.ts +0 -171
  140. package/dist/collaboration/identity/types.js +0 -87
  141. package/dist/collaboration/index.d.ts +0 -3
  142. package/dist/collaboration/index.js +0 -3
  143. package/dist/collaboration/types.d.ts +0 -25
  144. package/dist/collaboration/types.js +0 -1
  145. package/dist/contracts/agent-tools/index.d.ts +0 -2
  146. package/dist/contracts/agent-tools/index.js +0 -2
  147. package/dist/contracts/agent-tools/types.d.ts +0 -697
  148. package/dist/contracts/agent-tools/types.js +0 -125
  149. package/dist/contracts/collaboration/index.d.ts +0 -4
  150. package/dist/contracts/collaboration/index.js +0 -4
  151. package/dist/contracts/collaboration/reports/constants.d.ts +0 -1
  152. package/dist/contracts/collaboration/reports/constants.js +0 -2
  153. package/dist/contracts/collaboration/reports/index.d.ts +0 -3
  154. package/dist/contracts/collaboration/reports/index.js +0 -3
  155. package/dist/contracts/collaboration/reports/types.d.ts +0 -69
  156. package/dist/contracts/collaboration/reports/types.js +0 -53
  157. package/dist/contracts/collaboration/types.d.ts +0 -6734
  158. package/dist/contracts/collaboration/types.js +0 -696
  159. package/dist/contracts/plans/index.d.ts +0 -6
  160. package/dist/contracts/plans/index.js +0 -6
  161. package/dist/contracts/plans/types.d.ts +0 -1788
  162. package/dist/contracts/plans/types.js +0 -278
  163. package/dist/plans/admission.d.ts +0 -288
  164. package/dist/plans/admission.js +0 -393
  165. package/dist/plans/authority.d.ts +0 -21
  166. package/dist/plans/authority.js +0 -207
  167. package/dist/plans/documents.d.ts +0 -80
  168. package/dist/plans/documents.js +0 -238
  169. package/dist/plans/evidence.d.ts +0 -11
  170. package/dist/plans/evidence.js +0 -211
  171. package/dist/plans/files.d.ts +0 -55
  172. package/dist/plans/files.js +0 -264
  173. package/dist/plans/finalization.d.ts +0 -11
  174. package/dist/plans/finalization.js +0 -30
  175. package/dist/plans/index.d.ts +0 -5
  176. package/dist/plans/index.js +0 -6
  177. package/dist/plans/plans.d.ts +0 -325
  178. package/dist/plans/plans.js +0 -803
  179. package/dist/plans/projections.d.ts +0 -13
  180. package/dist/plans/projections.js +0 -67
  181. package/dist/plans/revisions.d.ts +0 -50
  182. package/dist/plans/revisions.js +0 -181
  183. package/dist/plans/types.d.ts +0 -114
  184. package/dist/plans/types.js +0 -43
  185. package/dist/plans/utilities.d.ts +0 -36
  186. package/dist/plans/utilities.js +0 -62
  187. package/dist/snapshots/artifacts.d.ts +0 -16
  188. package/dist/snapshots/artifacts.js +0 -75
  189. package/dist/store/collaboration/authority.d.ts +0 -228
  190. package/dist/store/collaboration/authority.js +0 -128
  191. package/dist/store/collaboration/collaboration.model.d.ts +0 -412
  192. package/dist/store/collaboration/collaboration.model.js +0 -254
  193. package/dist/store/collaboration/constants.d.ts +0 -13
  194. package/dist/store/collaboration/constants.js +0 -14
  195. package/dist/store/collaboration/dispatch.d.ts +0 -19
  196. package/dist/store/collaboration/dispatch.js +0 -197
  197. package/dist/store/collaboration/identity.d.ts +0 -21
  198. package/dist/store/collaboration/identity.js +0 -146
  199. package/dist/store/collaboration/index.d.ts +0 -3
  200. package/dist/store/collaboration/index.js +0 -5
  201. package/dist/store/collaboration/invocation.d.ts +0 -21
  202. package/dist/store/collaboration/invocation.js +0 -162
  203. package/dist/store/collaboration/messages.d.ts +0 -54
  204. package/dist/store/collaboration/messages.js +0 -157
  205. package/dist/store/collaboration/outcomes.d.ts +0 -11
  206. package/dist/store/collaboration/outcomes.js +0 -216
  207. package/dist/store/collaboration/queries.d.ts +0 -23
  208. package/dist/store/collaboration/queries.js +0 -259
  209. package/dist/store/collaboration/reports.d.ts +0 -37
  210. package/dist/store/collaboration/reports.js +0 -117
  211. package/dist/store/collaboration/requests.d.ts +0 -22
  212. package/dist/store/collaboration/requests.js +0 -111
  213. package/dist/store/collaboration/search.d.ts +0 -13
  214. package/dist/store/collaboration/search.js +0 -58
  215. package/dist/store/collaboration/spawn.d.ts +0 -33
  216. package/dist/store/collaboration/spawn.js +0 -96
  217. package/dist/store/collaboration/streams.d.ts +0 -13
  218. package/dist/store/collaboration/streams.js +0 -100
  219. package/dist/store/collaboration/tasks.d.ts +0 -20
  220. package/dist/store/collaboration/tasks.js +0 -169
  221. package/dist/store/collaboration/transformers.d.ts +0 -56
  222. package/dist/store/collaboration/transformers.js +0 -179
  223. package/dist/store/collaboration/types.d.ts +0 -25
  224. package/dist/store/collaboration/types.js +0 -8
  225. package/dist/store/collaboration/utilities.d.ts +0 -23
  226. package/dist/store/collaboration/utilities.js +0 -77
  227. package/dist/store/collaboration/waits.d.ts +0 -26
  228. package/dist/store/collaboration/waits.js +0 -114
  229. package/dist/store/plans/index.d.ts +0 -1
  230. package/dist/store/plans/index.js +0 -2
  231. package/dist/store/plans/plans.model.d.ts +0 -47
  232. package/dist/store/plans/plans.model.js +0 -179
@@ -1,11 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { ActionEnvelopeSchema, ActionReceiptSchema, ActionSummarySchema, ActionPlanContextSchema, ManagedThreadSchema, NativeApprovalSchema, } from '../actions/index.js';
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 plan context, pending approvals, live items and recent actions
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 is shared by trusted hosts and scoped agent tools
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';
@@ -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,2 @@
1
+ export { LockStateSchema, LocksSchema } from './types.js';
2
+ export type { ILockState, ILocks } from './types.js';
@@ -0,0 +1,2 @@
1
+ // machine-wide jg-locks locks
2
+ export { LockStateSchema, LocksSchema } from './types.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, plan and transport metadata
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) => {
@@ -103,4 +103,6 @@ export declare const SessionTransitionPageSchema: z.ZodObject<{
103
103
  recordedAt: z.ZodNumber;
104
104
  }, z.core.$strip>>;
105
105
  hasMore: z.ZodBoolean;
106
+ latestSequence: z.ZodNumber;
107
+ isReset: z.ZodBoolean;
106
108
  }, z.core.$strip>;
@@ -38,8 +38,14 @@ export const SessionTransitionSchema = z.object({
38
38
  reason: SessionTransitionReasonSchema,
39
39
  recordedAt: z.number().int(),
40
40
  });
41
- // transitions after a sequence cursor; continue with the last returned sequence
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
  });
@@ -32,6 +32,7 @@ export declare const SkillPageSchema: z.ZodObject<{
32
32
  available: "available";
33
33
  partial: "partial";
34
34
  }>;
35
+ invocationPrefix: z.ZodNullable<z.ZodString>;
35
36
  observedAt: z.ZodNullable<z.ZodNumber>;
36
37
  data: z.ZodArray<z.ZodObject<{
37
38
  id: z.ZodString;
@@ -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(),