@kici-dev/engine 0.0.0 → 0.1.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 (129) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +1 -6
  3. package/dist/audit/access-log-policy.d.ts +97 -0
  4. package/dist/audit/access-log-policy.js +195 -0
  5. package/dist/audit/activity.d.ts +156 -0
  6. package/dist/audit/activity.js +175 -0
  7. package/dist/audit/retention-policy.d.ts +157 -0
  8. package/dist/audit/retention-policy.js +364 -0
  9. package/dist/bundler/index.d.ts +3 -0
  10. package/dist/bundler/index.js +3 -0
  11. package/dist/bundler/rolldown-config.d.ts +41 -0
  12. package/dist/bundler/rolldown-config.js +40 -0
  13. package/dist/chunk-gOLHoazu.js +4 -0
  14. package/dist/env/environment-allowlist.d.ts +45 -0
  15. package/dist/env/environment-allowlist.js +69 -0
  16. package/dist/environment/index.d.ts +3 -0
  17. package/dist/environment/index.js +3 -0
  18. package/dist/environment/scope-resolver.d.ts +35 -0
  19. package/dist/environment/scope-resolver.js +77 -0
  20. package/dist/environment/types.d.ts +98 -0
  21. package/dist/environment/types.js +2 -0
  22. package/dist/index.d.ts +54 -0
  23. package/dist/index.js +45 -0
  24. package/dist/labels.d.ts +106 -0
  25. package/dist/labels.js +162 -0
  26. package/dist/metrics/metric-catalog.generated.d.ts +400 -0
  27. package/dist/metrics/metric-catalog.generated.js +510 -0
  28. package/dist/protocol/dashboard-global-workflows.d.ts +9 -0
  29. package/dist/protocol/dashboard-global-workflows.js +3 -0
  30. package/dist/protocol/event-log-payload.d.ts +16 -0
  31. package/dist/protocol/event-log-payload.js +21 -0
  32. package/dist/protocol/messages/access-log.d.ts +545 -0
  33. package/dist/protocol/messages/access-log.js +175 -0
  34. package/dist/protocol/messages/actor.d.ts +100 -0
  35. package/dist/protocol/messages/actor.js +139 -0
  36. package/dist/protocol/messages/auth.d.ts +25 -0
  37. package/dist/protocol/messages/auth.js +36 -0
  38. package/dist/protocol/messages/browser.d.ts +369 -0
  39. package/dist/protocol/messages/browser.js +225 -0
  40. package/dist/protocol/messages/capabilities.d.ts +46 -0
  41. package/dist/protocol/messages/capabilities.js +42 -0
  42. package/dist/protocol/messages/common.d.ts +53 -0
  43. package/dist/protocol/messages/common.js +55 -0
  44. package/dist/protocol/messages/dashboard-global-workflows.d.ts +166 -0
  45. package/dist/protocol/messages/dashboard-global-workflows.js +80 -0
  46. package/dist/protocol/messages/dashboard.d.ts +4068 -0
  47. package/dist/protocol/messages/dashboard.js +1237 -0
  48. package/dist/protocol/messages/event-log.d.ts +49 -0
  49. package/dist/protocol/messages/event-log.js +45 -0
  50. package/dist/protocol/messages/execution-status.d.ts +164 -0
  51. package/dist/protocol/messages/execution-status.js +166 -0
  52. package/dist/protocol/messages/join.d.ts +18 -0
  53. package/dist/protocol/messages/join.js +28 -0
  54. package/dist/protocol/messages/log-pull.d.ts +27 -0
  55. package/dist/protocol/messages/log-pull.js +36 -0
  56. package/dist/protocol/messages/observe.d.ts +75 -0
  57. package/dist/protocol/messages/observe.js +70 -0
  58. package/dist/protocol/messages/orchestrator-agent.d.ts +606 -0
  59. package/dist/protocol/messages/orchestrator-agent.js +481 -0
  60. package/dist/protocol/messages/peer.d.ts +795 -0
  61. package/dist/protocol/messages/peer.js +372 -0
  62. package/dist/protocol/messages/platform-orchestrator.d.ts +1888 -0
  63. package/dist/protocol/messages/platform-orchestrator.js +379 -0
  64. package/dist/protocol/messages/run-events.d.ts +155 -0
  65. package/dist/protocol/messages/run-events.js +115 -0
  66. package/dist/protocol/messages/saas-orchestrator.d.ts +2179 -0
  67. package/dist/protocol/messages/source-registration.d.ts +103 -0
  68. package/dist/protocol/messages/source-registration.js +109 -0
  69. package/dist/protocol/messages/test-run.d.ts +59 -0
  70. package/dist/protocol/messages/test-run.js +52 -0
  71. package/dist/protocol/version.d.ts +12 -0
  72. package/dist/protocol/version.js +17 -0
  73. package/dist/provider/changed-files-fetcher.d.ts +24 -0
  74. package/dist/provider/changed-files-fetcher.js +2 -0
  75. package/dist/provider/check-run-conclusion.d.ts +15 -0
  76. package/dist/provider/check-run-conclusion.js +19 -0
  77. package/dist/provider/check-status-poster.d.ts +15 -0
  78. package/dist/provider/check-status-poster.js +2 -0
  79. package/dist/provider/clone-token-provider.d.ts +58 -0
  80. package/dist/provider/clone-token-provider.js +2 -0
  81. package/dist/provider/contributor-resolver.d.ts +22 -0
  82. package/dist/provider/contributor-resolver.js +2 -0
  83. package/dist/provider/index.d.ts +23 -0
  84. package/dist/provider/index.js +3 -0
  85. package/dist/provider/lock-file-fetcher.d.ts +24 -0
  86. package/dist/provider/lock-file-fetcher.js +2 -0
  87. package/dist/provider/repo-url-builder.d.ts +35 -0
  88. package/dist/provider/repo-url-builder.js +2 -0
  89. package/dist/provider/types.d.ts +9 -0
  90. package/dist/provider/types.js +2 -0
  91. package/dist/provider/webhook-normalizer.d.ts +163 -0
  92. package/dist/provider/webhook-normalizer.js +2 -0
  93. package/dist/registration/registerable-trigger-type.d.ts +52 -0
  94. package/dist/registration/registerable-trigger-type.js +56 -0
  95. package/dist/scaler/resource-types.d.ts +90 -0
  96. package/dist/scaler/resource-types.js +99 -0
  97. package/dist/scaler/scaler-backend-type.d.ts +16 -0
  98. package/dist/scaler/scaler-backend-type.js +20 -0
  99. package/dist/secrets/index.d.ts +7 -0
  100. package/dist/secrets/index.js +2 -0
  101. package/dist/secrets/types.d.ts +138 -0
  102. package/dist/secrets/types.js +2 -0
  103. package/dist/state-machine/index.d.ts +2 -0
  104. package/dist/state-machine/index.js +3 -0
  105. package/dist/state-machine/machine.d.ts +34 -0
  106. package/dist/state-machine/machine.js +103 -0
  107. package/dist/state-machine/types.d.ts +34 -0
  108. package/dist/state-machine/types.js +15 -0
  109. package/dist/trigger/decision-trace.d.ts +41 -0
  110. package/dist/trigger/decision-trace.js +30 -0
  111. package/dist/trigger/jsonpath-matcher.d.ts +27 -0
  112. package/dist/trigger/jsonpath-matcher.js +92 -0
  113. package/dist/trigger/matcher.d.ts +29 -0
  114. package/dist/trigger/matcher.js +704 -0
  115. package/dist/trigger/trigger-event-type.d.ts +14 -0
  116. package/dist/trigger/trigger-event-type.js +66 -0
  117. package/dist/trigger/types.d.ts +524 -0
  118. package/dist/trigger/types.js +48 -0
  119. package/dist/webhook/signature.d.ts +15 -0
  120. package/dist/webhook/signature.js +32 -0
  121. package/dist/ws/close-codes.d.ts +28 -0
  122. package/dist/ws/close-codes.js +33 -0
  123. package/dist/ws/rate-limiter.d.ts +86 -0
  124. package/dist/ws/rate-limiter.js +136 -0
  125. package/dist/ws/ws-like.d.ts +12 -0
  126. package/dist/ws/ws-like.js +2 -0
  127. package/package.json +54 -6
  128. package/sbom.spdx.json +202 -0
  129. package/index.js +0 -3
