@leitwerk-dev/worker-protocol 0.1.2 → 0.1.4

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 (45) hide show
  1. package/dist/index.d.ts +11 -448
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +10 -451
  4. package/dist/index.js.map +1 -1
  5. package/dist/ipc-codec.d.ts +29 -0
  6. package/dist/ipc-codec.d.ts.map +1 -0
  7. package/dist/ipc-codec.js +48 -0
  8. package/dist/ipc-codec.js.map +1 -0
  9. package/dist/ipc-decode.d.ts +19 -0
  10. package/dist/ipc-decode.d.ts.map +1 -0
  11. package/dist/ipc-decode.js +68 -0
  12. package/dist/ipc-decode.js.map +1 -0
  13. package/dist/ipc-messages.d.ts +310 -0
  14. package/dist/ipc-messages.d.ts.map +1 -0
  15. package/dist/ipc-messages.js +14 -0
  16. package/dist/ipc-messages.js.map +1 -0
  17. package/dist/pi-resource-bundle.d.ts +19 -0
  18. package/dist/pi-resource-bundle.d.ts.map +1 -0
  19. package/dist/pi-resource-bundle.js +139 -0
  20. package/dist/pi-resource-bundle.js.map +1 -0
  21. package/dist/pi-resource-manifest.d.ts +48 -0
  22. package/dist/pi-resource-manifest.d.ts.map +1 -0
  23. package/dist/pi-resource-manifest.js +101 -0
  24. package/dist/pi-resource-manifest.js.map +1 -0
  25. package/dist/testing.d.ts +3 -0
  26. package/dist/testing.d.ts.map +1 -0
  27. package/dist/testing.js +33 -0
  28. package/dist/testing.js.map +1 -0
  29. package/dist/worker-api-version.d.ts +9 -0
  30. package/dist/worker-api-version.d.ts.map +1 -0
  31. package/dist/worker-api-version.js +9 -0
  32. package/dist/worker-api-version.js.map +1 -0
  33. package/dist/worker-ipc-transport.d.ts +8 -0
  34. package/dist/worker-ipc-transport.d.ts.map +1 -0
  35. package/dist/worker-ipc-transport.js +8 -0
  36. package/dist/worker-ipc-transport.js.map +1 -0
  37. package/dist/worker-result-image.d.ts +16 -18
  38. package/dist/worker-result-image.d.ts.map +1 -0
  39. package/dist/worker-result-image.js +54 -28
  40. package/dist/worker-result-image.js.map +1 -1
  41. package/dist/worker-session-snapshot.d.ts +6 -0
  42. package/dist/worker-session-snapshot.d.ts.map +1 -0
  43. package/dist/worker-session-snapshot.js +8 -0
  44. package/dist/worker-session-snapshot.js.map +1 -0
  45. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -1,448 +1,11 @@
