@platforma-open/milaboratories.sequence-embeddings 1.1.0 → 1.2.0

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.
@@ -0,0 +1,4320 @@
1
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/author_marker.d.ts
2
+ //#region src/author_marker.d.ts
3
+ /** Structure to help resolve conflicts if multiple participants writes to
4
+ * the same state */
5
+ interface AuthorMarker {
6
+ /** Unique identifier of client or even a specific window that sets this
7
+ * particular state */
8
+ authorId: string;
9
+ /** Sequential version of the state local to the author */
10
+ localVersion: number;
11
+ } //#endregion
12
+ //#endregion
13
+ //#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.d.cts
14
+ type Primitive = string | number | symbol | bigint | boolean | null | undefined;
15
+ //#endregion
16
+ //#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.d.cts
17
+ declare namespace util {
18
+ type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends (<V>() => V extends U ? 1 : 2) ? true : false;
19
+ export type isAny<T> = 0 extends 1 & T ? true : false;
20
+ export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
21
+ export function assertIs<T>(_arg: T): void;
22
+ export function assertNever(_x: never): never;
23
+ export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
24
+ export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
25
+ export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
26
+ export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
27
+ export type InexactPartial<T> = { [k in keyof T]?: T[k] | undefined };
28
+ export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k };
29
+ export const getValidEnumValues: (obj: any) => any[];
30
+ export const objectValues: (obj: any) => any[];
31
+ export const objectKeys: ObjectConstructor["keys"];
32
+ export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
33
+ export type identity<T> = objectUtil.identity<T>;
34
+ export type flatten<T> = objectUtil.flatten<T>;
35
+ export type noUndefined<T> = T extends undefined ? never : T;
36
+ export const isInteger: NumberConstructor["isInteger"];
37
+ export function joinValues<T extends any[]>(array: T, separator?: string): string;
38
+ export const jsonStringifyReplacer: (_: string, value: any) => any;
39
+ export {};
40
+ }
41
+ declare namespace objectUtil {
42
+ export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : { [k in Exclude<keyof U, keyof V>]: U[k] } & V;
43
+ type optionalKeys<T extends object> = { [k in keyof T]: undefined extends T[k] ? k : never }[keyof T];
44
+ type requiredKeys<T extends object> = { [k in keyof T]: undefined extends T[k] ? never : k }[keyof T];
45
+ export type addQuestionMarks<T extends object, _O = any> = { [K in requiredKeys<T>]: T[K] } & { [K in optionalKeys<T>]?: T[K] } & { [k in keyof T]?: unknown };
46
+ export type identity<T> = T;
47
+ export type flatten<T> = identity<{ [k in keyof T]: T[k] }>;
48
+ export type noNeverKeys<T> = { [k in keyof T]: [T[k]] extends [never] ? never : k }[keyof T];
49
+ export type noNever<T> = identity<{ [k in noNeverKeys<T>]: k extends keyof T ? T[k] : never }>;
50
+ export const mergeShapes: <U, T>(first: U, second: T) => T & U;
51
+ export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K] } & { [K in keyof B]: B[K] };
52
+ export {};
53
+ }
54
+ declare const ZodParsedType: {
55
+ string: "string";
56
+ nan: "nan";
57
+ number: "number";
58
+ integer: "integer";
59
+ float: "float";
60
+ boolean: "boolean";
61
+ date: "date";
62
+ bigint: "bigint";
63
+ symbol: "symbol";
64
+ function: "function";
65
+ undefined: "undefined";
66
+ null: "null";
67
+ array: "array";
68
+ object: "object";
69
+ unknown: "unknown";
70
+ promise: "promise";
71
+ void: "void";
72
+ never: "never";
73
+ map: "map";
74
+ set: "set";
75
+ };
76
+ type ZodParsedType = keyof typeof ZodParsedType;
77
+ //#endregion
78
+ //#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.d.cts
79
+ type allKeys<T> = T extends any ? keyof T : never;
80
+ type typeToFlattenedError<T, U = string> = {
81
+ formErrors: U[];
82
+ fieldErrors: { [P in allKeys<T>]?: U[] };
83
+ };
84
+ declare const ZodIssueCode: {
85
+ invalid_type: "invalid_type";
86
+ invalid_literal: "invalid_literal";
87
+ custom: "custom";
88
+ invalid_union: "invalid_union";
89
+ invalid_union_discriminator: "invalid_union_discriminator";
90
+ invalid_enum_value: "invalid_enum_value";
91
+ unrecognized_keys: "unrecognized_keys";
92
+ invalid_arguments: "invalid_arguments";
93
+ invalid_return_type: "invalid_return_type";
94
+ invalid_date: "invalid_date";
95
+ invalid_string: "invalid_string";
96
+ too_small: "too_small";
97
+ too_big: "too_big";
98
+ invalid_intersection_types: "invalid_intersection_types";
99
+ not_multiple_of: "not_multiple_of";
100
+ not_finite: "not_finite";
101
+ };
102
+ type ZodIssueCode = keyof typeof ZodIssueCode;
103
+ type ZodIssueBase = {
104
+ path: (string | number)[];
105
+ message?: string | undefined;
106
+ };
107
+ interface ZodInvalidTypeIssue extends ZodIssueBase {
108
+ code: typeof ZodIssueCode.invalid_type;
109
+ expected: ZodParsedType;
110
+ received: ZodParsedType;
111
+ }
112
+ interface ZodInvalidLiteralIssue extends ZodIssueBase {
113
+ code: typeof ZodIssueCode.invalid_literal;
114
+ expected: unknown;
115
+ received: unknown;
116
+ }
117
+ interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
118
+ code: typeof ZodIssueCode.unrecognized_keys;
119
+ keys: string[];
120
+ }
121
+ interface ZodInvalidUnionIssue extends ZodIssueBase {
122
+ code: typeof ZodIssueCode.invalid_union;
123
+ unionErrors: ZodError[];
124
+ }
125
+ interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
126
+ code: typeof ZodIssueCode.invalid_union_discriminator;
127
+ options: Primitive[];
128
+ }
129
+ interface ZodInvalidEnumValueIssue extends ZodIssueBase {
130
+ received: string | number;
131
+ code: typeof ZodIssueCode.invalid_enum_value;
132
+ options: (string | number)[];
133
+ }
134
+ interface ZodInvalidArgumentsIssue extends ZodIssueBase {
135
+ code: typeof ZodIssueCode.invalid_arguments;
136
+ argumentsError: ZodError;
137
+ }
138
+ interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
139
+ code: typeof ZodIssueCode.invalid_return_type;
140
+ returnTypeError: ZodError;
141
+ }
142
+ interface ZodInvalidDateIssue extends ZodIssueBase {
143
+ code: typeof ZodIssueCode.invalid_date;
144
+ }
145
+ type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | {
146
+ includes: string;
147
+ position?: number | undefined;
148
+ } | {
149
+ startsWith: string;
150
+ } | {
151
+ endsWith: string;
152
+ };
153
+ interface ZodInvalidStringIssue extends ZodIssueBase {
154
+ code: typeof ZodIssueCode.invalid_string;
155
+ validation: StringValidation;
156
+ }
157
+ interface ZodTooSmallIssue extends ZodIssueBase {
158
+ code: typeof ZodIssueCode.too_small;
159
+ minimum: number | bigint;
160
+ inclusive: boolean;
161
+ exact?: boolean;
162
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
163
+ }
164
+ interface ZodTooBigIssue extends ZodIssueBase {
165
+ code: typeof ZodIssueCode.too_big;
166
+ maximum: number | bigint;
167
+ inclusive: boolean;
168
+ exact?: boolean;
169
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
170
+ }
171
+ interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
172
+ code: typeof ZodIssueCode.invalid_intersection_types;
173
+ }
174
+ interface ZodNotMultipleOfIssue extends ZodIssueBase {
175
+ code: typeof ZodIssueCode.not_multiple_of;
176
+ multipleOf: number | bigint;
177
+ }
178
+ interface ZodNotFiniteIssue extends ZodIssueBase {
179
+ code: typeof ZodIssueCode.not_finite;
180
+ }
181
+ interface ZodCustomIssue extends ZodIssueBase {
182
+ code: typeof ZodIssueCode.custom;
183
+ params?: {
184
+ [k: string]: any;
185
+ };
186
+ }
187
+ type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
188
+ type ZodIssue = ZodIssueOptionalMessage & {
189
+ fatal?: boolean | undefined;
190
+ message: string;
191
+ };
192
+ type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? { [K in keyof T]?: ZodFormattedError<T[K]> } : T extends any[] ? {
193
+ [k: number]: ZodFormattedError<T[number]>;
194
+ } : T extends object ? { [K in keyof T]?: ZodFormattedError<T[K]> } : unknown;
195
+ type ZodFormattedError<T, U = string> = {
196
+ _errors: U[];
197
+ } & recursiveZodFormattedError<NonNullable<T>>;
198
+ declare class ZodError<T = any> extends Error {
199
+ issues: ZodIssue[];
200
+ get errors(): ZodIssue[];
201
+ constructor(issues: ZodIssue[]);
202
+ format(): ZodFormattedError<T>;
203
+ format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
204
+ static create: (issues: ZodIssue[]) => ZodError<any>;
205
+ static assert(value: unknown): asserts value is ZodError;
206
+ toString(): string;
207
+ get message(): string;
208
+ get isEmpty(): boolean;
209
+ addIssue: (sub: ZodIssue) => void;
210
+ addIssues: (subs?: ZodIssue[]) => void;
211
+ flatten(): typeToFlattenedError<T>;
212
+ flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
213
+ get formErrors(): typeToFlattenedError<T, string>;
214
+ }
215
+ type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
216
+ type IssueData = stripPath<ZodIssueOptionalMessage> & {
217
+ path?: (string | number)[];
218
+ fatal?: boolean | undefined;
219
+ };
220
+ type ErrorMapCtx = {
221
+ defaultError: string;
222
+ data: any;
223
+ };
224
+ type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
225
+ message: string;
226
+ };
227
+ //#endregion
228
+ //#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.d.cts
229
+ type ParseParams = {
230
+ path: (string | number)[];
231
+ errorMap: ZodErrorMap;
232
+ async: boolean;
233
+ };
234
+ type ParsePathComponent = string | number;
235
+ type ParsePath = ParsePathComponent[];
236
+ interface ParseContext {
237
+ readonly common: {
238
+ readonly issues: ZodIssue[];
239
+ readonly contextualErrorMap?: ZodErrorMap | undefined;
240
+ readonly async: boolean;
241
+ };
242
+ readonly path: ParsePath;
243
+ readonly schemaErrorMap?: ZodErrorMap | undefined;
244
+ readonly parent: ParseContext | null;
245
+ readonly data: any;
246
+ readonly parsedType: ZodParsedType;
247
+ }
248
+ type ParseInput = {
249
+ data: any;
250
+ path: (string | number)[];
251
+ parent: ParseContext;
252
+ };
253
+ declare class ParseStatus {
254
+ value: "aborted" | "dirty" | "valid";
255
+ dirty(): void;
256
+ abort(): void;
257
+ static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
258
+ static mergeObjectAsync(status: ParseStatus, pairs: {
259
+ key: ParseReturnType<any>;
260
+ value: ParseReturnType<any>;
261
+ }[]): Promise<SyncParseReturnType<any>>;
262
+ static mergeObjectSync(status: ParseStatus, pairs: {
263
+ key: SyncParseReturnType<any>;
264
+ value: SyncParseReturnType<any>;
265
+ alwaysSet?: boolean;
266
+ }[]): SyncParseReturnType;
267
+ }
268
+ type INVALID = {
269
+ status: "aborted";
270
+ };
271
+ declare const INVALID: INVALID;
272
+ type DIRTY<T> = {
273
+ status: "dirty";
274
+ value: T;
275
+ };
276
+ declare const DIRTY: <T>(value: T) => DIRTY<T>;
277
+ type OK<T> = {
278
+ status: "valid";
279
+ value: T;
280
+ };
281
+ declare const OK: <T>(value: T) => OK<T>;
282
+ type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
283
+ type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
284
+ type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
285
+ //#endregion
286
+ //#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/enumUtil.d.cts
287
+ declare namespace enumUtil {
288
+ type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends ((k: infer Intersection) => void) ? Intersection : never;
289
+ type GetUnionLast<T> = UnionToIntersectionFn<T> extends (() => infer Last) ? Last : never;
290
+ type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
291
+ type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
292
+ export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
293
+ export {};
294
+ }
295
+ //#endregion
296
+ //#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.d.cts
297
+ declare namespace errorUtil {
298
+ type ErrMessage = string | {
299
+ message?: string | undefined;
300
+ };
301
+ const errToObj: (message?: ErrMessage) => {
302
+ message?: string | undefined;
303
+ };
304
+ const toString: (message?: ErrMessage) => string | undefined;
305
+ }
306
+ //#endregion
307
+ //#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/partialUtil.d.cts
308
+ declare namespace partialUtil {
309
+ type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{ [k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>> }, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? { [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never } extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
310
+ }
311
+ //#endregion
312
+ //#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/standard-schema.d.cts
313
+ /**
314
+ * The Standard Schema interface.
315
+ */
316
+ type StandardSchemaV1<Input = unknown, Output = Input> = {
317
+ /**
318
+ * The Standard Schema properties.
319
+ */
320
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
321
+ };
322
+ declare namespace StandardSchemaV1 {
323
+ /**
324
+ * The Standard Schema properties interface.
325
+ */
326
+ export interface Props<Input = unknown, Output = Input> {
327
+ /**
328
+ * The version number of the standard.
329
+ */
330
+ readonly version: 1;
331
+ /**
332
+ * The vendor name of the schema library.
333
+ */
334
+ readonly vendor: string;
335
+ /**
336
+ * Validates unknown input values.
337
+ */
338
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
339
+ /**
340
+ * Inferred types associated with the schema.
341
+ */
342
+ readonly types?: Types<Input, Output> | undefined;
343
+ }
344
+ /**
345
+ * The result interface of the validate function.
346
+ */
347
+ export type Result<Output> = SuccessResult<Output> | FailureResult;
348
+ /**
349
+ * The result interface if validation succeeds.
350
+ */
351
+ export interface SuccessResult<Output> {
352
+ /**
353
+ * The typed output value.
354
+ */
355
+ readonly value: Output;
356
+ /**
357
+ * The non-existent issues.
358
+ */
359
+ readonly issues?: undefined;
360
+ }
361
+ /**
362
+ * The result interface if validation fails.
363
+ */
364
+ export interface FailureResult {
365
+ /**
366
+ * The issues of failed validation.
367
+ */
368
+ readonly issues: ReadonlyArray<Issue>;
369
+ }
370
+ /**
371
+ * The issue interface of the failure output.
372
+ */
373
+ export interface Issue {
374
+ /**
375
+ * The error message of the issue.
376
+ */
377
+ readonly message: string;
378
+ /**
379
+ * The path of the issue, if any.
380
+ */
381
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
382
+ }
383
+ /**
384
+ * The path segment interface of the issue.
385
+ */
386
+ export interface PathSegment {
387
+ /**
388
+ * The key representing a path segment.
389
+ */
390
+ readonly key: PropertyKey;
391
+ }
392
+ /**
393
+ * The Standard Schema types interface.
394
+ */
395
+ export interface Types<Input = unknown, Output = Input> {
396
+ /**
397
+ * The input type of the schema.
398
+ */
399
+ readonly input: Input;
400
+ /**
401
+ * The output type of the schema.
402
+ */
403
+ readonly output: Output;
404
+ }
405
+ /**
406
+ * Infers the input type of a Standard Schema.
407
+ */
408
+ export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
409
+ /**
410
+ * Infers the output type of a Standard Schema.
411
+ */
412
+ export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
413
+ export {};
414
+ }
415
+ //#endregion
416
+ //#region ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.d.cts
417
+ interface RefinementCtx {
418
+ addIssue: (arg: IssueData) => void;
419
+ path: (string | number)[];
420
+ }
421
+ type ZodRawShape = {
422
+ [k: string]: ZodTypeAny;
423
+ };
424
+ type ZodTypeAny = ZodType<any, any, any>;
425
+ type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
426
+ type input<T extends ZodType<any, any, any>> = T["_input"];
427
+ type output<T extends ZodType<any, any, any>> = T["_output"];
428
+ type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
429
+ interface ZodTypeDef {
430
+ errorMap?: ZodErrorMap | undefined;
431
+ description?: string | undefined;
432
+ }
433
+ type RawCreateParams = {
434
+ errorMap?: ZodErrorMap | undefined;
435
+ invalid_type_error?: string | undefined;
436
+ required_error?: string | undefined;
437
+ message?: string | undefined;
438
+ description?: string | undefined;
439
+ } | undefined;
440
+ type SafeParseSuccess<Output> = {
441
+ success: true;
442
+ data: Output;
443
+ error?: never;
444
+ };
445
+ type SafeParseError<Input> = {
446
+ success: false;
447
+ error: ZodError<Input>;
448
+ data?: never;
449
+ };
450
+ type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
451
+ declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
452
+ readonly _type: Output;
453
+ readonly _output: Output;
454
+ readonly _input: Input;
455
+ readonly _def: Def;
456
+ get description(): string | undefined;
457
+ "~standard": StandardSchemaV1.Props<Input, Output>;
458
+ abstract _parse(input: ParseInput): ParseReturnType<Output>;
459
+ _getType(input: ParseInput): string;
460
+ _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
461
+ _processInputParams(input: ParseInput): {
462
+ status: ParseStatus;
463
+ ctx: ParseContext;
464
+ };
465
+ _parseSync(input: ParseInput): SyncParseReturnType<Output>;
466
+ _parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
467
+ parse(data: unknown, params?: util.InexactPartial<ParseParams>): Output;
468
+ safeParse(data: unknown, params?: util.InexactPartial<ParseParams>): SafeParseReturnType<Input, Output>;
469
+ "~validate"(data: unknown): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>>;
470
+ parseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<Output>;
471
+ safeParseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
472
+ /** Alias of safeParseAsync */
473
+ spa: (data: unknown, params?: util.InexactPartial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
474
+ refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
475
+ refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
476
+ refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
477
+ refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
478
+ _refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
479
+ superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
480
+ superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
481
+ superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
482
+ constructor(def: Def);
483
+ optional(): ZodOptional<this>;
484
+ nullable(): ZodNullable<this>;
485
+ nullish(): ZodOptional<ZodNullable<this>>;
486
+ array(): ZodArray<this>;
487
+ promise(): ZodPromise<this>;
488
+ or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
489
+ and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
490
+ transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
491
+ default(def: util.noUndefined<Input>): ZodDefault<this>;
492
+ default(def: () => util.noUndefined<Input>): ZodDefault<this>;
493
+ brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
494
+ catch(def: Output): ZodCatch<this>;
495
+ catch(def: (ctx: {
496
+ error: ZodError;
497
+ input: Input;
498
+ }) => Output): ZodCatch<this>;
499
+ describe(description: string): this;
500
+ pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
501
+ readonly(): ZodReadonly<this>;
502
+ isOptional(): boolean;
503
+ isNullable(): boolean;
504
+ }
505
+ type IpVersion = "v4" | "v6";
506
+ type ZodStringCheck = {
507
+ kind: "min";
508
+ value: number;
509
+ message?: string | undefined;
510
+ } | {
511
+ kind: "max";
512
+ value: number;
513
+ message?: string | undefined;
514
+ } | {
515
+ kind: "length";
516
+ value: number;
517
+ message?: string | undefined;
518
+ } | {
519
+ kind: "email";
520
+ message?: string | undefined;
521
+ } | {
522
+ kind: "url";
523
+ message?: string | undefined;
524
+ } | {
525
+ kind: "emoji";
526
+ message?: string | undefined;
527
+ } | {
528
+ kind: "uuid";
529
+ message?: string | undefined;
530
+ } | {
531
+ kind: "nanoid";
532
+ message?: string | undefined;
533
+ } | {
534
+ kind: "cuid";
535
+ message?: string | undefined;
536
+ } | {
537
+ kind: "includes";
538
+ value: string;
539
+ position?: number | undefined;
540
+ message?: string | undefined;
541
+ } | {
542
+ kind: "cuid2";
543
+ message?: string | undefined;
544
+ } | {
545
+ kind: "ulid";
546
+ message?: string | undefined;
547
+ } | {
548
+ kind: "startsWith";
549
+ value: string;
550
+ message?: string | undefined;
551
+ } | {
552
+ kind: "endsWith";
553
+ value: string;
554
+ message?: string | undefined;
555
+ } | {
556
+ kind: "regex";
557
+ regex: RegExp;
558
+ message?: string | undefined;
559
+ } | {
560
+ kind: "trim";
561
+ message?: string | undefined;
562
+ } | {
563
+ kind: "toLowerCase";
564
+ message?: string | undefined;
565
+ } | {
566
+ kind: "toUpperCase";
567
+ message?: string | undefined;
568
+ } | {
569
+ kind: "jwt";
570
+ alg?: string;
571
+ message?: string | undefined;
572
+ } | {
573
+ kind: "datetime";
574
+ offset: boolean;
575
+ local: boolean;
576
+ precision: number | null;
577
+ message?: string | undefined;
578
+ } | {
579
+ kind: "date";
580
+ message?: string | undefined;
581
+ } | {
582
+ kind: "time";
583
+ precision: number | null;
584
+ message?: string | undefined;
585
+ } | {
586
+ kind: "duration";
587
+ message?: string | undefined;
588
+ } | {
589
+ kind: "ip";
590
+ version?: IpVersion | undefined;
591
+ message?: string | undefined;
592
+ } | {
593
+ kind: "cidr";
594
+ version?: IpVersion | undefined;
595
+ message?: string | undefined;
596
+ } | {
597
+ kind: "base64";
598
+ message?: string | undefined;
599
+ } | {
600
+ kind: "base64url";
601
+ message?: string | undefined;
602
+ };
603
+ interface ZodStringDef extends ZodTypeDef {
604
+ checks: ZodStringCheck[];
605
+ typeName: ZodFirstPartyTypeKind.ZodString;
606
+ coerce: boolean;
607
+ }
608
+ declare class ZodString extends ZodType<string, ZodStringDef, string> {
609
+ _parse(input: ParseInput): ParseReturnType<string>;
610
+ protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage): ZodEffects<this, string, string>;
611
+ _addCheck(check: ZodStringCheck): ZodString;
612
+ email(message?: errorUtil.ErrMessage): ZodString;
613
+ url(message?: errorUtil.ErrMessage): ZodString;
614
+ emoji(message?: errorUtil.ErrMessage): ZodString;
615
+ uuid(message?: errorUtil.ErrMessage): ZodString;
616
+ nanoid(message?: errorUtil.ErrMessage): ZodString;
617
+ cuid(message?: errorUtil.ErrMessage): ZodString;
618
+ cuid2(message?: errorUtil.ErrMessage): ZodString;
619
+ ulid(message?: errorUtil.ErrMessage): ZodString;
620
+ base64(message?: errorUtil.ErrMessage): ZodString;
621
+ base64url(message?: errorUtil.ErrMessage): ZodString;
622
+ jwt(options?: {
623
+ alg?: string;
624
+ message?: string | undefined;
625
+ }): ZodString;
626
+ ip(options?: string | {
627
+ version?: IpVersion;
628
+ message?: string | undefined;
629
+ }): ZodString;
630
+ cidr(options?: string | {
631
+ version?: IpVersion;
632
+ message?: string | undefined;
633
+ }): ZodString;
634
+ datetime(options?: string | {
635
+ message?: string | undefined;
636
+ precision?: number | null;
637
+ offset?: boolean;
638
+ local?: boolean;
639
+ }): ZodString;
640
+ date(message?: string): ZodString;
641
+ time(options?: string | {
642
+ message?: string | undefined;
643
+ precision?: number | null;
644
+ }): ZodString;
645
+ duration(message?: errorUtil.ErrMessage): ZodString;
646
+ regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
647
+ includes(value: string, options?: {
648
+ message?: string;
649
+ position?: number;
650
+ }): ZodString;
651
+ startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
652
+ endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
653
+ min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
654
+ max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
655
+ length(len: number, message?: errorUtil.ErrMessage): ZodString;
656
+ /**
657
+ * Equivalent to `.min(1)`
658
+ */
659
+ nonempty(message?: errorUtil.ErrMessage): ZodString;
660
+ trim(): ZodString;
661
+ toLowerCase(): ZodString;
662
+ toUpperCase(): ZodString;
663
+ get isDatetime(): boolean;
664
+ get isDate(): boolean;
665
+ get isTime(): boolean;
666
+ get isDuration(): boolean;
667
+ get isEmail(): boolean;
668
+ get isURL(): boolean;
669
+ get isEmoji(): boolean;
670
+ get isUUID(): boolean;
671
+ get isNANOID(): boolean;
672
+ get isCUID(): boolean;
673
+ get isCUID2(): boolean;
674
+ get isULID(): boolean;
675
+ get isIP(): boolean;
676
+ get isCIDR(): boolean;
677
+ get isBase64(): boolean;
678
+ get isBase64url(): boolean;
679
+ get minLength(): number | null;
680
+ get maxLength(): number | null;
681
+ static create: (params?: RawCreateParams & {
682
+ coerce?: true;
683
+ }) => ZodString;
684
+ }
685
+ type ZodNumberCheck = {
686
+ kind: "min";
687
+ value: number;
688
+ inclusive: boolean;
689
+ message?: string | undefined;
690
+ } | {
691
+ kind: "max";
692
+ value: number;
693
+ inclusive: boolean;
694
+ message?: string | undefined;
695
+ } | {
696
+ kind: "int";
697
+ message?: string | undefined;
698
+ } | {
699
+ kind: "multipleOf";
700
+ value: number;
701
+ message?: string | undefined;
702
+ } | {
703
+ kind: "finite";
704
+ message?: string | undefined;
705
+ };
706
+ interface ZodNumberDef extends ZodTypeDef {
707
+ checks: ZodNumberCheck[];
708
+ typeName: ZodFirstPartyTypeKind.ZodNumber;
709
+ coerce: boolean;
710
+ }
711
+ declare class ZodNumber extends ZodType<number, ZodNumberDef, number> {
712
+ _parse(input: ParseInput): ParseReturnType<number>;
713
+ static create: (params?: RawCreateParams & {
714
+ coerce?: boolean;
715
+ }) => ZodNumber;
716
+ gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
717
+ min: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
718
+ gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
719
+ lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
720
+ max: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
721
+ lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
722
+ protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
723
+ _addCheck(check: ZodNumberCheck): ZodNumber;
724
+ int(message?: errorUtil.ErrMessage): ZodNumber;
725
+ positive(message?: errorUtil.ErrMessage): ZodNumber;
726
+ negative(message?: errorUtil.ErrMessage): ZodNumber;
727
+ nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
728
+ nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
729
+ multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
730
+ step: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
731
+ finite(message?: errorUtil.ErrMessage): ZodNumber;
732
+ safe(message?: errorUtil.ErrMessage): ZodNumber;
733
+ get minValue(): number | null;
734
+ get maxValue(): number | null;
735
+ get isInt(): boolean;
736
+ get isFinite(): boolean;
737
+ }
738
+ interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
739
+ type: T;
740
+ typeName: ZodFirstPartyTypeKind.ZodArray;
741
+ exactLength: {
742
+ value: number;
743
+ message?: string | undefined;
744
+ } | null;
745
+ minLength: {
746
+ value: number;
747
+ message?: string | undefined;
748
+ } | null;
749
+ maxLength: {
750
+ value: number;
751
+ message?: string | undefined;
752
+ } | null;
753
+ }
754
+ type ArrayCardinality = "many" | "atleastone";
755
+ type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
756
+ declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {
757
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
758
+ get element(): T;
759
+ min(minLength: number, message?: errorUtil.ErrMessage): this;
760
+ max(maxLength: number, message?: errorUtil.ErrMessage): this;
761
+ length(len: number, message?: errorUtil.ErrMessage): this;
762
+ nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
763
+ static create: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
764
+ }
765
+ type UnknownKeysParam = "passthrough" | "strict" | "strip";
766
+ interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
767
+ typeName: ZodFirstPartyTypeKind.ZodObject;
768
+ shape: () => T;
769
+ catchall: Catchall;
770
+ unknownKeys: UnknownKeys;
771
+ }
772
+ type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
773
+ type baseObjectOutputType<Shape extends ZodRawShape> = { [k in keyof Shape]: Shape[k]["_output"] };
774
+ type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
775
+ type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{ [k in keyof Shape]: Shape[k]["_input"] }>;
776
+ type CatchallOutput<T extends ZodType> = ZodType extends T ? unknown : {
777
+ [k: string]: T["_output"];
778
+ };
779
+ type CatchallInput<T extends ZodType> = ZodType extends T ? unknown : {
780
+ [k: string]: T["_input"];
781
+ };
782
+ type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
783
+ [k: string]: unknown;
784
+ } : unknown;
785
+ type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
786
+ declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall, UnknownKeys>, Input = objectInputType<T, Catchall, UnknownKeys>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
787
+ private _cached;
788
+ _getCached(): {
789
+ shape: T;
790
+ keys: string[];
791
+ };
792
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
793
+ get shape(): T;
794
+ strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
795
+ strip(): ZodObject<T, "strip", Catchall>;
796
+ passthrough(): ZodObject<T, "passthrough", Catchall>;
797
+ /**
798
+ * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
799
+ * If you want to pass through unknown properties, use `.passthrough()` instead.
800
+ */
801
+ nonstrict: () => ZodObject<T, "passthrough", Catchall>;
802
+ extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
803
+ /**
804
+ * @deprecated Use `.extend` instead
805
+ * */
806
+ augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
807
+ /**
808
+ * Prior to zod@1.0.12 there was a bug in the
809
+ * inferred type of merged objects. Please
810
+ * upgrade if you are experiencing issues.
811
+ */
812
+ merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<objectUtil.extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
813
+ setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & { [k in Key]: Schema }, UnknownKeys, Catchall>;
814
+ catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
815
+ pick<Mask extends util.Exactly<{ [k in keyof T]?: true }, Mask>>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
816
+ omit<Mask extends util.Exactly<{ [k in keyof T]?: true }, Mask>>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
817
+ /**
818
+ * @deprecated
819
+ */
820
+ deepPartial(): partialUtil.DeepPartial<this>;
821
+ partial(): ZodObject<{ [k in keyof T]: ZodOptional<T[k]> }, UnknownKeys, Catchall>;
822
+ partial<Mask extends util.Exactly<{ [k in keyof T]?: true }, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{ [k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k] }>, UnknownKeys, Catchall>;
823
+ required(): ZodObject<{ [k in keyof T]: deoptional<T[k]> }, UnknownKeys, Catchall>;
824
+ required<Mask extends util.Exactly<{ [k in keyof T]?: true }, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{ [k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k] }>, UnknownKeys, Catchall>;
825
+ keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
826
+ static create: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, objectOutputType<Shape, ZodTypeAny, "strip">, objectInputType<Shape, ZodTypeAny, "strip">>;
827
+ static strictCreate: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strict">;
828
+ static lazycreate: <Shape extends ZodRawShape>(shape: () => Shape, params?: RawCreateParams) => ZodObject<Shape, "strip">;
829
+ }
830
+ type AnyZodObject = ZodObject<any, any, any>;
831
+ type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
832
+ interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>> extends ZodTypeDef {
833
+ options: T;
834
+ typeName: ZodFirstPartyTypeKind.ZodUnion;
835
+ }
836
+ declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
837
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
838
+ get options(): T;
839
+ static create: <Options extends Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
840
+ }
841
+ interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
842
+ left: T;
843
+ right: U;
844
+ typeName: ZodFirstPartyTypeKind.ZodIntersection;
845
+ }
846
+ declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
847
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
848
+ static create: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
849
+ }
850
+ type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
851
+ type AssertArray<T> = T extends any[] ? T : never;
852
+ type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{ [k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_output"] : never }>;
853
+ type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
854
+ type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{ [k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_input"] : never }>;
855
+ type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
856
+ interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
857
+ items: T;
858
+ rest: Rest;
859
+ typeName: ZodFirstPartyTypeKind.ZodTuple;
860
+ }
861
+ declare class ZodTuple<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
862
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
863
+ get items(): T;
864
+ rest<RestSchema extends ZodTypeAny>(rest: RestSchema): ZodTuple<T, RestSchema>;
865
+ static create: <Items extends [ZodTypeAny, ...ZodTypeAny[]] | []>(schemas: Items, params?: RawCreateParams) => ZodTuple<Items, null>;
866
+ }
867
+ interface ZodLiteralDef<T = any> extends ZodTypeDef {
868
+ value: T;
869
+ typeName: ZodFirstPartyTypeKind.ZodLiteral;
870
+ }
871
+ declare class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>, T> {
872
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
873
+ get value(): T;
874
+ static create: <Value extends Primitive>(value: Value, params?: RawCreateParams) => ZodLiteral<Value>;
875
+ }
876
+ type EnumValues<T extends string = string> = readonly [T, ...T[]];
877
+ type Values<T extends EnumValues> = { [k in T[number]]: k };
878
+ interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
879
+ values: T;
880
+ typeName: ZodFirstPartyTypeKind.ZodEnum;
881
+ }
882
+ type Writeable<T> = { -readonly [P in keyof T]: T[P] };
883
+ type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
884
+ type typecast<A, T> = A extends T ? A : never;
885
+ declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
886
+ declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
887
+ declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>, T[number]> {
888
+ _cache: Set<T[number]> | undefined;
889
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
890
+ get options(): T;
891
+ get enum(): Values<T>;
892
+ get Values(): Values<T>;
893
+ get Enum(): Values<T>;
894
+ extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract, newDef?: RawCreateParams): ZodEnum<Writeable<ToExtract>>;
895
+ exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude, newDef?: RawCreateParams): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
896
+ static create: typeof createZodEnum;
897
+ }
898
+ interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
899
+ type: T;
900
+ typeName: ZodFirstPartyTypeKind.ZodPromise;
901
+ }
902
+ declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
903
+ unwrap(): T;
904
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
905
+ static create: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
906
+ }
907
+ type RefinementEffect<T> = {
908
+ type: "refinement";
909
+ refinement: (arg: T, ctx: RefinementCtx) => any;
910
+ };
911
+ type TransformEffect<T> = {
912
+ type: "transform";
913
+ transform: (arg: T, ctx: RefinementCtx) => any;
914
+ };
915
+ type PreprocessEffect<T> = {
916
+ type: "preprocess";
917
+ transform: (arg: T, ctx: RefinementCtx) => any;
918
+ };
919
+ type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
920
+ interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
921
+ schema: T;
922
+ typeName: ZodFirstPartyTypeKind.ZodEffects;
923
+ effect: Effect<any>;
924
+ }
925
+ declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
926
+ innerType(): T;
927
+ sourceType(): T;
928
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
929
+ static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
930
+ static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
931
+ }
932
+ interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
933
+ innerType: T;
934
+ typeName: ZodFirstPartyTypeKind.ZodOptional;
935
+ }
936
+ declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
937
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
938
+ unwrap(): T;
939
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
940
+ }
941
+ interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
942
+ innerType: T;
943
+ typeName: ZodFirstPartyTypeKind.ZodNullable;
944
+ }
945
+ declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
946
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
947
+ unwrap(): T;
948
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
949
+ }
950
+ interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
951
+ innerType: T;
952
+ defaultValue: () => util.noUndefined<T["_input"]>;
953
+ typeName: ZodFirstPartyTypeKind.ZodDefault;
954
+ }
955
+ declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
956
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
957
+ removeDefault(): T;
958
+ static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
959
+ default: Inner["_input"] | (() => util.noUndefined<Inner["_input"]>);
960
+ }) => ZodDefault<Inner>;
961
+ }
962
+ interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
963
+ innerType: T;
964
+ catchValue: (ctx: {
965
+ error: ZodError;
966
+ input: unknown;
967
+ }) => T["_input"];
968
+ typeName: ZodFirstPartyTypeKind.ZodCatch;
969
+ }
970
+ declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
971
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
972
+ removeCatch(): T;
973
+ static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
974
+ catch: Inner["_output"] | (() => Inner["_output"]);
975
+ }) => ZodCatch<Inner>;
976
+ }
977
+ interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
978
+ type: T;
979
+ typeName: ZodFirstPartyTypeKind.ZodBranded;
980
+ }
981
+ declare const BRAND: unique symbol;
982
+ type BRAND<T extends string | number | symbol> = {
983
+ [BRAND]: { [k in T]: true };
984
+ };
985
+ declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
986
+ _parse(input: ParseInput): ParseReturnType<any>;
987
+ unwrap(): T;
988
+ }
989
+ interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
990
+ in: A;
991
+ out: B;
992
+ typeName: ZodFirstPartyTypeKind.ZodPipeline;
993
+ }
994
+ declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
995
+ _parse(input: ParseInput): ParseReturnType<any>;
996
+ static create<ASchema extends ZodTypeAny, BSchema extends ZodTypeAny>(a: ASchema, b: BSchema): ZodPipeline<ASchema, BSchema>;
997
+ }
998
+ type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
999
+ readonly [Symbol.toStringTag]: string;
1000
+ } | Date | Error | Generator | Promise<unknown> | RegExp;
1001
+ type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
1002
+ interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1003
+ innerType: T;
1004
+ typeName: ZodFirstPartyTypeKind.ZodReadonly;
1005
+ }
1006
+ declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, MakeReadonly<T["_input"]>> {
1007
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1008
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodReadonly<Inner>;
1009
+ unwrap(): T;
1010
+ }
1011
+ declare enum ZodFirstPartyTypeKind {
1012
+ ZodString = "ZodString",
1013
+ ZodNumber = "ZodNumber",
1014
+ ZodNaN = "ZodNaN",
1015
+ ZodBigInt = "ZodBigInt",
1016
+ ZodBoolean = "ZodBoolean",
1017
+ ZodDate = "ZodDate",
1018
+ ZodSymbol = "ZodSymbol",
1019
+ ZodUndefined = "ZodUndefined",
1020
+ ZodNull = "ZodNull",
1021
+ ZodAny = "ZodAny",
1022
+ ZodUnknown = "ZodUnknown",
1023
+ ZodNever = "ZodNever",
1024
+ ZodVoid = "ZodVoid",
1025
+ ZodArray = "ZodArray",
1026
+ ZodObject = "ZodObject",
1027
+ ZodUnion = "ZodUnion",
1028
+ ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
1029
+ ZodIntersection = "ZodIntersection",
1030
+ ZodTuple = "ZodTuple",
1031
+ ZodRecord = "ZodRecord",
1032
+ ZodMap = "ZodMap",
1033
+ ZodSet = "ZodSet",
1034
+ ZodFunction = "ZodFunction",
1035
+ ZodLazy = "ZodLazy",
1036
+ ZodLiteral = "ZodLiteral",
1037
+ ZodEnum = "ZodEnum",
1038
+ ZodEffects = "ZodEffects",
1039
+ ZodNativeEnum = "ZodNativeEnum",
1040
+ ZodOptional = "ZodOptional",
1041
+ ZodNullable = "ZodNullable",
1042
+ ZodDefault = "ZodDefault",
1043
+ ZodCatch = "ZodCatch",
1044
+ ZodPromise = "ZodPromise",
1045
+ ZodBranded = "ZodBranded",
1046
+ ZodPipeline = "ZodPipeline",
1047
+ ZodReadonly = "ZodReadonly"
1048
+ }
1049
+ //#endregion
1050
+ //#region ../node_modules/.pnpm/@milaboratories+pl-error-like@1.12.10/node_modules/@milaboratories/pl-error-like/dist/error_like_shape.d.ts
1051
+ //#region src/error_like_shape.d.ts
1052
+ declare const BasePlErrorLike: ZodObject<{
1053
+ type: ZodLiteral<"PlError">;
1054
+ name: ZodString;
1055
+ message: ZodString; /** The message with all details needed for SDK developers. */
1056
+ fullMessage: ZodOptional<ZodString>;
1057
+ stack: ZodOptional<ZodString>;
1058
+ }, "strip", ZodTypeAny, {
1059
+ type: "PlError";
1060
+ message: string;
1061
+ name: string;
1062
+ fullMessage?: string | undefined;
1063
+ stack?: string | undefined;
1064
+ }, {
1065
+ type: "PlError";
1066
+ message: string;
1067
+ name: string;
1068
+ fullMessage?: string | undefined;
1069
+ stack?: string | undefined;
1070
+ }>;
1071
+ /** Known Pl backend and ML errors. */
1072
+ type PlErrorLike = TypeOf<typeof BasePlErrorLike> & {
1073
+ cause?: ErrorLike;
1074
+ errors?: ErrorLike[];
1075
+ };
1076
+ declare const PlErrorLike: ZodType<PlErrorLike>;
1077
+ declare const BaseStandardErrorLike: ZodObject<{
1078
+ type: ZodLiteral<"StandardError">;
1079
+ name: ZodString;
1080
+ message: ZodString;
1081
+ stack: ZodOptional<ZodString>;
1082
+ }, "strip", ZodTypeAny, {
1083
+ type: "StandardError";
1084
+ message: string;
1085
+ name: string;
1086
+ stack?: string | undefined;
1087
+ }, {
1088
+ type: "StandardError";
1089
+ message: string;
1090
+ name: string;
1091
+ stack?: string | undefined;
1092
+ }>;
1093
+ /** Others unknown errors that could be thrown by the client. */
1094
+ type StandardErrorLike = TypeOf<typeof BaseStandardErrorLike> & {
1095
+ cause?: ErrorLike;
1096
+ errors?: ErrorLike[];
1097
+ };
1098
+ declare const StandardErrorLike: ZodType<StandardErrorLike>;
1099
+ declare const ErrorLike: ZodUnion<[ZodType<StandardErrorLike, ZodTypeDef, StandardErrorLike>, ZodType<PlErrorLike, ZodTypeDef, PlErrorLike>]>;
1100
+ type ErrorLike = TypeOf<typeof ErrorLike>;
1101
+ /** Converts everything into ErrorLike. */
1102
+ //#endregion
1103
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/common_types.d.ts
1104
+ type OutputWithStatus<T> = {
1105
+ ok: true;
1106
+ value: T;
1107
+ stable: boolean;
1108
+ } | {
1109
+ ok: false;
1110
+ errors: ErrorLike[];
1111
+ moreErrors: boolean;
1112
+ };
1113
+ /** Base type for block outputs */
1114
+ type BlockOutputsBase = Record<string, OutputWithStatus<unknown>>;
1115
+ //#endregion
1116
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/navigation.d.ts
1117
+ /**
1118
+ * Part of the block state, representing current navigation information
1119
+ * (i.e. currently selected section)
1120
+ */
1121
+ type NavigationState<Href extends `/${string}` = `/${string}`> = {
1122
+ readonly href: Href;
1123
+ };
1124
+ //#endregion
1125
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/json.d.ts
1126
+ //#region src/json.d.ts
1127
+ type JsonPrimitive = string | number | boolean | null;
1128
+ type JsonValue = JsonPrimitive | JsonValue[] | {
1129
+ [key: string]: JsonValue;
1130
+ };
1131
+ type NotAssignableToJson = bigint | symbol | Function;
1132
+ type JsonCompatible<T> = unknown extends T ? unknown : [T] extends [JsonValue] ? T : [T] extends [NotAssignableToJson] ? never : { [P in keyof T]: [Exclude<T[P], undefined>] extends [JsonValue] ? T[P] : [Exclude<T[P], undefined>] extends [NotAssignableToJson] ? never : JsonCompatible<T[P]> };
1133
+ type StringifiedJson<T = unknown> = JsonCompatible<T> extends never ? never : string & {
1134
+ __json_stringified: T;
1135
+ };
1136
+ //#endregion
1137
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/block_state.d.ts
1138
+ //#region src/block_state.d.ts
1139
+ /**
1140
+ * @template Args sets type of block arguments passed to the workflow
1141
+ * @template Outputs type of the outputs returned by the workflow and rendered
1142
+ * according to the output configuration specified for the block
1143
+ * @template UiState data that stores only UI related state, that is not passed
1144
+ * to the workflow
1145
+ * @template Href typed href to represent navigation state
1146
+ */
1147
+ type BlockState<Args = unknown, Outputs extends BlockOutputsBase = BlockOutputsBase, UiState = unknown, Href extends `/${string}` = `/${string}`> = {
1148
+ /** Block arguments passed to the workflow */args: Args;
1149
+ /** UI State persisted in the block state but not passed to the backend
1150
+ * template */
1151
+ ui: UiState; /** Outputs rendered with block config */
1152
+ outputs: Outputs; /** Current navigation state */
1153
+ navigationState: NavigationState<Href>;
1154
+ readonly author: AuthorMarker | undefined;
1155
+ };
1156
+ type BlockStateV3<_Data = unknown, Outputs extends BlockOutputsBase = BlockOutputsBase, Href extends `/${string}` = `/${string}`> = {
1157
+ /** Block storage persisted in the block state */blockStorage: StringifiedJson; /** Outputs rendered with block config */
1158
+ outputs: Outputs; /** Current navigation state */
1159
+ navigationState: NavigationState<Href>;
1160
+ readonly author: AuthorMarker | undefined;
1161
+ }; //#endregion
1162
+ //#endregion
1163
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/branding.d.ts
1164
+ //#region src/branding.d.ts
1165
+ type Brand<B, K extends string = "__pl_model_brand__"> = { [key in K]: B };
1166
+ type Branded$1<T, B, K extends string = "__pl_model_brand__"> = T & Brand<B, K>; //#endregion
1167
+ //#endregion
1168
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/dialog/index.d.ts
1169
+ //#region src/dialog/index.d.ts
1170
+ /**
1171
+ * File filter passed to the native save dialog. Matches Electron's
1172
+ * `FileFilter` shape so desktop runtimes can forward it verbatim.
1173
+ */
1174
+ interface FileFilter {
1175
+ name: string;
1176
+ extensions: string[];
1177
+ }
1178
+ /**
1179
+ * Options accepted by `Dialog.showSaveDialog`. The UI supplies only a
1180
+ * default file name; the main-process handler decides the default
1181
+ * directory (e.g. `~/Downloads`).
1182
+ */
1183
+ interface ShowSaveDialogOptions {
1184
+ defaultFileName?: string;
1185
+ filters?: FileFilter[];
1186
+ title?: string;
1187
+ }
1188
+ /** Result of `Dialog.showSaveDialog`. */
1189
+ interface ShowSaveDialogResult {
1190
+ canceled: boolean;
1191
+ path?: string;
1192
+ }
1193
+ /**
1194
+ * UI-facing save-dialog service. Implemented by desktop runtimes that
1195
+ * can open a native file picker; absent in web/preview environments.
1196
+ */
1197
+ interface DialogService {
1198
+ showSaveDialog(options: ShowSaveDialogOptions): Promise<ShowSaveDialogResult>;
1199
+ } //#endregion
1200
+ //#endregion
1201
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/pool_entry.d.ts
1202
+ //#region src/pool_entry.d.ts
1203
+ interface PoolEntry<K extends string = string, R extends {} = {}> extends Disposable {
1204
+ /** Resource key, calculated using provided `calculateParamsKey` function */
1205
+ readonly key: K;
1206
+ /** Resource itself created by `createNewResource` function */
1207
+ readonly resource: R;
1208
+ /**
1209
+ * Release the reference. Idempotent.
1210
+ * Same as `[Symbol.dispose]()` — provided as a named function
1211
+ * for use in callbacks (e.g. `addOnDestroy(entry.unref)`).
1212
+ */
1213
+ readonly unref: () => void;
1214
+ }
1215
+ /**
1216
+ * Wraps a PoolEntry for use with `using`. Auto-calls `unref()` at end of scope
1217
+ * unless `keep()` is called to transfer ownership to the caller.
1218
+ */
1219
+ //#endregion
1220
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_common.d.ts
1221
+ //#region src/drivers/pframe/table_common.d.ts
1222
+ type PTableColumnSpecAxis = {
1223
+ type: "axis";
1224
+ id: AxisId;
1225
+ spec: AxisSpec;
1226
+ };
1227
+ type PTableColumnSpecColumn = {
1228
+ type: "column";
1229
+ id: PObjectId;
1230
+ spec: PColumnSpec;
1231
+ };
1232
+ /** Unified spec object for axes and columns */
1233
+ type PTableColumnSpec = PTableColumnSpecAxis | PTableColumnSpecColumn;
1234
+ type PTableColumnIdAxis = {
1235
+ type: "axis";
1236
+ id: AxisId;
1237
+ };
1238
+ type PTableColumnIdColumn = {
1239
+ type: "column";
1240
+ id: PObjectId;
1241
+ };
1242
+ /** Unified PTable column identifier */
1243
+ type PTableColumnId = PTableColumnIdAxis | PTableColumnIdColumn;
1244
+ //#endregion
1245
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_types.d.ts
1246
+ //#region src/drivers/pframe/data_types.d.ts
1247
+ type PVectorDataInt = Int32Array;
1248
+ type PVectorDataLong = BigInt64Array;
1249
+ type PVectorDataFloat = Float32Array;
1250
+ type PVectorDataDouble = Float64Array;
1251
+ type PVectorDataString = (null | string)[];
1252
+ type PVectorDataBytes = (null | Uint8Array)[];
1253
+ type PVectorDataTyped<DataType extends ValueType> = DataType extends typeof ValueType.Int ? PVectorDataInt : DataType extends typeof ValueType.Long ? PVectorDataLong : DataType extends typeof ValueType.Float ? PVectorDataFloat : DataType extends typeof ValueType.Double ? PVectorDataDouble : DataType extends typeof ValueType.String ? PVectorDataString : DataType extends typeof ValueType.Bytes ? PVectorDataBytes : never;
1254
+ type PTableVectorTyped<DataType extends ValueType> = {
1255
+ /** Stored data type */readonly type: DataType; /** Values for present positions */
1256
+ readonly data: PVectorDataTyped<DataType>;
1257
+ /**
1258
+ * Encoded bit array marking some elements of this vector as NA,
1259
+ * call {@link bitSet} to read the data.
1260
+ * In old desktop versions NA values are encoded as magic values in data array.
1261
+ * */
1262
+ readonly isNA?: Uint8Array; /** @deprecated Always empty. Kept for backwards compatibility with old blocks. */
1263
+ readonly absent?: Uint8Array;
1264
+ };
1265
+ /** Table column data */
1266
+ type PTableVector = PTableVectorTyped<ValueType>;
1267
+ /** Used in requests to partially retrieve table's data */
1268
+ type TableRange = {
1269
+ /** Index of the first record to retrieve */readonly offset: number; /** Block length */
1270
+ readonly length: number;
1271
+ };
1272
+ /** Unified information about table shape */
1273
+ type PTableShape = {
1274
+ /** Number of unified table columns, including all axes and PColumn values */columns: number; /** Number of rows */
1275
+ rows: number;
1276
+ };
1277
+ /** Supported formats for PTable file download. */
1278
+ type PTableDownloadFormat = "csv" | "tsv";
1279
+ /** Compression applied to the written file. */
1280
+ /** Options for downloading PTable data to a file. */
1281
+ interface WritePTableToFsOptions {
1282
+ path: string;
1283
+ format: PTableDownloadFormat;
1284
+ columnIndices: number[];
1285
+ range?: TableRange;
1286
+ chunkSize?: number;
1287
+ includeHeader?: boolean;
1288
+ bom?: boolean;
1289
+ compression?: {
1290
+ type: "gzip";
1291
+ level?: number;
1292
+ };
1293
+ signal?: AbortSignal;
1294
+ }
1295
+ /** Result of a PTable file download. */
1296
+ interface WritePTableToFsResult {
1297
+ path: string;
1298
+ rowsWritten: number;
1299
+ bytesWritten: number;
1300
+ }
1301
+ /**
1302
+ * Maximum number of data rows allowed per sheet in an `xlsx` export, kept below
1303
+ * Excel's hard limit of 1,048,576. The driver rejects oversized `xlsx` exports
1304
+ * (see {@link PFrameDriver.exportPTable}); UIs use it to gate the `xlsx` option.
1305
+ */
1306
+ /** Options for {@link PFrameDriver.exportPTable}. */
1307
+ interface ExportPTableOptions {
1308
+ /** Destination file path; its extension selects the output format
1309
+ * (`csv`/`tsv`/`parquet`/`xlsx`). */
1310
+ path: string;
1311
+ /** Unified indices of the columns to export, in output order
1312
+ * (axes first, then data columns). */
1313
+ columnIndices: number[];
1314
+ } //#endregion
1315
+ //#endregion
1316
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/data_info.d.ts
1317
+ //#region src/drivers/pframe/data_info.d.ts
1318
+ /**
1319
+ * Represents a JavaScript representation of a value in a PColumn. Can be null, a number, or a string.
1320
+ * These are the primitive types that can be stored directly in PColumns.
1321
+ *
1322
+ * Note: Actual columns can hold more value types, which are converted to these JavaScript types
1323
+ * once they enter the JavaScript runtime.
1324
+ */
1325
+ type PColumnValue = null | number | string;
1326
+ /**
1327
+ * Represents a key for a PColumn value.
1328
+ * Can be an array of strings or numbers.
1329
+ */
1330
+ type PColumnKey = (number | string)[];
1331
+ /**
1332
+ * Represents a single entry in a PColumn's data structure.
1333
+ * Contains a key and a value.
1334
+ */
1335
+ /**
1336
+ * Represents column data stored as a simple JSON structure.
1337
+ * Used for small datasets that can be efficiently stored directly in memory.
1338
+ */
1339
+ type JsonDataInfo = {
1340
+ /** Identifier for this data format ('Json') */type: "Json"; /** Number of axes that make up the complete key (tuple length) */
1341
+ keyLength: number;
1342
+ /**
1343
+ * Key-value pairs where keys are stringified tuples of axis values
1344
+ * and values are the column values for those coordinates
1345
+ */
1346
+ data: Record<string, PColumnValue>;
1347
+ };
1348
+ /**
1349
+ * Represents column data partitioned across multiple JSON blobs.
1350
+ * Used for larger datasets that need to be split into manageable chunks.
1351
+ */
1352
+ type JsonPartitionedDataInfo<Blob> = {
1353
+ /** Identifier for this data format ('JsonPartitioned') */type: "JsonPartitioned"; /** Number of leading axes used for partitioning */
1354
+ partitionKeyLength: number; /** Map of stringified partition keys to blob references */
1355
+ parts: Record<string, Blob>;
1356
+ };
1357
+ /**
1358
+ * Represents a binary format chunk containing index and values as separate blobs.
1359
+ * Used for efficient storage and retrieval of column data in binary format.
1360
+ */
1361
+ type BinaryChunk<Blob> = {
1362
+ /** Binary blob containing structured index information */index: Blob; /** Binary blob containing the actual values */
1363
+ values: Blob;
1364
+ };
1365
+ /**
1366
+ * Represents column data partitioned across multiple binary chunks.
1367
+ * Optimized for efficient storage and retrieval of large datasets.
1368
+ */
1369
+ type BinaryPartitionedDataInfo<Blob> = {
1370
+ /** Identifier for this data format ('BinaryPartitioned') */type: "BinaryPartitioned"; /** Number of leading axes used for partitioning */
1371
+ partitionKeyLength: number; /** Map of stringified partition keys to binary chunks */
1372
+ parts: Record<string, BinaryChunk<Blob>>;
1373
+ };
1374
+ type ParquetPartitionedDataInfo<Blob> = {
1375
+ /** Identifier for this data format ('ParquetPartitioned') */type: "ParquetPartitioned"; /** Number of leading axes used for partitioning */
1376
+ partitionKeyLength: number; /** Map of stringified partition keys to parquet files */
1377
+ parts: Record<string, Blob>;
1378
+ };
1379
+ /**
1380
+ * Union type representing all possible data storage formats for PColumn data.
1381
+ * The specific format used depends on data size, access patterns, and performance requirements.
1382
+ *
1383
+ * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)
1384
+ */
1385
+ type DataInfo<Blob> = JsonDataInfo | JsonPartitionedDataInfo<Blob> | BinaryPartitionedDataInfo<Blob> | ParquetPartitionedDataInfo<Blob>;
1386
+ /**
1387
+ * Type guard function that checks if the given value is a valid DataInfo.
1388
+ *
1389
+ * @param value - The value to check
1390
+ * @returns True if the value is a valid DataInfo, false otherwise
1391
+ */
1392
+ /**
1393
+ * Represents a single key-value entry in a column's explicit data structure.
1394
+ * Used when directly instantiating PColumns with explicit data.
1395
+ */
1396
+ type PColumnValuesEntry = {
1397
+ key: PColumnKey;
1398
+ val: PColumnValue;
1399
+ };
1400
+ /**
1401
+ * Array of key-value entries representing explicit column data.
1402
+ * Used for lightweight explicit instantiation of PColumns.
1403
+ */
1404
+ type PColumnValues = PColumnValuesEntry[];
1405
+ /**
1406
+ * Entry-based representation of JsonDataInfo
1407
+ */
1408
+ //#endregion
1409
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/query_common.d.ts
1410
+ //#region src/drivers/pframe/query/query_common.d.ts
1411
+ /**
1412
+ * Structural type information for a single column: the axis value types (in
1413
+ * order) and the single column value type. Mirrors the self-contained
1414
+ * `typeSpec` shape carried by the data layer (`{ axes, column }`).
1415
+ */
1416
+ type ColumnTypeSpec = {
1417
+ /** List of axis value types defining the dimensions of the data */axes: AxisValueType[]; /** The single column value type */
1418
+ column: ColumnValueType;
1419
+ };
1420
+ /**
1421
+ * Unary mathematical operation kinds.
1422
+ *
1423
+ * These operations take a single numeric input and produce a numeric output.
1424
+ * **Null handling**: If input is null, result is null.
1425
+ *
1426
+ * Operations:
1427
+ * - `abs` - Absolute value: |x|
1428
+ * - `ceil` - Round up to nearest integer
1429
+ * - `floor` - Round down to nearest integer
1430
+ * - `round` - Round to nearest integer (banker's rounding)
1431
+ * - `sqrt` - Square root (returns NaN for negative inputs)
1432
+ * - `log` - Natural logarithm (ln)
1433
+ * - `log2` - Base-2 logarithm
1434
+ * - `log10` - Base-10 logarithm
1435
+ * - `exp` - Exponential function (e^x)
1436
+ * - `negate` - Negation (-x)
1437
+ */
1438
+ type NumericUnaryOperand = "abs" | "ceil" | "floor" | "round" | "sqrt" | "log" | "log2" | "log10" | "exp" | "negate";
1439
+ /**
1440
+ * Binary mathematical operation kinds.
1441
+ *
1442
+ * These operations take two numeric inputs and produce a numeric result.
1443
+ * **Null handling**: If either operand is null, result is null.
1444
+ *
1445
+ * Operations:
1446
+ * - `add` - Addition: left + right
1447
+ * - `sub` - Subtraction: left - right
1448
+ * - `mul` - Multiplication: left * right
1449
+ * - `div` - Division: left / right (division by zero returns Infinity or NaN)
1450
+ * - `mod` - Modulo: left % right
1451
+ * - `power` - Exponentiation: left ** right
1452
+ */
1453
+ type NumericBinaryOperand = "add" | "sub" | "mul" | "div" | "mod" | "power";
1454
+ /**
1455
+ * Numeric comparison operation kinds.
1456
+ *
1457
+ * These operations compare two numeric inputs and produce a boolean result.
1458
+ * **Null handling**: If either operand is null, result is null.
1459
+ *
1460
+ * Operations:
1461
+ * - `eq` - Equal: left == right
1462
+ * - `ne` - Not equal: left != right
1463
+ * - `lt` - Less than: left < right
1464
+ * - `le` - Less or equal: left <= right
1465
+ * - `gt` - Greater than: left > right
1466
+ * - `ge` - Greater or equal: left >= right
1467
+ */
1468
+ type NumericComparisonOperand = "eq" | "ne" | "lt" | "le" | "gt" | "ge";
1469
+ /**
1470
+ * Constant value expression.
1471
+ *
1472
+ * Represents a literal constant value in an expression tree.
1473
+ * The value can be a string, number, or boolean.
1474
+ *
1475
+ * @example
1476
+ * // Constant number
1477
+ * { type: 'constant', value: 42 }
1478
+ *
1479
+ * // Constant string
1480
+ * { type: 'constant', value: 'hello' }
1481
+ *
1482
+ * // Constant boolean
1483
+ * { type: 'constant', value: true }
1484
+ */
1485
+ type ExprConstant = {
1486
+ type: "constant";
1487
+ value: string | number | boolean;
1488
+ };
1489
+ /**
1490
+ * Null check expression.
1491
+ *
1492
+ * Tests if an expression evaluates to null.
1493
+ * **Input**: Any expression.
1494
+ * **Output**: Boolean (true if input is null, false otherwise).
1495
+ *
1496
+ * @template I - The expression type (for recursion)
1497
+ *
1498
+ * @example
1499
+ * // Check if column value is null
1500
+ * { type: 'isNull', input: columnRef }
1501
+ *
1502
+ * // Combine with NOT to check for non-null
1503
+ * { type: 'not', input: { type: 'isNull', input: columnRef } }
1504
+ */
1505
+ interface ExprIsNull<I> {
1506
+ type: "isNull";
1507
+ /** Input expression to check for null */
1508
+ input: I;
1509
+ }
1510
+ /**
1511
+ * Null coalescing expression.
1512
+ *
1513
+ * Returns the input value if it is not null, otherwise returns the replacement value.
1514
+ * Equivalent to SQL's `IFNULL(input, replacement)` or `COALESCE(input, replacement)`.
1515
+ * **Input**: Any expression.
1516
+ * **Output**: Same type as input/replacement.
1517
+ * **Null handling**: If input is null, returns replacement; otherwise returns input.
1518
+ *
1519
+ * The Rust runtime also accepts the legacy `"ifNull"` tag as a serde
1520
+ * alias; new code should emit `"fillNull"`.
1521
+ *
1522
+ * @template I - The expression type (for recursion)
1523
+ *
1524
+ * @example
1525
+ * // Replace null values with 0
1526
+ * { type: 'fillNull', input: columnRef, replacement: { type: 'constant', value: 0 } }
1527
+ *
1528
+ * // Replace null strings with 'unknown'
1529
+ * { type: 'fillNull', input: nameColumn, replacement: { type: 'constant', value: 'unknown' } }
1530
+ */
1531
+ interface ExprFillNull<I> {
1532
+ type: "fillNull";
1533
+ /** Value to check for null */
1534
+ input: I;
1535
+ /** Replacement value if input is null */
1536
+ replacement: I;
1537
+ }
1538
+ /**
1539
+ * Unary mathematical expression.
1540
+ *
1541
+ * Applies a unary mathematical function to a single input expression.
1542
+ * **Input**: One expression that evaluates to a numeric value.
1543
+ * **Output**: Numeric value.
1544
+ * **Null handling**: If input is null, result is null.
1545
+ *
1546
+ * @template I - The expression type (for recursion)
1547
+ *
1548
+ * @example
1549
+ * // Absolute value of column "value"
1550
+ * { type: 'unaryMath', operand: 'abs', input: columnRef }
1551
+ *
1552
+ * // Natural log of expression
1553
+ * { type: 'unaryMath', operand: 'log', input: someExpr }
1554
+ *
1555
+ * @see NumericUnaryOperand for available operations
1556
+ */
1557
+ interface ExprNumericUnary<I> {
1558
+ type: "numericUnary";
1559
+ /** The mathematical operation to apply */
1560
+ operand: NumericUnaryOperand;
1561
+ /** Input expression (must evaluate to numeric) */
1562
+ input: I;
1563
+ }
1564
+ /**
1565
+ * Binary mathematical expression.
1566
+ *
1567
+ * Applies a binary arithmetic operation to two input expressions.
1568
+ * **Input**: Two expressions that evaluate to numeric values.
1569
+ * **Output**: Numeric value.
1570
+ * **Null handling**: If either operand is null, result is null.
1571
+ *
1572
+ * @template I - The expression type (for recursion)
1573
+ *
1574
+ * @example
1575
+ * // Addition: col_a + col_b
1576
+ * { type: 'binaryMath', operand: 'add', left: colA, right: colB }
1577
+ *
1578
+ * // Division: col_a / 2
1579
+ * { type: 'binaryMath', operand: 'div', left: colA, right: { type: 'constant', value: 2 } }
1580
+ *
1581
+ * @see NumericBinaryOperand for available operations
1582
+ */
1583
+ interface ExprNumericBinary<I> {
1584
+ type: "numericBinary";
1585
+ /** The arithmetic operation to apply */
1586
+ operand: NumericBinaryOperand;
1587
+ /** Left operand expression */
1588
+ left: I;
1589
+ /** Right operand expression */
1590
+ right: I;
1591
+ }
1592
+ /**
1593
+ * Numeric comparison expression.
1594
+ *
1595
+ * Compares two numeric expressions and produces a boolean result.
1596
+ * **Input**: Two expressions that evaluate to numeric values.
1597
+ * **Output**: Boolean.
1598
+ * **Null handling**: If either operand is null, result is null.
1599
+ *
1600
+ * @template I - The expression type (for recursion)
1601
+ *
1602
+ * @example
1603
+ * // Greater than: col_a > 10
1604
+ * { type: 'numericComparison', operand: 'gt', left: colA, right: { type: 'constant', value: 10 } }
1605
+ *
1606
+ * // Equality: col_a == col_b
1607
+ * { type: 'numericComparison', operand: 'eq', left: colA, right: colB }
1608
+ *
1609
+ * // Range check (combine with logical AND): 0 <= x && x < 100
1610
+ * // { type: 'logical', operand: 'and', input: [
1611
+ * // { type: 'numericComparison', operand: 'ge', left: colX, right: { type: 'constant', value: 0 } },
1612
+ * // { type: 'numericComparison', operand: 'lt', left: colX, right: { type: 'constant', value: 100 } }
1613
+ * // ]}
1614
+ *
1615
+ * @see NumericComparisonOperand for available operations
1616
+ */
1617
+ interface ExprNumericComparison<I> {
1618
+ type: "numericComparison";
1619
+ /** The comparison operation to apply */
1620
+ operand: NumericComparisonOperand;
1621
+ /** Left operand expression */
1622
+ left: I;
1623
+ /** Right operand expression */
1624
+ right: I;
1625
+ }
1626
+ /**
1627
+ * String equality check.
1628
+ *
1629
+ * Compares input string to a reference value.
1630
+ * **Input**: Expression evaluating to a string.
1631
+ * **Output**: Boolean.
1632
+ * **Null handling**: Returns false if input is null.
1633
+ *
1634
+ * @template I - The expression type (for recursion)
1635
+ *
1636
+ * @example
1637
+ * // Check if name equals "John" (case-sensitive)
1638
+ * // Matches only: "John"
1639
+ * { type: 'stringEquals', input: nameColumn, value: 'John' }
1640
+ *
1641
+ * @example
1642
+ * // Check if name equals "John" (case-insensitive)
1643
+ * // Matches: "john", "JOHN", "John", "jOhN"
1644
+ * { type: 'stringEquals', input: nameColumn, value: 'John', caseInsensitive: true }
1645
+ */
1646
+ interface ExprStringEquals<I> {
1647
+ type: "stringEquals";
1648
+ /** Input expression (must evaluate to string) */
1649
+ input: I;
1650
+ /** Reference string to compare against */
1651
+ value: string;
1652
+ /** If true, comparison ignores case */
1653
+ caseInsensitive: boolean;
1654
+ }
1655
+ /**
1656
+ * Regular expression match check.
1657
+ *
1658
+ * Tests if input string matches a regular expression pattern.
1659
+ * **Input**: Expression evaluating to a string.
1660
+ * **Output**: Boolean (true if pattern matches).
1661
+ * **Null handling**: Returns false if input is null.
1662
+ *
1663
+ * @template I - The expression type (for recursion)
1664
+ *
1665
+ * @example
1666
+ * // Check if value matches email pattern
1667
+ * { type: 'stringRegex', input: emailColumn, value: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$' }
1668
+ *
1669
+ * // Check if starts with "prefix"
1670
+ * { type: 'stringRegex', input: valueColumn, value: '^prefix' }
1671
+ *
1672
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions | MDN Regular Expressions Guide}
1673
+ */
1674
+ interface ExprStringRegex<I> {
1675
+ type: "stringRegex";
1676
+ /** Input expression (must evaluate to string) */
1677
+ input: I;
1678
+ /** Regular expression pattern */
1679
+ value: string;
1680
+ }
1681
+ /**
1682
+ * Substring containment check.
1683
+ *
1684
+ * Tests if input string contains a specified substring.
1685
+ * **Input**: Expression evaluating to a string.
1686
+ * **Output**: Boolean (true if substring is found).
1687
+ * **Null handling**: Returns false if input is null.
1688
+ *
1689
+ * @template I - The expression type (for recursion)
1690
+ *
1691
+ * @example
1692
+ * // Case-sensitive contains
1693
+ * { type: 'stringContains', input: descColumn, value: 'error', caseInsensitive: false }
1694
+ *
1695
+ * // Case-insensitive contains
1696
+ * { type: 'stringContains', input: descColumn, value: 'ERROR', caseInsensitive: true }
1697
+ */
1698
+ interface ExprStringContains<I> {
1699
+ type: "stringContains";
1700
+ /** Input expression (must evaluate to string) */
1701
+ input: I;
1702
+ /** Substring to search for */
1703
+ value: string;
1704
+ /** If true, comparison ignores case */
1705
+ caseInsensitive: boolean;
1706
+ }
1707
+ /**
1708
+ * Fuzzy string containment check with edit distance.
1709
+ *
1710
+ * Tests if input string approximately matches a pattern within a specified edit distance.
1711
+ * Uses Levenshtein distance (or substitution-only distance) for fuzzy matching.
1712
+ * **Input**: Expression evaluating to a string.
1713
+ * **Output**: Boolean (true if approximate match found within maxEdits).
1714
+ * **Null handling**: Returns false if input is null.
1715
+ *
1716
+ * @template I - The expression type (for recursion)
1717
+ *
1718
+ * @example
1719
+ * // Match "color" with up to 1 edit (catches "colour", "colr", etc.)
1720
+ * {
1721
+ * type: 'stringContainsFuzzy',
1722
+ * input: textColumn,
1723
+ * value: 'color',
1724
+ * maxEdits: 1,
1725
+ * caseInsensitive: true,
1726
+ * substitutionsOnly: false,
1727
+ * wildcard: null
1728
+ * }
1729
+ *
1730
+ * // Match with wildcard (? matches any single character)
1731
+ * {
1732
+ * type: 'stringContainsFuzzy',
1733
+ * input: textColumn,
1734
+ * value: 'te?t',
1735
+ * maxEdits: 0,
1736
+ * caseInsensitive: false,
1737
+ * substitutionsOnly: false,
1738
+ * wildcard: '?'
1739
+ * }
1740
+ */
1741
+ interface ExprStringContainsFuzzy<I> {
1742
+ type: "stringContainsFuzzy";
1743
+ /** Input expression (must evaluate to string) */
1744
+ input: I;
1745
+ /** Pattern to match against */
1746
+ value: string;
1747
+ /**
1748
+ * Maximum edit distance (Levenshtein distance).
1749
+ * 0 = exact match only, 1 = one edit allowed, etc.
1750
+ */
1751
+ maxEdits: number;
1752
+ /** If true, comparison ignores case */
1753
+ caseInsensitive: boolean;
1754
+ /**
1755
+ * If true, only substitutions count as edits (no insertions/deletions).
1756
+ * Useful when you want to match strings of same length with typos.
1757
+ */
1758
+ substitutionsOnly: boolean;
1759
+ /**
1760
+ * Optional wildcard character that matches any single character.
1761
+ * Example: '?' in "te?t" matches "test", "text", "tent", etc.
1762
+ * Set to null to disable wildcard matching.
1763
+ */
1764
+ wildcard: null | string;
1765
+ }
1766
+ /**
1767
+ * Logical NOT expression.
1768
+ *
1769
+ * Negates a boolean expression.
1770
+ * **Input**: Expression evaluating to boolean.
1771
+ * **Output**: Boolean (inverted).
1772
+ * **Null handling**: NOT null = null.
1773
+ *
1774
+ * @template I - The expression type (for recursion)
1775
+ *
1776
+ * @example
1777
+ * // NOT (value > 10)
1778
+ * { type: 'not', input: comparisonExpr }
1779
+ */
1780
+ interface ExprLogicalUnary<I> {
1781
+ type: "not";
1782
+ /** Input boolean expression to negate */
1783
+ input: I;
1784
+ }
1785
+ /**
1786
+ * Logical AND/OR expression.
1787
+ *
1788
+ * Combines multiple boolean expressions using AND or OR logic.
1789
+ * **Input**: Array of expressions evaluating to boolean (minimum 2).
1790
+ * **Output**: Boolean.
1791
+ *
1792
+ * **Null handling**
1793
+ * - AND: null AND true = null, null AND false = false
1794
+ * - OR: null OR true = true, null OR false = null
1795
+ *
1796
+ * @template I - The expression type (for recursion)
1797
+ *
1798
+ * @example
1799
+ * // (a > 0) AND (b < 100)
1800
+ * { type: 'and', input: [exprA, exprB] }
1801
+ *
1802
+ * // (status == 'active') OR (status == 'pending')
1803
+ * { type: 'or', input: [statusActive, statusPending] }
1804
+ */
1805
+ interface ExprLogicalVariadic<I> {
1806
+ /** Logical operation: 'and' or 'or' */
1807
+ type: "and" | "or";
1808
+ /** Array of boolean expressions to combine (minimum 2 elements) */
1809
+ input: I[];
1810
+ }
1811
+ /**
1812
+ * Set membership check expression.
1813
+ *
1814
+ * Tests if a value is present in a predefined set of values.
1815
+ * **Input**: Expression evaluating to string or number.
1816
+ * **Output**: Boolean.
1817
+ * **Null handling**: Returns false if input is null.
1818
+ *
1819
+ * @template I - The expression type (for recursion)
1820
+ * @template T - The type of set elements (string or number)
1821
+ *
1822
+ * @example
1823
+ * // Check if status is in ['active', 'pending', 'review']
1824
+ * {
1825
+ * type: 'isIn',
1826
+ * input: statusColumn,
1827
+ * set: ['active', 'pending', 'review']
1828
+ * }
1829
+ */
1830
+ interface ExprIsIn<I, T extends string | number> {
1831
+ type: "isIn";
1832
+ /** Input expression to test */
1833
+ input: I;
1834
+ /** Set of allowed values */
1835
+ set: T[];
1836
+ /** If true, the predicate is inverted (true for values NOT in `set`). */
1837
+ negate: boolean;
1838
+ }
1839
+ /**
1840
+ * Type cast expression.
1841
+ *
1842
+ * Converts the input value to a different column value type. Mirrors
1843
+ * SQL `CAST(input AS U)`.
1844
+ *
1845
+ * **Input**: any expression.
1846
+ * **Output**: a value of `targetType`.
1847
+ * **Null handling**: null in → null out.
1848
+ *
1849
+ * @template I - The expression type (for recursion)
1850
+ */
1851
+ interface ExprCast<I> {
1852
+ type: "cast";
1853
+ /** Expression to cast. */
1854
+ input: I;
1855
+ /** Target column value type. */
1856
+ targetType: ColumnValueType;
1857
+ }
1858
+ /**
1859
+ * A single `when → then` case in a {@link ExprConditional} expression.
1860
+ *
1861
+ * @template I - The expression type (for recursion)
1862
+ */
1863
+ interface ExprConditionalCase<I> {
1864
+ /** Boolean predicate that selects this branch. */
1865
+ when: I;
1866
+ /** Value produced when `when` evaluates to true. */
1867
+ then: I;
1868
+ }
1869
+ /**
1870
+ * Conditional (CASE WHEN) expression.
1871
+ *
1872
+ * Evaluates `cases` in order; the value of the first case whose `when`
1873
+ * is true is returned. If no case matches, `otherwise` is used (or
1874
+ * null when omitted).
1875
+ *
1876
+ * **Result type**: the type of the first case's `then`; subsequent
1877
+ * `then`s and `otherwise` are cast to it.
1878
+ *
1879
+ * @template I - The expression type (for recursion)
1880
+ *
1881
+ * @example
1882
+ * {
1883
+ * type: 'conditional',
1884
+ * cases: [
1885
+ * { when: gtTwenty, then: { type: 'constant', value: 'high' } },
1886
+ * { when: gtTen, then: { type: 'constant', value: 'mid' } }
1887
+ * ],
1888
+ * otherwise: { type: 'constant', value: 'low' }
1889
+ * }
1890
+ */
1891
+ interface ExprConditional<I> {
1892
+ type: "conditional";
1893
+ /** Cases evaluated in order; first matching wins. At least one. */
1894
+ cases: [ExprConditionalCase<I>, ...ExprConditionalCase<I>[]];
1895
+ /** Fallback value when no case matches. */
1896
+ otherwise?: I;
1897
+ }
1898
+ /** Ranking function kind. */
1899
+ type RankingKind = "rank" | "denseRank" | "rowNumber";
1900
+ /**
1901
+ * Ranking expression (always a window function).
1902
+ *
1903
+ * Orders rows by `orderBy` within each partition and assigns ranks
1904
+ * according to `kind`. Output is always `Long`.
1905
+ *
1906
+ * @template I - The expression type (for recursion)
1907
+ * @template A - Axis selector type
1908
+ * @template C - Column selector type
1909
+ */
1910
+ interface ExprRanking<I, A, C> {
1911
+ type: "ranking";
1912
+ /** Ranking semantics. */
1913
+ kind: RankingKind;
1914
+ /** Expression to order by within each partition. */
1915
+ orderBy: I;
1916
+ /** If true (default), sort ascending; if false, descending. */
1917
+ ascending?: boolean;
1918
+ /** Partition specification — at least one entry when supplied. */
1919
+ partitionBy?: [QuerySelector<A, C>, ...QuerySelector<A, C>[]];
1920
+ }
1921
+ /**
1922
+ * Axis reference expression.
1923
+ *
1924
+ * References an axis value for use in expressions (filtering, sorting, etc.).
1925
+ * The axis identifier type varies by context (spec vs data layer).
1926
+ *
1927
+ * @template A - Axis identifier type (e.g., SingleAxisSelector for spec, number for data)
1928
+ *
1929
+ * @example
1930
+ * // Reference axis by selector (spec layer)
1931
+ * { type: 'axisRef', value: { name: 'sample' } }
1932
+ *
1933
+ * // Reference axis by index (data layer)
1934
+ * { type: 'axisRef', value: 0 }
1935
+ */
1936
+ interface ExprAxisRef<A> {
1937
+ type: "axisRef";
1938
+ /** Axis identifier (selector or index depending on context) */
1939
+ value: A;
1940
+ }
1941
+ /**
1942
+ * Column reference expression.
1943
+ *
1944
+ * References a column value for use in expressions (filtering, arithmetic, etc.).
1945
+ * The column identifier type varies by context (spec vs data layer).
1946
+ *
1947
+ * @template C - Column identifier type (e.g., PObjectId for spec, number for data)
1948
+ *
1949
+ * @example
1950
+ * // Reference column by ID (spec layer)
1951
+ * { type: 'columnRef', value: 'col_abc123' }
1952
+ *
1953
+ * // Reference column by index (data layer)
1954
+ * { type: 'columnRef', value: 0 }
1955
+ */
1956
+ interface ExprColumnRef<C> {
1957
+ type: "columnRef";
1958
+ /** Column identifier (ID or index depending on context) */
1959
+ value: C;
1960
+ }
1961
+ type InferBooleanExpressionUnion<E> = [E extends ExprNumericComparison<unknown> ? Extract<E, {
1962
+ type: "numericComparison";
1963
+ }> : never, E extends ExprStringEquals<unknown> ? Extract<E, {
1964
+ type: "stringEquals";
1965
+ }> : never, E extends ExprStringContains<unknown> ? Extract<E, {
1966
+ type: "stringContains";
1967
+ }> : never, E extends ExprStringContainsFuzzy<unknown> ? Extract<E, {
1968
+ type: "stringContainsFuzzy";
1969
+ }> : never, E extends ExprStringRegex<unknown> ? Extract<E, {
1970
+ type: "stringRegex";
1971
+ }> : never, E extends ExprIsNull<unknown> ? Extract<E, {
1972
+ type: "isNull";
1973
+ }> : never, E extends ExprLogicalUnary<unknown> ? Extract<E, {
1974
+ type: "not";
1975
+ }> : never, E extends ExprLogicalVariadic<unknown> ? Extract<E, {
1976
+ type: "and" | "or";
1977
+ }> : never, E extends ExprIsIn<unknown, string | number> ? Extract<E, {
1978
+ type: "isIn";
1979
+ }> : never][number];
1980
+ /**
1981
+ * Selector for referencing an axis in queries.
1982
+ *
1983
+ * Used to identify a specific axis dimension in operations like:
1984
+ * - Sorting by axis values
1985
+ * - Partitioning for window functions
1986
+ * - Filtering/slicing axes
1987
+ *
1988
+ * @template A - Axis identifier type (typically string name or numeric index)
1989
+ *
1990
+ * @example
1991
+ * // Select axis by name
1992
+ * { type: 'axis', id: 'sample' }
1993
+ *
1994
+ * // Select axis by index
1995
+ * { type: 'axis', id: 0 }
1996
+ */
1997
+ interface QueryAxisSelector<A> {
1998
+ type: "axis";
1999
+ /** Axis identifier (name or index depending on context) */
2000
+ id: A;
2001
+ }
2002
+ /**
2003
+ * Selector for referencing a column in queries.
2004
+ *
2005
+ * Used to identify a specific column in operations like:
2006
+ * - Sorting by column values
2007
+ * - Partitioning for window functions
2008
+ * - Aggregation expressions
2009
+ *
2010
+ * @template C - Column identifier type (typically string name or numeric index)
2011
+ *
2012
+ * @example
2013
+ * // Select column by name
2014
+ * { type: 'column', id: 'expression_value' }
2015
+ *
2016
+ * // Select column by index
2017
+ * { type: 'column', id: 0 }
2018
+ */
2019
+ interface QueryColumnSelector<C> {
2020
+ type: "column";
2021
+ /** Column identifier (name or index depending on context) */
2022
+ id: C;
2023
+ }
2024
+ /**
2025
+ * Axis-or-column selector — mirrors the Rust `Selector<AxisSelector,
2026
+ * ColumnSelector>` enum
2027
+ * (`packages/bridge/src/query/query_sort.rs`). Used for the
2028
+ * `partitionBy` / `over` fields of window expressions where either an
2029
+ * axis or a column can drive the partition.
2030
+ */
2031
+ type QuerySelector<A, C> = QueryAxisSelector<A> | QueryColumnSelector<C>;
2032
+ /**
2033
+ * Left outer join query operation.
2034
+ *
2035
+ * Joins a primary query with one or more secondary queries using left outer join semantics.
2036
+ * All records from the primary are preserved; matching records from secondaries are joined,
2037
+ * non-matching positions are filled with nulls.
2038
+ *
2039
+ * **Join behavior**:
2040
+ * - All records from `primary` are preserved
2041
+ * - For each secondary, matching records (by axis keys) are joined
2042
+ * - Missing matches from secondaries are filled with null values
2043
+ * - Empty `secondary` array acts as identity (returns primary unchanged)
2044
+ *
2045
+ * **Null handling**: Null join keys don't match; positions without matches get null values.
2046
+ *
2047
+ * @template JE - Join entry type
2048
+ *
2049
+ * @example
2050
+ * // Left join samples with optional annotations
2051
+ * {
2052
+ * type: 'outerJoin',
2053
+ * primary: samplesQuery,
2054
+ * secondary: [annotationsQuery, metadataQuery]
2055
+ * }
2056
+ * // Result has all samples; annotations/metadata are null where not available
2057
+ */
2058
+ interface QueryOuterJoin<JE extends QueryJoinEntry<unknown>> {
2059
+ type: "outerJoin";
2060
+ /** Primary query - all its records are preserved */
2061
+ primary: JE;
2062
+ /** Secondary queries - joined where keys match, null where they don't */
2063
+ secondary: JE[];
2064
+ }
2065
+ /**
2066
+ * Axis slicing query operation.
2067
+ *
2068
+ * Filters data by fixing one or more axes to specific constant values.
2069
+ * Each filtered axis is removed from the resulting data shape (reduces dimensionality).
2070
+ *
2071
+ * **Behavior**:
2072
+ * - Each axis filter selects records where that axis equals the constant
2073
+ * - Filtered axes are removed from the output spec
2074
+ * - Multiple filters apply conjunctively (AND)
2075
+ *
2076
+ * @template Q - Input query type
2077
+ * @template A - Axis selector type
2078
+ *
2079
+ * @example
2080
+ * // Spec layer: axisSelector is a SingleAxisSelector.
2081
+ * {
2082
+ * type: 'sliceAxes',
2083
+ * input: fullDataQuery,
2084
+ * axisFilters: [
2085
+ * { axisSelector: { name: 'sample' }, constant: 'Sample1' },
2086
+ * { axisSelector: { name: 'condition' }, constant: 'Treatment' }
2087
+ * ]
2088
+ * }
2089
+ *
2090
+ * @example
2091
+ * // Data layer: axisSelector is the axis index.
2092
+ * {
2093
+ * type: 'sliceAxes',
2094
+ * input: fullDataQuery,
2095
+ * axisFilters: [{ axisSelector: 0, constant: 'Sample1' }]
2096
+ * }
2097
+ */
2098
+ interface QuerySliceAxes<Q, A> {
2099
+ type: "sliceAxes";
2100
+ /** Input query to slice */
2101
+ input: Q;
2102
+ /** List of axis filters to apply (at least one required) */
2103
+ axisFilters: {
2104
+ /** Axis to filter. `SingleAxisSelector` at the spec layer; axis index at the data layer. */axisSelector: A; /** The constant value to filter the axis to */
2105
+ constant: string | number;
2106
+ }[];
2107
+ }
2108
+ /**
2109
+ * Sort query operation.
2110
+ *
2111
+ * Reorders records by one or more axes or columns.
2112
+ * Does not change data shape or values, only record order.
2113
+ *
2114
+ * **Behavior**:
2115
+ * - Sort entries are applied in priority order (first entry = primary sort key)
2116
+ * - Ties in first sort key are broken by second, etc.
2117
+ * - All axes and columns pass through unchanged
2118
+ * - Only the physical ordering of records changes
2119
+ *
2120
+ * @template Q - Input query type
2121
+ * @template SE - Sort entry type
2122
+ *
2123
+ * @example
2124
+ * // Sort by score descending, then by name ascending for ties
2125
+ * {
2126
+ * type: 'sort',
2127
+ * input: dataQuery,
2128
+ * sortBy: [
2129
+ * { expression: { type: 'columnRef', value: 'score' }, ascending: false, nullsFirst: false },
2130
+ * { expression: { type: 'axisRef', value: { name: 'name' } }, ascending: true, nullsFirst: false }
2131
+ * ]
2132
+ * }
2133
+ */
2134
+ interface QuerySort<Q, E> {
2135
+ type: "sort";
2136
+ /** Input query to sort */
2137
+ input: Q;
2138
+ /** Sort criteria in priority order (at least one required) */
2139
+ sortBy: {
2140
+ expression: E; /** If true, sort ascending (A-Z, 0-9); if false, descending */
2141
+ ascending: boolean;
2142
+ /**
2143
+ * Null placement control:
2144
+ * - true: nulls sort before non-null values
2145
+ * - false: nulls sort after non-null values
2146
+ */
2147
+ nullsFirst: boolean;
2148
+ }[];
2149
+ }
2150
+ /**
2151
+ * Filter query operation.
2152
+ *
2153
+ * Filters records based on a boolean predicate expression.
2154
+ * Only records where predicate evaluates to true are kept.
2155
+ *
2156
+ * **Behavior**:
2157
+ * - Evaluates predicate for each record
2158
+ * - Keeps records where predicate is true
2159
+ * - Discards records where predicate is false or null
2160
+ * - Data shape (axes, columns) is preserved
2161
+ *
2162
+ * **Null handling**: Records with null predicate result are excluded (null ≠ true).
2163
+ *
2164
+ * @template Q - Input query type
2165
+ * @template E - Expression type
2166
+ *
2167
+ * @example
2168
+ * // Filter to records where value > 10 AND status == 'active'
2169
+ * {
2170
+ * type: 'filter',
2171
+ * input: dataQuery,
2172
+ * predicate: {
2173
+ * type: 'logical',
2174
+ * operand: 'and',
2175
+ * input: [
2176
+ * { type: 'numericComparison', operand: 'gt', left: valueRef, right: { type: 'constant', value: 10 } },
2177
+ * { type: 'stringEquals', input: statusRef, value: 'active' }
2178
+ * ]
2179
+ * }
2180
+ * }
2181
+ */
2182
+ interface QueryFilter<Q, E> {
2183
+ type: "filter";
2184
+ /** Input query to filter */
2185
+ input: Q;
2186
+ /** Boolean predicate expression - only true records pass */
2187
+ predicate: E;
2188
+ }
2189
+ /**
2190
+ * Column reference query (leaf node).
2191
+ *
2192
+ * References an existing column by its unique identifier.
2193
+ * This is a leaf node in the query tree that retrieves actual data.
2194
+ *
2195
+ * The column must exist in the dataset and its spec (axes, value type)
2196
+ * becomes the output spec of this query node.
2197
+ *
2198
+ * @example
2199
+ * // Reference column by ID
2200
+ * { type: 'column', column: 'col_abc123' }
2201
+ *
2202
+ * @template C - Column reference type (e.g., PObjectId for spec, full PColumn for rich queries)
2203
+ */
2204
+ interface QueryColumn<C = PObjectId> {
2205
+ type: "column";
2206
+ /** Column reference (ID or full column object depending on context) */
2207
+ column: C;
2208
+ }
2209
+ /**
2210
+ * Inline column query (leaf node).
2211
+ *
2212
+ * Creates a column with inline/embedded data and type specification.
2213
+ * Useful for creating constant columns or injecting computed data.
2214
+ *
2215
+ * The data is provided via dataInfo which contains the actual values
2216
+ * or reference to where data is stored.
2217
+ *
2218
+ * @template T - Type spec type
2219
+ *
2220
+ * @example
2221
+ * // Create inline column with constant values
2222
+ * {
2223
+ * type: 'inlineColumn',
2224
+ * spec: { axes: ['sample'], columns: ['Int'] },
2225
+ * dataInfo: { ... } // JsonDataInfo object
2226
+ * }
2227
+ */
2228
+ interface QueryInlineColumn<T> {
2229
+ type: "inlineColumn";
2230
+ /** Type specification defining axes and column types */
2231
+ spec: T;
2232
+ /** Data information containing or referencing the actual values */
2233
+ dataInfo: JsonDataInfo;
2234
+ }
2235
+ /**
2236
+ * Sparse to dense column query operation.
2237
+ *
2238
+ * Densifies a sparse column over the Cartesian product of distinct
2239
+ * axis values: `axes` partitions the column's own axes into two sets
2240
+ * (the listed axes on one side, the rest on the other); both sides
2241
+ * contribute their distinct values, and the cross product fills in
2242
+ * the missing tuples (null on rows that have no underlying value).
2243
+ *
2244
+ * **Use case**: graph-maker and other UI surfaces that need a dense
2245
+ * grid to plot.
2246
+ *
2247
+ * **Behavior**:
2248
+ * - Output axes = input axes (no axes are added).
2249
+ * - Missing axis-tuple combinations become null in the output (or
2250
+ * filled later via `pl7.app/graph/isDenseAxis` /
2251
+ * `treatAbsentValuesAs` annotations).
2252
+ *
2253
+ * @template C - Column reference type
2254
+ * @template A - Axis selector type (named selectors at the spec layer,
2255
+ * numeric axis indices at the data layer)
2256
+ * @template SO - Spec override type
2257
+ *
2258
+ * @example
2259
+ * // Spec layer: name the axis to expand across.
2260
+ * {
2261
+ * type: 'sparseToDenseColumn',
2262
+ * column: 'col_abc123',
2263
+ * axes: [{ name: 'sample' }],
2264
+ * specOverride: { ... } // optional spec modifications
2265
+ * }
2266
+ *
2267
+ * @example
2268
+ * // Data layer: the same query after spec→data lowering.
2269
+ * {
2270
+ * type: 'sparseToDenseColumn',
2271
+ * column: 'col_abc123',
2272
+ * axes: [0],
2273
+ * specOverride: { ... }
2274
+ * }
2275
+ */
2276
+ interface QuerySparseToDenseColumn<C, A, SO> {
2277
+ type: "sparseToDenseColumn";
2278
+ /** Column reference (ID or full column object depending on context) */
2279
+ column: C;
2280
+ /** Optional override for the column specification */
2281
+ specOverride?: SO;
2282
+ /**
2283
+ * Axes that participate in the cartesian-product densification.
2284
+ * Named selectors at the spec layer; resolved to numeric axis
2285
+ * indices during spec→data lowering. The Rust runtime also accepts
2286
+ * the legacy field name `axesIndices` as a serde alias.
2287
+ */
2288
+ axes: [A, ...A[]];
2289
+ }
2290
+ /**
2291
+ * Symmetric join query operation (inner join or full outer join).
2292
+ *
2293
+ * Joins multiple queries symmetrically (order doesn't affect result semantics).
2294
+ *
2295
+ * **Inner Join** (`type: 'innerJoin'`):
2296
+ * - Returns only records that exist in ALL entries
2297
+ * - Null join keys don't match, so records with null keys are excluded
2298
+ * - Result contains intersection of all entries by axis keys
2299
+ *
2300
+ * **Full Join** (`type: 'fullJoin'`):
2301
+ * - Returns all records from ALL entries
2302
+ * - Missing values are filled with nulls
2303
+ * - Null join keys create separate groups
2304
+ * - Result contains union of all entries by axis keys
2305
+ *
2306
+ * **Single entry**: Acts as identity (returns entry unchanged).
2307
+ *
2308
+ * @template JE - Join entry type
2309
+ *
2310
+ * @example
2311
+ * // Inner join: only records present in all queries
2312
+ * {
2313
+ * type: 'innerJoin',
2314
+ * entries: [query1Entry, query2Entry, query3Entry]
2315
+ * }
2316
+ *
2317
+ * // Full join: all records from all queries, nulls for missing
2318
+ * {
2319
+ * type: 'fullJoin',
2320
+ * entries: [query1Entry, query2Entry]
2321
+ * }
2322
+ */
2323
+ interface QuerySymmetricJoin<JE extends QueryJoinEntry<unknown>> {
2324
+ /** 'innerJoin' for intersection, 'fullJoin' for union with nulls */
2325
+ type: "innerJoin" | "fullJoin";
2326
+ /** Queries to join (at least one required) */
2327
+ entries: JE[];
2328
+ }
2329
+ /**
2330
+ * Join entry wrapper.
2331
+ *
2332
+ * Wraps a query to be used as an entry in join operations.
2333
+ * The wrapper allows for additional metadata or configuration
2334
+ * on each joined query (e.g., specifying join keys, aliases).
2335
+ *
2336
+ * @template Q - Query type
2337
+ *
2338
+ * @example
2339
+ * // Wrap a query for use in join
2340
+ * { entry: someQuery }
2341
+ */
2342
+ interface QueryJoinEntry<Q> {
2343
+ /** The query to be joined */
2344
+ entry: Q;
2345
+ }
2346
+ /**
2347
+ * Linker-join query operation.
2348
+ *
2349
+ * Inner-joins a linker column (`linker`) with one or more secondary subqueries,
2350
+ * then projects out the linker's one-side axes from the joined result. Used to
2351
+ * traverse a linker relationship: rows on the secondary side are "lifted" onto
2352
+ * the linker's many-side axes, with one-side axes collapsed away.
2353
+ *
2354
+ * Mirrors {@link QueryOuterJoin}'s `{ primary, secondary }` shape (with
2355
+ * `secondary` as an array), but the linker side is a specialized sub-struct —
2356
+ * a plain column reference rather than a full join entry.
2357
+ *
2358
+ * **Join behavior**:
2359
+ * - The linker column is inner-joined with all `secondary` entries
2360
+ * - After the join, the linker's one-side axes are projected out
2361
+ * - Result axes = joined axes minus the linker's one-side axes
2362
+ *
2363
+ * **Note**: `secondary` must contain at least one entry (empty has no
2364
+ * well-defined meaning for linker-join).
2365
+ *
2366
+ * @template L - Linker sub-struct type (layer-specific)
2367
+ * @template JE - Join entry type for the secondary side
2368
+ *
2369
+ * @example
2370
+ * // Traverse linker l1 and read rest data lifted onto l1's many-side
2371
+ * {
2372
+ * type: 'linkerJoin',
2373
+ * linker: { column: 'l1' },
2374
+ * secondary: [{ entry: restQuery, ... }]
2375
+ * }
2376
+ */
2377
+ interface QueryLinkerJoin<L, JE extends QueryJoinEntry<unknown>> {
2378
+ type: "linkerJoin";
2379
+ /** Linker side — column reference plus layer-specific integration data. */
2380
+ linker: L;
2381
+ /** Rest side — one or more subqueries joined with the linker (at least one). */
2382
+ secondary: JE[];
2383
+ }
2384
+ /**
2385
+ * `transformColumns` mode.
2386
+ *
2387
+ * - `"append"` — existing columns pass through; the new columns are
2388
+ * appended.
2389
+ * - `"replace"` — only the listed columns are kept; everything else is
2390
+ * dropped.
2391
+ *
2392
+ * The Rust runtime accepts the legacy `"add"` tag as a serde alias;
2393
+ * new code should emit `"append"`.
2394
+ */
2395
+ type TransformColumnsMode = "append" | "replace";
2396
+ /**
2397
+ * Single column entry for {@link QueryTransformColumns}.
2398
+ *
2399
+ * @template E - Expression type
2400
+ * @template SO - Spec override type (typically `PColumnIdAndSpec` at
2401
+ * the spec layer, or layer-specific id+typespec at the data layer)
2402
+ */
2403
+ interface TransformColumnEntry<E, SO> {
2404
+ /** Expression computing the column values. */
2405
+ expression: E;
2406
+ /**
2407
+ * Optional spec override. If omitted, the runtime auto-derives the
2408
+ * column's spec from the host's input and the expression.
2409
+ * `valueType` is always inferred from the expression.
2410
+ */
2411
+ specOverride?: SO;
2412
+ }
2413
+ /**
2414
+ * Transform-columns query operation.
2415
+ *
2416
+ * Computes one or more derived columns from `input`. Axes are
2417
+ * preserved.
2418
+ *
2419
+ * @template Q - Input query type
2420
+ * @template E - Expression type
2421
+ * @template SO - Spec override type
2422
+ */
2423
+ interface QueryTransformColumns<Q, E, SO> {
2424
+ type: "transformColumns";
2425
+ /** Input query. */
2426
+ input: Q;
2427
+ /** `"append"` to add new columns; `"replace"` to keep only listed columns. */
2428
+ mode: TransformColumnsMode;
2429
+ /** Derived columns to compute (at least one). */
2430
+ columns: [TransformColumnEntry<E, SO>, ...TransformColumnEntry<E, SO>[]];
2431
+ } //#endregion
2432
+ //#endregion
2433
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/query_spec.d.ts
2434
+ //#region src/drivers/pframe/query/query_spec.d.ts
2435
+ /**
2436
+ * Join entry for spec-layer queries — the base join entry extended with
2437
+ * per-axis domain constraints. Absent `qualifications` is equivalent to `[]`.
2438
+ *
2439
+ * @example
2440
+ * {
2441
+ * entry: querySpec,
2442
+ * qualifications: [{ axis: { name: 'sample' }, contextDomain: { ... } }]
2443
+ * }
2444
+ */
2445
+ type SpecQueryJoinEntry<C = PObjectId> = QueryJoinEntry<SpecQuery<C>> & {
2446
+ qualifications?: {
2447
+ /** Axis to qualify. */axis: SingleAxisSelector; /** Additional domain constraints for this axis. */
2448
+ contextDomain: Domain;
2449
+ }[];
2450
+ };
2451
+ /** @see QueryColumn */
2452
+ type SpecQueryColumn<C = PObjectId> = QueryColumn<C>;
2453
+ /** @see QueryInlineColumn */
2454
+ type SpecQueryInlineColumn = QueryInlineColumn<PColumnIdAndSpec>;
2455
+ /** @see QuerySparseToDenseColumn */
2456
+ type SpecQuerySparseToDenseColumn<C = PObjectId> = QuerySparseToDenseColumn<C, SingleAxisSelector, PColumnIdAndSpec>;
2457
+ /** @see QuerySymmetricJoin */
2458
+ type SpecQuerySymmetricJoin<C = PObjectId> = QuerySymmetricJoin<SpecQueryJoinEntry<C>>;
2459
+ /** @see QueryOuterJoin */
2460
+ type SpecQueryOuterJoin<C = PObjectId> = QueryOuterJoin<SpecQueryJoinEntry<C>>;
2461
+ /**
2462
+ * Linker side of a spec-layer linker-join.
2463
+ *
2464
+ * At the spec layer the linker is just a column reference — integration artifacts
2465
+ * (axes mapping, one-side indices) are derived during spec→data conversion.
2466
+ */
2467
+ type SpecQueryLinkerJoinLinker<C = PObjectId> = {
2468
+ /** Linker column reference. */column: C;
2469
+ };
2470
+ /** @see QueryLinkerJoin */
2471
+ type SpecQueryLinkerJoin<C = PObjectId> = QueryLinkerJoin<SpecQueryLinkerJoinLinker<C>, SpecQueryJoinEntry<C>>;
2472
+ /** @see QuerySliceAxes */
2473
+ type SpecQuerySliceAxes<C = PObjectId> = QuerySliceAxes<SpecQuery<C>, SingleAxisSelector>;
2474
+ /** @see QuerySort */
2475
+ type SpecQuerySort<C = PObjectId> = QuerySort<SpecQuery<C>, SpecQueryExpression>;
2476
+ /** @see QueryFilter */
2477
+ type SpecQueryFilter<C = PObjectId> = QueryFilter<SpecQuery<C>, SpecQueryBooleanExpression>;
2478
+ /** @see QueryTransformColumns */
2479
+ type SpecQueryTransformColumns<C = PObjectId> = QueryTransformColumns<SpecQuery<C>, SpecQueryExpression, PColumnIdAndSpec>;
2480
+ /**
2481
+ * Union of all spec layer query types.
2482
+ *
2483
+ * The spec layer operates with named selectors and column IDs,
2484
+ * making it suitable for user-facing query construction and validation.
2485
+ *
2486
+ * @template C - Column reference type. Defaults to PObjectId (ID-only).
2487
+ * Can be parameterized with richer types (e.g., PColumn<Data>) to carry
2488
+ * full column data directly in the query tree.
2489
+ *
2490
+ * Includes:
2491
+ * - Leaf nodes: column, inlineColumn, sparseToDenseColumn
2492
+ * - Join operations: innerJoin, fullJoin, outerJoin, linkerJoin
2493
+ * - Transformations: sliceAxes, sort, filter, transformColumns
2494
+ */
2495
+ type SpecQuery<C = PObjectId> = SpecQueryColumn<C> | SpecQueryInlineColumn | SpecQuerySparseToDenseColumn<C> | SpecQuerySymmetricJoin<C> | SpecQueryOuterJoin<C> | SpecQueryLinkerJoin<C> | SpecQuerySliceAxes<C> | SpecQuerySort<C> | SpecQueryFilter<C> | SpecQueryTransformColumns<C>;
2496
+ /** @see ExprAxisRef */
2497
+ type SpecExprAxisRef = ExprAxisRef<SingleAxisSelector>;
2498
+ /** @see ExprColumnRef */
2499
+ type SpecExprColumnRef = ExprColumnRef<PObjectId>;
2500
+ type SpecQueryExpression = SpecExprColumnRef | SpecExprAxisRef | ExprConstant | ExprNumericBinary<SpecQueryExpression> | ExprNumericComparison<SpecQueryExpression> | ExprNumericUnary<SpecQueryExpression> | ExprStringEquals<SpecQueryExpression> | ExprStringContains<SpecQueryExpression> | ExprStringRegex<SpecQueryExpression> | ExprStringContainsFuzzy<SpecQueryExpression> | ExprIsNull<SpecQueryExpression> | ExprFillNull<SpecQueryExpression> | ExprLogicalUnary<SpecQueryExpression> | ExprLogicalVariadic<SpecQueryExpression> | ExprIsIn<SpecQueryExpression, string> | ExprIsIn<SpecQueryExpression, number> | ExprCast<SpecQueryExpression> | ExprConditional<SpecQueryExpression> | ExprRanking<SpecQueryExpression, SingleAxisSelector, PObjectId>;
2501
+ type SpecQueryBooleanExpression = InferBooleanExpressionUnion<SpecQueryExpression>; //#endregion
2502
+ //#endregion
2503
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/table_calculate.d.ts
2504
+ //#region src/drivers/pframe/table_calculate.d.ts
2505
+ /** Defines a terminal column node in the join request tree */
2506
+ interface ColumnJoinEntry<Col> {
2507
+ /** Node type discriminator */
2508
+ readonly type: "column";
2509
+ /** Local column */
2510
+ readonly column: Col;
2511
+ }
2512
+ /**
2513
+ * Axis filter slicing target axis from column axes.
2514
+ * If the axis has parents or is a parent, slicing cannot be applied (an error will be thrown).
2515
+ * */
2516
+ interface ConstantAxisFilter {
2517
+ /** Filter type discriminator */
2518
+ readonly type: "constant";
2519
+ /** Index of axis to slice (zero-based) */
2520
+ readonly axisIndex: number;
2521
+ /** Equality filter reference value, see {@link SingleValueEqualPredicate} */
2522
+ readonly constant: string | number;
2523
+ }
2524
+ /** Defines a terminal column node in the join request tree */
2525
+ interface SlicedColumnJoinEntry<Col> {
2526
+ /** Node type discriminator */
2527
+ readonly type: "slicedColumn";
2528
+ /** Local column */
2529
+ readonly column: Col;
2530
+ /** New column id */
2531
+ readonly newId: PObjectId;
2532
+ /** Non-empty list of axis filters */
2533
+ readonly axisFilters: ConstantAxisFilter[];
2534
+ }
2535
+ interface ArtificialColumnJoinEntry<Col> {
2536
+ /** Node type discriminator */
2537
+ readonly type: "artificialColumn";
2538
+ /** Column definition */
2539
+ readonly column: Col;
2540
+ /** New column id */
2541
+ readonly newId: PObjectId;
2542
+ /** Indices of axes to pick from the column (zero-based) */
2543
+ readonly axesIndices: number[];
2544
+ }
2545
+ /** Defines a terminal column node in the join request tree */
2546
+ interface InlineColumnJoinEntry {
2547
+ /** Node type discriminator */
2548
+ readonly type: "inlineColumn";
2549
+ /** Column definition */
2550
+ readonly column: PColumn<PColumnValues>;
2551
+ }
2552
+ /**
2553
+ * Defines a join request tree node that will output only records present in
2554
+ * all child nodes ({@link entries}).
2555
+ * */
2556
+ interface InnerJoin<Col> {
2557
+ /** Node type discriminator */
2558
+ readonly type: "inner";
2559
+ /** Child nodes to be inner joined */
2560
+ readonly entries: JoinEntry<Col>[];
2561
+ }
2562
+ /**
2563
+ * Defines a join request tree node that will output all records present at
2564
+ * least in one of the child nodes ({@link entries}), values for those PColumns
2565
+ * that lack corresponding combinations of axis values will be null.
2566
+ * */
2567
+ interface FullJoin<Col> {
2568
+ /** Node type discriminator */
2569
+ readonly type: "full";
2570
+ /** Child nodes to be fully outer joined */
2571
+ readonly entries: JoinEntry<Col>[];
2572
+ }
2573
+ /**
2574
+ * Defines a join request tree node that will output all records present in
2575
+ * {@link primary} child node, and records from the {@link secondary} nodes will
2576
+ * be added to the output only if present, values for those PColumns from the
2577
+ * {@link secondary} list, that lack corresponding combinations of axis values
2578
+ * will be null.
2579
+ *
2580
+ * This node can be thought as a chain of SQL LEFT JOIN operations starting from
2581
+ * the {@link primary} node and adding {@link secondary} nodes one by one.
2582
+ * */
2583
+ interface OuterJoin<Col> {
2584
+ /** Node type discriminator */
2585
+ readonly type: "outer";
2586
+ /** Primes the join operation. Left part of LEFT JOIN. */
2587
+ readonly primary: JoinEntry<Col>;
2588
+ /** Driven nodes, giving their values only if primary node have corresponding
2589
+ * nodes. Right parts of LEFT JOIN chain. */
2590
+ readonly secondary: JoinEntry<Col>[];
2591
+ }
2592
+ /**
2593
+ * Base type of all join request tree nodes. Join request tree allows to combine
2594
+ * information from multiple PColumns into a PTable. Correlation between records
2595
+ * is performed by looking for records with the same values in common axis between
2596
+ * the PColumns. Common axis are those axis which have equal {@link AxisId} derived
2597
+ * from the columns axes spec.
2598
+ * */
2599
+ type JoinEntry<Col> = ColumnJoinEntry<Col> | SlicedColumnJoinEntry<Col> | ArtificialColumnJoinEntry<Col> | InlineColumnJoinEntry | InnerJoin<Col> | FullJoin<Col> | OuterJoin<Col>;
2600
+ /** Container representing whole data stored in specific PTable column. */
2601
+ interface FullPTableColumnData {
2602
+ /** Unified spec */
2603
+ readonly spec: PTableColumnSpec;
2604
+ /** Data */
2605
+ readonly data: PTableVector;
2606
+ }
2607
+ interface SingleValueIsNAPredicate {
2608
+ /** Comparison operator */
2609
+ readonly operator: "IsNA";
2610
+ }
2611
+ interface SingleValueEqualPredicate {
2612
+ /** Comparison operator */
2613
+ readonly operator: "Equal";
2614
+ /** Reference value, NA values will not match */
2615
+ readonly reference: string | number;
2616
+ }
2617
+ interface SingleValueInSetPredicate {
2618
+ /** Comparison operator */
2619
+ readonly operator: "InSet";
2620
+ /** Reference values, NA values will not match */
2621
+ readonly references: (string | number)[];
2622
+ }
2623
+ interface SingleValueIEqualPredicate {
2624
+ /** Comparison operator (case insensitive) */
2625
+ readonly operator: "IEqual";
2626
+ /** Reference value, NA values will not match */
2627
+ readonly reference: string;
2628
+ }
2629
+ interface SingleValueLessPredicate {
2630
+ /** Comparison operator */
2631
+ readonly operator: "Less";
2632
+ /** Reference value, NA values will not match */
2633
+ readonly reference: string | number;
2634
+ }
2635
+ interface SingleValueLessOrEqualPredicate {
2636
+ /** Comparison operator */
2637
+ readonly operator: "LessOrEqual";
2638
+ /** Reference value, NA values will not match */
2639
+ readonly reference: string | number;
2640
+ }
2641
+ interface SingleValueGreaterPredicate {
2642
+ /** Comparison operator */
2643
+ readonly operator: "Greater";
2644
+ /** Reference value, NA values will not match */
2645
+ readonly reference: string | number;
2646
+ }
2647
+ interface SingleValueGreaterOrEqualPredicate {
2648
+ /** Comparison operator */
2649
+ readonly operator: "GreaterOrEqual";
2650
+ /** Reference value, NA values will not match */
2651
+ readonly reference: string | number;
2652
+ }
2653
+ interface SingleValueStringContainsPredicate {
2654
+ /** Comparison operator */
2655
+ readonly operator: "StringContains";
2656
+ /** Reference substring, NA values are skipped */
2657
+ readonly substring: string;
2658
+ }
2659
+ interface SingleValueStringIContainsPredicate {
2660
+ /** Comparison operator (case insensitive) */
2661
+ readonly operator: "StringIContains";
2662
+ /** Reference substring, NA values are skipped */
2663
+ readonly substring: string;
2664
+ }
2665
+ interface SingleValueMatchesPredicate {
2666
+ /** Comparison operator */
2667
+ readonly operator: "Matches";
2668
+ /** Regular expression, NA values are skipped */
2669
+ readonly regex: string;
2670
+ }
2671
+ interface SingleValueStringContainsFuzzyPredicate {
2672
+ /** Comparison operator */
2673
+ readonly operator: "StringContainsFuzzy";
2674
+ /** Reference value, NA values are skipped */
2675
+ readonly reference: string;
2676
+ /**
2677
+ * Integer specifying the upper bound of edit distance between
2678
+ * reference and actual value.
2679
+ * When {@link substitutionsOnly} is not defined or set to false
2680
+ * Levenshtein distance is used (substitutions and indels)
2681
+ * @see https://en.wikipedia.org/wiki/Levenshtein_distance
2682
+ * When {@link substitutionsOnly} is set to true
2683
+ * Hamming distance is used (substitutions only)
2684
+ * @see https://en.wikipedia.org/wiki/Hamming_distance
2685
+ */
2686
+ readonly maxEdits: number;
2687
+ /** Changes the type of edit distance in {@link maxEdits} */
2688
+ readonly substitutionsOnly?: boolean;
2689
+ /**
2690
+ * Some character in {@link reference} that will match any
2691
+ * single character in searched text.
2692
+ */
2693
+ readonly wildcard?: string;
2694
+ }
2695
+ interface SingleValueStringIContainsFuzzyPredicate {
2696
+ /** Comparison operator (case insensitive) */
2697
+ readonly operator: "StringIContainsFuzzy";
2698
+ /** Reference value, NA values are skipped */
2699
+ readonly reference: string;
2700
+ /**
2701
+ * Integer specifying the upper bound of edit distance between
2702
+ * reference and actual value.
2703
+ * When {@link substitutionsOnly} is not defined or set to false
2704
+ * Levenshtein distance is used (substitutions and indels)
2705
+ * @see https://en.wikipedia.org/wiki/Levenshtein_distance
2706
+ * When {@link substitutionsOnly} is set to true
2707
+ * Hamming distance is used (substitutions only)
2708
+ * @see https://en.wikipedia.org/wiki/Hamming_distance
2709
+ */
2710
+ readonly maxEdits: number;
2711
+ /** Changes the type of edit distance in {@link maxEdits} */
2712
+ readonly substitutionsOnly?: boolean;
2713
+ /**
2714
+ * Some character in {@link reference} that will match any
2715
+ * single character in searched text.
2716
+ */
2717
+ readonly wildcard?: string;
2718
+ }
2719
+ interface SingleValueNotPredicateV2 {
2720
+ /** Comparison operator */
2721
+ readonly operator: "Not";
2722
+ /** Operand to negate */
2723
+ readonly operand: SingleValuePredicateV2;
2724
+ }
2725
+ interface SingleValueAndPredicateV2 {
2726
+ /** Comparison operator */
2727
+ readonly operator: "And";
2728
+ /** Operands to combine */
2729
+ readonly operands: SingleValuePredicateV2[];
2730
+ }
2731
+ interface SingleValueOrPredicateV2 {
2732
+ /** Comparison operator */
2733
+ readonly operator: "Or";
2734
+ /** Operands to combine */
2735
+ readonly operands: SingleValuePredicateV2[];
2736
+ }
2737
+ /** Filtering predicate for a single axis or column value */
2738
+ type SingleValuePredicateV2 = SingleValueIsNAPredicate | SingleValueEqualPredicate | SingleValueInSetPredicate | SingleValueLessPredicate | SingleValueLessOrEqualPredicate | SingleValueGreaterPredicate | SingleValueGreaterOrEqualPredicate | SingleValueStringContainsPredicate | SingleValueMatchesPredicate | SingleValueStringContainsFuzzyPredicate | SingleValueNotPredicateV2 | SingleValueAndPredicateV2 | SingleValueOrPredicateV2 | SingleValueIEqualPredicate | SingleValueStringIContainsPredicate | SingleValueStringIContainsFuzzyPredicate;
2739
+ /**
2740
+ * Filter PTable records based on specific axis or column value. If this is an
2741
+ * axis value filter and the axis is part of a partitioning key in some of the
2742
+ * source PColumns, the filter will be pushed down to those columns, so only
2743
+ * specific partitions will be retrieved from the remote storage.
2744
+ * */
2745
+ interface PTableRecordSingleValueFilterV2 {
2746
+ /** Filter type discriminator */
2747
+ readonly type: "bySingleColumnV2";
2748
+ /** Target axis selector to examine values from */
2749
+ readonly column: PTableColumnId;
2750
+ /** Value predicate */
2751
+ readonly predicate: SingleValuePredicateV2;
2752
+ }
2753
+ /** Generic PTable records filter */
2754
+ type PTableRecordFilter = PTableRecordSingleValueFilterV2;
2755
+ /** Sorting parameters for a PTable. */
2756
+ type PTableSorting = {
2757
+ /** Unified column identifier */readonly column: PTableColumnId; /** Sorting order */
2758
+ readonly ascending: boolean; /** Sorting in respect to NA and absent values */
2759
+ readonly naAndAbsentAreLeastValues: boolean;
2760
+ };
2761
+ /** Information required to instantiate a PTable. */
2762
+ interface PTableDef<Col> {
2763
+ /** Join tree to populate the PTable */
2764
+ readonly src: JoinEntry<Col>;
2765
+ /** Partition filters */
2766
+ readonly partitionFilters: PTableRecordFilter[];
2767
+ /** Record filters */
2768
+ readonly filters: PTableRecordFilter[];
2769
+ /** Table sorting */
2770
+ readonly sorting: PTableSorting[];
2771
+ }
2772
+ /** Information required to instantiate a PTable (V2, query-based). */
2773
+ interface PTableDefV2<Col> {
2774
+ /** Pre-built query spec describing joins, filters and sorting */
2775
+ readonly query: SpecQuery<Col>;
2776
+ }
2777
+ /** Request to create and retrieve entirety of data of PTable. */
2778
+ type CalculateTableDataRequest<Col> = {
2779
+ /** Join tree to populate the PTable */readonly src: JoinEntry<Col>; /** Record filters */
2780
+ readonly filters: PTableRecordFilter[]; /** Table sorting */
2781
+ readonly sorting: PTableSorting[];
2782
+ };
2783
+ /** Response for {@link CalculateTableDataRequest} */
2784
+ type CalculateTableDataResponse = FullPTableColumnData[];
2785
+ //#endregion
2786
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/ref.d.ts
2787
+ //#region src/ref.d.ts
2788
+ declare const PlRef: ZodReadonly<ZodObject<{
2789
+ __isRef: ZodLiteral<true>;
2790
+ blockId: ZodString;
2791
+ name: ZodString;
2792
+ requireEnrichments: ZodOptional<ZodLiteral<true>>;
2793
+ }, "strip", ZodTypeAny, {
2794
+ __isRef: true;
2795
+ blockId: string;
2796
+ name: string;
2797
+ requireEnrichments?: true | undefined;
2798
+ }, {
2799
+ __isRef: true;
2800
+ blockId: string;
2801
+ name: string;
2802
+ requireEnrichments?: true | undefined;
2803
+ }>>;
2804
+ type PlRef = TypeOf<typeof PlRef>;
2805
+ /** @deprecated use {@link PlRef} */
2806
+ //#endregion
2807
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/pool/spec.d.ts
2808
+ //#region src/pool/spec.d.ts
2809
+ /** Any object exported into the result pool by the block always have spec attached to it */
2810
+ type PObjectSpec = {
2811
+ /** PObject kind discriminator */readonly kind: string; /** Name is common part of PObject identity */
2812
+ readonly name: string; /** Domain is a set of key-value pairs that can be used to identify the object */
2813
+ readonly domain?: Record<string, string>;
2814
+ /** Context domain provides additional axis/column identity that is matched
2815
+ * by kinship rules (subset/superset/overlap) rather than exact equality */
2816
+ readonly contextDomain?: Record<string, string>; /** Additional information attached to the object */
2817
+ readonly annotations?: Record<string, string>;
2818
+ };
2819
+ /** Stable PObject id */
2820
+ type PObjectId = Branded$1<string, "PColumnId">;
2821
+ /**
2822
+ * Full PObject representation.
2823
+ *
2824
+ * @template Data type of the object referencing or describing the "data" part of the PObject
2825
+ * */
2826
+ interface PObject<Data> {
2827
+ /** Fully rendered PObjects are assigned a stable identifier. */
2828
+ readonly id: PObjectId;
2829
+ /** PObject spec, allowing it to be found among other PObjects */
2830
+ readonly spec: PObjectSpec;
2831
+ /** A handle to data object */
2832
+ readonly data: Data;
2833
+ }
2834
+ //#endregion
2835
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.d.ts
2836
+ //#region src/drivers/pframe/spec/spec.d.ts
2837
+ declare const ValueType: {
2838
+ readonly Int: "Int";
2839
+ readonly Long: "Long";
2840
+ readonly Float: "Float";
2841
+ readonly Double: "Double";
2842
+ readonly String: "String";
2843
+ readonly Bytes: "Bytes";
2844
+ };
2845
+ type AxisValueType = Extract<ValueType, "Int" | "Long" | "String">;
2846
+ type ColumnValueType = ValueType;
2847
+ /** PFrame columns and axes within them may store one of these types. */
2848
+ type ValueType = (typeof ValueType)[keyof typeof ValueType];
2849
+ type Metadata = Record<string, string>;
2850
+ declare const Domain: {
2851
+ readonly Alphabet: "pl7.app/alphabet";
2852
+ readonly BlockId: "pl7.app/blockId";
2853
+ readonly VDJ: {
2854
+ readonly Clustering: {
2855
+ readonly BlockId: "pl7.app/vdj/clustering/blockId";
2856
+ };
2857
+ readonly ScClonotypeChain: {
2858
+ readonly Index: "pl7.app/vdj/scClonotypeChain/index";
2859
+ };
2860
+ };
2861
+ };
2862
+ type Domain = Metadata & Partial<{
2863
+ [Domain.Alphabet]: "nucleotide" | "aminoacid" | (string & {});
2864
+ [Domain.BlockId]: string;
2865
+ [Domain.VDJ.ScClonotypeChain.Index]: "primary" | "secondary" | (string & {});
2866
+ }>;
2867
+ /**
2868
+ * Specification of an individual axis.
2869
+ *
2870
+ * Each axis is a part of a composite key that addresses data inside the PColumn.
2871
+ *
2872
+ * Each record inside a PColumn is addressed by a unique tuple of values set for
2873
+ * all the axes specified in the column spec.
2874
+ */
2875
+ type AxisSpec = {
2876
+ /** Type of the axis value. Should not use non-key types like float or double. */readonly type: AxisValueType; /** Name of the axis */
2877
+ readonly name: string;
2878
+ /** Adds auxiliary information to the axis name, type and parents to form a
2879
+ * unique identifier */
2880
+ readonly domain?: Record<string, string>;
2881
+ /** Context domain provides additional axis identity that is matched
2882
+ * by kinship rules (subset/superset/overlap) rather than exact equality */
2883
+ readonly contextDomain?: Record<string, string>;
2884
+ /** Any additional information attached to the axis that does not affect its
2885
+ * identifier */
2886
+ readonly annotations?: Record<string, string>;
2887
+ /**
2888
+ * Parent axes provide contextual grouping for the axis in question, establishing
2889
+ * a hierarchy where the current axis is dependent on one or more axes for its
2890
+ * full definition and meaning. For instance, in a data structure where each
2891
+ * "container" axis may contain multiple "item" axes, the `item` axis would
2892
+ * list the index of the `container` axis in this field to denote its dependency.
2893
+ *
2894
+ * This means that the identity or significance of the `item` axis is only
2895
+ * interpretable when combined with its parent `container` axis. An `item` axis
2896
+ * index by itself may be non-unique and only gains uniqueness within the context
2897
+ * of its parent `container`. Therefore, the `parentAxes` field is essential for
2898
+ * mapping these relationships and ensuring data coherence across nested or
2899
+ * multi-level data models.
2900
+ *
2901
+ * A list of zero-based indices of parent axes in the overall axes specification
2902
+ * from the column spec. Each index corresponds to the position of a parent axis
2903
+ * in the list that defines the structure of the data model.
2904
+ */
2905
+ readonly parentAxes?: number[];
2906
+ };
2907
+ /** Parents are specs, not indexes; normalized axis can be used considering its parents independently from column */
2908
+ /** Common type representing spec for all the axes in a column */
2909
+ type AxesSpec = AxisSpec[];
2910
+ /**
2911
+ * Full column specification including all axes specs and specs of the column
2912
+ * itself.
2913
+ *
2914
+ * A PColumn in its essence represents a mapping from a fixed size, explicitly
2915
+ * typed tuple to an explicitly typed value.
2916
+ *
2917
+ * (axis1Value1, axis2Value1, ...) -> columnValue
2918
+ *
2919
+ * Each element in tuple correspond to the axis having the same index in axesSpec.
2920
+ */
2921
+ type PUniversalColumnSpec = PObjectSpec & {
2922
+ /** Defines specific type of BObject, the most generic type of unit of
2923
+ * information in Platforma Project. */
2924
+ readonly kind: "PColumn"; /** Type of column values */
2925
+ readonly valueType: string; /** Column name */
2926
+ readonly name: string;
2927
+ /** Adds auxiliary information to the axis name, type and parents to form a
2928
+ * unique identifier */
2929
+ readonly domain?: Record<string, string>;
2930
+ /** Context domain provides additional column identity that is matched
2931
+ * by kinship rules (subset/superset/overlap) rather than exact equality */
2932
+ readonly contextDomain?: Record<string, string>;
2933
+ /** Any additional information attached to the column that does not affect its
2934
+ * identifier */
2935
+ readonly annotations?: Record<string, string>; /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */
2936
+ readonly parentAxes?: number[]; /** Axes specifications */
2937
+ readonly axesSpec: AxesSpec;
2938
+ };
2939
+ /**
2940
+ * Specification of a data column.
2941
+ *
2942
+ * Data column is a specialized type of PColumn that stores only simple values (strings and numbers)
2943
+ * addressed by multiple keys. This is in contrast to other PColumn variants that can store more complex
2944
+ * values like files or other abstract data types. Data columns are optimized for storing and processing
2945
+ * basic tabular data.
2946
+ */
2947
+ type PDataColumnSpec = PUniversalColumnSpec & {
2948
+ /** Type of column values */readonly valueType: ValueType;
2949
+ };
2950
+ type PColumnSpec = PDataColumnSpec;
2951
+ /** Unique PColumnSpec identifier */
2952
+ interface PColumn<Data> extends PObject<Data> {
2953
+ /** PColumn spec, allowing it to be found among other PObjects */
2954
+ readonly spec: PColumnSpec;
2955
+ }
2956
+ /** Columns in a PFrame also have internal identifier, this object represents
2957
+ * combination of specs and such id */
2958
+ interface PColumnIdAndSpec {
2959
+ /** Internal column id within the PFrame */
2960
+ readonly columnId: PObjectId;
2961
+ /** Column spec */
2962
+ readonly spec: PColumnSpec;
2963
+ }
2964
+ /** Get column id and spec from a column */
2965
+ interface AxisId {
2966
+ /** Type of the axis or column value. For an axis should not use non-key
2967
+ * types like float or double. */
2968
+ readonly type: AxisValueType;
2969
+ /** Name of the axis or column */
2970
+ readonly name: string;
2971
+ /** Adds auxiliary information to the axis or column name and type to form a
2972
+ * unique identifier */
2973
+ readonly domain?: Record<string, string>;
2974
+ /** Context domain provides additional axis identity that is matched
2975
+ * by kinship rules (subset/superset/overlap) rather than exact equality */
2976
+ readonly contextDomain?: Record<string, string>;
2977
+ }
2978
+ /** Array of axis ids */
2979
+ type AxesId = AxisId[];
2980
+ /** Extracts axis ids from axis spec */
2981
+ //#endregion
2982
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/query/query_data.d.ts
2983
+ //#region src/drivers/pframe/query/query_data.d.ts
2984
+ /**
2985
+ * Column identifier with type specification.
2986
+ *
2987
+ * Pairs a column ID with its full type specification (axes and column types).
2988
+ * Used in data layer to carry type information alongside column references.
2989
+ */
2990
+ type ColumnIdAndTypeSpec = {
2991
+ /** Unique identifier of the column */id: PObjectId; /** Type specification defining the axes and the single column value type */
2992
+ spec: ColumnTypeSpec;
2993
+ };
2994
+ /**
2995
+ * Join entry for data layer queries.
2996
+ *
2997
+ * Extends the base join entry with axes mapping information.
2998
+ * The mapping specifies how axes from this entry align with the joined result.
2999
+ *
3000
+ * @example
3001
+ * // Join entry with axes mapping [0, 2] means:
3002
+ * // - This entry's axis 0 maps to result axis 0
3003
+ * // - This entry's axis 1 maps to result axis 2
3004
+ * { entry: queryData, axesMapping: [0, 2] }
3005
+ */
3006
+ interface DataQueryJoinEntry extends QueryJoinEntry<DataQuery> {
3007
+ /** Maps this entry's axes to the result axes by index */
3008
+ axesMapping: number[];
3009
+ }
3010
+ /** @see QueryColumn */
3011
+ type DataQueryColumn = QueryColumn;
3012
+ /** @see QueryInlineColumn */
3013
+ type DataQueryInlineColumn = QueryInlineColumn<ColumnIdAndTypeSpec>;
3014
+ /** @see QuerySparseToDenseColumn */
3015
+ type DataQuerySparseToDenseColumn = QuerySparseToDenseColumn<PObjectId, number, ColumnIdAndTypeSpec>;
3016
+ /** @see QuerySymmetricJoin */
3017
+ type DataQuerySymmetricJoin = QuerySymmetricJoin<DataQueryJoinEntry>;
3018
+ /** @see QueryOuterJoin */
3019
+ type DataQueryOuterJoin = QueryOuterJoin<DataQueryJoinEntry>;
3020
+ /**
3021
+ * Linker side of a data-layer linker-join.
3022
+ *
3023
+ * Carries the linker column id along with integration-derived artifacts needed
3024
+ * for execution:
3025
+ * - `axesMapping` — how the linker's axes map into the joined result
3026
+ * - `oneSideAxesIndices` — which axis indices in the joined result to project out
3027
+ */
3028
+ type DataQueryLinkerJoinLinker = {
3029
+ /** Linker column reference. */column: PObjectId; /** Linker's axes mapped into the joined result. */
3030
+ axesMapping: number[]; /** Axis indices (in the joined result) to project out — the linker's one-side axes. */
3031
+ oneSideAxesIndices: number[];
3032
+ };
3033
+ /** @see QueryLinkerJoin */
3034
+ type DataQueryLinkerJoin = QueryLinkerJoin<DataQueryLinkerJoinLinker, DataQueryJoinEntry>;
3035
+ /** @see QuerySliceAxes */
3036
+ type DataQuerySliceAxes = QuerySliceAxes<DataQuery, number>;
3037
+ /** @see QuerySort */
3038
+ type DataQuerySort = QuerySort<DataQuery, DataQueryExpression>;
3039
+ /** @see QueryFilter */
3040
+ type DataQueryFilter = QueryFilter<DataQuery, DataQueryBooleanExpression>;
3041
+ /** @see QueryTransformColumns */
3042
+ type DataQueryTransformColumns = QueryTransformColumns<DataQuery, DataQueryExpression, ColumnIdAndTypeSpec>;
3043
+ /**
3044
+ * Union of all data layer query types.
3045
+ *
3046
+ * The data layer operates with numeric indices for axes and columns,
3047
+ * making it suitable for runtime query execution and optimization.
3048
+ *
3049
+ * Includes:
3050
+ * - Leaf nodes: column, inlineColumn, sparseToDenseColumn
3051
+ * - Join operations: innerJoin, fullJoin, outerJoin, linkerJoin
3052
+ * - Transformations: sliceAxes, sort, filter, transformColumns
3053
+ */
3054
+ type DataQuery = DataQueryColumn | DataQueryInlineColumn | DataQuerySparseToDenseColumn | DataQuerySymmetricJoin | DataQueryOuterJoin | DataQueryLinkerJoin | DataQuerySliceAxes | DataQuerySort | DataQueryFilter | DataQueryTransformColumns;
3055
+ /** @see ExprAxisRef */
3056
+ type DataExprAxisRef = ExprAxisRef<number>;
3057
+ /** @see ExprColumnRef */
3058
+ type DataExprColumnRef = ExprColumnRef<number>;
3059
+ type DataQueryExpression = DataExprColumnRef | DataExprAxisRef | ExprConstant | ExprNumericBinary<DataQueryExpression> | ExprNumericComparison<DataQueryExpression> | ExprNumericUnary<DataQueryExpression> | ExprStringEquals<DataQueryExpression> | ExprStringContains<DataQueryExpression> | ExprStringRegex<DataQueryExpression> | ExprStringContainsFuzzy<DataQueryExpression> | ExprIsNull<DataQueryExpression> | ExprFillNull<DataQueryExpression> | ExprLogicalUnary<DataQueryExpression> | ExprLogicalVariadic<DataQueryExpression> | ExprIsIn<DataQueryExpression, string> | ExprIsIn<DataQueryExpression, number> | ExprCast<DataQueryExpression> | ExprConditional<DataQueryExpression> | ExprRanking<DataQueryExpression, number, number>;
3060
+ type DataQueryBooleanExpression = InferBooleanExpressionUnion<DataQueryExpression>; //#endregion
3061
+ //#endregion
3062
+ //#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.2/node_modules/@milaboratories/helpers/dist/types/brand.d.ts
3063
+ //#region src/types/brand.d.ts
3064
+ declare const __brand: unique symbol;
3065
+ type Branded<T, B> = T & {
3066
+ readonly [__brand]: B;
3067
+ };
3068
+ //#endregion
3069
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec_driver.d.ts
3070
+ //#region src/drivers/pframe/spec_driver.d.ts
3071
+ /** Matches a string value either exactly or by regex pattern */
3072
+ type StringMatcher = {
3073
+ type: "exact";
3074
+ value: string;
3075
+ } | {
3076
+ type: "regex";
3077
+ value: string;
3078
+ };
3079
+ /** Map of key to array of string matchers (OR-ed per key, AND-ed across keys) */
3080
+ type MatcherMap = Record<string, StringMatcher[]>;
3081
+ /** Selector for matching axes by various criteria */
3082
+ interface MultiAxisSelector {
3083
+ /** Match any of the axis types listed here */
3084
+ readonly type?: AxisValueType[];
3085
+ /** Match any of the axis names listed here */
3086
+ readonly name?: StringMatcher[];
3087
+ /** Match requires all the domains listed here */
3088
+ readonly domain?: MatcherMap;
3089
+ /** Match requires all the context domains listed here */
3090
+ readonly contextDomain?: MatcherMap;
3091
+ /** Match requires all the annotations listed here */
3092
+ readonly annotations?: MatcherMap;
3093
+ }
3094
+ /** Column selector for discover columns request, matching columns by various criteria.
3095
+ * Multiple selectors are OR-ed: a column matches if it satisfies any selector. */
3096
+ interface MultiColumnSelector {
3097
+ /** Match any of the value types listed here */
3098
+ readonly type?: ColumnValueType[];
3099
+ /** Match any of the names listed here */
3100
+ readonly name?: StringMatcher[];
3101
+ /** Match requires all the domains listed here */
3102
+ readonly domain?: MatcherMap;
3103
+ /** Match requires all the context domains listed here */
3104
+ readonly contextDomain?: MatcherMap;
3105
+ /** Match requires all the annotations listed here */
3106
+ readonly annotations?: MatcherMap;
3107
+ /** Match any of the axis selectors listed here */
3108
+ readonly axes?: MultiAxisSelector[];
3109
+ /** When true (default), allows matching if only a subset of axes match */
3110
+ readonly partialAxesMatch?: boolean;
3111
+ }
3112
+ /** Qualifications needed for both query (already-integrated) columns and the hit column. */
3113
+ interface ColumnAxesWithQualifications {
3114
+ /** Already integrated (query) columns with their qualifications. */
3115
+ axesSpec: AxisSpec[];
3116
+ /** Qualifications for each already integrated (query) column. */
3117
+ qualifications: AxisQualification[];
3118
+ }
3119
+ /** Fine-grained constraints controlling axes matching and qualification behavior */
3120
+ interface DiscoverColumnsConstraints {
3121
+ /** Allow source (query) axes that have no match in the hit column */
3122
+ allowFloatingSourceAxes: boolean;
3123
+ /** Allow hit column axes that have no match in the source (query) */
3124
+ allowFloatingHitAxes: boolean;
3125
+ /** Allow source (query) axes to be qualified (contextDomain extended) */
3126
+ allowSourceQualifications: boolean;
3127
+ /** Allow hit column axes to be qualified (contextDomain extended) */
3128
+ allowHitQualifications: boolean;
3129
+ }
3130
+ /** Request for discovering columns compatible with a given axes integration */
3131
+ interface DiscoverColumnsRequest {
3132
+ /** Include columns matching these selectors (OR-ed); empty or omitted matches all columns */
3133
+ includeColumns?: MultiColumnSelector[];
3134
+ /** Exclude columns matching these selectors (OR-ed); applied after include filter */
3135
+ excludeColumns?: MultiColumnSelector[];
3136
+ /** Already integrated axes with qualifications */
3137
+ axes: ColumnAxesWithQualifications[];
3138
+ /** Maximum number of hops allowed between provided axes integration and returned hits (0 = direct only) */
3139
+ maxHops?: number;
3140
+ /** Constraints controlling axes matching and qualification behavior */
3141
+ constraints: DiscoverColumnsConstraints;
3142
+ }
3143
+ /** Linker step: traversal through a linker column */
3144
+ interface DiscoverColumnsLinkerStep {
3145
+ type: "linker";
3146
+ /** The linker column traversed in this step */
3147
+ linker: PColumnIdAndSpec;
3148
+ }
3149
+ /**
3150
+ * Filter step: intersects the current subquery with a filter column on shared
3151
+ * axes. Filter columns carry `pl7.app/isSubset: "true"` with axes ⊆ dataset
3152
+ * axes, so the inner-join narrows the key space to rows where the filter is
3153
+ * present.
3154
+ */
3155
+ interface DiscoverColumnsFilterStep {
3156
+ type: "filter";
3157
+ /** The filter column applied in this step */
3158
+ filter: PColumnIdAndSpec;
3159
+ }
3160
+ /** A step traversed during path-based column discovery. Discriminated by `type`. */
3161
+ type DiscoverColumnsStepInfo = DiscoverColumnsLinkerStep | DiscoverColumnsFilterStep;
3162
+ /**
3163
+ * Input to `buildQuery`: a terminal column plus an ordered
3164
+ * path of wrapping steps (linker hops, filter joins). Produces a
3165
+ * {@link SpecQueryJoinEntry} ready to be plugged into an
3166
+ * `innerJoin`/`fullJoin`/`outerJoin` entry list.
3167
+ *
3168
+ * Path ordering: `path[0]` is outermost (first applied), `path[N-1]` is
3169
+ * closest to `column`. Omit or pass `[]` for a direct column with no
3170
+ * wrapping.
3171
+ *
3172
+ * Columns are referenced by id — specs are resolved later at
3173
+ * `evaluateQuery` against the registered specs of the PFrame, so the
3174
+ * caller cannot disagree with the frame about spec content.
3175
+ *
3176
+ * Qualifications annotate the resulting outermost entry; they do not
3177
+ * propagate into the inner query.
3178
+ */
3179
+ type BuildQueryInput = {
3180
+ /** Shape version marker — bumped only on breaking structural changes. */readonly version: "v1"; /** Terminal column id — the column actually returning data. */
3181
+ readonly column: PObjectId; /** Ordered path from source integration to `column`. Outermost first. */
3182
+ readonly path?: DiscoverColumnsStepInfo[]; /** Axis qualifications attached to the resulting join entry. */
3183
+ readonly qualifications?: AxisQualification[];
3184
+ };
3185
+ /** Qualifications info for a discover columns response mapping variant */
3186
+ interface DiscoverColumnsResponseQualifications {
3187
+ /** Qualifications for each query (already-integrated) column set */
3188
+ forQueries: AxisQualification[][];
3189
+ /** Qualifications for the hit column */
3190
+ forHit: AxisQualification[];
3191
+ }
3192
+ /** A single mapping variant describing how a hit column can be integrated */
3193
+ interface DiscoverColumnsMappingVariant {
3194
+ /** Full qualifications needed for integration */
3195
+ qualifications: DiscoverColumnsResponseQualifications;
3196
+ /** Distinctive (minimal) qualifications needed for integration */
3197
+ distinctiveQualifications: DiscoverColumnsResponseQualifications;
3198
+ }
3199
+ /** A single hit in the discover columns response */
3200
+ interface DiscoverColumnsResponseHit {
3201
+ /** The column that was found compatible */
3202
+ hit: PColumnIdAndSpec;
3203
+ /** Possible ways to integrate this column with the existing set */
3204
+ mappingVariants: DiscoverColumnsMappingVariant[];
3205
+ /** Linker steps traversed to reach this hit; empty for direct matches */
3206
+ path: DiscoverColumnsStepInfo[];
3207
+ }
3208
+ /** Response from discover columns */
3209
+ interface DiscoverColumnsResponse {
3210
+ /** Columns that could be integrated and possible ways to integrate them */
3211
+ hits: DiscoverColumnsResponseHit[];
3212
+ }
3213
+ /** Request for deleting an entry from a given axes integration */
3214
+ interface DeleteColumnRequest {
3215
+ /** Already integrated axes with qualifications */
3216
+ axes: ColumnAxesWithQualifications[];
3217
+ /** Zero based index of the entry to be deleted */
3218
+ delete: number;
3219
+ }
3220
+ /** Response from delete column */
3221
+ interface DeleteColumnResponse {
3222
+ axes: ColumnAxesWithQualifications[];
3223
+ }
3224
+ /** Response from evaluating a query against a PFrame. */
3225
+ type EvaluateQueryResponse = {
3226
+ /**
3227
+ * The table specification describing the structure of the query result,
3228
+ * including all axes and columns that will be present in the output.
3229
+ */
3230
+ tableSpec: PTableColumnSpec[];
3231
+ /**
3232
+ * The data layer query representation with numeric indices,
3233
+ * suitable for execution by the data processing engine.
3234
+ */
3235
+ dataQuery: DataQuery;
3236
+ };
3237
+ /** Handle to a spec-only PFrame (no data, synchronous operations). */
3238
+ type SpecFrameHandle = Branded<string, "SpecFrameHandle">;
3239
+ /**
3240
+ * Synchronous driver for spec-level PFrame operations.
3241
+ *
3242
+ * Unlike the async PFrameDriver (which works with data), this driver
3243
+ * operates on column specifications only. All methods are synchronous
3244
+ * because the underlying WASM PFrame computes results immediately.
3245
+ */
3246
+ interface PFrameSpecDriver {
3247
+ /** Create a spec-only PFrame from column specs. Returns a pool entry with handle and unref. */
3248
+ createSpecFrame(specs: Record<string, PColumnSpec>): PoolEntry<SpecFrameHandle>;
3249
+ /** List all columns currently registered in the frame. */
3250
+ listColumns(handle: SpecFrameHandle): PColumnIdAndSpec[];
3251
+ /** Discover columns compatible with given axes integration. */
3252
+ discoverColumns(handle: SpecFrameHandle, request: DiscoverColumnsRequest): DiscoverColumnsResponse;
3253
+ /** Delete an entry from a given axes integration */
3254
+ deleteColumn(handle: SpecFrameHandle, request: DeleteColumnRequest): DeleteColumnResponse;
3255
+ /** Evaluates a query specification against this PFrame */
3256
+ evaluateQuery(handle: SpecFrameHandle, request: SpecQuery): EvaluateQueryResponse;
3257
+ /**
3258
+ * Assembles a {@link SpecQueryJoinEntry} from a terminal column plus an
3259
+ * ordered path of wrapping steps (linker hops, filter joins).
3260
+ *
3261
+ * Pure over its input — no frame handle is needed. Column ids are resolved
3262
+ * later at {@link evaluateQuery} against the registered specs.
3263
+ */
3264
+ buildQuery(input: BuildQueryInput): SpecQueryJoinEntry;
3265
+ /** Expand index-based parentAxes in AxesSpec to resolved AxisId parents in AxesId. */
3266
+ expandAxes(spec: AxesSpec): AxesId;
3267
+ /** Collapse resolved AxisId parents back to index-based parentAxes in AxesSpec. */
3268
+ collapseAxes(ids: AxesId): AxesSpec;
3269
+ /** Find the index of an axis matching the given selector. Returns -1 if not found. */
3270
+ findAxis(spec: AxesSpec, selector: SingleAxisSelector): number;
3271
+ /** Find the flat index of a table column matching the given selector. Returns -1 if not found. */
3272
+ findTableColumn(tableSpec: PTableColumnSpec[], selector: PTableColumnId): number;
3273
+ /**
3274
+ * Upgrades selector-based legacy record filters into index-based data-layer
3275
+ * boolean expressions, resolved against the provided unified table spec
3276
+ * (axes first, then columns).
3277
+ */
3278
+ rewriteLegacyFilters(request: {
3279
+ tableSpec: PTableColumnSpec[];
3280
+ filters: PTableRecordFilter[];
3281
+ }): DataQueryBooleanExpression[];
3282
+ } //#endregion
3283
+ //#endregion
3284
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/selectors.d.ts
3285
+ /** Single axis selector */
3286
+ interface SingleAxisSelector {
3287
+ /** Axis name (required) */
3288
+ name: string;
3289
+ /** Axis type (optional) */
3290
+ type?: AxisValueType;
3291
+ /** Domain requirements (optional) */
3292
+ domain?: Domain;
3293
+ /** Parent axes requirements (optional) */
3294
+ parentAxes?: SingleAxisSelector[];
3295
+ }
3296
+ /** Qualification applied to a single axis to make it compatible during integration. */
3297
+ interface AxisQualification {
3298
+ /** Axis selector identifying which axis is qualified. */
3299
+ readonly axis: SingleAxisSelector;
3300
+ /** Additional context domain entries applied to the axis. */
3301
+ readonly contextDomain: Record<string, string>;
3302
+ }
3303
+ /**
3304
+ * Reference to an axis by its numerical index within the anchor column's axes array
3305
+ * Format: [anchorId, axisIndex]
3306
+ */
3307
+ //#endregion
3308
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/ids.d.ts
3309
+ /**
3310
+ * Canonically serialized {@link UniversalPColumnId}.
3311
+ */
3312
+ type SUniversalPColumnId = Branded$1<PObjectId, "SUniversalPColumnId", "__pl_model_brand_2__">;
3313
+ /**
3314
+ * Canonically serializes a {@link UniversalPColumnId} to a string.
3315
+ * @param id - The column identifier to serialize
3316
+ * @returns The canonically serialized string
3317
+ */
3318
+ //#endregion
3319
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/interfaces.d.ts
3320
+ //#region src/drivers/interfaces.d.ts
3321
+ /**
3322
+ * Intended to match web.Blob, node.Blob, node-fetch.Blob, etc.
3323
+ */
3324
+ interface BlobLike {
3325
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
3326
+ readonly size: number;
3327
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
3328
+ readonly type: string;
3329
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
3330
+ text(): Promise<string>;
3331
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
3332
+ slice(start?: number, end?: number): BlobLike;
3333
+ }
3334
+ /**
3335
+ * Intended to match web.File, node.File, node-fetch.File, etc.
3336
+ */
3337
+ interface FileLike extends BlobLike {
3338
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
3339
+ readonly lastModified: number;
3340
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
3341
+ readonly name: string;
3342
+ } //#endregion
3343
+ //#endregion
3344
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.d.ts
3345
+ //#region src/drivers/blob.d.ts
3346
+ /** Handle of locally downloaded blob. This handle is issued only after the
3347
+ * blob's content is downloaded locally, and ready for quick access. */
3348
+ type LocalBlobHandle = Branded$1<string, "LocalBlobHandle">;
3349
+ /** Handle of remote blob. This handle is issued as soon as the data becomes
3350
+ * available on the remote server. */
3351
+ type RemoteBlobHandle = Branded$1<string, "RemoteBlobHandle">;
3352
+ /** Being configured inside the output structure provides information about
3353
+ * blob's content and means to retrieve it when needed. */
3354
+ /** Range in bytes, from should be less than to. */
3355
+ declare const RangeBytes: ZodObject<{
3356
+ /** Included left border. */from: ZodNumber; /** Excluded right border. */
3357
+ to: ZodNumber;
3358
+ }, "strip", ZodTypeAny, {
3359
+ from: number;
3360
+ to: number;
3361
+ }, {
3362
+ from: number;
3363
+ to: number;
3364
+ }>;
3365
+ type RangeBytes = TypeOf<typeof RangeBytes>;
3366
+ /** Defines API of blob driver as it is seen from the block UI code. */
3367
+ interface BlobDriver {
3368
+ /**
3369
+ * Given the blob handle returns its content.
3370
+ * Depending on the handle type, content will be served from locally downloaded file,
3371
+ * or directly from remote platforma storage.
3372
+ */
3373
+ getContent(handle: LocalBlobHandle | RemoteBlobHandle, range?: RangeBytes): Promise<Uint8Array>;
3374
+ }
3375
+ /**
3376
+ * Operational metrics of the blob download driver.
3377
+ */
3378
+ //#endregion
3379
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/log.d.ts
3380
+ //#region src/drivers/log.d.ts
3381
+ /** Prefix constants — single source of truth for handle format. */
3382
+ declare const LIVE_LOG_PREFIX = "log+live://log/";
3383
+ declare const READY_LOG_PREFIX = "log+ready://log/";
3384
+ /** Handle of the live logs of a program.
3385
+ * The resource that represents a log can be deleted,
3386
+ * in this case the handle should be refreshed. */
3387
+ type LiveLogHandle = Branded$1<`${typeof LIVE_LOG_PREFIX}${string}`, "LiveLogHandle">;
3388
+ /** Handle of the ready logs of a program. */
3389
+ type ReadyLogHandle = Branded$1<`${typeof READY_LOG_PREFIX}${string}`, "ReadyLogHandle">;
3390
+ /** Handle of logs. This handle should be passed
3391
+ * to the driver for retrieving logs. */
3392
+ type AnyLogHandle = LiveLogHandle | ReadyLogHandle;
3393
+ /** Type guard to check if a value is any kind of log handle. */
3394
+ /** Driver to retrieve logs given log handle */
3395
+ interface LogsDriver {
3396
+ lastLines(/** A handle that was issued previously. */
3397
+
3398
+ handle: AnyLogHandle, /** Allows client to limit total data sent from server. */
3399
+
3400
+ lineCount: number,
3401
+ /** Makes streamer to perform seek operation to given offset before sending the contents.
3402
+ * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.
3403
+ * If undefined, then starts from the end. */
3404
+
3405
+ offsetBytes?: number,
3406
+ /** Is substring for line search pattern.
3407
+ * This option makes controller to send to the client only lines, that
3408
+ * have given substring. */
3409
+
3410
+ searchStr?: string): Promise<StreamingApiResponse>;
3411
+ readText(/** A handle that was issued previously. */
3412
+
3413
+ handle: AnyLogHandle, /** Allows client to limit total data sent from server. */
3414
+
3415
+ lineCount: number,
3416
+ /** Makes streamer to perform seek operation to given offset before sending the contents.
3417
+ * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.
3418
+ * If undefined of 0, then starts from the beginning. */
3419
+
3420
+ offsetBytes?: number,
3421
+ /** Is substring for line search pattern.
3422
+ * This option makes controller to send to the client only lines, that
3423
+ * have given substring. */
3424
+
3425
+ searchStr?: string): Promise<StreamingApiResponse>;
3426
+ }
3427
+ /** Response of the driver.
3428
+ * The caller should give a handle to retrieve it.
3429
+ * It can be OK or outdated, in which case the handle
3430
+ * should be issued again. */
3431
+ type StreamingApiResponse = StreamingApiResponseOk | StreamingApiResponseHandleOutdated;
3432
+ type StreamingApiResponseOk = {
3433
+ /** The handle don't have to be updated,
3434
+ * the response is OK. */
3435
+ shouldUpdateHandle: false; /** Whether the log can still grow or it's in a final state. */
3436
+ live: boolean; /** Data of the response, in bytes. */
3437
+ data: Uint8Array; /** Current size of the file. It can grow if it's still live. */
3438
+ size: number; /** Offset in bytes from the beginning of a file. */
3439
+ newOffset: number;
3440
+ };
3441
+ /** The handle should be issued again, this one is done. */
3442
+ type StreamingApiResponseHandleOutdated = {
3443
+ shouldUpdateHandle: true;
3444
+ };
3445
+ //#endregion
3446
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/column_filter.d.ts
3447
+ //#region src/drivers/pframe/column_filter.d.ts
3448
+ /** Allows to search multiple columns in different contexts. */
3449
+ interface ColumnFilter {
3450
+ /** Match any of the types listed here. If undefined, will be ignored during
3451
+ * matching. */
3452
+ readonly type?: ValueType[];
3453
+ /** Match any of the names listed here. If undefined, will be ignored during
3454
+ * matching. */
3455
+ readonly name?: string[];
3456
+ /** Match requires all the domains listed here to have corresponding values. */
3457
+ readonly domainValue?: Record<string, string>;
3458
+ /** Match requires all the annotations listed here to have corresponding values. */
3459
+ readonly annotationValue?: Record<string, string>;
3460
+ /** Match requires all the annotations listed here to match corresponding regex
3461
+ * pattern. */
3462
+ readonly annotationPattern?: Record<string, string>;
3463
+ } //#endregion
3464
+ //#endregion
3465
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/find_columns.d.ts
3466
+ //#region src/drivers/pframe/find_columns.d.ts
3467
+ /**
3468
+ * Request to search among existing columns in the PFrame. Two filtering
3469
+ * criteria can be used: (1) column ашдеук, to search for columns with
3470
+ * specific properties like name, annotations and domains, and (2) being
3471
+ * compatible with the given list of axis ids.
3472
+ * */
3473
+ interface FindColumnsRequest {
3474
+ /** Basic column filter */
3475
+ readonly columnFilter: ColumnFilter;
3476
+ /** Will only search for columns compatible with these list of axis ids */
3477
+ readonly compatibleWith: AxisId[];
3478
+ /**
3479
+ * Defines what level of compatibility with provided list of axis ids is required.
3480
+ *
3481
+ * If true will search only for such columns which axes completely maps onto the
3482
+ * axes listed in the {@link compatibleWith} list.
3483
+ * */
3484
+ readonly strictlyCompatible: boolean;
3485
+ }
3486
+ /** Response for {@link FindColumnsRequest} */
3487
+ interface FindColumnsResponse {
3488
+ /** Array of column ids found using request criteria. */
3489
+ readonly hits: PColumnIdAndSpec[];
3490
+ } //#endregion
3491
+ //#endregion
3492
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/unique_values.d.ts
3493
+ //#region src/drivers/pframe/unique_values.d.ts
3494
+ /** Calculate set of unique values for a specific axis for the filtered set of records */
3495
+ interface UniqueValuesRequest {
3496
+ /** Target axis id */
3497
+ readonly columnId: PObjectId;
3498
+ /** Target axis id, if not specified calculates unique column values */
3499
+ readonly axis?: AxisId;
3500
+ /** Filters to apply before calculating unique values */
3501
+ readonly filters: PTableRecordFilter[];
3502
+ /** Max number of values to return, if reached response will contain overflow flag */
3503
+ readonly limit: number;
3504
+ }
3505
+ interface UniqueValuesResponse {
3506
+ /** Unique values */
3507
+ readonly values: PTableVector;
3508
+ /** True if limit was reached and response contain non-exhaustive list of values. */
3509
+ readonly overflow: boolean;
3510
+ } //#endregion
3511
+ //#endregion
3512
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/ls.d.ts
3513
+ //#region src/drivers/ls.d.ts
3514
+ type ImportFileHandleUpload = `upload://upload/${string}`;
3515
+ type ImportFileHandleIndex = `index://index/${string}`;
3516
+ type ImportFileHandle = ImportFileHandleUpload | ImportFileHandleIndex;
3517
+ type LocalImportFileHandle = Branded$1<ImportFileHandle, "Local">;
3518
+ /** Results in upload */
3519
+ type StorageHandleLocal = `local://${string}`;
3520
+ /** Results in index */
3521
+ type StorageHandleRemote = `remote://${string}`;
3522
+ type StorageHandle = StorageHandleLocal | StorageHandleRemote;
3523
+ type StorageEntry = {
3524
+ /** Stable machine identifier (e.g. "library", "root", "local"). Used for filtering. */id: string; /** Human-readable display name. */
3525
+ name: string;
3526
+ handle: StorageHandle;
3527
+ initialFullPath: string;
3528
+ };
3529
+ type ListFilesResult = {
3530
+ parent?: string;
3531
+ entries: LsEntry[];
3532
+ };
3533
+ type LsEntry = {
3534
+ type: "dir";
3535
+ name: string;
3536
+ fullPath: string;
3537
+ } | {
3538
+ type: "file";
3539
+ name: string;
3540
+ fullPath: string; /** This handle should be set to args... */
3541
+ handle: ImportFileHandle;
3542
+ };
3543
+ type OpenDialogFilter = {
3544
+ /** Human-readable file type name */readonly name: string; /** File extensions */
3545
+ readonly extensions: string[];
3546
+ };
3547
+ type OpenDialogOps = {
3548
+ /** Open dialog window title */readonly title?: string; /** Custom label for the confirmation button, when left empty the default label will be used. */
3549
+ readonly buttonLabel?: string; /** Limits of file types user can select */
3550
+ readonly filters?: OpenDialogFilter[];
3551
+ };
3552
+ type OpenSingleFileResponse = {
3553
+ /** Contains local file handle, allowing file importing or content reading. If user canceled
3554
+ * the dialog, field will be undefined. */
3555
+ readonly file?: LocalImportFileHandle;
3556
+ };
3557
+ type OpenMultipleFilesResponse = {
3558
+ /** Contains local file handles, allowing file importing or content reading. If user canceled
3559
+ * the dialog, field will be undefined. */
3560
+ readonly files?: LocalImportFileHandle[];
3561
+ };
3562
+ /** Can be used to limit request for local file content to a certain bytes range */
3563
+ interface LsDriver {
3564
+ /** remote and local storages */
3565
+ getStorageList(): Promise<StorageEntry[]>;
3566
+ listFiles(storage: StorageHandle, fullPath: string): Promise<ListFilesResult>;
3567
+ /** Opens system file open dialog allowing to select single file and awaits user action */
3568
+ showOpenSingleFileDialog(ops: OpenDialogOps): Promise<OpenSingleFileResponse>;
3569
+ /** Opens system file open dialog allowing to multiple files and awaits user action */
3570
+ showOpenMultipleFilesDialog(ops: OpenDialogOps): Promise<OpenMultipleFilesResponse>;
3571
+ /** Given a handle to a local file, allows to get file size */
3572
+ getLocalFileSize(file: LocalImportFileHandle): Promise<number>;
3573
+ /** Given a handle to a local file, allows to get its content */
3574
+ getLocalFileContent(file: LocalImportFileHandle, range?: TableRange): Promise<Uint8Array>;
3575
+ /**
3576
+ * Resolves browser's File object into platforma's import file handle.
3577
+ *
3578
+ * This method is useful among other things for implementation of UI
3579
+ * components, that handle file Drag&Drop.
3580
+ * */
3581
+ fileToImportHandle(file: FileLike): Promise<ImportFileHandle>;
3582
+ /** Saves currently opened block webview as a PDF. */
3583
+ exportToPdf?(): Promise<void>;
3584
+ }
3585
+ /** Gets a file path from an import handle. */
3586
+ //#endregion
3587
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/pframe.d.ts
3588
+ /** Information required to instantiate a PFrame. */
3589
+ type PFrameDef<Col> = Col[]; //#endregion
3590
+ //#endregion
3591
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/driver.d.ts
3592
+ //#region src/drivers/pframe/driver.d.ts
3593
+ /** PFrame handle */
3594
+ type PFrameHandle = Branded$1<string, "PFrame">;
3595
+ /** PFrame handle */
3596
+ type PTableHandle = Branded$1<string, "PTable">;
3597
+ /** Model-side PFrame service — creates frames/tables from column definitions. */
3598
+ interface PFrameModelDriver<Col = PColumn<string | PColumnValues | DataInfo<string>>> {
3599
+ createPFrame(def: PFrameDef<Col>): PFrameHandle;
3600
+ createPTable(def: PTableDef<Col>): PTableHandle;
3601
+ createPTableV2(def: PTableDefV2<Col>): PTableHandle;
3602
+ }
3603
+ /** Allows to access main data layer features of platforma */
3604
+ interface PFrameDriver {
3605
+ /**
3606
+ * Finds columns given filtering criteria on column name, annotations etc.
3607
+ * and a set of axes ids to find only columns with compatible specs.
3608
+ * */
3609
+ findColumns(handle: PFrameHandle, request: FindColumnsRequest): Promise<FindColumnsResponse>;
3610
+ /** Retrieve single column spec */
3611
+ getColumnSpec(handle: PFrameHandle, columnId: PObjectId): Promise<PColumnSpec | null>;
3612
+ /** Retrieve information about all columns currently added to the PFrame */
3613
+ listColumns(handle: PFrameHandle): Promise<PColumnIdAndSpec[]>;
3614
+ /** Calculates data for the table and returns complete data representation of it */
3615
+ calculateTableData(handle: PFrameHandle, request: CalculateTableDataRequest<PObjectId>, range?: TableRange): Promise<CalculateTableDataResponse>;
3616
+ /** Calculate set of unique values for a specific axis for the filtered set of records */
3617
+ getUniqueValues(handle: PFrameHandle, request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
3618
+ /** Unified table shape */
3619
+ getShape(handle: PTableHandle): Promise<PTableShape>;
3620
+ /**
3621
+ * Returns ordered array of table axes specs (primary key "columns" in SQL
3622
+ * terms) and data column specs (regular "columns" in SQL terms).
3623
+ *
3624
+ * Data for a specific table column can be retrieved using unified indexing
3625
+ * corresponding to elements in this array.
3626
+ *
3627
+ * Axes are always listed first.
3628
+ * */
3629
+ getSpec(handle: PTableHandle): Promise<PTableColumnSpec[]>;
3630
+ /**
3631
+ * Retrieve the data from the table. To retrieve only data required, it can be
3632
+ * sliced both horizontally ({@link columnIndices}) and vertically
3633
+ * ({@link range}).
3634
+ *
3635
+ * @param columnIndices unified indices of columns to be retrieved
3636
+ * @param range optionally limit the range of records to retrieve
3637
+ * */
3638
+ getData(handle: PTableHandle, columnIndices: number[], range?: TableRange): Promise<PTableVector[]>;
3639
+ /**
3640
+ * Stream the table to a file at the given path. Caller is responsible
3641
+ * for producing the destination path (e.g. via the `Dialog` service).
3642
+ */
3643
+ writePTableToFs(handle: PTableHandle, options: WritePTableToFsOptions): Promise<WritePTableToFsResult>;
3644
+ /**
3645
+ * Export the table to a file. The output format is selected from the file
3646
+ * extension of `options.path` (`csv`, `tsv`, `parquet`, or `xlsx`).
3647
+ *
3648
+ * `options.columnIndices` selects the columns to export (output order). Column
3649
+ * headers are derived on the driver side from each field's label annotation
3650
+ * (falling back to its spec name), so the caller supplies only the path and
3651
+ * the columns.
3652
+ *
3653
+ * For `xlsx` the driver rejects tables whose row count would exceed the
3654
+ * 1,000,000-row per-sheet limit (below Excel's hard cap of 1,048,576).
3655
+ */
3656
+ exportPTable(handle: PTableHandle, options: ExportPTableOptions): Promise<void>;
3657
+ } //#endregion
3658
+ //#endregion
3659
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/services/service_types.d.ts
3660
+ //#region src/services/service_types.d.ts
3661
+ type ServiceTypesLike<Model = unknown, Ui = unknown, Kind extends ServiceType = ServiceType> = {
3662
+ readonly __types?: {
3663
+ model: Model;
3664
+ ui: Ui;
3665
+ kind: Kind;
3666
+ };
3667
+ };
3668
+ type InferServiceUi<S extends ServiceTypesLike> = S extends ServiceTypesLike<unknown, infer U, ServiceType> ? U : unknown;
3669
+ type ServiceName<S extends ServiceTypesLike = ServiceTypesLike> = Branded$1<string, S>;
3670
+ type ServiceType = "node" | "wasm" | "main";
3671
+ type ServiceBrand<T> = T extends Branded$1<string, infer S extends ServiceTypesLike> ? S : never;
3672
+ /** Contract between any service provider and any service consumer. */
3673
+ interface ServiceDispatch {
3674
+ getServiceNames(): ServiceName[];
3675
+ getServiceMethods(serviceId: ServiceName): string[];
3676
+ callServiceMethod(serviceId: ServiceName, method: string, ...args: unknown[]): unknown;
3677
+ }
3678
+ type TServices = typeof Services;
3679
+ type ExtractServiceName<T> = T extends Branded$1<infer N extends string, any> ? N : never;
3680
+ /** Model-side service interfaces keyed by service name literal. */
3681
+ /** UI-side service interfaces keyed by service name literal. */
3682
+ type UiServices$1 = { [K in keyof TServices as ExtractServiceName<TServices[K]>]: InferServiceUi<ServiceBrand<TServices[K]>> };
3683
+ /** Map from Services keys to their unbranded string name literals. */
3684
+ type ServiceNameLiterals = { [K in keyof TServices]: ExtractServiceName<TServices[K]> };
3685
+ /** Auto-derived requires* feature flags from Services keys. */
3686
+ type ServiceRequireFlags = { [K in keyof TServices as `requires${K & string}`]?: boolean };
3687
+ //#endregion
3688
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/services/service_declarations.d.ts
3689
+ //#region src/services/service_declarations.d.ts
3690
+ declare const Services: {
3691
+ PFrameSpec: Branded$1<"pframeSpec", ServiceTypesLike<PFrameSpecDriver, PFrameSpecDriver, "wasm">>;
3692
+ PFrame: Branded$1<"pframe", ServiceTypesLike<PFrameModelDriver<PColumn<string | PColumnValues | DataInfo<string>>>, PFrameDriver, "node">>;
3693
+ Dialog: Branded$1<"dialog", ServiceTypesLike<Record<string, never>, DialogService, "main">>;
3694
+ }; //#endregion
3695
+ //#endregion
3696
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/flags/block_flags.d.ts
3697
+ /**
3698
+ * Known block flags. Flags are set during model compilation, see `BlockModel.create` for more details and for initial values.
3699
+ */
3700
+ type BlockCodeKnownFeatureFlags = {
3701
+ readonly supportsLazyState?: boolean;
3702
+ readonly supportsPframeQueryRanking?: boolean;
3703
+ readonly requiresModelAPIVersion?: number;
3704
+ readonly requiresUIAPIVersion?: number;
3705
+ readonly requiresCreatePTable?: number;
3706
+ readonly requiresPFramesVersion?: number;
3707
+ } & ServiceRequireFlags;
3708
+ /**
3709
+ * Required PFrames version. Bump this in lockstep with the `@milaboratories/pframes-rs-*`
3710
+ * version in `pnpm-workspace.yaml` so blocks built against the new SDK refuse to load on
3711
+ * older desktop apps.
3712
+ */
3713
+ //#endregion
3714
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/driver_kit.d.ts
3715
+ //#region src/driver_kit.d.ts
3716
+ /** Set of all drivers exposed in UI SDK via the platforma object. */
3717
+ interface DriverKit {
3718
+ /** Driver allowing to retrieve blob data */
3719
+ readonly blobDriver: BlobDriver;
3720
+ /** Driver allowing to dynamically work with logs */
3721
+ readonly logDriver: LogsDriver;
3722
+ /**
3723
+ * Driver allowing to list local and remote files that current user has
3724
+ * access to.
3725
+ *
3726
+ * Along with file listing this driver provides import handles for listed
3727
+ * files, that can be communicated to the workflow via block arguments,
3728
+ * converted into blobs using standard workflow library functions.
3729
+ * */
3730
+ readonly lsDriver: LsDriver;
3731
+ /** Driver allowing to interact with PFrames and PTables */
3732
+ readonly pFrameDriver: PFrameDriver;
3733
+ } //#endregion
3734
+ //#endregion
3735
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/errors.d.ts
3736
+ type ResultOrError<S, F = Error> = {
3737
+ value: S;
3738
+ error?: undefined;
3739
+ } | {
3740
+ error: F;
3741
+ };
3742
+ //#endregion
3743
+ //#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.46.3/node_modules/@milaboratories/pl-model-common/dist/utag.d.ts
3744
+ //#region src/utag.d.ts
3745
+ /** Value returned for changing states supporting reactive listening for changes */
3746
+ interface ValueWithUTag<V> {
3747
+ /** Value snapshot. */
3748
+ readonly value: V;
3749
+ /**
3750
+ * Unique tag for the value snapshot.
3751
+ *
3752
+ * It can be used to synchronously detect if changes happened after current
3753
+ * snapshot was retrieved, or asynchronously await next value snapshot,
3754
+ * generated on underlying data changes.
3755
+ * */
3756
+ readonly uTag: string;
3757
+ }
3758
+ interface ValueWithUTagAndAuthor<V> extends ValueWithUTag<V> {
3759
+ readonly author?: AuthorMarker;
3760
+ } //#endregion
3761
+ //#endregion
3762
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/block_state_patch.d.ts
3763
+ //#region src/block_state_patch.d.ts
3764
+ /** Patch for the structural object */
3765
+ type Patch<K, V> = {
3766
+ /** Field name to patch */readonly key: K; /** New value for the field */
3767
+ readonly value: V;
3768
+ };
3769
+ /** Creates union type of all possible shallow patches for the given structure */
3770
+ type Unionize<T extends Record<string, unknown>> = { [K in keyof T]: Patch<K, T[K]> }[keyof T];
3771
+ /** Patch for the BlockState, pushed by onStateUpdates method in SDK. */
3772
+ type BlockStatePatch<Args = unknown, Outputs extends BlockOutputsBase = BlockOutputsBase, UiState = unknown, Href extends `/${string}` = `/${string}`> = Unionize<BlockState<Args, Outputs, UiState, Href>>; //#endregion
3773
+ //#endregion
3774
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/plugin_handle.d.ts
3775
+ //#region src/plugin_handle.d.ts
3776
+ /**
3777
+ * Phantom-only base type for constraining PluginHandle's type parameter.
3778
+ *
3779
+ * PluginFactory has create() → PluginInstance with function properties, making it invariant
3780
+ * under strictFunctionTypes. PluginFactoryLike exposes only the covariant `__types` phantom,
3781
+ * avoiding the contravariance chain. Handles only need `__types` for type extraction.
3782
+ *
3783
+ * PluginFactory extends PluginFactoryLike, so every concrete factory satisfies this constraint.
3784
+ */
3785
+ interface PluginFactoryLike<Data extends Record<string, unknown> = Record<string, unknown>, Params extends undefined | Record<string, unknown> = undefined | Record<string, unknown>, Outputs extends Record<string, unknown> = Record<string, unknown>, ModelServices = unknown, UiServices = unknown> {
3786
+ readonly __types?: {
3787
+ data: Data;
3788
+ params: Params;
3789
+ outputs: Outputs;
3790
+ modelServices: ModelServices;
3791
+ uiServices: UiServices;
3792
+ };
3793
+ }
3794
+ /** Extract the Data type from a PluginFactoryLike phantom. */
3795
+ /**
3796
+ * Opaque handle for a plugin instance. Runtime value is the plugin instance ID string.
3797
+ * Branded with factory phantom `F` for type-safe data/outputs extraction.
3798
+ * Constrained with PluginFactoryLike (not PluginFactory) to avoid variance issues.
3799
+ */
3800
+ type PluginHandle<F extends PluginFactoryLike = PluginFactoryLike> = Branded<string, F>;
3801
+ /** Construct the output key for a plugin output in the block outputs map. */
3802
+ //#endregion
3803
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/block_storage.d.ts
3804
+ /** Payload for storage mutation operations. SDK defines specific operations. */
3805
+ type MutateStoragePayload<T = unknown> = {
3806
+ operation: "update-block-data";
3807
+ value: T;
3808
+ } | {
3809
+ operation: "update-plugin-data";
3810
+ pluginId: PluginHandle;
3811
+ value: unknown;
3812
+ };
3813
+ /**
3814
+ * Updates the data in BlockStorage (immutable)
3815
+ *
3816
+ * @param storage - The current BlockStorage
3817
+ * @param payload - The update payload with operation and value
3818
+ * @returns A new BlockStorage with updated data
3819
+ */
3820
+ //#endregion
3821
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/bconfig/lambdas.d.ts
3822
+ /** Additional information that may alter lambda rendering procedure. */
3823
+ type ConfigRenderLambdaFlags = {
3824
+ /**
3825
+ * Tells the system that corresponding computable should be created with StableOnlyRetentive rendering mode.
3826
+ * This flag can be overridden by the system.
3827
+ * */
3828
+ retentive?: boolean;
3829
+ /**
3830
+ * Tells the system that resulting computable has important side-effects, thus it's rendering is required even
3831
+ * nobody is actively monitoring rendered values. Like file upload progress, that triggers upload itself.
3832
+ * */
3833
+ isActive?: boolean;
3834
+ /**
3835
+ * If true, result will be wrapped with additional status information,
3836
+ * such as stability status and explicit error
3837
+ */
3838
+ withStatus?: boolean;
3839
+ };
3840
+ /** Creates branded Cfg type */
3841
+ interface ConfigRenderLambda<Return = unknown> extends ConfigRenderLambdaFlags {
3842
+ /** Type marker */
3843
+ __renderLambda: true;
3844
+ /** Phantom property for type inference. Never set at runtime. */
3845
+ __phantomReturn?: Return;
3846
+ /** Reference to a callback registered inside the model code. */
3847
+ handle: string;
3848
+ }
3849
+ type ExtractFunctionHandleReturn<Func extends ConfigRenderLambda> = Func extends ConfigRenderLambda<infer Return> ? Return : never;
3850
+ /** Infers the output type from a TypedConfig or ConfigRenderLambda */
3851
+ /** Maps lambda-only outputs configuration to inferred output types (for V3 blocks) */
3852
+ type InferOutputsFromLambdas<OutputsCfg extends Record<string, ConfigRenderLambda>> = { [Key in keyof OutputsCfg]: OutputWithStatus<ExtractFunctionHandleReturn<OutputsCfg[Key]>> & {
3853
+ __unwrap: OutputsCfg[Key] extends {
3854
+ withStatus: true;
3855
+ } ? false : true;
3856
+ } }; //#endregion
3857
+ //#endregion
3858
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/block_api_v1.d.ts
3859
+ //#region src/block_api_v1.d.ts
3860
+ /** Returned by state subscription methods to be able to cancel the subscription. */
3861
+ type CancelSubscription = () => void;
3862
+ /** Defines methods to read and write current block data. */
3863
+ interface BlockApiV1<Args = unknown, Outputs extends BlockOutputsBase = BlockOutputsBase, UiState = unknown, Href extends `/${string}` = `/${string}`> {
3864
+ /**
3865
+ * Use this method to retrieve block state during UI initialization. Then use
3866
+ * {@link onStateUpdates} method to subscribe for updates.
3867
+ * */
3868
+ loadBlockState(): Promise<BlockState<Args, Outputs, UiState, Href>>;
3869
+ /**
3870
+ * Subscribe to updates of block state.
3871
+ *
3872
+ * This method internally have several ways to limit the rate at which new
3873
+ * states are pushed to the corresponding callback. Among other rate limiting
3874
+ * approaches it guarantees that new state will never be pushed to the
3875
+ * supplied async callback until the previous call returns.
3876
+ *
3877
+ * It is a good idea to develop the callback in such a way that it will wait
3878
+ * until the given state propagates all the way to the DOM. See for example
3879
+ * nextTick() method from Vue framework to achieve this.
3880
+ *
3881
+ * This method will only push args and uiState patches if changes were made
3882
+ * externally, i.e. by another user editing the same block.
3883
+ *
3884
+ * @return function that cancels created subscription
3885
+ * */
3886
+ onStateUpdates(cb: (updates: BlockStatePatch<Args, Outputs, UiState, Href>[]) => Promise<void>): CancelSubscription;
3887
+ /**
3888
+ * Sets block args.
3889
+ *
3890
+ * This method returns when corresponding arguments are safely saved so in
3891
+ * case the window is closed there will be no information losses. This
3892
+ * function under the hood may delay actual persistence of the supplied
3893
+ * arguments.
3894
+ * */
3895
+ setBlockArgs(args: Args): Promise<void>;
3896
+ /**
3897
+ * Sets block ui state.
3898
+ *
3899
+ * This method returns when corresponding arguments are safely saved so in
3900
+ * case the window is closed there will be no information losses. This
3901
+ * function under the hood may delay actual persistence of the supplied
3902
+ * values.
3903
+ * */
3904
+ setBlockUiState(state: UiState): Promise<void>;
3905
+ /**
3906
+ * Sets block args and ui state.
3907
+ *
3908
+ * This method returns when corresponding arguments are safely saved so in
3909
+ * case the window is closed there will be no information losses. This
3910
+ * function under the hood may delay actual persistence of the supplied
3911
+ * values.
3912
+ * */
3913
+ setBlockArgsAndUiState(args: Args, state: UiState): Promise<void>;
3914
+ /**
3915
+ * Sets block navigation state.
3916
+ * */
3917
+ setNavigationState(state: NavigationState<Href>): Promise<void>;
3918
+ } //#endregion
3919
+ //#endregion
3920
+ //#region ../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/module/core.d.ts
3921
+ declare type Operation = AddOperation<any> | RemoveOperation | ReplaceOperation<any> | MoveOperation | CopyOperation | TestOperation<any> | GetOperation<any>;
3922
+ interface BaseOperation {
3923
+ path: string;
3924
+ }
3925
+ interface AddOperation<T> extends BaseOperation {
3926
+ op: 'add';
3927
+ value: T;
3928
+ }
3929
+ interface RemoveOperation extends BaseOperation {
3930
+ op: 'remove';
3931
+ }
3932
+ interface ReplaceOperation<T> extends BaseOperation {
3933
+ op: 'replace';
3934
+ value: T;
3935
+ }
3936
+ interface MoveOperation extends BaseOperation {
3937
+ op: 'move';
3938
+ from: string;
3939
+ }
3940
+ interface CopyOperation extends BaseOperation {
3941
+ op: 'copy';
3942
+ from: string;
3943
+ }
3944
+ interface TestOperation<T> extends BaseOperation {
3945
+ op: 'test';
3946
+ value: T;
3947
+ }
3948
+ interface GetOperation<T> extends BaseOperation {
3949
+ op: '_get';
3950
+ value: T;
3951
+ }
3952
+ //#endregion
3953
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/block_api_v2.d.ts
3954
+ //#region src/block_api_v2.d.ts
3955
+ /** Defines methods to read and write current block data. */
3956
+ interface BlockApiV2<Args = unknown, Outputs extends BlockOutputsBase = BlockOutputsBase, UiState = unknown, Href extends `/${string}` = `/${string}`> {
3957
+ /**
3958
+ * Use this method to retrieve block state during UI initialization. Then use
3959
+ * {@link onStateUpdates} method to subscribe for updates.
3960
+ * */
3961
+ loadBlockState(): Promise<ResultOrError<ValueWithUTag<BlockState<Args, Outputs, UiState, Href>>>>;
3962
+ /**
3963
+ * Get all json patches (rfc6902) that were applied to the block state.
3964
+ * */
3965
+ getPatches(uTag: string): Promise<ResultOrError<ValueWithUTagAndAuthor<Operation[]>>>;
3966
+ /**
3967
+ * Sets block args.
3968
+ *
3969
+ * This method returns when corresponding arguments are safely saved so in
3970
+ * case the window is closed there will be no information losses. This
3971
+ * function under the hood may delay actual persistence of the supplied
3972
+ * arguments.
3973
+ * */
3974
+ setBlockArgs(args: Args, author?: AuthorMarker): Promise<ResultOrError<void>>;
3975
+ /**
3976
+ * Sets block ui state.
3977
+ *
3978
+ * This method returns when corresponding arguments are safely saved so in
3979
+ * case the window is closed there will be no information losses. This
3980
+ * function under the hood may delay actual persistence of the supplied
3981
+ * values.
3982
+ * */
3983
+ setBlockUiState(state: UiState, author?: AuthorMarker): Promise<ResultOrError<void>>;
3984
+ /**
3985
+ * Sets block args and ui state.
3986
+ *
3987
+ * This method returns when corresponding arguments are safely saved so in
3988
+ * case the window is closed there will be no information losses. This
3989
+ * function under the hood may delay actual persistence of the supplied
3990
+ * values.
3991
+ * */
3992
+ setBlockArgsAndUiState(args: Args, state: UiState, author?: AuthorMarker): Promise<ResultOrError<void>>;
3993
+ /**
3994
+ * Sets block navigation state.
3995
+ * */
3996
+ setNavigationState(state: NavigationState<Href>): Promise<ResultOrError<void>>;
3997
+ /**
3998
+ * Disposes the block API.
3999
+ * */
4000
+ dispose(): Promise<ResultOrError<void>>;
4001
+ } //#endregion
4002
+ //#endregion
4003
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/version.d.ts
4004
+ type SdkInfo = {
4005
+ readonly sdkVersion: string;
4006
+ };
4007
+ //#endregion
4008
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/services/block_services.d.ts
4009
+ //#region src/services/block_services.d.ts
4010
+ /**
4011
+ * Services required by all V3 blocks by default.
4012
+ * Edit this when a new service should be available to all blocks.
4013
+ *
4014
+ * Standalone module to avoid circular dependencies between block_model.ts
4015
+ * and service type resolution.
4016
+ */
4017
+ declare const BLOCK_SERVICE_FLAGS: {
4018
+ readonly requiresPFrameSpec: true;
4019
+ readonly requiresPFrame: true;
4020
+ readonly requiresDialog: true;
4021
+ };
4022
+ type BlockServiceFlags = typeof BLOCK_SERVICE_FLAGS;
4023
+ //#endregion
4024
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/services/service_resolve.d.ts
4025
+ //#region src/services/service_resolve.d.ts
4026
+ type FlagToName<Flag extends string> = Flag extends `requires${infer K}` ? K extends keyof ServiceNameLiterals ? ServiceNameLiterals[K] : never : never;
4027
+ type RequiredServiceNames<Flags> = { [K in keyof Flags & `requires${string}`]: Flags[K] extends true ? FlagToName<K & string> : never }[keyof Flags & `requires${string}`];
4028
+ type ResolveUiServices<Flags> = Pick<UiServices$1, RequiredServiceNames<Flags> & keyof UiServices$1>;
4029
+ type BlockDefaultUiServices = ResolveUiServices<BlockServiceFlags>; //#endregion
4030
+ //#endregion
4031
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/plugin_model.d.ts
4032
+ /**
4033
+ * Runtime definition for a single public output field.
4034
+ * Stored in PluginModel and passed through BlockModelInfo to the UI layer.
4035
+ */
4036
+ type PublicOutputFieldDef = {
4037
+ readonly getter: (data: unknown) => unknown;
4038
+ };
4039
+ //#endregion
4040
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/block_api_v3.d.ts
4041
+ //#region src/block_api_v3.d.ts
4042
+ /** Defines methods to read and write current block data. */
4043
+ interface BlockApiV3<_Data = unknown, _Args = unknown, Outputs extends BlockOutputsBase = BlockOutputsBase, Href extends `/${string}` = `/${string}`> {
4044
+ /**
4045
+ * Use this method to retrieve block state during UI initialization. Then use
4046
+ * {@link onStateUpdates} method to subscribe for updates.
4047
+ * */
4048
+ loadBlockState(): Promise<ResultOrError<ValueWithUTag<BlockStateV3<_Data, Outputs, Href>>>>;
4049
+ /**
4050
+ * Get all json patches (rfc6902) that were applied to the block state.
4051
+ * */
4052
+ getPatches(uTag: string): Promise<ResultOrError<ValueWithUTagAndAuthor<Operation[]>>>;
4053
+ /**
4054
+ * Mutates block storage with the given operation.
4055
+ *
4056
+ * This method returns when the data is safely saved so in case the window is
4057
+ * closed there will be no information losses. This function under the hood
4058
+ * may delay actual persistence of the supplied values.
4059
+ * */
4060
+ mutateStorage(payload: MutateStoragePayload, author?: AuthorMarker): Promise<ResultOrError<void>>;
4061
+ /**
4062
+ * Sets block navigation state.
4063
+ * */
4064
+ setNavigationState(state: NavigationState<Href>): Promise<ResultOrError<void>>;
4065
+ /**
4066
+ * Disposes the block API.
4067
+ * */
4068
+ dispose(): Promise<ResultOrError<void>>;
4069
+ } //#endregion
4070
+ //#endregion
4071
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.79.24/node_modules/@platforma-sdk/model/dist/platforma.d.ts
4072
+ //#region src/platforma.d.ts
4073
+ /** Defines all methods to interact with the platform environment from within a block UI. @deprecated */
4074
+ interface PlatformaV1<Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`> extends BlockApiV1<Args, Outputs, UiState, Href>, DriverKit {
4075
+ /** Information about SDK version current platforma environment was compiled with. */
4076
+ readonly sdkInfo: SdkInfo;
4077
+ readonly apiVersion?: 1;
4078
+ }
4079
+ /** V2 version based on effective json patches pulling API */
4080
+ interface PlatformaV2<Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`> extends BlockApiV2<Args, Outputs, UiState, Href>, DriverKit {
4081
+ /** Information about SDK version current platforma environment was compiled with. */
4082
+ readonly sdkInfo: SdkInfo;
4083
+ readonly apiVersion: 2;
4084
+ }
4085
+ interface PlatformaV3<Data = unknown, Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, Href extends `/${string}` = `/${string}`, Plugins extends Record<string, unknown> = Record<string, unknown>, UiServices extends Partial<UiServices$1> = Partial<UiServices$1>> extends BlockApiV3<Data, Args, Outputs, Href>, DriverKit {
4086
+ /** Information about SDK version current platforma environment was compiled with. */
4087
+ readonly sdkInfo: SdkInfo;
4088
+ readonly apiVersion: 3;
4089
+ /** Service dispatch — lists available services, their methods, and invokes them. */
4090
+ readonly serviceDispatch: ServiceDispatch;
4091
+ /** @internal Type brand for plugin type inference. Not used at runtime. */
4092
+ readonly __pluginsBrand?: Plugins;
4093
+ /** @internal Type brand for UI service type inference. Not used at runtime. */
4094
+ readonly __uiServicesBrand?: UiServices;
4095
+ }
4096
+ type Platforma<Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, UiStateOrData = unknown, Href extends `/${string}` = `/${string}`> = PlatformaV1<Args, Outputs, UiStateOrData, Href> | PlatformaV2<Args, Outputs, UiStateOrData, Href> | PlatformaV3<UiStateOrData, Args, Outputs, Href>;
4097
+ type PlatformaExtended<Pl extends Platforma = Platforma> = Pl & {
4098
+ blockModelInfo: BlockModelInfo;
4099
+ };
4100
+ type BlockModelInfo = {
4101
+ outputs: Record<string, {
4102
+ withStatus: boolean;
4103
+ }>;
4104
+ pluginIds: PluginHandle[];
4105
+ featureFlags: BlockCodeKnownFeatureFlags;
4106
+ pluginPublicOutputs: Record<string, Record<string, PublicOutputFieldDef>>;
4107
+ };
4108
+ type InferOutputsType<Pl extends Platforma> = Pl extends Platforma<unknown, infer Outputs> ? Outputs : never;
4109
+ type InferDataType<Pl extends Platforma> = Pl extends Platforma<unknown, Record<string, OutputWithStatus<unknown>>, infer Data> ? Data : never;
4110
+ type InferHrefType<Pl extends Platforma> = Pl extends Platforma<unknown, BlockOutputsBase, unknown, infer Href> ? Href : never;
4111
+ //#endregion
4112
+ //#region ../model/dist/types.d.ts
4113
+ //#region src/types.d.ts
4114
+ /** Receptor type. Same enum as sequence-properties to keep label conventions aligned. */
4115
+ type WorkflowReceptor = "IG" | "TCRAB" | "TCRGD";
4116
+ /**
4117
+ * ESM-2 fidelity the user picks per card, projected into args. Default is `standard`.
4118
+ * `standard` → ESM-2 150M; `high` → ESM-2 650M. Only meaningful when the card's
4119
+ * model is ESM-2; ignored for the single-checkpoint specialists.
4120
+ */
4121
+ type Fidelity = "high" | "standard";
4122
+ /**
4123
+ * User-facing embedding-model choice — the value of a card's model dropdown. A
4124
+ * logical id; the workflow maps it (plus `Fidelity` for ESM-2) to a concrete
4125
+ * checkpoint `ModelTag`. The catalog and scope↔model compatibility live in
4126
+ * `compat.ts`.
4127
+ */
4128
+ type EmbeddingModelId = "esm2" | "ablang2" | "currab" | "vhhbert" | "h3berta" | "tcr-bert" | "peptideclm2" | "sceptr";
4129
+ /**
4130
+ * Checkpoint tag emitted on the `pl7.app/embedding/model` domain of every output
4131
+ * column (model provenance). ESM-2 splits by fidelity; specialists are 1:1 with
4132
+ * their `EmbeddingModelId`.
4133
+ */
4134
+ type ModelTag = "esm2-650M" | "esm2-150M" | "ablang2" | "currab" | "vhhbert" | "h3berta" | "tcr-bert" | "peptideclm2" | "sceptr";
4135
+ /** Embedding scope feature. `Fv` and `scFv` span/merge chains and carry no `chain`. */
4136
+ type ScopeFeature = "peptide" | "CDR3" | "VDJRegion" | "Fv" | "scFv";
4137
+ /**
4138
+ * One embedding scope the user can select. `columns` carries the workflow-
4139
+ * resolvable `SUniversalPColumnId`(s) of the sequence column(s) to embed — one
4140
+ * for single-chain scopes, two (`[VH, VL]`) for the paired Fv scope. The column
4141
+ * ids (and `isHeavy`/`receptor`) are snapshotted into `BlockData` on the user's
4142
+ * gesture (the anchored-id storage pattern), so the args lambda stays `data`-only.
4143
+ */
4144
+ type SelectedScope = {
4145
+ /** Stable picker key. The sequence column id for single scopes; `"Fv"` for paired Fv. */id: string;
4146
+ feature: ScopeFeature;
4147
+ chain: "A" | "B" | "";
4148
+ columns: SUniversalPColumnId[];
4149
+ label: string;
4150
+ /**
4151
+ * True when this is an IG heavy chain (single-cell chain `A`, or bulk
4152
+ * `IGHeavy`). Gates the heavy-only specialists (VHHBERT, H3BERTa) and the
4153
+ * VHH-vs-mAb default. Snapshotted so the args lambda stays `data`-only.
4154
+ */
4155
+ isHeavy: boolean;
4156
+ /** Receptor of the input this scope came from, snapshotted for `data`-only
4157
+ * compatibility validation in the args lambda. */
4158
+ receptor: WorkflowReceptor;
4159
+ };
4160
+ /** A selectable scope. Alias of `SelectedScope` — the label lives on the base type. */
4161
+ /**
4162
+ * One embedding card in the settings list: a (sequence scope, model) task the
4163
+ * user assembles. `scope` and `model` are each undefined until picked — the UI
4164
+ * fills one and bidirectionally filters the other. `fidelity` applies only when
4165
+ * `model` is ESM-2.
4166
+ */
4167
+ type EmbeddingCard = {
4168
+ /** Stable card key for the `PlElementList` (`get-item-key`). */id: string;
4169
+ scope?: SelectedScope;
4170
+ model?: EmbeddingModelId; /** ESM-2 fidelity; ignored for other models. */
4171
+ fidelity?: Fidelity; /** UI: card expanded in the list. */
4172
+ isExpanded?: boolean;
4173
+ };
4174
+ /**
4175
+ * Per-scope record in the Python step's `stats.json` output — one entry per
4176
+ * selected scope. `n_entities = 0` marks an empty scope.
4177
+ */
4178
+ /**
4179
+ * V2 BlockData. Model selection moves per-scope: the global `fidelity` + flat
4180
+ * `selectedScopes` become a list of embedding cards, each a (scope, model,
4181
+ * fidelity?) task. Enables specialist models and same-scope model comparison.
4182
+ */
4183
+ type BlockDataV2 = {
4184
+ inputAnchor?: PlRef; /** The embedding cards (scope × model tasks) the user has assembled. */
4185
+ embeddings: EmbeddingCard[];
4186
+ /**
4187
+ * Init-guard: canonical id of the anchor whose default cards were last seeded.
4188
+ * Prevents re-seeding on panel reopen / server patch; triggers re-seed +
4189
+ * reconciliation on input change.
4190
+ */
4191
+ embeddingsInitializedForAnchor?: string; /** Advanced resource overrides (GiB / cores); undefined → workflow defaults. */
4192
+ mem?: number;
4193
+ cpu?: number;
4194
+ defaultBlockLabel?: string;
4195
+ };
4196
+ /** Current BlockData shape. */
4197
+ /**
4198
+ * One embedding task in the workflow input: a scope plus the model to embed it
4199
+ * with (and ESM-2 fidelity, when applicable). Projected from `BlockData.embeddings`.
4200
+ */
4201
+ type EmbeddingTask = {
4202
+ scope: SelectedScope;
4203
+ model: EmbeddingModelId; /** ESM-2 fidelity; undefined for other models. */
4204
+ fidelity?: Fidelity;
4205
+ };
4206
+ /**
4207
+ * Workflow input shape. Args projection in `index.ts` builds this from
4208
+ * `BlockData`, validating that `inputAnchor` is set and every card is a complete,
4209
+ * compatible (scope, model) pair (throws otherwise — the V3 idiom replaces V1's
4210
+ * `.argsValid()`).
4211
+ */
4212
+ type BlockArgs = {
4213
+ inputAnchor: PlRef; /** Tasks to emit, projected from `data.embeddings` (validated complete + compatible). */
4214
+ embeddings: EmbeddingTask[]; /** Advanced resource overrides for the embedding step (GiB / cores); undefined → workflow defaults. */
4215
+ mem?: number;
4216
+ cpu?: number;
4217
+ }; //#endregion
4218
+ //#endregion
4219
+ //#region ../model/dist/index.d.ts
4220
+ //#region src/index.d.ts
4221
+ declare const platforma: PlatformaExtended<PlatformaV3<BlockDataV2, BlockArgs, InferOutputsFromLambdas<{
4222
+ inputOptions: ConfigRenderLambda<{
4223
+ readonly ref: {
4224
+ readonly __isRef: true;
4225
+ readonly blockId: string;
4226
+ readonly name: string;
4227
+ readonly requireEnrichments?: true | undefined | undefined;
4228
+ };
4229
+ readonly label: string;
4230
+ }[]>;
4231
+ } & {
4232
+ inputSpec: ConfigRenderLambda<{
4233
+ readonly kind: "PColumn";
4234
+ readonly name: string;
4235
+ readonly domain?: {
4236
+ [x: string]: string;
4237
+ } | undefined;
4238
+ readonly contextDomain?: {
4239
+ [x: string]: string;
4240
+ } | undefined;
4241
+ readonly annotations?: {
4242
+ [x: string]: string;
4243
+ } | undefined;
4244
+ readonly valueType: "Int" | "Long" | "Float" | "Double" | "String" | "Bytes";
4245
+ readonly parentAxes?: number[] | undefined;
4246
+ readonly axesSpec: {
4247
+ readonly type: AxisValueType;
4248
+ readonly name: string;
4249
+ readonly domain?: {
4250
+ [x: string]: string;
4251
+ } | undefined;
4252
+ readonly contextDomain?: {
4253
+ [x: string]: string;
4254
+ } | undefined;
4255
+ readonly annotations?: {
4256
+ [x: string]: string;
4257
+ } | undefined;
4258
+ readonly parentAxes?: number[] | undefined;
4259
+ }[];
4260
+ } | undefined>;
4261
+ } & {
4262
+ availableScopes: ConfigRenderLambda<{
4263
+ options: {
4264
+ id: string;
4265
+ feature: ScopeFeature;
4266
+ chain: "A" | "B" | "";
4267
+ columns: SUniversalPColumnId[];
4268
+ label: string;
4269
+ isHeavy: boolean;
4270
+ receptor: WorkflowReceptor;
4271
+ }[];
4272
+ defaults: {
4273
+ id: string;
4274
+ feature: ScopeFeature;
4275
+ chain: "A" | "B" | "";
4276
+ columns: SUniversalPColumnId[];
4277
+ label: string;
4278
+ isHeavy: boolean;
4279
+ receptor: WorkflowReceptor;
4280
+ }[];
4281
+ forAnchor: string;
4282
+ receptor: WorkflowReceptor;
4283
+ paired: boolean;
4284
+ } | undefined>;
4285
+ } & {
4286
+ stats: ConfigRenderLambda<{
4287
+ device_used: "cpu" | "gpu";
4288
+ model: ModelTag;
4289
+ max_length?: number | undefined;
4290
+ scopes: {
4291
+ name: string;
4292
+ feature: "peptide" | "CDR3" | "VDJRegion" | "Fv" | "scFv";
4293
+ chain: "A" | "B" | "";
4294
+ label: string;
4295
+ model: ModelTag;
4296
+ max_length?: number | undefined;
4297
+ n_entities?: number | undefined;
4298
+ n_dropped_empty?: number | undefined;
4299
+ n_truncated?: number | undefined;
4300
+ }[];
4301
+ } | undefined>;
4302
+ } & {
4303
+ isRunning: ConfigRenderLambda<boolean>;
4304
+ } & {
4305
+ resultsStale: ConfigRenderLambda<boolean>;
4306
+ } & {
4307
+ gpuAvailable: ConfigRenderLambda<boolean | undefined>;
4308
+ }>, "/", {}, BlockDefaultUiServices>>;
4309
+ //#endregion
4310
+ //#region src/index.d.ts
4311
+ type BlockContract = {
4312
+ outputs: InferOutputsType<typeof platforma>;
4313
+ data: InferDataType<typeof platforma>;
4314
+ href: InferHrefType<typeof platforma>;
4315
+ };
4316
+ type BlockOutputs = BlockContract["outputs"];
4317
+ type BlockData = BlockContract["data"];
4318
+ //#endregion
4319
+ export type { BlockContract, BlockData, BlockOutputs };
4320
+ //# sourceMappingURL=AGENTS.d.ts.map