@mowaos/host-browser 0.0.0-stage → 0.5.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/LICENSE +201 -0
- package/NOTICE +8 -0
- package/README.md +31 -2
- package/dist/host.d.ts +91 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +232 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/kernel.d.ts +33 -0
- package/dist/kernel.d.ts.map +1 -0
- package/dist/kernel.js +63 -0
- package/dist/kernel.js.map +1 -0
- package/dist/locks.d.ts +24 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +46 -0
- package/dist/locks.js.map +1 -0
- package/dist/outbox.d.ts +68 -0
- package/dist/outbox.d.ts.map +1 -0
- package/dist/outbox.js +212 -0
- package/dist/outbox.js.map +1 -0
- package/dist/storage.d.ts +104 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +466 -0
- package/dist/storage.js.map +1 -0
- package/dist/types.d.ts +232 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +42 -0
- package/dist/types.js.map +1 -0
- package/dist/validation.d.ts +21 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +121 -0
- package/dist/validation.js.map +1 -0
- package/package.json +42 -4
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for MO·WA OS Browser Host Adapter.
|
|
3
|
+
* Matches mowa-core and mowa-wasm wire contracts.
|
|
4
|
+
*/
|
|
5
|
+
export interface ActorRef {
|
|
6
|
+
type: string;
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export type Value = null | boolean | number | string | Value[] | {
|
|
10
|
+
[key: string]: Value;
|
|
11
|
+
};
|
|
12
|
+
export interface CanonicalEvent {
|
|
13
|
+
id: string;
|
|
14
|
+
type: string;
|
|
15
|
+
source: string;
|
|
16
|
+
caseId: string;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
effectiveAt?: number | null;
|
|
19
|
+
idempotencyKey: string;
|
|
20
|
+
actor: ActorRef;
|
|
21
|
+
payload: Record<string, Value>;
|
|
22
|
+
}
|
|
23
|
+
export interface WorkflowSession {
|
|
24
|
+
id: string;
|
|
25
|
+
caseId: string;
|
|
26
|
+
workflowId: string;
|
|
27
|
+
workflowVersion: string;
|
|
28
|
+
flowHash: string;
|
|
29
|
+
state: string;
|
|
30
|
+
variables: Record<string, Value>;
|
|
31
|
+
version: number;
|
|
32
|
+
createdAt: number;
|
|
33
|
+
updatedAt: number;
|
|
34
|
+
lastResultHash?: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface DecisionContext {
|
|
37
|
+
asOf: number;
|
|
38
|
+
contextRefs: Record<string, string>;
|
|
39
|
+
}
|
|
40
|
+
export interface DecisionFacts {
|
|
41
|
+
facts: Record<string, string>;
|
|
42
|
+
}
|
|
43
|
+
export interface SideEffect {
|
|
44
|
+
id: string;
|
|
45
|
+
kind: string;
|
|
46
|
+
payload: Value;
|
|
47
|
+
}
|
|
48
|
+
export interface TransitionAudit {
|
|
49
|
+
transitionId: string;
|
|
50
|
+
sessionId: string;
|
|
51
|
+
caseId: string;
|
|
52
|
+
fromVersion: number | null;
|
|
53
|
+
eventId: string;
|
|
54
|
+
eventType: string;
|
|
55
|
+
resolvedKey: string | null;
|
|
56
|
+
fromState: string | null;
|
|
57
|
+
toState: string;
|
|
58
|
+
guardFailed: boolean;
|
|
59
|
+
workflowId: string;
|
|
60
|
+
workflowVersion: string;
|
|
61
|
+
flowHash: string;
|
|
62
|
+
kernelVersion: string;
|
|
63
|
+
decisionHash: string;
|
|
64
|
+
contextRefs: Record<string, string>;
|
|
65
|
+
factsHash: string;
|
|
66
|
+
actor: ActorRef;
|
|
67
|
+
timestamp: number;
|
|
68
|
+
prevResultHash?: string | null;
|
|
69
|
+
resultHash: string;
|
|
70
|
+
}
|
|
71
|
+
export interface Commit {
|
|
72
|
+
newSession: WorkflowSession;
|
|
73
|
+
expectedSessionVersion: number | null;
|
|
74
|
+
audit: TransitionAudit;
|
|
75
|
+
dedupKey: string;
|
|
76
|
+
outbox: SideEffect[];
|
|
77
|
+
}
|
|
78
|
+
export type FlowStatus = "DRAFT" | "ACTIVE" | "DEPRECATED";
|
|
79
|
+
export interface Transition {
|
|
80
|
+
to: string;
|
|
81
|
+
allowedActors: string[];
|
|
82
|
+
guard?: unknown;
|
|
83
|
+
onGuardFail?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface FlowNode {
|
|
86
|
+
id: string;
|
|
87
|
+
type: string;
|
|
88
|
+
tier: "T0" | "T1" | "T2" | "T3" | "T4";
|
|
89
|
+
terminal?: boolean;
|
|
90
|
+
transitions?: Record<string, Transition>;
|
|
91
|
+
onEnter?: Array<{
|
|
92
|
+
kind: string;
|
|
93
|
+
payload?: Value;
|
|
94
|
+
}>;
|
|
95
|
+
}
|
|
96
|
+
export interface FlowDefinition {
|
|
97
|
+
id: string;
|
|
98
|
+
version: string;
|
|
99
|
+
status: FlowStatus;
|
|
100
|
+
startNode: string;
|
|
101
|
+
startActors: string[];
|
|
102
|
+
description?: string;
|
|
103
|
+
declaredFacts?: Record<string, string[]>;
|
|
104
|
+
nodes: Record<string, FlowNode>;
|
|
105
|
+
effectiveFrom: number;
|
|
106
|
+
effectiveTo?: number | null;
|
|
107
|
+
}
|
|
108
|
+
export interface KernelError {
|
|
109
|
+
code: string;
|
|
110
|
+
[key: string]: unknown;
|
|
111
|
+
}
|
|
112
|
+
export type KernelResponse = {
|
|
113
|
+
status: "OK";
|
|
114
|
+
commit: Commit;
|
|
115
|
+
} | {
|
|
116
|
+
status: "KERNEL_ERROR";
|
|
117
|
+
error: KernelError;
|
|
118
|
+
} | {
|
|
119
|
+
status: "FLOW_INVALID";
|
|
120
|
+
errors: unknown[];
|
|
121
|
+
} | {
|
|
122
|
+
status: "FLOW_HANDLE_NOT_FOUND";
|
|
123
|
+
handle: string;
|
|
124
|
+
} | {
|
|
125
|
+
status: "BAD_REQUEST";
|
|
126
|
+
reason: string;
|
|
127
|
+
};
|
|
128
|
+
export type LoadFlowResponse = {
|
|
129
|
+
status: "OK";
|
|
130
|
+
flowHandle: string;
|
|
131
|
+
flowHash: string;
|
|
132
|
+
} | {
|
|
133
|
+
status: "FLOW_INVALID";
|
|
134
|
+
errors: unknown[];
|
|
135
|
+
} | {
|
|
136
|
+
status: "BAD_REQUEST";
|
|
137
|
+
reason: string;
|
|
138
|
+
};
|
|
139
|
+
export type DedupResponse = {
|
|
140
|
+
status: "OK";
|
|
141
|
+
dedupKey: string;
|
|
142
|
+
intentHash: string;
|
|
143
|
+
} | {
|
|
144
|
+
status: "BAD_REQUEST";
|
|
145
|
+
reason: string;
|
|
146
|
+
};
|
|
147
|
+
export type OutboxStatus = "PENDING" | "AWAIT_CONFIRMATION" | "DISPATCHED" | "FAILED_DLQ" | "REJECTED";
|
|
148
|
+
export interface OutboxRecord {
|
|
149
|
+
outboxId: string;
|
|
150
|
+
sessionId: string;
|
|
151
|
+
transitionId: string;
|
|
152
|
+
effect: SideEffect;
|
|
153
|
+
status: OutboxStatus;
|
|
154
|
+
attempts: number;
|
|
155
|
+
createdAt: number;
|
|
156
|
+
nextAttemptAt: number;
|
|
157
|
+
lastAttemptAt?: number;
|
|
158
|
+
unhandledSince?: number;
|
|
159
|
+
lastError?: string;
|
|
160
|
+
}
|
|
161
|
+
export interface IdempotencyRecord {
|
|
162
|
+
dedupKey: string;
|
|
163
|
+
sessionId: string;
|
|
164
|
+
intentHash?: string;
|
|
165
|
+
commit: Commit;
|
|
166
|
+
createdAt: number;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* What the kernel was given for one step. Kept with every commit so the decision can
|
|
170
|
+
* be replayed later (docs/host-contract.md, section 6). `facts` is present for
|
|
171
|
+
* `advance` only, exactly as supplied (including facts the flow does not declare).
|
|
172
|
+
*/
|
|
173
|
+
export interface StepInputs {
|
|
174
|
+
call: "start" | "advance";
|
|
175
|
+
event: CanonicalEvent;
|
|
176
|
+
facts?: DecisionFacts;
|
|
177
|
+
ctx: DecisionContext;
|
|
178
|
+
}
|
|
179
|
+
/** One committed step: its inputs and the commit they produced. */
|
|
180
|
+
export interface StepRecord extends StepInputs {
|
|
181
|
+
transitionId: string;
|
|
182
|
+
sessionId: string;
|
|
183
|
+
/** `commit.newSession.version`: 0 for `start`, then 1, 2, … */
|
|
184
|
+
version: number;
|
|
185
|
+
commit: Commit;
|
|
186
|
+
}
|
|
187
|
+
/** Written by `atomicCommit` together with the commit itself. */
|
|
188
|
+
export interface CommitRecord {
|
|
189
|
+
intentHash: string;
|
|
190
|
+
inputs: StepInputs;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Everything needed to verify a set of sessions without access to the host
|
|
194
|
+
* (docs/host-contract.md, section 6.1). Format version 1; may change before 1.0.
|
|
195
|
+
*/
|
|
196
|
+
export interface VerificationBundle {
|
|
197
|
+
format: "mowa.verification-bundle/1";
|
|
198
|
+
/** Version of the kernel that exported the bundle. Each step's own version is in `commit.audit.kernelVersion`. */
|
|
199
|
+
kernelVersion: string;
|
|
200
|
+
/** Every flow the sessions use, keyed by flow hash. */
|
|
201
|
+
flows: Record<string, FlowDefinition>;
|
|
202
|
+
sessions: Array<{
|
|
203
|
+
sessionId: string;
|
|
204
|
+
steps: Array<StepInputs & {
|
|
205
|
+
commit: Commit;
|
|
206
|
+
}>;
|
|
207
|
+
}>;
|
|
208
|
+
/** Reference data named in `contextRefs`, or where to obtain it. Supplied by the caller. */
|
|
209
|
+
contextData: Record<string, unknown>;
|
|
210
|
+
}
|
|
211
|
+
export declare class IdempotencyConflictError extends Error {
|
|
212
|
+
readonly dedupKey: string;
|
|
213
|
+
readonly existingIntentHash: string;
|
|
214
|
+
readonly incomingIntentHash: string;
|
|
215
|
+
constructor(dedupKey: string, existingIntentHash: string, incomingIntentHash: string);
|
|
216
|
+
}
|
|
217
|
+
export declare class FlowHandleNotFoundError extends Error {
|
|
218
|
+
readonly handle: string;
|
|
219
|
+
constructor(handle: string);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Thrown by `exportVerificationBundle` when a session's stored steps do not cover every
|
|
223
|
+
* version from 0 to the current one, for example a session committed before the 0.5.0
|
|
224
|
+
* storage upgrade. Such a session cannot be replayed, so it cannot be exported.
|
|
225
|
+
*/
|
|
226
|
+
export declare class IncompleteStepHistoryError extends Error {
|
|
227
|
+
readonly sessionId: string;
|
|
228
|
+
readonly stepCount: number;
|
|
229
|
+
readonly sessionVersion: number;
|
|
230
|
+
constructor(sessionId: string, stepCount: number, sessionVersion: number);
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,KAAK,GACb,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,KAAK,EAAE,GACP;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;CAAE,CAAC;AAE7B,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAChC;AAED,MAAM,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AAM,EAAE,4BAA4B,CAAC;IACrC,kHAAkH;IAClH,aAAa,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACtC,QAAQ,EAAE,KAAK,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC/C,CAAC,CAAC;IACH,4FAA4F;IAC5F,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,qBAAa,wBAAyB,SAAQ,KAAK;aAE/B,QAAQ,EAAE,MAAM;aAChB,kBAAkB,EAAE,MAAM;aAC1B,kBAAkB,EAAE,MAAM;gBAF1B,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,MAAM,EAC1B,kBAAkB,EAAE,MAAM;CAO7C;AAED,qBAAa,uBAAwB,SAAQ,KAAK;aACpB,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;CAI3C;AAED;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;aAEjC,SAAS,EAAE,MAAM;aACjB,SAAS,EAAE,MAAM;aACjB,cAAc,EAAE,MAAM;gBAFtB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM;CAOzC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for MO·WA OS Browser Host Adapter.
|
|
3
|
+
* Matches mowa-core and mowa-wasm wire contracts.
|
|
4
|
+
*/
|
|
5
|
+
export class IdempotencyConflictError extends Error {
|
|
6
|
+
dedupKey;
|
|
7
|
+
existingIntentHash;
|
|
8
|
+
incomingIntentHash;
|
|
9
|
+
constructor(dedupKey, existingIntentHash, incomingIntentHash) {
|
|
10
|
+
super(`Idempotency key '${dedupKey}' was previously committed with intent '${existingIntentHash}', conflicting with incoming intent '${incomingIntentHash}'.`);
|
|
11
|
+
this.dedupKey = dedupKey;
|
|
12
|
+
this.existingIntentHash = existingIntentHash;
|
|
13
|
+
this.incomingIntentHash = incomingIntentHash;
|
|
14
|
+
this.name = "IdempotencyConflictError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class FlowHandleNotFoundError extends Error {
|
|
18
|
+
handle;
|
|
19
|
+
constructor(handle) {
|
|
20
|
+
super(`Flow handle '${handle}' not found in WASM cache.`);
|
|
21
|
+
this.handle = handle;
|
|
22
|
+
this.name = "FlowHandleNotFoundError";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Thrown by `exportVerificationBundle` when a session's stored steps do not cover every
|
|
27
|
+
* version from 0 to the current one, for example a session committed before the 0.5.0
|
|
28
|
+
* storage upgrade. Such a session cannot be replayed, so it cannot be exported.
|
|
29
|
+
*/
|
|
30
|
+
export class IncompleteStepHistoryError extends Error {
|
|
31
|
+
sessionId;
|
|
32
|
+
stepCount;
|
|
33
|
+
sessionVersion;
|
|
34
|
+
constructor(sessionId, stepCount, sessionVersion) {
|
|
35
|
+
super(`Session '${sessionId}' has an incomplete step history (${stepCount} steps for version ${sessionVersion}); it cannot be exported for verification.`);
|
|
36
|
+
this.sessionId = sessionId;
|
|
37
|
+
this.stepCount = stepCount;
|
|
38
|
+
this.sessionVersion = sessionVersion;
|
|
39
|
+
this.name = "IncompleteStepHistoryError";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuNH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAE/B;IACA;IACA;IAHlB,YACkB,QAAgB,EAChB,kBAA0B,EAC1B,kBAA0B;QAE1C,KAAK,CACH,oBAAoB,QAAQ,2CAA2C,kBAAkB,wCAAwC,kBAAkB,IAAI,CACxJ,CAAC;QANc,aAAQ,GAAR,QAAQ,CAAQ;QAChB,uBAAkB,GAAlB,kBAAkB,CAAQ;QAC1B,uBAAkB,GAAlB,kBAAkB,CAAQ;QAK1C,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACpB;IAA5B,YAA4B,MAAc;QACxC,KAAK,CAAC,gBAAgB,MAAM,4BAA4B,CAAC,CAAC;QADhC,WAAM,GAAN,MAAM,CAAQ;QAExC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAEjC;IACA;IACA;IAHlB,YACkB,SAAiB,EACjB,SAAiB,EACjB,cAAsB;QAEtC,KAAK,CACH,YAAY,SAAS,qCAAqC,SAAS,sBAAsB,cAAc,4CAA4C,CACpJ,CAAC;QANc,cAAS,GAAT,SAAS,CAAQ;QACjB,cAAS,GAAT,SAAS,CAAQ;QACjB,mBAAc,GAAd,cAAc,CAAQ;QAKtC,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime boundary validation.
|
|
3
|
+
* Validates untrusted input crossing network/extension boundaries.
|
|
4
|
+
*
|
|
5
|
+
* Every validator first takes a snapshot of its input (a JSON round trip, which is the
|
|
6
|
+
* form the kernel receives), then checks and returns the snapshot. The host only ever
|
|
7
|
+
* uses that snapshot, so what is hashed, decided and stored as the step's inputs is the
|
|
8
|
+
* same data, even if the caller changes its object afterwards or a property is a getter.
|
|
9
|
+
* Unknown fields are kept, so the kernel still rejects them rather than the host
|
|
10
|
+
* silently dropping them.
|
|
11
|
+
*/
|
|
12
|
+
import type { CanonicalEvent, DecisionContext, DecisionFacts, FlowDefinition } from "./types.js";
|
|
13
|
+
export declare class ValidationError extends Error {
|
|
14
|
+
readonly path: string;
|
|
15
|
+
constructor(path: string, message: string);
|
|
16
|
+
}
|
|
17
|
+
export declare function validateCanonicalEvent(raw: unknown): CanonicalEvent;
|
|
18
|
+
export declare function validateDecisionContext(raw: unknown): DecisionContext;
|
|
19
|
+
export declare function validateDecisionFacts(raw: unknown): DecisionFacts;
|
|
20
|
+
export declare function validateFlowDefinition(raw: unknown): FlowDefinition;
|
|
21
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,qBAAa,eAAgB,SAAQ,KAAK;aACZ,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAI1D;AAoCD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAqBnE;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAgBrE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,CAcjE;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAkCnE"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime boundary validation.
|
|
3
|
+
* Validates untrusted input crossing network/extension boundaries.
|
|
4
|
+
*
|
|
5
|
+
* Every validator first takes a snapshot of its input (a JSON round trip, which is the
|
|
6
|
+
* form the kernel receives), then checks and returns the snapshot. The host only ever
|
|
7
|
+
* uses that snapshot, so what is hashed, decided and stored as the step's inputs is the
|
|
8
|
+
* same data, even if the caller changes its object afterwards or a property is a getter.
|
|
9
|
+
* Unknown fields are kept, so the kernel still rejects them rather than the host
|
|
10
|
+
* silently dropping them.
|
|
11
|
+
*/
|
|
12
|
+
export class ValidationError extends Error {
|
|
13
|
+
path;
|
|
14
|
+
constructor(path, message) {
|
|
15
|
+
super(`Validation failed at '${path}': ${message}`);
|
|
16
|
+
this.path = path;
|
|
17
|
+
this.name = "ValidationError";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function assertString(val, path) {
|
|
21
|
+
if (typeof val !== "string" || val.length === 0) {
|
|
22
|
+
throw new ValidationError(path, "expected non-empty string");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function assertInteger(val, path) {
|
|
26
|
+
if (typeof val !== "number" || !Number.isSafeInteger(val)) {
|
|
27
|
+
throw new ValidationError(path, "expected safe integer");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function snapshot(val, path) {
|
|
31
|
+
let text;
|
|
32
|
+
try {
|
|
33
|
+
text = JSON.stringify(val);
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
throw new ValidationError(path, `not JSON-serialisable (${err instanceof Error ? err.message : String(err)})`);
|
|
37
|
+
}
|
|
38
|
+
if (text === undefined) {
|
|
39
|
+
throw new ValidationError(path, "not JSON-serialisable");
|
|
40
|
+
}
|
|
41
|
+
return JSON.parse(text);
|
|
42
|
+
}
|
|
43
|
+
function assertObject(val, path) {
|
|
44
|
+
if (typeof val !== "object" || val === null || Array.isArray(val)) {
|
|
45
|
+
throw new ValidationError(path, "expected non-null object");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export function validateCanonicalEvent(raw) {
|
|
49
|
+
const input = snapshot(raw, "event");
|
|
50
|
+
assertObject(input, "event");
|
|
51
|
+
assertString(input.id, "event.id");
|
|
52
|
+
assertString(input.type, "event.type");
|
|
53
|
+
assertString(input.source, "event.source");
|
|
54
|
+
assertString(input.caseId, "event.caseId");
|
|
55
|
+
assertInteger(input.timestamp, "event.timestamp");
|
|
56
|
+
assertString(input.idempotencyKey, "event.idempotencyKey");
|
|
57
|
+
assertObject(input.actor, "event.actor");
|
|
58
|
+
assertString(input.actor.type, "event.actor.type");
|
|
59
|
+
assertString(input.actor.id, "event.actor.id");
|
|
60
|
+
if (input.effectiveAt !== undefined && input.effectiveAt !== null) {
|
|
61
|
+
assertInteger(input.effectiveAt, "event.effectiveAt");
|
|
62
|
+
}
|
|
63
|
+
assertObject(input.payload ?? {}, "event.payload");
|
|
64
|
+
return input;
|
|
65
|
+
}
|
|
66
|
+
export function validateDecisionContext(raw) {
|
|
67
|
+
const input = snapshot(raw, "context");
|
|
68
|
+
assertObject(input, "context");
|
|
69
|
+
assertInteger(input.asOf, "context.asOf");
|
|
70
|
+
const refs = input.contextRefs ?? {};
|
|
71
|
+
assertObject(refs, "context.contextRefs");
|
|
72
|
+
for (const [k, v] of Object.entries(refs)) {
|
|
73
|
+
assertString(k, `context.contextRefs.${k}`);
|
|
74
|
+
assertString(v, `context.contextRefs.${k}`);
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
asOf: input.asOf,
|
|
78
|
+
contextRefs: refs,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export function validateDecisionFacts(raw) {
|
|
82
|
+
if (raw === undefined || raw === null) {
|
|
83
|
+
return { facts: {} };
|
|
84
|
+
}
|
|
85
|
+
const input = snapshot(raw, "facts");
|
|
86
|
+
assertObject(input, "facts");
|
|
87
|
+
const factsObj = input.facts ?? {};
|
|
88
|
+
assertObject(factsObj, "facts.facts");
|
|
89
|
+
for (const [k, v] of Object.entries(factsObj)) {
|
|
90
|
+
assertString(k, `facts.facts.${k}`);
|
|
91
|
+
assertString(v, `facts.facts.${k}`);
|
|
92
|
+
}
|
|
93
|
+
return { facts: factsObj };
|
|
94
|
+
}
|
|
95
|
+
export function validateFlowDefinition(raw) {
|
|
96
|
+
const input = snapshot(raw, "flow");
|
|
97
|
+
assertObject(input, "flow");
|
|
98
|
+
assertString(input.id, "flow.id");
|
|
99
|
+
assertString(input.version, "flow.version");
|
|
100
|
+
assertString(input.status, "flow.status");
|
|
101
|
+
if (!["DRAFT", "ACTIVE", "DEPRECATED"].includes(input.status)) {
|
|
102
|
+
throw new ValidationError("flow.status", "expected DRAFT, ACTIVE, or DEPRECATED");
|
|
103
|
+
}
|
|
104
|
+
assertString(input.startNode, "flow.startNode");
|
|
105
|
+
if (!Array.isArray(input.startActors) || input.startActors.length === 0) {
|
|
106
|
+
throw new ValidationError("flow.startActors", "expected non-empty array of strings");
|
|
107
|
+
}
|
|
108
|
+
for (let i = 0; i < input.startActors.length; i++) {
|
|
109
|
+
assertString(input.startActors[i], `flow.startActors[${i}]`);
|
|
110
|
+
}
|
|
111
|
+
assertInteger(input.effectiveFrom, "flow.effectiveFrom");
|
|
112
|
+
if (input.effectiveTo !== undefined && input.effectiveTo !== null) {
|
|
113
|
+
assertInteger(input.effectiveTo, "flow.effectiveTo");
|
|
114
|
+
}
|
|
115
|
+
assertObject(input.nodes, "flow.nodes");
|
|
116
|
+
if (Object.keys(input.nodes).length === 0) {
|
|
117
|
+
throw new ValidationError("flow.nodes", "expected non-empty nodes object");
|
|
118
|
+
}
|
|
119
|
+
return input;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACZ;IAA5B,YAA4B,IAAY,EAAE,OAAe;QACvD,KAAK,CAAC,yBAAyB,IAAI,MAAM,OAAO,EAAE,CAAC,CAAC;QAD1B,SAAI,GAAJ,IAAI,CAAQ;QAEtC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,SAAS,YAAY,CAAC,GAAY,EAAE,IAAY;IAC9C,IAAI,OAAO,GAA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C1C,MAAM,IAAI,eAAe,CAAC,YAAY,EAAE,iCAAiC,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,KAAkC,CAAC;AAC5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mowaos/host-browser",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "MO·WA OS Browser Extension Host Adapter (WASM + IndexedDB + Web Locks)",
|
|
6
|
+
"author": "Bruce Gardiner (ScrAtcH)",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"NOTICE"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc",
|
|
25
|
+
"pretest": "npm run build",
|
|
26
|
+
"test": "node --test tests/host.test.mjs"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/mowaos/mowa-kernel.git",
|
|
31
|
+
"directory": "packages/host-browser"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"fsm",
|
|
35
|
+
"workflow",
|
|
36
|
+
"deterministic",
|
|
37
|
+
"audit",
|
|
38
|
+
"wasm",
|
|
39
|
+
"indexeddb"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=20"
|
|
43
|
+
}
|
|
44
|
+
}
|