1
- import * as v from 'valibot';
2
- import { ProcessLifecycleStatus, CurrentExecutionRef, ProcessSemanticEntryRefKey, TurnStartRecord, PreparedTurnStart, ProcessInputTarget, WorkerBootstrapReceipt, NormalizedQuestion, ProcessTurnType, ProcessTurnRecordPathType, TurnFailedPayload } from '@leitwerk-dev/domain';
3
- import { ConfigSnapshot } from '@leitwerk-dev/protocol/config-snapshot';
4
- export { RESULT_IMAGE_ID_PATTERN, RESULT_IMAGE_MAX_SIZE_BYTES, RESULT_IMAGE_MIME_TYPES, RESULT_IMAGE_STORAGE_SEGMENT_PATTERN, ResultImageMimeType, WORKER_RESULT_IMAGE_WORKER_ID_HEADER, WorkerResultImageUploadResponse, buildManagedResultImagePath, buildWorkerResultImageUploadPath, isResultImageStorageSegment, parseManagedResultImagePath, parseResultImageId, parseWorkerResultImageUploadResponse, workerResultImageUploadResponseSchema } from './worker-result-image.js';
5
-
6
- declare const IPC_PROTOCOL_VERSION: "leitwerk/worker-ipc/v1";
7
- declare const IPC_ENVELOPE_SCHEMA: v.ObjectSchema<{
8
- readonly protocol: v.LiteralSchema<"leitwerk/worker-ipc/v1", undefined>;
9
- readonly messageId: v.StringSchema<undefined>;
10
- readonly correlationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
11
- readonly type: v.StringSchema<undefined>;
12
- readonly instanceId: v.StringSchema<undefined>;
13
- readonly workerId: v.StringSchema<undefined>;
14
- readonly sentAt: v.StringSchema<undefined>;
15
- readonly payload: v.UnknownSchema;
16
- }, undefined>;
17
- type IpcEnvelope = v.InferOutput<typeof IPC_ENVELOPE_SCHEMA>;
18
- declare function validateEnvelope(msg: unknown): {
19
- ok: true;
20
- envelope: IpcEnvelope;
21
- } | {
22
- ok: false;
23
- error: string;
24
- };
25
- declare function serializeMessage<TEnvelope extends IpcEnvelope>(envelope: TEnvelope): string;
26
- declare function deserializeMessage(line: string): {
27
- ok: true;
28
- message: IpcEnvelope;
29
- } | {
30
- ok: false;
31
- error: string;
32
- };
33
-
34
- interface ProcessInstanceSnapshot {
35
- id?: string;
36
- processId?: string;
37
- selectedTurnId?: string | null;
38
- lifecycleStatus?: ProcessLifecycleStatus;
39
- currentExecution?: CurrentExecutionRef;
40
- planRevision?: number;
41
- title?: string | null;
42
- externalId?: string | null;
43
- externalUrl?: string | null;
44
- metadata?: Record<string, unknown> | null;
45
- defaultModelProfileId?: string | null;
46
- turnConfigsJson?: string | null;
47
- selectedTurnModelProfileId?: string | null;
48
- paramsJson?: string | null;
49
- stateJson?: string | null;
50
- createdAt?: string;
51
- updatedAt?: string;
52
- }
53
- interface ProcessProjectSnapshot {
54
- id?: string;
55
- instanceId?: string;
56
- key: string;
57
- repoLocator: string;
58
- repoLocatorKind?: "remote_url" | "local_path";
59
- baseBranch: string;
60
- workBranch?: string | null;
61
- externalId?: string | null;
62
- externalUrl?: string | null;
63
- metadata?: Record<string, unknown> | null;
64
- pipelineStatus?: string | null;
65
- createdAt?: string;
66
- updatedAt?: string;
67
- }
68
- interface InputDelivery {
69
- inputId: string;
70
- sequence: number;
71
- source: string;
72
- kind: string;
73
- target: ProcessInputTarget | null;
74
- receivedAt: string;
75
- bodyMarkdown: string;
76
- }
77
- interface WorkerRuntimeContextSnapshot {
78
- processSnapshot: ProcessInstanceSnapshot;
79
- projectSnapshots: ProcessProjectSnapshot[];
80
- turnResultMarkdownBySemanticRef?: Partial<Record<ProcessSemanticEntryRefKey, string>>;
81
- turnResultMarkdownByProduct?: Record<string, string>;
82
- }
83
- interface WorkerCredentialMaterial {
84
- providerId: string;
85
- revision: number;
86
- /** Secret payload. This type is valid only in worker.start and credential-update frames. */
87
- values: Record<string, string>;
88
- }
89
- interface WorkerGitSshCredential {
90
- projectKey: string;
91
- kind: "git_ssh";
92
- credentialRef: string;
93
- /** Secret values; valid only while preparing worker.start. */
94
- privateKey: string;
95
- knownHosts: string;
96
- }
97
- interface LlmWorkerStartBootstrap {
98
- kind: "llm";
99
- resourceBundle: {
100
- digest: string;
101
- archiveBase64: string;
102
- };
103
- credential: WorkerCredentialMaterial | null;
104
- }
105
- interface AutomaticWorkerStartBootstrap {
106
- kind: "automatic";
107
- }
108
- interface WorkerStartPayloadBase extends WorkerRuntimeContextSnapshot {
109
- workerLeaseId: string;
110
- turnStart: TurnStartRecord;
111
- /**
112
- * The immutable pre-acceptance tree plan from the lease that first accepted
113
- * this start. It is supplied only when a replacement resumes a running turn.
114
- */
115
- acceptedPreparedStart?: PreparedTurnStart | null;
116
- pendingInputs: InputDelivery[];
117
- treePaths: {
118
- primaryTreeFile: string;
119
- workspaceRoot: string;
120
- };
121
- resume: boolean;
122
- resumeLeafEntryId?: string | null;
123
- /** Fresh secret material resolved for this physical worker start only. */
124
- repositoryCredentials?: WorkerGitSshCredential[];
125
- }
126
- type WorkerStartPayload = (WorkerStartPayloadBase & {
127
- bootstrap: LlmWorkerStartBootstrap;
128
- configSnapshot: ConfigSnapshot;
129
- }) | (WorkerStartPayloadBase & {
130
- bootstrap: AutomaticWorkerStartBootstrap;
131
- });
132
- interface InputBatchPayload {
133
- inputs: InputDelivery[];
134
- }
135
- interface WorkerStopPayload {
136
- reason: string;
137
- }
138
- interface WorkerAbortTurnPayload {
139
- reason: string;
140
- }
141
- interface WorkerTurnStartAcceptedPayload {
142
- startRecordId: string;
143
- turnRecordId: string;
144
- }
145
- interface WorkerQuestionResponsePayload {
146
- turnRecordId: string;
147
- toolCallId: string;
148
- answers: string[];
149
- }
150
- interface WorkerQuestionRequestedPayload {
151
- turnRecordId: string;
152
- toolCallId: string;
153
- questions: NormalizedQuestion[];
154
- }
155
- interface WorkerCredentialUpdateResultPayload {
156
- providerId: string;
157
- accepted: boolean;
158
- currentRevision: number | null;
159
- safeReason?: string;
160
- }
161
- type ServerToWorkerMessage = (Omit<IpcEnvelope, "type" | "payload"> & {
162
- type: "worker.start";
163
- payload: WorkerStartPayload;
164
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
165
- type: "worker.turn_start_accepted";
166
- payload: WorkerTurnStartAcceptedPayload;
167
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
168
- type: "worker.credential_update_accepted";
169
- payload: WorkerCredentialUpdateResultPayload;
170
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
171
- type: "worker.question_response";
172
- payload: WorkerQuestionResponsePayload;
173
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
174
- type: "input.batch";
175
- payload: InputBatchPayload;
176
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
177
- type: "worker.stop";
178
- payload: WorkerStopPayload;
179
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
180
- type: "worker.abort_turn";
181
- payload: WorkerAbortTurnPayload;
182
- });
183
- interface WorkerHelloPayload {
184
- /** Package/runtime version for diagnostics. */
185
- version: string;
186
- /** Server-worker API compatibility version. Missing only on legacy/test workers. */
187
- apiVersion?: string;
188
- capabilities: string[];
189
- }
190
- interface WorkerReadyPayload {
191
- receipt: WorkerBootstrapReceipt;
192
- resumed: boolean;
193
- primaryTreeFile: string;
194
- workspaceRoot: string;
195
- aggregatedAgentsSources: string[];
196
- loadedSkills: string[];
197
- loadedAgentsFiles: Array<{
198
- path: string;
199
- sizeBytes: number;
200
- }>;
201
- loadedSkillFiles: Array<{
202
- name: string;
203
- path: string;
204
- }>;
205
- rootEntryId?: string | null;
206
- }
207
- interface WorkerHeartbeatPayload {
208
- /** Diagnostic worker-local runtime state; not the authoritative lease transition channel. */
209
- state: string;
210
- lastSequenceConsumed: number;
211
- currentTurnId?: string;
212
- currentSelectedTurnId?: string | null;
213
- }
214
- interface WorkerStatePayload {
215
- /** Explicit server-visible runtime transition, e.g. idle -> busy or busy -> idle. */
216
- from: string;
217
- to: string;
218
- reason: string;
219
- }
220
- interface WorkerInputConsumedPayload {
221
- inputId: string;
222
- sequence: number;
223
- deliveryMode: string;
224
- currentPrimaryPathLeafId?: string | null;
225
- rootEntryId?: string | null;
226
- targetSemanticRef?: ProcessSemanticEntryRefKey | null;
227
- targetProductName?: string | null;
228
- targetEntryId?: string | null;
229
- }
230
- interface WorkerEventPayload {
231
- eventType: string;
232
- selectedTurnId?: string | null;
233
- /**
234
- * Object-shaped event data emitted by trusted worker senders. Decode helpers
235
- * do not deeply validate this field at runtime; they only narrow it at the
236
- * protocol boundary after envelope + message-type validation.
237
- */
238
- data: Record<string, unknown>;
239
- }
240
- interface WorkerTurnStartedPayload {
241
- startRecordId: string;
242
- proposedTurnRecordId: string;
243
- }
244
- interface WorkerCredentialUpdatePayload {
245
- providerId: string;
246
- expectedRevision: number;
247
- /** Secret payload. It must not be copied into receipts, events, or turn state. */
248
- values: Record<string, string>;
249
- }
250
- interface WorkerTurnOutcomePayload {
251
- turnRecordId: string;
252
- turnId: string;
253
- turnType: ProcessTurnType;
254
- outcome: string;
255
- params: Record<string, unknown>;
256
- pathType?: ProcessTurnRecordPathType;
257
- forkPiEntryId?: string | null;
258
- resultPiEntryId?: string | null;
259
- turnResultMarkdown?: string | null;
260
- rootEntryId?: string | null;
261
- }
262
- interface WorkerTurnFailedPayload extends Omit<TurnFailedPayload, "instanceId" | "errorClass"> {
263
- errorClass?: string;
264
- }
265
- interface WorkerLifecycleParkedPayload {
266
- selectedTurnId: string | null;
267
- reason?: string;
268
- errorClass?: string;
269
- }
270
- interface WorkerCleanupStartedPayload {
271
- reason: string;
272
- }
273
- interface WorkerCleanupCompletedPayload {
274
- releasedLocks: string[];
275
- removedTransientPaths: string[];
276
- }
277
- interface WorkerFailedPayload {
278
- state: string;
279
- errorCode: string;
280
- message: string;
281
- errorClass: string;
282
- selectedTurnId?: string | null;
283
- retryAttempt?: number;
284
- }
285
- type WorkerToServerMessage = (Omit<IpcEnvelope, "type" | "payload"> & {
286
- type: "worker.hello";
287
- payload: WorkerHelloPayload;
288
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
289
- type: "worker.credential_update";
290
- payload: WorkerCredentialUpdatePayload;
291
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
292
- type: "worker.ready";
293
- payload: WorkerReadyPayload;
294
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
295
- type: "worker.heartbeat";
296
- payload: WorkerHeartbeatPayload;
297
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
298
- type: "worker.state";
299
- payload: WorkerStatePayload;
300
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
301
- type: "worker.input_consumed";
302
- payload: WorkerInputConsumedPayload;
303
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
304
- type: "worker.event";
305
- payload: WorkerEventPayload;
306
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
307
- type: "worker.turn_started";
308
- payload: WorkerTurnStartedPayload;
309
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
310
- type: "worker.question_requested";
311
- payload: WorkerQuestionRequestedPayload;
312
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
313
- type: "worker.turn_outcome";
314
- payload: WorkerTurnOutcomePayload;
315
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
316
- type: "worker.turn_failed";
317
- payload: WorkerTurnFailedPayload;
318
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
319
- type: "worker.lifecycle_parked";
320
- payload: WorkerLifecycleParkedPayload;
321
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
322
- type: "worker.cleanup_started";
323
- payload: WorkerCleanupStartedPayload;
324
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
325
- type: "worker.cleanup_completed";
326
- payload: WorkerCleanupCompletedPayload;
327
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
328
- type: "worker.failed";
329
- payload: WorkerFailedPayload;
330
- });
331
- type AnyIpcMessage = ServerToWorkerMessage | WorkerToServerMessage;
332
- type IpcMessageType = AnyIpcMessage["type"];
333
- type IpcMessageOfType<TType extends IpcMessageType> = Extract<AnyIpcMessage, {
334
- type: TType;
335
- }>;
336
- declare function createIpcMessage<TMessage extends AnyIpcMessage>(args: Omit<TMessage, "protocol" | "sentAt"> & {
337
- sentAt?: string;
338
- }): TMessage;
339
-
340
- type IpcDecodeResult<TMessage> = {
341
- ok: true;
342
- message: TMessage;
343
- } | {
344
- ok: false;
345
- error: string;
346
- };
347
- /**
348
- * Decode a parsed envelope coming from the server side of the IPC channel.
349
- * Only envelope structure + message type are runtime-validated.
350
- */
351
- declare function decodeServerToWorkerMessage(msg: unknown): IpcDecodeResult<ServerToWorkerMessage>;
352
- /**
353
- * Decode a parsed envelope coming from the worker side of the IPC channel.
354
- * Only envelope structure + message type are runtime-validated.
355
- */
356
- declare function decodeWorkerToServerMessage(msg: unknown): IpcDecodeResult<WorkerToServerMessage>;
357
-
358
- interface PiResourceFile {
359
- path: string;
360
- content: Uint8Array;
361
- }
362
- interface PiResourceBundle {
363
- digest: string;
364
- bytes: Uint8Array;
365
- }
366
- interface ExtractedPiResourceFile {
367
- path: string;
368
- content: Uint8Array;
369
- }
370
- declare function validateResourceRelativePath(value: string): string;
371
- declare function sha256Digest(bytes: Uint8Array): string;
372
- /** Creates a deterministic, uncompressed ustar archive containing regular files only. */
373
- declare function createCanonicalPiResourceBundle(files: readonly PiResourceFile[]): PiResourceBundle;
374
- /** Parses only the narrow regular-file ustar subset emitted by this module. */
375
- declare function verifyCanonicalPiResourceBundle(bytes: Uint8Array, expectedDigest?: string): ExtractedPiResourceFile[];
376
-
377
- declare const PI_RESOURCE_SNAPSHOT_SCHEMA_VERSION = 1;
378
- declare const piResourceManifestSchema: v.StrictObjectSchema<{
379
- readonly schemaVersion: v.LiteralSchema<1, undefined>;
380
- readonly model: v.StrictObjectSchema<{
381
- readonly profileId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>;
382
- readonly providerId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>;
383
- readonly modelId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>;
384
- readonly thinkingLevel: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>;
385
- }, undefined>;
386
- readonly providerOptions: v.RecordSchema<v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>, undefined>;
387
- readonly providerWorkerConfig: v.NullableSchema<v.StrictObjectSchema<{
388
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
389
- readonly value: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
390
- }, undefined>, undefined>;
391
- readonly declaredCredentialPaths: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>, undefined>;
392
- readonly compatibility: v.StrictObjectSchema<{
393
- readonly workerApiVersion: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>;
394
- readonly piVersion: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>;
395
- readonly protocolVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>, undefined>;
396
- }, undefined>;
397
- readonly provenance: v.ArraySchema<v.StrictObjectSchema<{
398
- readonly kind: v.PicklistSchema<["extension", "skill", "prompt", "generated"], undefined>;
399
- readonly ownerExtensionId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>, undefined>;
400
- readonly packageName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>, undefined>;
401
- readonly snapshotPath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Expected a non-empty string">]>;
402
- readonly sha256: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
403
- readonly size: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.SafeIntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
404
- }, undefined>, undefined>;
405
- }, undefined>;
406
- type DeepReadonly<T> = T extends readonly unknown[] ? {
407
- readonly [Index in keyof T]: DeepReadonly<T[Index]>;
408
- } : T extends object ? {
409
- readonly [Key in keyof T]: DeepReadonly<T[Key]>;
410
- } : T;
411
- type PiResourceManifest = DeepReadonly<v.InferOutput<typeof piResourceManifestSchema>>;
412
- type PiResourceSnapshotModel = PiResourceManifest["model"];
413
- type PiResourceSnapshotWorkerConfig = NonNullable<PiResourceManifest["providerWorkerConfig"]>;
414
- type PiResourceSnapshotCompatibility = PiResourceManifest["compatibility"];
415
- type PiResourceFileProvenance = PiResourceManifest["provenance"][number];
416
- type PiResourceProvenanceKind = PiResourceFileProvenance["kind"];
417
- /** Parses and validates the complete generated.json contract. */
418
- declare function parsePiResourceManifest(raw: unknown): PiResourceManifest;
419
- declare function canonicalizeJson(value: unknown, location?: string): unknown;
420
- declare function canonicalJsonStringify(value: unknown, location?: string): string;
421
- declare function canonicalJsonEqual(left: unknown, right: unknown): boolean;
422
-
423
- declare function createTestConfigSnapshot(): ConfigSnapshot;
424
-
425
- /**
426
- * Compatibility version for the server ↔ worker runtime API.
427
- *
428
- * Container image labels use the same value (`leitwerk.dev/worker-api-version`).
429
- * Workers also report it in `worker.hello` so the server can fail fast when a
430
- * pod image is from an incompatible leitwerk build line.
431
- */
432
- declare const WORKER_API_VERSION = "2026-07-26";
433
-
434
- declare const WORKER_INSTANCE_ID_ENV = "LEITWERK_INSTANCE_ID";
435
- declare const WORKER_ID_ENV = "LEITWERK_WORKER_ID";
436
- declare const WORKER_IPC_SERVER_URL_ENV = "LEITWERK_SERVER_URL";
437
- declare const WORKER_IPC_CONNECT_TOKEN_ENV = "LEITWERK_WORKER_CONNECT_TOKEN";
438
- declare const WORKER_IPC_RECONNECT_ENV = "LEITWERK_WORKER_RECONNECT";
439
- declare const WORKER_SNAPSHOT_TOKEN_ENV = "LEITWERK_WORKER_SNAPSHOT_TOKEN";
440
- declare const WORKER_SERVER_EPOCH_ENV = "LEITWERK_SERVER_EPOCH";
441
-
442
- declare const WORKER_SESSION_SNAPSHOT_CONTENT_TYPE = "application/x-ndjson";
443
- declare const WORKER_SESSION_SNAPSHOT_WORKER_ID_HEADER = "x-leitwerk-worker-id";
444
- declare const WORKER_SESSION_SNAPSHOT_REASON_HEADER = "x-leitwerk-session-snapshot-reason";
445
- declare const WORKER_SESSION_SNAPSHOT_TURN_RECORD_ID_HEADER = "x-leitwerk-turn-record-id";
446
- declare function buildWorkerSessionSnapshotPath(instanceId: string): string;
447
-
448
- export { type AnyIpcMessage, type AutomaticWorkerStartBootstrap, type ExtractedPiResourceFile, IPC_ENVELOPE_SCHEMA, IPC_PROTOCOL_VERSION, type InputBatchPayload, type InputDelivery, type IpcDecodeResult, type IpcEnvelope, type IpcMessageOfType, type IpcMessageType, type LlmWorkerStartBootstrap, PI_RESOURCE_SNAPSHOT_SCHEMA_VERSION, type PiResourceBundle, type PiResourceFile, type PiResourceFileProvenance, type PiResourceManifest, type PiResourceProvenanceKind, type PiResourceSnapshotCompatibility, type PiResourceSnapshotModel, type PiResourceSnapshotWorkerConfig, type ProcessInstanceSnapshot, type ProcessProjectSnapshot, type ServerToWorkerMessage, WORKER_API_VERSION, WORKER_ID_ENV, WORKER_INSTANCE_ID_ENV, WORKER_IPC_CONNECT_TOKEN_ENV, WORKER_IPC_RECONNECT_ENV, WORKER_IPC_SERVER_URL_ENV, WORKER_SERVER_EPOCH_ENV, WORKER_SESSION_SNAPSHOT_CONTENT_TYPE, WORKER_SESSION_SNAPSHOT_REASON_HEADER, WORKER_SESSION_SNAPSHOT_TURN_RECORD_ID_HEADER, WORKER_SESSION_SNAPSHOT_WORKER_ID_HEADER, WORKER_SNAPSHOT_TOKEN_ENV, type WorkerAbortTurnPayload, type WorkerCleanupCompletedPayload, type WorkerCleanupStartedPayload, type WorkerCredentialMaterial, type WorkerCredentialUpdatePayload, type WorkerCredentialUpdateResultPayload, type WorkerEventPayload, type WorkerFailedPayload, type WorkerGitSshCredential, type WorkerHeartbeatPayload, type WorkerHelloPayload, type WorkerInputConsumedPayload, type WorkerLifecycleParkedPayload, type WorkerQuestionRequestedPayload, type WorkerQuestionResponsePayload, type WorkerReadyPayload, type WorkerRuntimeContextSnapshot, type WorkerStartPayload, type WorkerStatePayload, type WorkerStopPayload, type WorkerToServerMessage, type WorkerTurnFailedPayload, type WorkerTurnOutcomePayload, type WorkerTurnStartAcceptedPayload, type WorkerTurnStartedPayload, buildWorkerSessionSnapshotPath, canonicalJsonEqual, canonicalJsonStringify, canonicalizeJson, createCanonicalPiResourceBundle, createIpcMessage, createTestConfigSnapshot, decodeServerToWorkerMessage, decodeWorkerToServerMessage, deserializeMessage, parsePiResourceManifest, piResourceManifestSchema, serializeMessage, sha256Digest, validateEnvelope, validateResourceRelativePath, verifyCanonicalPiResourceBundle };
1
+ export * from "./ipc-codec.js";
2
+ export * from "./ipc-decode.js";
3
+ export * from "./ipc-messages.js";
4
+ export * from "./pi-resource-bundle.js";
5
+ export * from "./pi-resource-manifest.js";
6
+ export * from "./testing.js";
7
+ export * from "./worker-api-version.js";
8
+ export * from "./worker-ipc-transport.js";
9
+ export * from "./worker-result-image.js";
10
+ export * from "./worker-session-snapshot.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC"}