@leitwerk-dev/worker-protocol 0.1.0 → 0.1.2

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 +448 -11
  2. package/dist/index.js +451 -10
  3. package/dist/index.js.map +1 -1
  4. package/dist/worker-result-image.d.ts +18 -16
  5. package/dist/worker-result-image.js +28 -54
  6. package/dist/worker-result-image.js.map +1 -1
  7. package/package.json +3 -3
  8. package/dist/index.d.ts.map +0 -1
  9. package/dist/ipc-codec.d.ts +0 -29
  10. package/dist/ipc-codec.d.ts.map +0 -1
  11. package/dist/ipc-codec.js +0 -48
  12. package/dist/ipc-codec.js.map +0 -1
  13. package/dist/ipc-decode.d.ts +0 -19
  14. package/dist/ipc-decode.d.ts.map +0 -1
  15. package/dist/ipc-decode.js +0 -68
  16. package/dist/ipc-decode.js.map +0 -1
  17. package/dist/ipc-messages.d.ts +0 -310
  18. package/dist/ipc-messages.d.ts.map +0 -1
  19. package/dist/ipc-messages.js +0 -14
  20. package/dist/ipc-messages.js.map +0 -1
  21. package/dist/pi-resource-bundle.d.ts +0 -19
  22. package/dist/pi-resource-bundle.d.ts.map +0 -1
  23. package/dist/pi-resource-bundle.js +0 -139
  24. package/dist/pi-resource-bundle.js.map +0 -1
  25. package/dist/pi-resource-manifest.d.ts +0 -48
  26. package/dist/pi-resource-manifest.d.ts.map +0 -1
  27. package/dist/pi-resource-manifest.js +0 -101
  28. package/dist/pi-resource-manifest.js.map +0 -1
  29. package/dist/testing.d.ts +0 -3
  30. package/dist/testing.d.ts.map +0 -1
  31. package/dist/testing.js +0 -33
  32. package/dist/testing.js.map +0 -1
  33. package/dist/worker-api-version.d.ts +0 -9
  34. package/dist/worker-api-version.d.ts.map +0 -1
  35. package/dist/worker-api-version.js +0 -9
  36. package/dist/worker-api-version.js.map +0 -1
  37. package/dist/worker-ipc-transport.d.ts +0 -8
  38. package/dist/worker-ipc-transport.d.ts.map +0 -1
  39. package/dist/worker-ipc-transport.js +0 -8
  40. package/dist/worker-ipc-transport.js.map +0 -1
  41. package/dist/worker-result-image.d.ts.map +0 -1
  42. package/dist/worker-session-snapshot.d.ts +0 -6
  43. package/dist/worker-session-snapshot.d.ts.map +0 -1
  44. package/dist/worker-session-snapshot.js +0 -8
  45. package/dist/worker-session-snapshot.js.map +0 -1