@@ -0,0 +1,372 @@
1
+ import "../../chunk-gOLHoazu.js";
2
+ import { ExecutionJobStatus } from "./execution-status.js";
3
+ import { z } from "zod";
4
+ //#region src/protocol/messages/peer.ts
5
+ /** Agent summary included in peer heartbeat and auth response messages. */
6
+ const peerAgentSummarySchema = z.object({
7
+ agentId: z.string(),
8
+ labels: z.array(z.string()),
9
+ activeJobs: z.number(),
10
+ maxConcurrency: z.number(),
11
+ platform: z.string(),
12
+ arch: z.string(),
13
+ /**
14
+ * Kubernetes-taint-style mandatory labels inherited from the spawning
15
+ * scaler (empty / omitted for static agents and warm-pool replenishment
16
+ * spawns). Cross-peer routing applies the same gate the local label
17
+ * matcher does: a connected-agent entry only matches when every
18
+ * mandatory label appears in the required label set.
19
+ *
20
+ * Optional + default `[]` for legacy peers — older orchestrators that
21
+ * predate the gate omit the field, and the coordinator falls back to
22
+ * "no gate" routing for those agents (matching pre-gate behavior).
23
+ */
24
+ mandatoryLabels: z.array(z.string()).optional().default([])
25
+ });
26
+ /** Peer capabilities advertised during heartbeat and auth response. */
27
+ const peerCapabilitiesSchema = z.object({
28
+ s3LogAccess: z.boolean(),
29
+ logRoutingOverride: z.enum(["direct", "coordinator"]).optional()
30
+ });
31
+ /** Scaler capacity summary included in peer heartbeat and auth response for routing decisions. */
32
+ const scalerCapacitySummarySchema = z.object({
33
+ /** Scaler backend name (e.g. "stg-worker-bare-metal") */
34
+ name: z.string().optional(),
35
+ /** Scaler backend type (e.g. "bare-metal", "container") */
36
+ type: z.string().optional(),
37
+ /** Label sets this scaler backend can provision */
38
+ labelSets: z.array(z.array(z.string())),
39
+ /** Maximum agents for this backend */
40
+ maxAgents: z.number(),
41
+ /** Current active count for this backend */
42
+ activeCount: z.number(),
43
+ /**
44
+ * Labels a job MUST declare in `runsOn` to be allowed on this backend
45
+ * (Kubernetes-taint-style opt-in gate). When omitted (legacy peer) or
46
+ * empty the backend has no gate. Cross-peer routing applies the same
47
+ * rule as the local label matcher: a scaler-capacity entry only
48
+ * matches when every mandatory label appears in the required label set.
49
+ */
50
+ mandatoryLabels: z.array(z.string()).optional().default([])
51
+ });
52
+ /** Peer hello: initiator sends ephemeral X25519 public key and nonce. */
53
+ const peerHelloSchema = z.object({
54
+ type: z.literal("peer.hello"),
55
+ /** Base64-encoded X25519 DER SPKI ephemeral public key. */
56
+ ephemeralPublicKey: z.string(),
57
+ /** Base64-encoded 32-byte random nonce (HKDF salt). */
58
+ nonce: z.string()
59
+ });
60
+ /** Peer hello response: responder sends their ephemeral X25519 public key. */
61
+ const peerHelloResponseSchema = z.object({
62
+ type: z.literal("peer.hello.response"),
63
+ /** Base64-encoded X25519 DER SPKI ephemeral public key. */
64
+ ephemeralPublicKey: z.string()
65
+ });
66
+ /** Peer auth request sent after ECDH handshake (encrypted channel established). */
67
+ const peerAuthRequestSchema = z.object({
68
+ type: z.literal("peer.auth.request"),
69
+ instanceId: z.string(),
70
+ /** Join token (first connection via token-based auth). */
71
+ token: z.string().optional(),
72
+ /** HMAC proof of credential ownership (reconnection). */
73
+ proof: z.string().optional(),
74
+ protocolVersion: z.number(),
75
+ /** Software version of the connecting peer (for version compat check). */
76
+ softwareVersion: z.string().optional(),
77
+ /** Role of the connecting peer. */
78
+ role: z.enum(["coordinator", "worker"]).optional()
79
+ });
80
+ /** Peer auth response indicating whether the connection was accepted. */
81
+ const peerAuthResponseSchema = z.object({
82
+ type: z.literal("peer.auth.response"),
83
+ accepted: z.boolean(),
84
+ instanceId: z.string().optional(),
85
+ reason: z.string().optional(),
86
+ /** Session credential issued on first join (worker stores for reconnection). */
87
+ sessionCredential: z.string().optional(),
88
+ /** Assigned role echoed back to the connecting peer. */
89
+ role: z.string().optional(),
90
+ /** Software version of the coordinator (for version compat check). */
91
+ softwareVersion: z.string().optional(),
92
+ agents: z.array(peerAgentSummarySchema).optional(),
93
+ scalerCapacity: z.array(scalerCapacitySummarySchema).optional(),
94
+ capabilities: peerCapabilitiesSchema.optional()
95
+ });
96
+ /** Periodic heartbeat from one orchestrator to its peers. */
97
+ const peerHeartbeatSchema = z.object({
98
+ type: z.literal("peer.heartbeat"),
99
+ instanceId: z.string(),
100
+ term: z.number(),
101
+ leaderId: z.string().nullable(),
102
+ draining: z.boolean(),
103
+ agents: z.array(peerAgentSummarySchema),
104
+ capabilities: peerCapabilitiesSchema,
105
+ /** Optional scaler capacity data for on-demand backends (backward compatible). */
106
+ scalerCapacity: z.array(scalerCapacitySummarySchema).optional(),
107
+ /** Shared config version for cross-orchestrator config sync (backward compatible). */
108
+ configVersion: z.number().optional(),
109
+ /** Registry version for cross-orchestrator registration sync (backward compatible). */
110
+ registryVersion: z.number().optional(),
111
+ timestamp: z.number(),
112
+ hostname: z.string().optional(),
113
+ osRelease: z.string().optional(),
114
+ totalMemoryMb: z.number().optional(),
115
+ memoryUsedMb: z.number().optional(),
116
+ memoryAvailableMb: z.number().optional(),
117
+ cpuCount: z.number().optional(),
118
+ uptimeSeconds: z.number().optional(),
119
+ nodeVersion: z.string().optional(),
120
+ runningAsUser: z.string().nullable().optional(),
121
+ runningAsUid: z.number().nullable().optional(),
122
+ version: z.string().optional()
123
+ });
124
+ /** Request to reroute a job to another orchestrator (no local agent can handle it). */
125
+ const jobRerouteSchema = z.object({
126
+ type: z.literal("job.reroute"),
127
+ messageId: z.string(),
128
+ /**
129
+ * Pre-allocated job identifier. The sending coordinator MUST allocate
130
+ * the jobId before sending so it can register the execution_runs +
131
+ * execution_jobs rows under that id in its own DB. Receiving peer
132
+ * (worker or coord) MUST use this exact id when dispatching to its
133
+ * agent — without that, the agent's later `job.status`/`step.status`
134
+ * messages reference a jobId the owning coord never wrote to the DB,
135
+ * and the run silently stalls at `running`.
136
+ */
137
+ jobId: z.string(),
138
+ runId: z.string(),
139
+ deliveryId: z.string(),
140
+ routingKey: z.string(),
141
+ event: z.string(),
142
+ action: z.string().nullable(),
143
+ payload: z.record(z.string(), z.unknown()),
144
+ jobName: z.string(),
145
+ workflowName: z.string(),
146
+ runsOnLabels: z.array(z.array(z.string())),
147
+ /** Labels that the dispatched agent must NOT have (optional for backward compatibility). */
148
+ excludeLabels: z.array(z.string()).optional(),
149
+ triedConnections: z.array(z.string()),
150
+ maxHops: z.number(),
151
+ coordinatorId: z.string(),
152
+ requestId: z.string().optional(),
153
+ traceId: z.string().optional(),
154
+ /** Resolved job configuration (steps, rules, matrix, etc.) for the receiving orch to dispatch. */
155
+ jobConfig: z.record(z.string(), z.unknown()).optional(),
156
+ /** Clone URL for the repository. */
157
+ repoUrl: z.string().optional(),
158
+ /** Git ref (branch name). */
159
+ ref: z.string().optional(),
160
+ /** Commit SHA. */
161
+ sha: z.string().optional(),
162
+ /** Provider type (e.g. 'github'). */
163
+ provider: z.string().optional(),
164
+ /** Provider-specific context (e.g. { installationId }). */
165
+ providerContext: z.record(z.string(), z.unknown()).optional(),
166
+ /** Pre-signed source tarball download URL (cache hit). */
167
+ sourceTarUrl: z.string().optional(),
168
+ /** SHA-256 hash of the source tarball bytes for integrity verification. */
169
+ sourceTarHash: z.string().optional(),
170
+ /** Pre-signed dependency tarball download URL (cache hit). */
171
+ depsUrl: z.string().optional(),
172
+ /** Dependency tarball hash for cache keying. */
173
+ depsHash: z.string().optional(),
174
+ /** Pre-resolved clone token for workers without provider credentials. */
175
+ cloneToken: z.string().optional(),
176
+ /** Encrypted secrets envelope (AES-256-GCM with session key). */
177
+ encryptedSecrets: z.string().optional(),
178
+ /** Encrypted namespaced secrets envelope. */
179
+ encryptedNamespacedSecrets: z.string().optional()
180
+ });
181
+ /** Acknowledgment of a job reroute request. */
182
+ const jobRerouteAckSchema = z.object({
183
+ type: z.literal("job.reroute.ack"),
184
+ messageId: z.string(),
185
+ accepted: z.boolean(),
186
+ reason: z.string().optional()
187
+ });
188
+ /**
189
+ * Job or step progress update forwarded from a worker peer to its owning
190
+ * coordinator (the coord that has the run rows in its DB).
191
+ *
192
+ * `kind` is the discriminator the coord uses to decide which downstream
193
+ * call to make:
194
+ * - kind='job' → ExecutionTracker.onJobStatus, which is what drives the
195
+ * run-level state machine (running → success/failed/...).
196
+ * `stepIndex`/`stepName` are unused for this kind.
197
+ * - kind='step' → ExecutionTracker.onStepStatus, which only persists step
198
+ * rows. `stepIndex`/`stepName` MUST point at the step.
199
+ *
200
+ * Without the discriminator, the coord conflated the two and silently
201
+ * dropped every job-level event into onStepStatus, so the run never
202
+ * advanced past `running` for a peer-rerouted job.
203
+ *
204
+ * `state` is typed as the full ExecutionJobStatus enum because the worker
205
+ * forwards the agent's job.status verbatim; ExecutionStepStatus is a
206
+ * strict subset and the coord trusts `kind` to route correctly.
207
+ */
208
+ const jobProgressSchema = z.object({
209
+ type: z.literal("job.progress"),
210
+ kind: z.enum(["job", "step"]),
211
+ runId: z.string(),
212
+ jobId: z.string(),
213
+ jobName: z.string(),
214
+ stepIndex: z.number(),
215
+ stepName: z.string(),
216
+ state: ExecutionJobStatus,
217
+ timestamp: z.number(),
218
+ data: z.record(z.string(), z.unknown()).optional()
219
+ });
220
+ /** Request to cancel a job on a peer orchestrator. */
221
+ const peerJobCancelSchema = z.object({
222
+ type: z.literal("peer.job.cancel"),
223
+ runId: z.string(),
224
+ jobId: z.string().optional(),
225
+ reason: z.string(),
226
+ /** When true, force-cancel immediately without waiting for hooks. */
227
+ force: z.boolean().optional()
228
+ });
229
+ /** Raft vote request during leader election. */
230
+ const raftVoteRequestSchema = z.object({
231
+ type: z.literal("raft.vote.request"),
232
+ term: z.number(),
233
+ candidateId: z.string(),
234
+ lastLogIndex: z.number(),
235
+ lastLogTerm: z.number()
236
+ });
237
+ /** Raft vote response from a peer. */
238
+ const raftVoteResponseSchema = z.object({
239
+ type: z.literal("raft.vote.response"),
240
+ term: z.number(),
241
+ voteGranted: z.boolean(),
242
+ voterId: z.string()
243
+ });
244
+ /** Raft append entries (leader heartbeat only, no log entries). */
245
+ const raftAppendEntriesSchema = z.object({
246
+ type: z.literal("raft.append.entries"),
247
+ term: z.number(),
248
+ leaderId: z.string()
249
+ });
250
+ /** Log chunk relay: worker -> coordinator. Batched log lines from agent execution. */
251
+ const peerLogChunkSchema = z.object({
252
+ type: z.literal("peer.log.chunk"),
253
+ runId: z.string(),
254
+ jobId: z.string(),
255
+ stepIndex: z.number(),
256
+ lines: z.array(z.object({
257
+ text: z.string(),
258
+ timestamp: z.number(),
259
+ stream: z.enum(["stdout", "stderr"]).optional()
260
+ }))
261
+ });
262
+ /** Cache upload request: worker -> coordinator. Worker agent needs upload URL. */
263
+ const peerCacheUploadRequestSchema = z.object({
264
+ type: z.literal("peer.cache.upload.request"),
265
+ messageId: z.string(),
266
+ runId: z.string(),
267
+ jobId: z.string(),
268
+ cacheType: z.enum(["source", "deps"]),
269
+ hash: z.string(),
270
+ sizeBytes: z.number()
271
+ });
272
+ /** Cache upload response: coordinator -> worker. Pre-signed upload URL. */
273
+ const peerCacheUploadResponseSchema = z.object({
274
+ type: z.literal("peer.cache.upload.response"),
275
+ messageId: z.string(),
276
+ runId: z.string(),
277
+ jobId: z.string(),
278
+ uploadUrl: z.string()
279
+ });
280
+ /**
281
+ * Config reload request: forwarded from one orchestrator to a specific peer
282
+ * when an operator calls POST /admin/config/reload with a `target` parameter.
283
+ * The receiving peer executes a local reload and replies with
284
+ * peer.config.reload.response.
285
+ */
286
+ const peerConfigReloadSchema = z.object({
287
+ type: z.literal("peer.config.reload"),
288
+ messageId: z.string(),
289
+ /** Whether to drain in-flight work before reloading. */
290
+ drain: z.boolean().optional()
291
+ });
292
+ /**
293
+ * Config reload response: sent back from the target peer carrying the
294
+ * ReloadResult fields produced by ConfigReloader.executeReload().
295
+ */
296
+ const peerConfigReloadResponseSchema = z.object({
297
+ type: z.literal("peer.config.reload.response"),
298
+ messageId: z.string(),
299
+ success: z.boolean(),
300
+ version: z.number().optional(),
301
+ errors: z.array(z.string()).optional(),
302
+ restartRequired: z.array(z.string()).optional(),
303
+ fieldsChanged: z.array(z.string()).optional()
304
+ });
305
+ /** Graceful shutdown announcement. Peers remove sender from registry immediately. */
306
+ const peerLeavingSchema = z.object({
307
+ type: z.literal("peer.leaving"),
308
+ instanceId: z.string(),
309
+ /** Current Raft term for leader identification */
310
+ term: z.number()
311
+ });
312
+ /**
313
+ * Notify every peer that an agent token has been revoked so each peer can
314
+ * close its own in-flight WS connections authenticated by that token.
315
+ * The originating peer kicks locally first (via the DELETE admin route),
316
+ * then broadcasts this message over the encrypted peer mesh.
317
+ */
318
+ const peerAgentTokenRevokeSchema = z.object({
319
+ type: z.literal("peer.agent-token.revoke"),
320
+ /** The `agent_tokens.id` whose in-flight WS must be kicked on every peer. */
321
+ tokenId: z.string().min(1),
322
+ /** Originating peer's instanceId — for log correlation across the cluster. */
323
+ senderInstanceId: z.string().min(1)
324
+ });
325
+ /** All peer-to-peer messages (outbound from this node). */
326
+ const peerToPeerMessageSchema = z.discriminatedUnion("type", [
327
+ peerHelloSchema,
328
+ peerHelloResponseSchema,
329
+ peerAuthRequestSchema,
330
+ peerAuthResponseSchema,
331
+ peerHeartbeatSchema,
332
+ jobRerouteSchema,
333
+ jobRerouteAckSchema,
334
+ jobProgressSchema,
335
+ peerJobCancelSchema,
336
+ raftVoteRequestSchema,
337
+ raftVoteResponseSchema,
338
+ raftAppendEntriesSchema,
339
+ peerLogChunkSchema,
340
+ peerCacheUploadRequestSchema,
341
+ peerCacheUploadResponseSchema,
342
+ peerConfigReloadSchema,
343
+ peerConfigReloadResponseSchema,
344
+ peerLeavingSchema,
345
+ peerAgentTokenRevokeSchema
346
+ ]);
347
+ /** All peer-to-peer messages (inbound to this node). */
348
+ const peerFromPeerMessageSchema = z.discriminatedUnion("type", [
349
+ peerHelloSchema,
350
+ peerHelloResponseSchema,
351
+ peerAuthRequestSchema,
352
+ peerAuthResponseSchema,
353
+ peerHeartbeatSchema,
354
+ jobRerouteSchema,
355
+ jobRerouteAckSchema,
356
+ jobProgressSchema,
357
+ peerJobCancelSchema,
358
+ raftVoteRequestSchema,
359
+ raftVoteResponseSchema,
360
+ raftAppendEntriesSchema,
361
+ peerLogChunkSchema,
362
+ peerCacheUploadRequestSchema,
363
+ peerCacheUploadResponseSchema,
364
+ peerConfigReloadSchema,
365
+ peerConfigReloadResponseSchema,
366
+ peerLeavingSchema,
367
+ peerAgentTokenRevokeSchema
368
+ ]);
369
+ //#endregion
370
+ export { jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema };
371
+
372
+ //# sourceMappingURL=peer.js.map