@lumenflow/control-plane-sdk 4.24.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-host-registry.d.ts +61 -0
- package/dist/agent-host-registry.d.ts.map +1 -0
- package/dist/agent-host-registry.js +196 -0
- package/dist/agent-host-registry.js.map +1 -0
- package/dist/authenticate.d.ts +59 -0
- package/dist/authenticate.d.ts.map +1 -0
- package/dist/authenticate.js +113 -0
- package/dist/authenticate.js.map +1 -0
- package/dist/delegation-registry.d.ts +107 -0
- package/dist/delegation-registry.d.ts.map +1 -0
- package/dist/delegation-registry.js +160 -0
- package/dist/delegation-registry.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/mock/mock-control-plane-sync-port.d.ts +2 -2
- package/dist/mock/mock-control-plane-sync-port.d.ts.map +1 -1
- package/dist/mock/mock-control-plane-sync-port.js.map +1 -1
- package/dist/pack-outcome-descriptor.d.ts +42 -0
- package/dist/pack-outcome-descriptor.d.ts.map +1 -0
- package/dist/pack-outcome-descriptor.js +4 -0
- package/dist/pack-outcome-descriptor.js.map +1 -0
- package/dist/policy-mode.d.ts +2 -2
- package/dist/policy-mode.d.ts.map +1 -1
- package/dist/policy-mode.js +12 -4
- package/dist/policy-mode.js.map +1 -1
- package/dist/replay-artifact.d.ts +48 -0
- package/dist/replay-artifact.d.ts.map +1 -0
- package/dist/replay-artifact.js +4 -0
- package/dist/replay-artifact.js.map +1 -0
- package/dist/scope-grammar.d.ts +12 -0
- package/dist/scope-grammar.d.ts.map +1 -0
- package/dist/scope-grammar.js +109 -0
- package/dist/scope-grammar.js.map +1 -0
- package/dist/sync-port.d.ts +261 -24
- package/dist/sync-port.d.ts.map +1 -1
- package/dist/sync-port.js +92 -0
- package/dist/sync-port.js.map +1 -1
- package/dist/wu-events.d.ts +197 -0
- package/dist/wu-events.d.ts.map +1 -0
- package/dist/wu-events.js +109 -0
- package/dist/wu-events.js.map +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* Apache-2.0 mirror of @lumenflow/core's WU event schema (ADR-011 §1).
|
|
5
|
+
*
|
|
6
|
+
* lumenflow-cloud is proprietary and cannot link AGPL code; the canonical
|
|
7
|
+
* WUEvent schema in @lumenflow/core/wu-state-schema.ts (AGPL-3.0-only) is
|
|
8
|
+
* mirrored here — not re-exported — so the Apache-2.0 SDK does not drag an
|
|
9
|
+
* AGPL dependency into the cloud's closure. Shape must stay byte-identical;
|
|
10
|
+
* a conformance test in WU-2638 keeps the two copies in sync.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
/**
|
|
14
|
+
* WU event type literals mirrored from @lumenflow/core/wu-state-schema.ts.
|
|
15
|
+
*/
|
|
16
|
+
export const WU_EVENT_TYPES = [
|
|
17
|
+
'create',
|
|
18
|
+
'claim',
|
|
19
|
+
'block',
|
|
20
|
+
'unblock',
|
|
21
|
+
'complete',
|
|
22
|
+
'checkpoint',
|
|
23
|
+
'delegation',
|
|
24
|
+
'release',
|
|
25
|
+
'wu_renamed',
|
|
26
|
+
];
|
|
27
|
+
const WU_ID_PATTERN = /^WU-\d+$/;
|
|
28
|
+
const ERROR_MESSAGES = {
|
|
29
|
+
EVENT_TYPE: `Event type must be one of: ${WU_EVENT_TYPES.join(', ')}`,
|
|
30
|
+
WU_ID: 'WU ID must match pattern WU-XXX (e.g., WU-2637)',
|
|
31
|
+
LANE_REQUIRED: 'Lane is required',
|
|
32
|
+
TITLE_REQUIRED: 'Title is required',
|
|
33
|
+
REASON_REQUIRED: 'Reason is required',
|
|
34
|
+
TIMESTAMP_REQUIRED: 'Timestamp is required',
|
|
35
|
+
CHECKPOINT_NOTE_REQUIRED: 'Checkpoint note is required',
|
|
36
|
+
DELEGATION_PARENT_REQUIRED: 'Parent WU ID must match pattern WU-XXX',
|
|
37
|
+
DELEGATION_ID_REQUIRED: 'Delegation ID is required',
|
|
38
|
+
};
|
|
39
|
+
const BaseEventSchema = z.object({
|
|
40
|
+
type: z.enum(WU_EVENT_TYPES, { error: ERROR_MESSAGES.EVENT_TYPE }),
|
|
41
|
+
wuId: z.string().regex(WU_ID_PATTERN, { message: ERROR_MESSAGES.WU_ID }),
|
|
42
|
+
timestamp: z.string().datetime({ message: ERROR_MESSAGES.TIMESTAMP_REQUIRED }),
|
|
43
|
+
});
|
|
44
|
+
export const CreateEventSchema = BaseEventSchema.extend({
|
|
45
|
+
type: z.literal('create'),
|
|
46
|
+
lane: z.string().min(1, { message: ERROR_MESSAGES.LANE_REQUIRED }),
|
|
47
|
+
title: z.string().min(1, { message: ERROR_MESSAGES.TITLE_REQUIRED }),
|
|
48
|
+
});
|
|
49
|
+
export const ClaimEventSchema = BaseEventSchema.extend({
|
|
50
|
+
type: z.literal('claim'),
|
|
51
|
+
lane: z.string().min(1, { message: ERROR_MESSAGES.LANE_REQUIRED }),
|
|
52
|
+
title: z.string().min(1, { message: ERROR_MESSAGES.TITLE_REQUIRED }),
|
|
53
|
+
});
|
|
54
|
+
export const BlockEventSchema = BaseEventSchema.extend({
|
|
55
|
+
type: z.literal('block'),
|
|
56
|
+
reason: z.string().min(1, { message: ERROR_MESSAGES.REASON_REQUIRED }),
|
|
57
|
+
});
|
|
58
|
+
export const UnblockEventSchema = BaseEventSchema.extend({
|
|
59
|
+
type: z.literal('unblock'),
|
|
60
|
+
});
|
|
61
|
+
export const CompleteEventSchema = BaseEventSchema.extend({
|
|
62
|
+
type: z.literal('complete'),
|
|
63
|
+
});
|
|
64
|
+
export const CheckpointEventSchema = BaseEventSchema.extend({
|
|
65
|
+
type: z.literal('checkpoint'),
|
|
66
|
+
note: z.string().min(1, { message: ERROR_MESSAGES.CHECKPOINT_NOTE_REQUIRED }),
|
|
67
|
+
sessionId: z.string().optional(),
|
|
68
|
+
progress: z.string().optional(),
|
|
69
|
+
nextSteps: z.string().optional(),
|
|
70
|
+
});
|
|
71
|
+
export const DelegationEventSchema = BaseEventSchema.extend({
|
|
72
|
+
type: z.literal('delegation'),
|
|
73
|
+
parentWuId: z
|
|
74
|
+
.string()
|
|
75
|
+
.regex(WU_ID_PATTERN, { message: ERROR_MESSAGES.DELEGATION_PARENT_REQUIRED }),
|
|
76
|
+
delegationId: z.string().min(1, { message: ERROR_MESSAGES.DELEGATION_ID_REQUIRED }),
|
|
77
|
+
});
|
|
78
|
+
export const ReleaseEventSchema = BaseEventSchema.extend({
|
|
79
|
+
type: z.literal('release'),
|
|
80
|
+
reason: z.string().min(1, { message: ERROR_MESSAGES.REASON_REQUIRED }),
|
|
81
|
+
});
|
|
82
|
+
export const WURenamedEventSchema = BaseEventSchema.extend({
|
|
83
|
+
type: z.literal('wu_renamed'),
|
|
84
|
+
from: z.string().regex(WU_ID_PATTERN, { message: ERROR_MESSAGES.WU_ID }),
|
|
85
|
+
to: z.string().regex(WU_ID_PATTERN, { message: ERROR_MESSAGES.WU_ID }),
|
|
86
|
+
reason: z.string().optional(),
|
|
87
|
+
});
|
|
88
|
+
export const WUEventSchema = z.discriminatedUnion('type', [
|
|
89
|
+
CreateEventSchema,
|
|
90
|
+
ClaimEventSchema,
|
|
91
|
+
BlockEventSchema,
|
|
92
|
+
UnblockEventSchema,
|
|
93
|
+
CompleteEventSchema,
|
|
94
|
+
CheckpointEventSchema,
|
|
95
|
+
DelegationEventSchema,
|
|
96
|
+
ReleaseEventSchema,
|
|
97
|
+
WURenamedEventSchema,
|
|
98
|
+
]);
|
|
99
|
+
/**
|
|
100
|
+
* Validates WU event data against the mirrored WUEventSchema.
|
|
101
|
+
*
|
|
102
|
+
* Cloud consumers should prefer this over ad-hoc parsing so that schema drift
|
|
103
|
+
* between @lumenflow/core and @lumenflow/control-plane-sdk surfaces as an
|
|
104
|
+
* explicit validation failure rather than silent data loss.
|
|
105
|
+
*/
|
|
106
|
+
export function validateWUEvent(data) {
|
|
107
|
+
return WUEventSchema.safeParse(data);
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=wu-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wu-events.js","sourceRoot":"","sources":["../src/wu-events.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,sCAAsC;AAEtC;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,QAAQ;IACR,OAAO;IACP,OAAO;IACP,SAAS;IACT,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,YAAY;CACJ,CAAC;AAIX,MAAM,aAAa,GAAG,UAAU,CAAC;AAEjC,MAAM,cAAc,GAAG;IACrB,UAAU,EAAE,8BAA8B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;IACrE,KAAK,EAAE,iDAAiD;IACxD,aAAa,EAAE,kBAAkB;IACjC,cAAc,EAAE,mBAAmB;IACnC,eAAe,EAAE,oBAAoB;IACrC,kBAAkB,EAAE,uBAAuB;IAC3C,wBAAwB,EAAE,6BAA6B;IACvD,0BAA0B,EAAE,wCAAwC;IACpE,sBAAsB,EAAE,2BAA2B;CAC3C,CAAC;AAEX,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,UAAU,EAAE,CAAC;IAClE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC;IACxE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,cAAc,CA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CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC;IACxE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC;IACtE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACxD,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB;IAClB,oBAAoB;CACrB,CAAC,CAAC;AAaH;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,IAAa;IAC3C,OAAO,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumenflow/control-plane-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Control plane sync contracts and adapters for LumenFlow runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"LICENSE",
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"zod": "^4.3.6"
|
|
15
|
+
},
|
|
13
16
|
"devDependencies": {
|
|
14
17
|
"@vitest/coverage-v8": "^4.0.18",
|
|
15
18
|
"typescript": "^5.9.3",
|