@@ -1,55 +1,29 @@
1
- import * as v from "valibot";
2
- export const WORKER_RESULT_IMAGE_WORKER_ID_HEADER = "x-leitwerk-worker-id";
3
- export const RESULT_IMAGE_MIME_TYPES = ["image/png", "image/jpeg", "image/webp"];
4
- export const RESULT_IMAGE_MAX_SIZE_BYTES = 10 * 1024 * 1024;
5
- export const RESULT_IMAGE_STORAGE_SEGMENT_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
6
- export const RESULT_IMAGE_ID_PATTERN = /^img_[A-Za-z0-9]+\.(png|jpg|webp)$/;
7
- export function isResultImageStorageSegment(value) {
8
- return RESULT_IMAGE_STORAGE_SEGMENT_PATTERN.test(value);
9
- }
10
- export function parseResultImageId(value) {
11
- const extension = RESULT_IMAGE_ID_PATTERN.exec(value)?.[1];
12
- return extension === "png" || extension === "jpg" || extension === "webp" ? { extension } : null;
13
- }
14
- function assertResultImageStorageSegment(value) {
15
- if (!isResultImageStorageSegment(value))
16
- throw new Error("Invalid result image storage id");
17
- }
18
- export const workerResultImageUploadResponseSchema = v.object({
19
- imageId: v.string(),
20
- url: v.string(),
21
- mimeType: v.picklist(RESULT_IMAGE_MIME_TYPES),
22
- byteSize: v.number(),
23
- });
24
- export function buildWorkerResultImageUploadPath(instanceId, turnRecordId) {
25
- assertResultImageStorageSegment(instanceId);
26
- assertResultImageStorageSegment(turnRecordId);
27
- return `/internal/workers/${instanceId}/turn-records/${turnRecordId}/result-images`;
28
- }
29
- export function buildManagedResultImagePath(instanceId, turnRecordId, imageId) {
30
- assertResultImageStorageSegment(instanceId);
31
- assertResultImageStorageSegment(turnRecordId);
32
- if (!parseResultImageId(imageId))
33
- throw new Error("Invalid result image id");
34
- return `/api/processes/${instanceId}/turn-records/${turnRecordId}/result-images/${imageId}`;
35
- }
36
- const MANAGED_RESULT_IMAGE_PATH = /^\/api\/processes\/([^/]+)\/turn-records\/([^/]+)\/result-images\/([^/]+)$/;
37
- export function parseManagedResultImagePath(value) {
38
- const match = MANAGED_RESULT_IMAGE_PATH.exec(value);
39
- const instanceId = match?.[1];
40
- const turnRecordId = match?.[2];
41
- const imageId = match?.[3];
42
- return instanceId &&
43
- turnRecordId &&
44
- imageId &&
45
- isResultImageStorageSegment(instanceId) &&
46
- isResultImageStorageSegment(turnRecordId) &&
47
- parseResultImageId(imageId)
48
- ? { instanceId, turnRecordId, imageId }
49
- : null;
50
- }
51
- export function parseWorkerResultImageUploadResponse(value) {
52
- const parsed = v.safeParse(workerResultImageUploadResponseSchema, value);
53
- return parsed.success ? parsed.output : null;
54
- }
1
+ import {
2
+ RESULT_IMAGE_ID_PATTERN,
3
+ RESULT_IMAGE_MAX_SIZE_BYTES,
4
+ RESULT_IMAGE_MIME_TYPES,
5
+ RESULT_IMAGE_STORAGE_SEGMENT_PATTERN,
6
+ WORKER_RESULT_IMAGE_WORKER_ID_HEADER,
7
+ buildManagedResultImagePath,
8
+ buildWorkerResultImageUploadPath,
9
+ isResultImageStorageSegment,
10
+ parseManagedResultImagePath,
11
+ parseResultImageId,
12
+ parseWorkerResultImageUploadResponse,
13
+ workerResultImageUploadResponseSchema
14
+ } from "./chunk-DVN32ANP.js";
15
+ export {
16
+ RESULT_IMAGE_ID_PATTERN,
17
+ RESULT_IMAGE_MAX_SIZE_BYTES,
18
+ RESULT_IMAGE_MIME_TYPES,
19
+ RESULT_IMAGE_STORAGE_SEGMENT_PATTERN,
20
+ WORKER_RESULT_IMAGE_WORKER_ID_HEADER,
21
+ buildManagedResultImagePath,
22
+ buildWorkerResultImageUploadPath,
23
+ isResultImageStorageSegment,
24
+ parseManagedResultImagePath,
25
+ parseResultImageId,
26
+ parseWorkerResultImageUploadResponse,
27
+ workerResultImageUploadResponseSchema
28
+ };
55
29
  //# sourceMappingURL=worker-result-image.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker-result-image.js","sourceRoot":"","sources":["../src/worker-result-image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,MAAM,CAAC,MAAM,oCAAoC,GAAG,sBAAsB,CAAC;AAC3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAU,CAAC;AAC1F,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC5D,MAAM,CAAC,MAAM,oCAAoC,GAAG,8BAA8B,CAAC;AACnF,MAAM,CAAC,MAAM,uBAAuB,GAAG,oCAAoC,CAAC;AAG5E,MAAM,UAAU,2BAA2B,CAAC,KAAa;IACxD,OAAO,oCAAoC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC/C,MAAM,SAAS,GAAG,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3D,OAAO,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAClG,CAAC;AAED,SAAS,+BAA+B,CAAC,KAAa;IACrD,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;AAC7F,CAAC;AAED,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,Q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C,CACnD,KAAc;IAEd,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC"}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leitwerk-dev/worker-protocol",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/leitwerk-dev/leitwerk.git",
