optio-contracts 0.1.3 → 0.2.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.
- package/dist/api-to-frontend.d.ts +551 -5
- package/dist/api-to-frontend.d.ts.map +1 -1
- package/dist/api-to-frontend.js +4 -1
- package/dist/api-to-frontend.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/optio-engine-to-api.d.ts +321 -15
- package/dist/optio-engine-to-api.d.ts.map +1 -1
- package/dist/optio-engine-to-api.js +6 -0
- package/dist/optio-engine-to-api.js.map +1 -1
- package/dist/process-filter-helpers.d.ts +14 -0
- package/dist/process-filter-helpers.d.ts.map +1 -0
- package/dist/process-filter-helpers.js +18 -0
- package/dist/process-filter-helpers.js.map +1 -0
- package/dist/schemas/process.d.ts +169 -2
- package/dist/schemas/process.d.ts.map +1 -1
- package/dist/schemas/process.js +52 -1
- package/dist/schemas/process.js.map +1 -1
- package/dist/schemas/session-events.d.ts +67 -0
- package/dist/schemas/session-events.d.ts.map +1 -0
- package/dist/schemas/session-events.js +14 -0
- package/dist/schemas/session-events.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ProcessMetadataPredicate, FilterScalar } from './schemas/process.js';
|
|
2
|
+
export declare const and: (...preds: ProcessMetadataPredicate[]) => ProcessMetadataPredicate;
|
|
3
|
+
export declare const or: (...preds: ProcessMetadataPredicate[]) => ProcessMetadataPredicate;
|
|
4
|
+
export declare const not: (pred: ProcessMetadataPredicate) => ProcessMetadataPredicate;
|
|
5
|
+
export declare const eq: (field: string, v: FilterScalar) => ProcessMetadataPredicate;
|
|
6
|
+
export declare const ne: (field: string, v: FilterScalar) => ProcessMetadataPredicate;
|
|
7
|
+
export declare const isIn: (field: string, v: FilterScalar[]) => ProcessMetadataPredicate;
|
|
8
|
+
export declare const notIn: (field: string, v: FilterScalar[]) => ProcessMetadataPredicate;
|
|
9
|
+
export declare const exists: (field: string, v?: boolean) => ProcessMetadataPredicate;
|
|
10
|
+
export declare const gt: (field: string, v: FilterScalar) => ProcessMetadataPredicate;
|
|
11
|
+
export declare const gte: (field: string, v: FilterScalar) => ProcessMetadataPredicate;
|
|
12
|
+
export declare const lt: (field: string, v: FilterScalar) => ProcessMetadataPredicate;
|
|
13
|
+
export declare const lte: (field: string, v: FilterScalar) => ProcessMetadataPredicate;
|
|
14
|
+
//# sourceMappingURL=process-filter-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-filter-helpers.d.ts","sourceRoot":"","sources":["../src/process-filter-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,YAAY,EACb,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,GAAG,GAAI,GAAG,OAAO,wBAAwB,EAAE,KAAG,wBACb,CAAC;AAE/C,eAAO,MAAM,EAAE,GAAI,GAAG,OAAO,wBAAwB,EAAE,KAAG,wBACb,CAAC;AAE9C,eAAO,MAAM,GAAG,GAAI,MAAM,wBAAwB,KAAG,wBACR,CAAC;AAM9C,eAAO,MAAM,EAAE,GAAI,OAAO,MAAM,EAAE,GAAG,YAAY,KAAG,wBACE,CAAC;AAEvD,eAAO,MAAM,EAAE,GAAI,OAAO,MAAM,EAAE,GAAG,YAAY,KAAG,wBACE,CAAC;AAEvD,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,EAAE,GAAG,YAAY,EAAE,KAAG,wBACF,CAAC;AAEvD,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,GAAG,YAAY,EAAE,KAAG,wBACF,CAAC;AAExD,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,EAAE,IAAG,OAAc,KAAG,wBACA,CAAC;AAE3D,eAAO,MAAM,EAAE,GAAI,OAAO,MAAM,EAAE,GAAG,YAAY,KAAG,wBACE,CAAC;AAEvD,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,EAAE,GAAG,YAAY,KAAG,wBACE,CAAC;AAExD,eAAO,MAAM,EAAE,GAAI,OAAO,MAAM,EAAE,GAAG,YAAY,KAAG,wBACE,CAAC;AAEvD,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,EAAE,GAAG,YAAY,KAAG,wBACE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Combinators.
|
|
2
|
+
export const and = (...preds) => ({ AND: preds });
|
|
3
|
+
export const or = (...preds) => ({ OR: preds });
|
|
4
|
+
export const not = (pred) => ({ NOT: pred });
|
|
5
|
+
// Leaf builders. `field` is a dotted path under `metadata.*` (auto-prefixed
|
|
6
|
+
// at translation time). `isIn` / `notIn` avoid the `in` JS reserved-word
|
|
7
|
+
// collision; `not` is the combinator and does not double as a leaf negation
|
|
8
|
+
// (use `not(eq(...))`).
|
|
9
|
+
export const eq = (field, v) => ({ [field]: { eq: v } });
|
|
10
|
+
export const ne = (field, v) => ({ [field]: { ne: v } });
|
|
11
|
+
export const isIn = (field, v) => ({ [field]: { in: v } });
|
|
12
|
+
export const notIn = (field, v) => ({ [field]: { nin: v } });
|
|
13
|
+
export const exists = (field, v = true) => ({ [field]: { exists: v } });
|
|
14
|
+
export const gt = (field, v) => ({ [field]: { gt: v } });
|
|
15
|
+
export const gte = (field, v) => ({ [field]: { gte: v } });
|
|
16
|
+
export const lt = (field, v) => ({ [field]: { lt: v } });
|
|
17
|
+
export const lte = (field, v) => ({ [field]: { lte: v } });
|
|
18
|
+
//# sourceMappingURL=process-filter-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-filter-helpers.js","sourceRoot":"","sources":["../src/process-filter-helpers.ts"],"names":[],"mappings":"AAKA,eAAe;AACf,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,KAAiC,EAA4B,EAAE,CACpF,CAAC,EAAE,GAAG,EAAE,KAAK,EA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AAE,CAC7E,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAA+B,CAAA,CAAC;AAEvD,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,CAAe,EAA4B,EAAE,CAC9E,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAA+B,CAAA,CAAC;AAExD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAa,EAAE,CAAe,EAA4B,EAAE,CAC7E,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAA+B,CAAA,CAAC;AAEvD,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,CAAe,EAA4B,EAAE,CAC9E,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAA+B,CAAA,CAAC"}
|
|
@@ -16,6 +16,44 @@ export declare const LogEntrySchema: z.ZodObject<{
|
|
|
16
16
|
level: "error" | "event" | "info" | "debug" | "warning";
|
|
17
17
|
data?: Record<string, unknown> | undefined;
|
|
18
18
|
}>;
|
|
19
|
+
export declare const BrowserOpenRequestSchema: z.ZodObject<{
|
|
20
|
+
requestId: z.ZodString;
|
|
21
|
+
url: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
requestId: string;
|
|
24
|
+
url: string;
|
|
25
|
+
}, {
|
|
26
|
+
requestId: string;
|
|
27
|
+
url: string;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const SessionEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
30
|
+
requestId: z.ZodString;
|
|
31
|
+
type: z.ZodLiteral<"attention">;
|
|
32
|
+
reason: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
type: "attention";
|
|
35
|
+
requestId: string;
|
|
36
|
+
reason: string;
|
|
37
|
+
}, {
|
|
38
|
+
type: "attention";
|
|
39
|
+
requestId: string;
|
|
40
|
+
reason: string;
|
|
41
|
+
}>, z.ZodObject<{
|
|
42
|
+
requestId: z.ZodString;
|
|
43
|
+
type: z.ZodLiteral<"domain">;
|
|
44
|
+
keyword: z.ZodString;
|
|
45
|
+
data: z.ZodUnknown;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
type: "domain";
|
|
48
|
+
requestId: string;
|
|
49
|
+
keyword: string;
|
|
50
|
+
data?: unknown;
|
|
51
|
+
}, {
|
|
52
|
+
type: "domain";
|
|
53
|
+
requestId: string;
|
|
54
|
+
keyword: string;
|
|
55
|
+
data?: unknown;
|
|
56
|
+
}>]>;
|
|
19
57
|
export declare const ProcessSchema: z.ZodObject<{
|
|
20
58
|
_id: z.ZodString;
|
|
21
59
|
processId: z.ZodString;
|
|
@@ -85,6 +123,45 @@ export declare const ProcessSchema: z.ZodObject<{
|
|
|
85
123
|
widgetData: z.ZodOptional<z.ZodUnknown>;
|
|
86
124
|
supportsResume: z.ZodOptional<z.ZodBoolean>;
|
|
87
125
|
hasSavedState: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
browserOpenRequests: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
127
|
+
requestId: z.ZodString;
|
|
128
|
+
url: z.ZodString;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
requestId: string;
|
|
131
|
+
url: string;
|
|
132
|
+
}, {
|
|
133
|
+
requestId: string;
|
|
134
|
+
url: string;
|
|
135
|
+
}>, "many">>;
|
|
136
|
+
sessionEvents: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
137
|
+
requestId: z.ZodString;
|
|
138
|
+
type: z.ZodLiteral<"attention">;
|
|
139
|
+
reason: z.ZodString;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
type: "attention";
|
|
142
|
+
requestId: string;
|
|
143
|
+
reason: string;
|
|
144
|
+
}, {
|
|
145
|
+
type: "attention";
|
|
146
|
+
requestId: string;
|
|
147
|
+
reason: string;
|
|
148
|
+
}>, z.ZodObject<{
|
|
149
|
+
requestId: z.ZodString;
|
|
150
|
+
type: z.ZodLiteral<"domain">;
|
|
151
|
+
keyword: z.ZodString;
|
|
152
|
+
data: z.ZodUnknown;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
type: "domain";
|
|
155
|
+
requestId: string;
|
|
156
|
+
keyword: string;
|
|
157
|
+
data?: unknown;
|
|
158
|
+
}, {
|
|
159
|
+
type: "domain";
|
|
160
|
+
requestId: string;
|
|
161
|
+
keyword: string;
|
|
162
|
+
data?: unknown;
|
|
163
|
+
}>]>, "many">>;
|
|
164
|
+
originatingSessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
165
|
createdAt: z.ZodDate;
|
|
89
166
|
}, "strip", z.ZodTypeAny, {
|
|
90
167
|
status: {
|
|
@@ -124,6 +201,21 @@ export declare const ProcessSchema: z.ZodObject<{
|
|
|
124
201
|
widgetData?: unknown;
|
|
125
202
|
supportsResume?: boolean | undefined;
|
|
126
203
|
hasSavedState?: boolean | undefined;
|
|
204
|
+
browserOpenRequests?: {
|
|
205
|
+
requestId: string;
|
|
206
|
+
url: string;
|
|
207
|
+
}[] | undefined;
|
|
208
|
+
sessionEvents?: ({
|
|
209
|
+
type: "attention";
|
|
210
|
+
requestId: string;
|
|
211
|
+
reason: string;
|
|
212
|
+
} | {
|
|
213
|
+
type: "domain";
|
|
214
|
+
requestId: string;
|
|
215
|
+
keyword: string;
|
|
216
|
+
data?: unknown;
|
|
217
|
+
})[] | undefined;
|
|
218
|
+
originatingSessionId?: string | null | undefined;
|
|
127
219
|
}, {
|
|
128
220
|
status: {
|
|
129
221
|
state: "idle" | "scheduled" | "running" | "done" | "failed" | "cancel_requested" | "cancelling" | "cancelled";
|
|
@@ -162,11 +254,86 @@ export declare const ProcessSchema: z.ZodObject<{
|
|
|
162
254
|
widgetData?: unknown;
|
|
163
255
|
supportsResume?: boolean | undefined;
|
|
164
256
|
hasSavedState?: boolean | undefined;
|
|
257
|
+
browserOpenRequests?: {
|
|
258
|
+
requestId: string;
|
|
259
|
+
url: string;
|
|
260
|
+
}[] | undefined;
|
|
261
|
+
sessionEvents?: ({
|
|
262
|
+
type: "attention";
|
|
263
|
+
requestId: string;
|
|
264
|
+
reason: string;
|
|
265
|
+
} | {
|
|
266
|
+
type: "domain";
|
|
267
|
+
requestId: string;
|
|
268
|
+
keyword: string;
|
|
269
|
+
data?: unknown;
|
|
270
|
+
})[] | undefined;
|
|
271
|
+
originatingSessionId?: string | null | undefined;
|
|
272
|
+
}>;
|
|
273
|
+
export declare const FilterScalar: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
274
|
+
export declare const FilterFieldPath: z.ZodString;
|
|
275
|
+
export declare const FilterLeafOps: z.ZodEffects<z.ZodObject<{
|
|
276
|
+
eq: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
277
|
+
ne: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
278
|
+
in: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">>;
|
|
279
|
+
nin: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">>;
|
|
280
|
+
exists: z.ZodOptional<z.ZodBoolean>;
|
|
281
|
+
gt: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
282
|
+
gte: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
283
|
+
lt: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
284
|
+
lte: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
285
|
+
}, "strict", z.ZodTypeAny, {
|
|
286
|
+
eq?: string | number | boolean | null | undefined;
|
|
287
|
+
ne?: string | number | boolean | null | undefined;
|
|
288
|
+
in?: (string | number | boolean | null)[] | undefined;
|
|
289
|
+
nin?: (string | number | boolean | null)[] | undefined;
|
|
290
|
+
exists?: boolean | undefined;
|
|
291
|
+
gt?: string | number | boolean | null | undefined;
|
|
292
|
+
gte?: string | number | boolean | null | undefined;
|
|
293
|
+
lt?: string | number | boolean | null | undefined;
|
|
294
|
+
lte?: string | number | boolean | null | undefined;
|
|
295
|
+
}, {
|
|
296
|
+
eq?: string | number | boolean | null | undefined;
|
|
297
|
+
ne?: string | number | boolean | null | undefined;
|
|
298
|
+
in?: (string | number | boolean | null)[] | undefined;
|
|
299
|
+
nin?: (string | number | boolean | null)[] | undefined;
|
|
300
|
+
exists?: boolean | undefined;
|
|
301
|
+
gt?: string | number | boolean | null | undefined;
|
|
302
|
+
gte?: string | number | boolean | null | undefined;
|
|
303
|
+
lt?: string | number | boolean | null | undefined;
|
|
304
|
+
lte?: string | number | boolean | null | undefined;
|
|
305
|
+
}>, {
|
|
306
|
+
eq?: string | number | boolean | null | undefined;
|
|
307
|
+
ne?: string | number | boolean | null | undefined;
|
|
308
|
+
in?: (string | number | boolean | null)[] | undefined;
|
|
309
|
+
nin?: (string | number | boolean | null)[] | undefined;
|
|
310
|
+
exists?: boolean | undefined;
|
|
311
|
+
gt?: string | number | boolean | null | undefined;
|
|
312
|
+
gte?: string | number | boolean | null | undefined;
|
|
313
|
+
lt?: string | number | boolean | null | undefined;
|
|
314
|
+
lte?: string | number | boolean | null | undefined;
|
|
315
|
+
}, {
|
|
316
|
+
eq?: string | number | boolean | null | undefined;
|
|
317
|
+
ne?: string | number | boolean | null | undefined;
|
|
318
|
+
in?: (string | number | boolean | null)[] | undefined;
|
|
319
|
+
nin?: (string | number | boolean | null)[] | undefined;
|
|
320
|
+
exists?: boolean | undefined;
|
|
321
|
+
gt?: string | number | boolean | null | undefined;
|
|
322
|
+
gte?: string | number | boolean | null | undefined;
|
|
323
|
+
lt?: string | number | boolean | null | undefined;
|
|
324
|
+
lte?: string | number | boolean | null | undefined;
|
|
165
325
|
}>;
|
|
166
|
-
export declare const
|
|
167
|
-
export declare const
|
|
326
|
+
export declare const ProcessMetadataPredicateSchema: z.ZodType<unknown>;
|
|
327
|
+
export declare const ProcessMetadataFilterLegacySchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
328
|
+
export declare const ProcessMetadataFilterSchema: z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
|
|
329
|
+
export declare const MetadataFilterQueryParamSchema: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, any, string>, z.ZodUnion<[z.ZodType<unknown, z.ZodTypeDef, unknown>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>>;
|
|
168
330
|
export type Process = z.infer<typeof ProcessSchema>;
|
|
169
331
|
export type ProcessState = z.infer<typeof ProcessStateSchema>;
|
|
170
332
|
export type LogEntry = z.infer<typeof LogEntrySchema>;
|
|
333
|
+
export type FilterScalar = z.infer<typeof FilterScalar>;
|
|
334
|
+
export type FilterLeafOps = z.infer<typeof FilterLeafOps>;
|
|
335
|
+
export type ProcessMetadataPredicate = z.infer<typeof ProcessMetadataPredicateSchema>;
|
|
171
336
|
export type ProcessMetadataFilter = z.infer<typeof ProcessMetadataFilterSchema>;
|
|
337
|
+
export type BrowserOpenRequest = z.infer<typeof BrowserOpenRequestSchema>;
|
|
338
|
+
export type SessionEvent = z.infer<typeof SessionEventSchema>;
|
|
172
339
|
//# sourceMappingURL=process.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/schemas/process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB,8GAG7B,CAAC;AAiBH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAKzB,CAAC;AAEH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/schemas/process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB,8GAG7B,CAAC;AAiBH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAKzB,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;IAG7B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCxB,CAAC;AAGH,eAAO,MAAM,YAAY,iEAA2D,CAAC;AAIrF,eAAO,MAAM,eAAe,aAEyB,CAAC;AAGtD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaqD,CAAC;AAKhF,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAO7D,CAAC;AAGF,eAAO,MAAM,iCAAiC,2FAA0C,CAAC;AAKzF,eAAO,MAAM,2BAA2B,oJAGtC,CAAC;AAEH,eAAO,MAAM,8BAA8B,0NAW9B,CAAC;AAEd,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/dist/schemas/process.js
CHANGED
|
@@ -23,6 +23,14 @@ export const LogEntrySchema = z.object({
|
|
|
23
23
|
message: z.string(),
|
|
24
24
|
data: z.record(z.unknown()).optional(),
|
|
25
25
|
});
|
|
26
|
+
export const BrowserOpenRequestSchema = z.object({
|
|
27
|
+
requestId: z.string(),
|
|
28
|
+
url: z.string(),
|
|
29
|
+
});
|
|
30
|
+
export const SessionEventSchema = z.discriminatedUnion('type', [
|
|
31
|
+
z.object({ requestId: z.string(), type: z.literal('attention'), reason: z.string() }),
|
|
32
|
+
z.object({ requestId: z.string(), type: z.literal('domain'), keyword: z.string(), data: z.unknown() }),
|
|
33
|
+
]);
|
|
26
34
|
export const ProcessSchema = z.object({
|
|
27
35
|
_id: ObjectIdSchema,
|
|
28
36
|
processId: z.string(),
|
|
@@ -50,9 +58,52 @@ export const ProcessSchema = z.object({
|
|
|
50
58
|
// missing fields as false defensively)
|
|
51
59
|
supportsResume: z.boolean().optional(),
|
|
52
60
|
hasSavedState: z.boolean().optional(),
|
|
61
|
+
// Client-directed events (phase 2). Append-only; never GC'd.
|
|
62
|
+
browserOpenRequests: z.array(BrowserOpenRequestSchema).optional(),
|
|
63
|
+
sessionEvents: z.array(SessionEventSchema).optional(),
|
|
64
|
+
originatingSessionId: z.string().nullable().optional(),
|
|
53
65
|
createdAt: DateSchema,
|
|
54
66
|
});
|
|
55
|
-
|
|
67
|
+
// Allowed leaf scalar value types in the filter.
|
|
68
|
+
export const FilterScalar = z.union([z.string(), z.number(), z.boolean(), z.null()]);
|
|
69
|
+
// Field-path validator: dotted segments under `metadata.*`, each non-empty,
|
|
70
|
+
// no `$` anywhere (defense against Mongo operator injection through paths).
|
|
71
|
+
export const FilterFieldPath = z
|
|
72
|
+
.string()
|
|
73
|
+
.regex(/^[^.$]+(\.[^.$]+)*$/, 'invalid field path');
|
|
74
|
+
// Operator object that lives at each leaf.
|
|
75
|
+
export const FilterLeafOps = z
|
|
76
|
+
.object({
|
|
77
|
+
eq: FilterScalar.optional(),
|
|
78
|
+
ne: FilterScalar.optional(),
|
|
79
|
+
in: z.array(FilterScalar).optional(),
|
|
80
|
+
nin: z.array(FilterScalar).optional(),
|
|
81
|
+
exists: z.boolean().optional(),
|
|
82
|
+
gt: FilterScalar.optional(),
|
|
83
|
+
gte: FilterScalar.optional(),
|
|
84
|
+
lt: FilterScalar.optional(),
|
|
85
|
+
lte: FilterScalar.optional(),
|
|
86
|
+
})
|
|
87
|
+
.strict()
|
|
88
|
+
.refine((o) => Object.keys(o).length > 0, 'leaf needs at least one operator');
|
|
89
|
+
// Recursive predicate tree. A predicate node is exactly one of:
|
|
90
|
+
// { AND: [...] } { OR: [...] } { NOT: ... } { "field": LeafOps, ... }
|
|
91
|
+
// .strict() forbids mixing combinator keys with field keys in one object.
|
|
92
|
+
export const ProcessMetadataPredicateSchema = z.lazy(() => z.union([
|
|
93
|
+
z.object({ AND: z.array(ProcessMetadataPredicateSchema).min(1) }).strict(),
|
|
94
|
+
z.object({ OR: z.array(ProcessMetadataPredicateSchema).min(1) }).strict(),
|
|
95
|
+
z.object({ NOT: ProcessMetadataPredicateSchema }).strict(),
|
|
96
|
+
z.record(FilterFieldPath, FilterLeafOps),
|
|
97
|
+
]));
|
|
98
|
+
// Legacy flat shape: keys are field names, values are scalars (implicit AND of equality).
|
|
99
|
+
export const ProcessMetadataFilterLegacySchema = z.record(FilterFieldPath, FilterScalar);
|
|
100
|
+
// Public union (backwards compatible). Predicate branch first so it wins on
|
|
101
|
+
// any input that has combinator keys or operator-object values; flat scalar
|
|
102
|
+
// shapes fall through to the legacy branch.
|
|
103
|
+
export const ProcessMetadataFilterSchema = z.union([
|
|
104
|
+
ProcessMetadataPredicateSchema,
|
|
105
|
+
ProcessMetadataFilterLegacySchema,
|
|
106
|
+
]);
|
|
56
107
|
export const MetadataFilterQueryParamSchema = z
|
|
57
108
|
.string()
|
|
58
109
|
.transform((s, ctx) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/schemas/process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ;IAChD,kBAAkB,EAAE,YAAY,EAAE,WAAW;CAC9C,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,CAAC,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AC,EAAE,EAAE,EAAG,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1E,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,8BAA8B,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1D,CAAC,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC;CACzC,CAAC,CACH,CAAC;AAEF,0FAA0F;AAC1F,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;AAEzF,4EAA4E;AAC5E,4EAA4E;AAC5E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC;IACjD,8BAA8B;IAC9B,iCAAiC;CAClC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC;KAC5C,MAAM,EAAE;KACR,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;IACpB,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC,CAAC;QAC/E,OAAO,CAAC,CAAC,KAAK,CAAC;IACjB,CAAC;AACH,CAAC,CAAC;KACD,IAAI,CAAC,2BAA2B,CAAC;KACjC,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Wire shape of one message on the GET /api/session-events/stream SSE feed.
|
|
4
|
+
* The poller emits one `session-events` message per tick carrying the new
|
|
5
|
+
* sessionEvents of every process whose originatingSessionId matches the
|
|
6
|
+
* subscriber's sessionId. `processId` is the process _id hex (string).
|
|
7
|
+
*/
|
|
8
|
+
export declare const SessionEventsStreamMessageSchema: z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"session-events">;
|
|
10
|
+
processId: z.ZodString;
|
|
11
|
+
events: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
12
|
+
requestId: z.ZodString;
|
|
13
|
+
type: z.ZodLiteral<"attention">;
|
|
14
|
+
reason: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
type: "attention";
|
|
17
|
+
requestId: string;
|
|
18
|
+
reason: string;
|
|
19
|
+
}, {
|
|
20
|
+
type: "attention";
|
|
21
|
+
requestId: string;
|
|
22
|
+
reason: string;
|
|
23
|
+
}>, z.ZodObject<{
|
|
24
|
+
requestId: z.ZodString;
|
|
25
|
+
type: z.ZodLiteral<"domain">;
|
|
26
|
+
keyword: z.ZodString;
|
|
27
|
+
data: z.ZodUnknown;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
type: "domain";
|
|
30
|
+
requestId: string;
|
|
31
|
+
keyword: string;
|
|
32
|
+
data?: unknown;
|
|
33
|
+
}, {
|
|
34
|
+
type: "domain";
|
|
35
|
+
requestId: string;
|
|
36
|
+
keyword: string;
|
|
37
|
+
data?: unknown;
|
|
38
|
+
}>]>, "many">;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
type: "session-events";
|
|
41
|
+
processId: string;
|
|
42
|
+
events: ({
|
|
43
|
+
type: "attention";
|
|
44
|
+
requestId: string;
|
|
45
|
+
reason: string;
|
|
46
|
+
} | {
|
|
47
|
+
type: "domain";
|
|
48
|
+
requestId: string;
|
|
49
|
+
keyword: string;
|
|
50
|
+
data?: unknown;
|
|
51
|
+
})[];
|
|
52
|
+
}, {
|
|
53
|
+
type: "session-events";
|
|
54
|
+
processId: string;
|
|
55
|
+
events: ({
|
|
56
|
+
type: "attention";
|
|
57
|
+
requestId: string;
|
|
58
|
+
reason: string;
|
|
59
|
+
} | {
|
|
60
|
+
type: "domain";
|
|
61
|
+
requestId: string;
|
|
62
|
+
keyword: string;
|
|
63
|
+
data?: unknown;
|
|
64
|
+
})[];
|
|
65
|
+
}>;
|
|
66
|
+
export type SessionEventsStreamMessage = z.infer<typeof SessionEventsStreamMessageSchema>;
|
|
67
|
+
//# sourceMappingURL=session-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-events.d.ts","sourceRoot":"","sources":["../../src/schemas/session-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SessionEventSchema } from './process.js';
|
|
3
|
+
/**
|
|
4
|
+
* Wire shape of one message on the GET /api/session-events/stream SSE feed.
|
|
5
|
+
* The poller emits one `session-events` message per tick carrying the new
|
|
6
|
+
* sessionEvents of every process whose originatingSessionId matches the
|
|
7
|
+
* subscriber's sessionId. `processId` is the process _id hex (string).
|
|
8
|
+
*/
|
|
9
|
+
export const SessionEventsStreamMessageSchema = z.object({
|
|
10
|
+
type: z.literal('session-events'),
|
|
11
|
+
processId: z.string(),
|
|
12
|
+
events: z.array(SessionEventSchema),
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=session-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-events.js","sourceRoot":"","sources":["../../src/schemas/session-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IACjC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;CACpC,CAAC,CAAC"}
|