@@ -23,8 +23,8 @@
23
23
  "build": "tsup --silent"
24
24
  },
25
25
  "dependencies": {
26
- "@leitwerk-dev/domain": "0.1.0",
27
- "@leitwerk-dev/protocol": "0.1.0",
26
+ "@leitwerk-dev/domain": "0.1.2",
27
+ "@leitwerk-dev/protocol": "0.1.2",
28
28
  "valibot": "^1.3.1"
29
29
  },
30
30
  "devDependencies": {
@@ -1 +0,0 @@
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"}
@@ -1,29 +0,0 @@
1
- import * as v from "valibot";
2
- export declare const IPC_PROTOCOL_VERSION: "leitwerk/worker-ipc/v1";
3
- export declare const IPC_ENVELOPE_SCHEMA: v.ObjectSchema<{
4
- readonly protocol: v.LiteralSchema<"leitwerk/worker-ipc/v1", undefined>;
5
- readonly messageId: v.StringSchema<undefined>;
6
- readonly correlationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
7
- readonly type: v.StringSchema<undefined>;
8
- readonly instanceId: v.StringSchema<undefined>;
9
- readonly workerId: v.StringSchema<undefined>;
10
- readonly sentAt: v.StringSchema<undefined>;
11
- readonly payload: v.UnknownSchema;
12
- }, undefined>;
13
- export type IpcEnvelope = v.InferOutput<typeof IPC_ENVELOPE_SCHEMA>;
14
- export declare function validateEnvelope(msg: unknown): {
15
- ok: true;
16
- envelope: IpcEnvelope;
17
- } | {
18
- ok: false;
19
- error: string;
20
- };
21
- export declare function serializeMessage<TEnvelope extends IpcEnvelope>(envelope: TEnvelope): string;
22
- export declare function deserializeMessage(line: string): {
23
- ok: true;
24
- message: IpcEnvelope;
25
- } | {
26
- ok: false;
27
- error: string;
28
- };
29
- //# sourceMappingURL=ipc-codec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ipc-codec.d.ts","sourceRoot":"","sources":["../src/ipc-codec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,eAAO,MAAM,oBAAoB,EAAG,wBAAiC,CAAC;AAEtE,eAAO,MAAM,mBAAmB;;;;;;;;;aAS9B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEpE,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,OAAO,GACV;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAiBpE;AAED,wBAAgB,gBAAgB,CAAC,SAAS,SAAS,WAAW,EAAE,QAAQ,EAAE,SAAS,GAAG,MAAM,CAE3F;AAED,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,MAAM,GACV;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAcnE"}
package/dist/ipc-codec.js DELETED
@@ -1,48 +0,0 @@
1
- import { parseSchema } from "@leitwerk-dev/protocol";
2
- import * as v from "valibot";
3
- export const IPC_PROTOCOL_VERSION = "leitwerk/worker-ipc/v1";
4
- export const IPC_ENVELOPE_SCHEMA = v.object({
5
- protocol: v.literal(IPC_PROTOCOL_VERSION),
6
- messageId: v.string(),
7
- correlationId: v.optional(v.string()),
8
- type: v.string(),
9
- instanceId: v.string(),
10
- workerId: v.string(),
11
- sentAt: v.string(),
12
- payload: v.unknown(),
13
- });
14
- export function validateEnvelope(msg) {
15
- if (typeof msg === "object" &&
16
- msg !== null &&
17
- "protocol" in msg &&
18
- typeof msg.protocol === "string" &&
19
- msg.protocol !== IPC_PROTOCOL_VERSION) {
20
- return {
21
- ok: false,
22
- error: `Worker IPC protocol '${msg.protocol}' is incompatible with expected protocol '${IPC_PROTOCOL_VERSION}'`,
23
- };
24
- }
25
- const envelope = parseSchema(IPC_ENVELOPE_SCHEMA, msg, "ipc envelope");
26
- return envelope.ok
27
- ? { ok: true, envelope: envelope.value }
28
- : { ok: false, error: envelope.error };
29
- }
30
- export function serializeMessage(envelope) {
31
- return JSON.stringify(envelope);
32
- }
33
- export function deserializeMessage(line) {
34
- const trimmed = line.length > 0 && line.charCodeAt(line.length - 1) === 0x0d ? line.slice(0, -1) : line;
35
- let parsed;
36
- try {
37
- parsed = JSON.parse(trimmed);
38
- }
39
- catch {
40
- return { ok: false, error: "invalid JSON" };
41
- }
42
- const validated = validateEnvelope(parsed);
43
- if (!validated.ok) {
44
- return { ok: false, error: validated.error };
45
- }
46
- return { ok: true, message: validated.envelope };
47
- }
48
- //# sourceMappingURL=ipc-codec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ipc-codec.js","sourceRoot":"","sources":["../src/ipc-codec.ts"],"names":[],"mappings":"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,KAAK,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAgC,QAAmB;IAClF,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,kBAAkB,CACjC,IAAY;IAEZ,MAAM,OAAO,GACZ,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACzF,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACJ,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAY,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAC7C,CAAC;IACD,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC;QACnB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC;AAClD,CAAC"}
@@ -1,19 +0,0 @@
1
- import type { ServerToWorkerMessage, WorkerToServerMessage } from "./ipc-messages.js";
2
- export type IpcDecodeResult<TMessage> = {
3
- ok: true;
4
- message: TMessage;
5
- } | {
6
- ok: false;
7
- error: string;
8
- };
9
- /**
10
- * Decode a parsed envelope coming from the server side of the IPC channel.
11
- * Only envelope structure + message type are runtime-validated.
12
- */
13
- export declare function decodeServerToWorkerMessage(msg: unknown): IpcDecodeResult<ServerToWorkerMessage>;
14
- /**
15
- * Decode a parsed envelope coming from the worker side of the IPC channel.
16
- * Only envelope structure + message type are runtime-validated.
17
- */
18
- export declare function decodeWorkerToServerMessage(msg: unknown): IpcDecodeResult<WorkerToServerMessage>;
19
- //# sourceMappingURL=ipc-decode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ipc-decode.d.ts","sourceRoot":"","sources":["../src/ipc-decode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEtF,MAAM,MAAM,eAAe,CAAC,QAAQ,IACjC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,GAC/B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAiEhC;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAEhG;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAEhG"}
@@ -1,68 +0,0 @@
1
- import { validateEnvelope } from "./ipc-codec.js";
2
- const SERVER_TO_WORKER_TYPES = [
3
- "worker.start",
4
- "worker.turn_start_accepted",
5
- "worker.credential_update_accepted",
6
- "worker.question_response",
7
- "input.batch",
8
- "worker.stop",
9
- "worker.abort_turn",
10
- ];
11
- const WORKER_TO_SERVER_TYPES = [
12
- "worker.hello",
13
- "worker.credential_update",
14
- "worker.ready",
15
- "worker.heartbeat",
16
- "worker.state",
17
- "worker.input_consumed",
18
- "worker.event",
19
- "worker.turn_started",
20
- "worker.question_requested",
21
- "worker.turn_outcome",
22
- "worker.turn_failed",
23
- "worker.lifecycle_parked",
24
- "worker.cleanup_started",
25
- "worker.cleanup_completed",
26
- "worker.failed",
27
- ];
28
- function hasMessageType(allowed, value) {
29
- return allowed.includes(value);
30
- }
31
- /**
32
- * Validate the generic IPC envelope and narrow it to the correct typed message
33
- * union member for the given direction.
34
- *
35
- * This intentionally stops at the message discriminant boundary: it validates
36
- * envelope structure + known message type, but does not deeply validate the
37
- * payload shape. Payload fields are trusted to come from same-version
38
- * leitwerk components, so malformed payloads from a buggy sender can still
39
- * pass through as typed data.
40
- */
41
- function decodeKnownMessage(msg, allowed, direction) {
42
- const validated = validateEnvelope(msg);
43
- if (!validated.ok) {
44
- return { ok: false, error: validated.error };
45
- }
46
- if (!hasMessageType(allowed, validated.envelope.type)) {
47
- return {
48
- ok: false,
49
- error: `unexpected ${direction} message type: ${validated.envelope.type}`,
50
- };
51
- }
52
- return { ok: true, message: validated.envelope };
53
- }
54
- /**
55
- * Decode a parsed envelope coming from the server side of the IPC channel.
56
- * Only envelope structure + message type are runtime-validated.
57
- */
58
- export function decodeServerToWorkerMessage(msg) {
59
- return decodeKnownMessage(msg, SERVER_TO_WORKER_TYPES, "server-to-worker");
60
- }
61
- /**
62
- * Decode a parsed envelope coming from the worker side of the IPC channel.
63
- * Only envelope structure + message type are runtime-validated.
64
- */
65
- export function decodeWorkerToServerMessage(msg) {
66
- return decodeKnownMessage(msg, WORKER_TO_SERVER_TYPES, "worker-to-server");
67
- }
68
- //# sourceMappingURL=ipc-decode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ipc-decode.js","sourceRoot":"","sources":["../src/ipc-decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOlD,MAAM,sBAAsB,GAAG;IAC9B,cAAc;IACd,4BAA4B;IAC5B,mCAAmC;IACnC,0BAA0B;IAC1B,aAAa;IACb,aAAa;IACb,mBAAmB;CACyC,CAAC;AAE9D,MAAM,sBAAsB,GAAG;IAC9B,cAAc;IACd,0BAA0B;IAC1B,cAAc;IACd,kBAAkB;IAClB,cAAc;IACd,uBAAuB;IACvB,cAAc;IACd,qBAAqB;IACrB,2BAA2B;IAC3B,qBAAqB;IACrB,oBAAoB;IACpB,yBAAyB;IACzB,wBAAwB;IACxB,0BAA0B;IAC1B,eAAe;CAC6C,CAAC;AAE9D,SAAS,cAAc,CACtB,OAAyB,EACzB,KAAa;IAEb,OAAQ,OAA6B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,kBAAkB,CAC1B,GAAY,EACZ,OAAoC,EACpC,SAAiB;IAEjB,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC;QACnB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC;IAC9C,CAAC;IACD,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACvD,OAAO;YACN,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,cAAc,SAAS,kBAAkB,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE;SACzE,CAAC;IACH,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,QAA+B,EAAE,CAAC;AACzE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,GAAY;IACvD,OAAO,kBAAkB,CAAC,GAAG,EAAE,sBAAsB,EAAE,kBAAkB,CAAC,CAAC;AAC5E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,GAAY;IACvD,OAAO,kBAAkB,CAAC,GAAG,EAAE,sBAAsB,EAAE,kBAAkB,CAAC,CAAC;AAC5E,CAAC"}
@@ -1,310 +0,0 @@
1
- import type { CurrentExecutionRef, NormalizedQuestion, PreparedTurnStart, ProcessInputTarget, ProcessLifecycleStatus, ProcessSemanticEntryRefKey, ProcessTurnRecordPathType, ProcessTurnType, TurnFailedPayload, TurnStartRecord, WorkerBootstrapReceipt } from "@leitwerk-dev/domain";
2
- import type { ConfigSnapshot } from "@leitwerk-dev/protocol/config-snapshot";
3
- import { type IpcEnvelope } from "./ipc-codec.js";
4
- export interface ProcessInstanceSnapshot {
5
- id?: string;
6
- processId?: string;
7
- selectedTurnId?: string | null;
8
- lifecycleStatus?: ProcessLifecycleStatus;
9
- currentExecution?: CurrentExecutionRef;
10
- planRevision?: number;
11
- title?: string | null;
12
- externalId?: string | null;
13
- externalUrl?: string | null;
14
- metadata?: Record<string, unknown> | null;
15
- defaultModelProfileId?: string | null;
16
- turnConfigsJson?: string | null;
17
- selectedTurnModelProfileId?: string | null;
18
- paramsJson?: string | null;
19
- stateJson?: string | null;
20
- createdAt?: string;
21
- updatedAt?: string;
22
- }
23
- export interface ProcessProjectSnapshot {
24
- id?: string;
25
- instanceId?: string;
26
- key: string;
27
- repoLocator: string;
28
- repoLocatorKind?: "remote_url" | "local_path";
29
- baseBranch: string;
30
- workBranch?: string | null;
31
- externalId?: string | null;
32
- externalUrl?: string | null;
33
- metadata?: Record<string, unknown> | null;
34
- pipelineStatus?: string | null;
35
- createdAt?: string;
36
- updatedAt?: string;
37
- }
38
- export interface InputDelivery {
39
- inputId: string;
40
- sequence: number;
41
- source: string;
42
- kind: string;
43
- target: ProcessInputTarget | null;
44
- receivedAt: string;
45
- bodyMarkdown: string;
46
- }
47
- export interface WorkerRuntimeContextSnapshot {
48
- processSnapshot: ProcessInstanceSnapshot;
49
- projectSnapshots: ProcessProjectSnapshot[];
50
- turnResultMarkdownBySemanticRef?: Partial<Record<ProcessSemanticEntryRefKey, string>>;
51
- turnResultMarkdownByProduct?: Record<string, string>;
52
- }
53
- export interface WorkerCredentialMaterial {
54
- providerId: string;
55
- revision: number;
56
- /** Secret payload. This type is valid only in worker.start and credential-update frames. */
57
- values: Record<string, string>;
58
- }
59
- export interface WorkerGitSshCredential {
60
- projectKey: string;
61
- kind: "git_ssh";
62
- credentialRef: string;
63
- /** Secret values; valid only while preparing worker.start. */
64
- privateKey: string;
65
- knownHosts: string;
66
- }
67
- export interface LlmWorkerStartBootstrap {
68
- kind: "llm";
69
- resourceBundle: {
70
- digest: string;
71
- archiveBase64: string;
72
- };
73
- credential: WorkerCredentialMaterial | null;
74
- }
75
- export interface AutomaticWorkerStartBootstrap {
76
- kind: "automatic";
77
- }
78
- interface WorkerStartPayloadBase extends WorkerRuntimeContextSnapshot {
79
- workerLeaseId: string;
80
- turnStart: TurnStartRecord;
81
- /**
82
- * The immutable pre-acceptance tree plan from the lease that first accepted
83
- * this start. It is supplied only when a replacement resumes a running turn.
84
- */
85
- acceptedPreparedStart?: PreparedTurnStart | null;
86
- pendingInputs: InputDelivery[];
87
- treePaths: {
88
- primaryTreeFile: string;
89
- workspaceRoot: string;
90
- };
91
- resume: boolean;
92
- resumeLeafEntryId?: string | null;
93
- /** Fresh secret material resolved for this physical worker start only. */
94
- repositoryCredentials?: WorkerGitSshCredential[];
95
- }
96
- export type WorkerStartPayload = (WorkerStartPayloadBase & {
97
- bootstrap: LlmWorkerStartBootstrap;
98
- configSnapshot: ConfigSnapshot;
99
- }) | (WorkerStartPayloadBase & {
100
- bootstrap: AutomaticWorkerStartBootstrap;
101
- });
102
- export interface InputBatchPayload {
103
- inputs: InputDelivery[];
104
- }
105
- export interface WorkerStopPayload {
106
- reason: string;
107
- }
108
- export interface WorkerAbortTurnPayload {
109
- reason: string;
110
- }
111
- export interface WorkerTurnStartAcceptedPayload {
112
- startRecordId: string;
113
- turnRecordId: string;
114
- }
115
- export interface WorkerQuestionResponsePayload {
116
- turnRecordId: string;
117
- toolCallId: string;
118
- answers: string[];
119
- }
120
- export interface WorkerQuestionRequestedPayload {
121
- turnRecordId: string;
122
- toolCallId: string;
123
- questions: NormalizedQuestion[];
124
- }
125
- export interface WorkerCredentialUpdateResultPayload {
126
- providerId: string;
127
- accepted: boolean;
128
- currentRevision: number | null;
129
- safeReason?: string;
130
- }
131
- export type ServerToWorkerMessage = (Omit<IpcEnvelope, "type" | "payload"> & {
132
- type: "worker.start";
133
- payload: WorkerStartPayload;
134
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
135
- type: "worker.turn_start_accepted";
136
- payload: WorkerTurnStartAcceptedPayload;
137
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
138
- type: "worker.credential_update_accepted";
139
- payload: WorkerCredentialUpdateResultPayload;
140
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
141
- type: "worker.question_response";
142
- payload: WorkerQuestionResponsePayload;
143
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
144
- type: "input.batch";
145
- payload: InputBatchPayload;
146
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
147
- type: "worker.stop";
148
- payload: WorkerStopPayload;
149
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
150
- type: "worker.abort_turn";
151
- payload: WorkerAbortTurnPayload;
152
- });
153
- export interface WorkerHelloPayload {
154
- /** Package/runtime version for diagnostics. */
155
- version: string;
156
- /** Server-worker API compatibility version. Missing only on legacy/test workers. */
157
- apiVersion?: string;
158
- capabilities: string[];
159
- }
160
- export interface WorkerReadyPayload {
161
- receipt: WorkerBootstrapReceipt;
162
- resumed: boolean;
163
- primaryTreeFile: string;
164
- workspaceRoot: string;
165
- aggregatedAgentsSources: string[];
166
- loadedSkills: string[];
167
- loadedAgentsFiles: Array<{
168
- path: string;
169
- sizeBytes: number;
170
- }>;
171
- loadedSkillFiles: Array<{
172
- name: string;
173
- path: string;
174
- }>;
175
- rootEntryId?: string | null;
176
- }
177
- export interface WorkerHeartbeatPayload {
178
- /** Diagnostic worker-local runtime state; not the authoritative lease transition channel. */
179
- state: string;
180
- lastSequenceConsumed: number;
181
- currentTurnId?: string;
182
- currentSelectedTurnId?: string | null;
183
- }
184
- export interface WorkerStatePayload {
185
- /** Explicit server-visible runtime transition, e.g. idle -> busy or busy -> idle. */
186
- from: string;
187
- to: string;
188
- reason: string;
189
- }
190
- export interface WorkerInputConsumedPayload {
191
- inputId: string;
192
- sequence: number;
193
- deliveryMode: string;
194
- currentPrimaryPathLeafId?: string | null;
195
- rootEntryId?: string | null;
196
- targetSemanticRef?: ProcessSemanticEntryRefKey | null;
197
- targetProductName?: string | null;
198
- targetEntryId?: string | null;
199
- }
200
- export interface WorkerEventPayload {
201
- eventType: string;
202
- selectedTurnId?: string | null;
203
- /**
204
- * Object-shaped event data emitted by trusted worker senders. Decode helpers
205
- * do not deeply validate this field at runtime; they only narrow it at the
206
- * protocol boundary after envelope + message-type validation.
207
- */
208
- data: Record<string, unknown>;
209
- }
210
- export interface WorkerTurnStartedPayload {
211
- startRecordId: string;
212
- proposedTurnRecordId: string;
213
- }
214
- export interface WorkerCredentialUpdatePayload {
215
- providerId: string;
216
- expectedRevision: number;
217
- /** Secret payload. It must not be copied into receipts, events, or turn state. */
218
- values: Record<string, string>;
219
- }
220
- export interface WorkerTurnOutcomePayload {
221
- turnRecordId: string;
222
- turnId: string;
223
- turnType: ProcessTurnType;
224
- outcome: string;
225
- params: Record<string, unknown>;
226
- pathType?: ProcessTurnRecordPathType;
227
- forkPiEntryId?: string | null;
228
- resultPiEntryId?: string | null;
229
- turnResultMarkdown?: string | null;
230
- rootEntryId?: string | null;
231
- }
232
- export interface WorkerTurnFailedPayload extends Omit<TurnFailedPayload, "instanceId" | "errorClass"> {
233
- errorClass?: string;
234
- }
235
- export interface WorkerLifecycleParkedPayload {
236
- selectedTurnId: string | null;
237
- reason?: string;
238
- errorClass?: string;
239
- }
240
- export interface WorkerCleanupStartedPayload {
241
- reason: string;
242
- }
243
- export interface WorkerCleanupCompletedPayload {
244
- releasedLocks: string[];
245
- removedTransientPaths: string[];
246
- }
247
- export interface WorkerFailedPayload {
248
- state: string;
249
- errorCode: string;
250
- message: string;
251
- errorClass: string;
252
- selectedTurnId?: string | null;
253
- retryAttempt?: number;
254
- }
255
- export type WorkerToServerMessage = (Omit<IpcEnvelope, "type" | "payload"> & {
256
- type: "worker.hello";
257
- payload: WorkerHelloPayload;
258
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
259
- type: "worker.credential_update";
260
- payload: WorkerCredentialUpdatePayload;
261
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
262
- type: "worker.ready";
263
- payload: WorkerReadyPayload;
264
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
265
- type: "worker.heartbeat";
266
- payload: WorkerHeartbeatPayload;
267
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
268
- type: "worker.state";
269
- payload: WorkerStatePayload;
270
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
271
- type: "worker.input_consumed";
272
- payload: WorkerInputConsumedPayload;
273
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
274
- type: "worker.event";
275
- payload: WorkerEventPayload;
276
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
277
- type: "worker.turn_started";
278
- payload: WorkerTurnStartedPayload;
279
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
280
- type: "worker.question_requested";
281
- payload: WorkerQuestionRequestedPayload;
282
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
283
- type: "worker.turn_outcome";
284
- payload: WorkerTurnOutcomePayload;
285
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
286
- type: "worker.turn_failed";
287
- payload: WorkerTurnFailedPayload;
288
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
289
- type: "worker.lifecycle_parked";
290
- payload: WorkerLifecycleParkedPayload;
291
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
292
- type: "worker.cleanup_started";
293
- payload: WorkerCleanupStartedPayload;
294
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
295
- type: "worker.cleanup_completed";
296
- payload: WorkerCleanupCompletedPayload;
297
- }) | (Omit<IpcEnvelope, "type" | "payload"> & {
298
- type: "worker.failed";
299
- payload: WorkerFailedPayload;
300
- });
301
- export type AnyIpcMessage = ServerToWorkerMessage | WorkerToServerMessage;
302
- export type IpcMessageType = AnyIpcMessage["type"];
303
- export type IpcMessageOfType<TType extends IpcMessageType> = Extract<AnyIpcMessage, {
304
- type: TType;
305
- }>;
306
- export declare function createIpcMessage<TMessage extends AnyIpcMessage>(args: Omit<TMessage, "protocol" | "sentAt"> & {
307
- sentAt?: string;
308
- }): TMessage;
309
- export {};
310
- //# sourceMappingURL=ipc-messages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ipc-messages.d.ts","sourceRoot":"","sources":["../src/ipc-messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExE,MAAM,WAAW,uBAAuB;IACvC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC1C,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,0BAA0B,CAAC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CAAE,GAC/D,QAAQ,CAWV"}
@@ -1,14 +0,0 @@
1
- import { IPC_PROTOCOL_VERSION } from "./ipc-codec.js";
2
- export function createIpcMessage(args) {
3
- return {
4
- protocol: IPC_PROTOCOL_VERSION,
5
- messageId: args.messageId,
6
- correlationId: args.correlationId,
7
- type: args.type,
8
- instanceId: args.instanceId,
9
- workerId: args.workerId,
10
- sentAt: args.sentAt ?? new Date().toISOString(),
11
- payload: args.payload,
12
- };
13
- }
14
- //# sourceMappingURL=ipc-messages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ipc-messages.js","sourceRoot":"","sources":["../src/ipc-messages.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,gBAAgB,CAAC;AAiWxE,MAAM,UAAU,gBAAgB,CAC/B,IAAiE;IAEjE,OAAO;QACN,QAAQ,EAAE,oBAAoB;QAC9B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC/C,OAAO,EAAE,IAAI,CAAC,OAAO;KACT,CAAC;AACf,CAAC"}