@workglow/ai 0.0.85 → 0.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/README.md +165 -34
  2. package/dist/browser.js +3947 -1449
  3. package/dist/browser.js.map +49 -38
  4. package/dist/bun.js +3947 -1449
  5. package/dist/bun.js.map +49 -38
  6. package/dist/common.d.ts +0 -3
  7. package/dist/common.d.ts.map +1 -1
  8. package/dist/model/ModelRegistry.d.ts +2 -2
  9. package/dist/model/ModelRegistry.d.ts.map +1 -1
  10. package/dist/model/ModelRepository.d.ts +3 -3
  11. package/dist/model/ModelRepository.d.ts.map +1 -1
  12. package/dist/node.js +3947 -1449
  13. package/dist/node.js.map +49 -38
  14. package/dist/task/BackgroundRemovalTask.d.ts +121 -289
  15. package/dist/task/BackgroundRemovalTask.d.ts.map +1 -1
  16. package/dist/task/ChunkRetrievalTask.d.ts +243 -0
  17. package/dist/task/ChunkRetrievalTask.d.ts.map +1 -0
  18. package/dist/task/ChunkToVectorTask.d.ts +183 -0
  19. package/dist/task/ChunkToVectorTask.d.ts.map +1 -0
  20. package/dist/task/ChunkVectorHybridSearchTask.d.ts +160 -0
  21. package/dist/task/ChunkVectorHybridSearchTask.d.ts.map +1 -0
  22. package/dist/task/ChunkVectorSearchTask.d.ts +137 -0
  23. package/dist/task/ChunkVectorSearchTask.d.ts.map +1 -0
  24. package/dist/task/ChunkVectorUpsertTask.d.ts +120 -0
  25. package/dist/task/ChunkVectorUpsertTask.d.ts.map +1 -0
  26. package/dist/task/ContextBuilderTask.d.ts +131 -0
  27. package/dist/task/ContextBuilderTask.d.ts.map +1 -0
  28. package/dist/task/DocumentEnricherTask.d.ts +232 -0
  29. package/dist/task/DocumentEnricherTask.d.ts.map +1 -0
  30. package/dist/task/DownloadModelTask.d.ts +79 -208
  31. package/dist/task/DownloadModelTask.d.ts.map +1 -1
  32. package/dist/task/FaceDetectorTask.d.ts +117 -272
  33. package/dist/task/FaceDetectorTask.d.ts.map +1 -1
  34. package/dist/task/FaceLandmarkerTask.d.ts +117 -272
  35. package/dist/task/FaceLandmarkerTask.d.ts.map +1 -1
  36. package/dist/task/GestureRecognizerTask.d.ts +129 -284
  37. package/dist/task/GestureRecognizerTask.d.ts.map +1 -1
  38. package/dist/task/HandLandmarkerTask.d.ts +125 -280
  39. package/dist/task/HandLandmarkerTask.d.ts.map +1 -1
  40. package/dist/task/HierarchicalChunkerTask.d.ts +212 -0
  41. package/dist/task/HierarchicalChunkerTask.d.ts.map +1 -0
  42. package/dist/task/HierarchyJoinTask.d.ts +318 -0
  43. package/dist/task/HierarchyJoinTask.d.ts.map +1 -0
  44. package/dist/task/ImageClassificationTask.d.ts +117 -272
  45. package/dist/task/ImageClassificationTask.d.ts.map +1 -1
  46. package/dist/task/ImageEmbeddingTask.d.ts +125 -446
  47. package/dist/task/ImageEmbeddingTask.d.ts.map +1 -1
  48. package/dist/task/ImageSegmentationTask.d.ts +117 -272
  49. package/dist/task/ImageSegmentationTask.d.ts.map +1 -1
  50. package/dist/task/ImageToTextTask.d.ts +117 -272
  51. package/dist/task/ImageToTextTask.d.ts.map +1 -1
  52. package/dist/task/ObjectDetectionTask.d.ts +119 -274
  53. package/dist/task/ObjectDetectionTask.d.ts.map +1 -1
  54. package/dist/task/PoseLandmarkerTask.d.ts +117 -272
  55. package/dist/task/PoseLandmarkerTask.d.ts.map +1 -1
  56. package/dist/task/QueryExpanderTask.d.ts +129 -0
  57. package/dist/task/QueryExpanderTask.d.ts.map +1 -0
  58. package/dist/task/RerankerTask.d.ts +209 -0
  59. package/dist/task/RerankerTask.d.ts.map +1 -0
  60. package/dist/task/StructuralParserTask.d.ts +91 -0
  61. package/dist/task/StructuralParserTask.d.ts.map +1 -0
  62. package/dist/task/TextChunkerTask.d.ts +129 -0
  63. package/dist/task/TextChunkerTask.d.ts.map +1 -0
  64. package/dist/task/TextClassificationTask.d.ts +42 -115
  65. package/dist/task/TextClassificationTask.d.ts.map +1 -1
  66. package/dist/task/TextEmbeddingTask.d.ts +55 -277
  67. package/dist/task/TextEmbeddingTask.d.ts.map +1 -1
  68. package/dist/task/TextFillMaskTask.d.ts +42 -115
  69. package/dist/task/TextFillMaskTask.d.ts.map +1 -1
  70. package/dist/task/TextGenerationTask.d.ts +44 -128
  71. package/dist/task/TextGenerationTask.d.ts.map +1 -1
  72. package/dist/task/TextLanguageDetectionTask.d.ts +42 -115
  73. package/dist/task/TextLanguageDetectionTask.d.ts.map +1 -1
  74. package/dist/task/TextNamedEntityRecognitionTask.d.ts +42 -115
  75. package/dist/task/TextNamedEntityRecognitionTask.d.ts.map +1 -1
  76. package/dist/task/TextQuestionAnswerTask.d.ts +47 -144
  77. package/dist/task/TextQuestionAnswerTask.d.ts.map +1 -1
  78. package/dist/task/TextRewriterTask.d.ts +45 -131
  79. package/dist/task/TextRewriterTask.d.ts.map +1 -1
  80. package/dist/task/TextSummaryTask.d.ts +42 -115
  81. package/dist/task/TextSummaryTask.d.ts.map +1 -1
  82. package/dist/task/TextTranslationTask.d.ts +54 -168
  83. package/dist/task/TextTranslationTask.d.ts.map +1 -1
  84. package/dist/task/TopicSegmenterTask.d.ts +148 -0
  85. package/dist/task/TopicSegmenterTask.d.ts.map +1 -0
  86. package/dist/task/UnloadModelTask.d.ts +79 -208
  87. package/dist/task/UnloadModelTask.d.ts.map +1 -1
  88. package/dist/task/VectorQuantizeTask.d.ts +120 -0
  89. package/dist/task/VectorQuantizeTask.d.ts.map +1 -0
  90. package/dist/task/VectorSimilarityTask.d.ts +18 -253
  91. package/dist/task/VectorSimilarityTask.d.ts.map +1 -1
  92. package/dist/task/base/AiTask.d.ts +24 -22
  93. package/dist/task/base/AiTask.d.ts.map +1 -1
  94. package/dist/task/base/AiTaskSchemas.d.ts +3 -127
  95. package/dist/task/base/AiTaskSchemas.d.ts.map +1 -1
  96. package/dist/task/base/AiVisionTask.d.ts +1 -4
  97. package/dist/task/base/AiVisionTask.d.ts.map +1 -1
  98. package/dist/task/index.d.ts +54 -1
  99. package/dist/task/index.d.ts.map +1 -1
  100. package/package.json +14 -9
  101. package/dist/source/Document.d.ts +0 -56
  102. package/dist/source/Document.d.ts.map +0 -1
  103. package/dist/source/DocumentConverter.d.ts +0 -15
  104. package/dist/source/DocumentConverter.d.ts.map +0 -1
  105. package/dist/source/DocumentConverterMarkdown.d.ts +0 -13
  106. package/dist/source/DocumentConverterMarkdown.d.ts.map +0 -1
  107. package/dist/source/DocumentConverterText.d.ts +0 -13
  108. package/dist/source/DocumentConverterText.d.ts.map +0 -1
  109. package/dist/source/MasterDocument.d.ts +0 -27
  110. package/dist/source/MasterDocument.d.ts.map +0 -1
  111. package/dist/source/index.d.ts +0 -10
  112. package/dist/source/index.d.ts.map +0 -1
  113. package/dist/task/DocumentSplitterTask.d.ts +0 -58
  114. package/dist/task/DocumentSplitterTask.d.ts.map +0 -1
@@ -3,9 +3,8 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { ArrayTask, CreateWorkflow, JobQueueTaskConfig } from "@workglow/task-graph";
7
- import { DataPortSchema, FromSchema } from "@workglow/util";
8
- import { TypedArray, TypedArraySchemaOptions } from "./base/AiTaskSchemas";
6
+ import { CreateWorkflow, GraphAsTask, JobQueueTaskConfig } from "@workglow/task-graph";
7
+ import { DataPortSchema, FromSchema, TypedArraySchemaOptions } from "@workglow/util";
9
8
  export declare const SimilarityFn: {
10
9
  readonly COSINE: "cosine";
11
10
  readonly JACCARD: "jaccard";
@@ -16,172 +15,18 @@ declare const SimilarityInputSchema: {
16
15
  readonly type: "object";
17
16
  readonly properties: {
18
17
  readonly query: {
19
- readonly oneOf: readonly [{
20
- readonly type: "array";
21
- readonly items: {
22
- readonly type: "number";
23
- readonly format: "Float64";
24
- };
25
- readonly title: "Float64Array";
26
- readonly description: "A 64-bit floating point array";
27
- readonly format: "Float64Array";
28
- }, {
29
- readonly type: "array";
30
- readonly items: {
31
- readonly type: "number";
32
- readonly format: "Float32";
33
- };
34
- readonly title: "Float32Array";
35
- readonly description: "A 32-bit floating point array";
36
- readonly format: "Float32Array";
37
- }, {
38
- readonly type: "array";
39
- readonly items: {
40
- readonly type: "number";
41
- readonly format: "Int32";
42
- };
43
- readonly title: "Int32Array";
44
- readonly description: "A 32-bit integer array";
45
- readonly format: "Int32Array";
46
- }, {
47
- readonly type: "array";
48
- readonly items: {
49
- readonly type: "number";
50
- readonly format: "Int16";
51
- };
52
- readonly title: "Int16Array";
53
- readonly description: "A 16-bit integer array";
54
- readonly format: "Int16Array";
55
- }, {
56
- readonly type: "array";
57
- readonly items: {
58
- readonly type: "number";
59
- readonly format: "Int8";
60
- };
61
- readonly title: "Int8Array";
62
- }, {
63
- readonly type: "array";
64
- readonly items: {
65
- readonly type: "number";
66
- readonly format: "Uint8";
67
- };
68
- readonly title: "Uint8Array";
69
- readonly description: "A 8-bit unsigned integer array";
70
- readonly format: "Uint8Array";
71
- }, {
72
- readonly type: "array";
73
- readonly items: {
74
- readonly type: "number";
75
- readonly format: "Uint16";
76
- };
77
- readonly title: "Uint16Array";
78
- readonly description: "A 16-bit unsigned integer array";
79
- readonly format: "Uint16Array";
80
- }, {
81
- readonly type: "array";
82
- readonly items: {
83
- readonly type: "number";
84
- readonly format: "Uint32";
85
- };
86
- readonly title: "Uint32Array";
87
- readonly description: "A 32-bit unsigned integer array";
88
- readonly format: "Uint32Array";
89
- }, {
90
- readonly type: "array";
91
- readonly items: {
92
- readonly type: "number";
93
- readonly format: "Uint8Clamped";
94
- };
95
- readonly title: "Uint8ClampedArray";
96
- readonly description: "A 8-bit unsigned integer array with values clamped to 0-255";
97
- readonly format: "Uint8ClampedArray";
98
- }];
18
+ readonly type: "array";
99
19
  readonly format: "TypedArray";
20
+ readonly title: "Typed Array";
21
+ readonly description: "A typed array (Float32Array, Int8Array, etc.)";
100
22
  };
101
- readonly input: {
23
+ readonly vectors: {
102
24
  readonly type: "array";
103
25
  readonly items: {
104
- readonly oneOf: readonly [{
105
- readonly type: "array";
106
- readonly items: {
107
- readonly type: "number";
108
- readonly format: "Float64";
109
- };
110
- readonly title: "Float64Array";
111
- readonly description: "A 64-bit floating point array";
112
- readonly format: "Float64Array";
113
- }, {
114
- readonly type: "array";
115
- readonly items: {
116
- readonly type: "number";
117
- readonly format: "Float32";
118
- };
119
- readonly title: "Float32Array";
120
- readonly description: "A 32-bit floating point array";
121
- readonly format: "Float32Array";
122
- }, {
123
- readonly type: "array";
124
- readonly items: {
125
- readonly type: "number";
126
- readonly format: "Int32";
127
- };
128
- readonly title: "Int32Array";
129
- readonly description: "A 32-bit integer array";
130
- readonly format: "Int32Array";
131
- }, {
132
- readonly type: "array";
133
- readonly items: {
134
- readonly type: "number";
135
- readonly format: "Int16";
136
- };
137
- readonly title: "Int16Array";
138
- readonly description: "A 16-bit integer array";
139
- readonly format: "Int16Array";
140
- }, {
141
- readonly type: "array";
142
- readonly items: {
143
- readonly type: "number";
144
- readonly format: "Int8";
145
- };
146
- readonly title: "Int8Array";
147
- }, {
148
- readonly type: "array";
149
- readonly items: {
150
- readonly type: "number";
151
- readonly format: "Uint8";
152
- };
153
- readonly title: "Uint8Array";
154
- readonly description: "A 8-bit unsigned integer array";
155
- readonly format: "Uint8Array";
156
- }, {
157
- readonly type: "array";
158
- readonly items: {
159
- readonly type: "number";
160
- readonly format: "Uint16";
161
- };
162
- readonly title: "Uint16Array";
163
- readonly description: "A 16-bit unsigned integer array";
164
- readonly format: "Uint16Array";
165
- }, {
166
- readonly type: "array";
167
- readonly items: {
168
- readonly type: "number";
169
- readonly format: "Uint32";
170
- };
171
- readonly title: "Uint32Array";
172
- readonly description: "A 32-bit unsigned integer array";
173
- readonly format: "Uint32Array";
174
- }, {
175
- readonly type: "array";
176
- readonly items: {
177
- readonly type: "number";
178
- readonly format: "Uint8Clamped";
179
- };
180
- readonly title: "Uint8ClampedArray";
181
- readonly description: "A 8-bit unsigned integer array with values clamped to 0-255";
182
- readonly format: "Uint8ClampedArray";
183
- }];
26
+ readonly type: "array";
184
27
  readonly format: "TypedArray";
28
+ readonly title: "Typed Array";
29
+ readonly description: "A typed array (Float32Array, Int8Array, etc.)";
185
30
  };
186
31
  };
187
32
  readonly topK: {
@@ -191,7 +36,7 @@ declare const SimilarityInputSchema: {
191
36
  readonly minimum: 1;
192
37
  readonly default: 10;
193
38
  };
194
- readonly similarity: {
39
+ readonly method: {
195
40
  readonly type: "string";
196
41
  readonly enum: ("cosine" | "jaccard" | "hamming")[];
197
42
  readonly title: "Similarity 𝑓";
@@ -199,7 +44,7 @@ declare const SimilarityInputSchema: {
199
44
  readonly default: "cosine";
200
45
  };
201
46
  };
202
- readonly required: readonly ["query", "input", "similarity"];
47
+ readonly required: readonly ["query", "vectors", "method"];
203
48
  readonly additionalProperties: false;
204
49
  };
205
50
  declare const SimilarityOutputSchema: {
@@ -208,87 +53,10 @@ declare const SimilarityOutputSchema: {
208
53
  readonly output: {
209
54
  readonly type: "array";
210
55
  readonly items: {
211
- readonly oneOf: readonly [{
212
- readonly type: "array";
213
- readonly items: {
214
- readonly type: "number";
215
- readonly format: "Float64";
216
- };
217
- readonly title: "Float64Array";
218
- readonly description: "A 64-bit floating point array";
219
- readonly format: "Float64Array";
220
- }, {
221
- readonly type: "array";
222
- readonly items: {
223
- readonly type: "number";
224
- readonly format: "Float32";
225
- };
226
- readonly title: "Float32Array";
227
- readonly description: "A 32-bit floating point array";
228
- readonly format: "Float32Array";
229
- }, {
230
- readonly type: "array";
231
- readonly items: {
232
- readonly type: "number";
233
- readonly format: "Int32";
234
- };
235
- readonly title: "Int32Array";
236
- readonly description: "A 32-bit integer array";
237
- readonly format: "Int32Array";
238
- }, {
239
- readonly type: "array";
240
- readonly items: {
241
- readonly type: "number";
242
- readonly format: "Int16";
243
- };
244
- readonly title: "Int16Array";
245
- readonly description: "A 16-bit integer array";
246
- readonly format: "Int16Array";
247
- }, {
248
- readonly type: "array";
249
- readonly items: {
250
- readonly type: "number";
251
- readonly format: "Int8";
252
- };
253
- readonly title: "Int8Array";
254
- }, {
255
- readonly type: "array";
256
- readonly items: {
257
- readonly type: "number";
258
- readonly format: "Uint8";
259
- };
260
- readonly title: "Uint8Array";
261
- readonly description: "A 8-bit unsigned integer array";
262
- readonly format: "Uint8Array";
263
- }, {
264
- readonly type: "array";
265
- readonly items: {
266
- readonly type: "number";
267
- readonly format: "Uint16";
268
- };
269
- readonly title: "Uint16Array";
270
- readonly description: "A 16-bit unsigned integer array";
271
- readonly format: "Uint16Array";
272
- }, {
273
- readonly type: "array";
274
- readonly items: {
275
- readonly type: "number";
276
- readonly format: "Uint32";
277
- };
278
- readonly title: "Uint32Array";
279
- readonly description: "A 32-bit unsigned integer array";
280
- readonly format: "Uint32Array";
281
- }, {
282
- readonly type: "array";
283
- readonly items: {
284
- readonly type: "number";
285
- readonly format: "Uint8Clamped";
286
- };
287
- readonly title: "Uint8ClampedArray";
288
- readonly description: "A 8-bit unsigned integer array with values clamped to 0-255";
289
- readonly format: "Uint8ClampedArray";
290
- }];
56
+ readonly type: "array";
291
57
  readonly format: "TypedArray";
58
+ readonly title: "Typed Array";
59
+ readonly description: "A typed array (Float32Array, Int8Array, etc.)";
292
60
  };
293
61
  };
294
62
  readonly score: {
@@ -305,7 +73,7 @@ declare const SimilarityOutputSchema: {
305
73
  };
306
74
  export type VectorSimilarityTaskInput = FromSchema<typeof SimilarityInputSchema, TypedArraySchemaOptions>;
307
75
  export type VectorSimilarityTaskOutput = FromSchema<typeof SimilarityOutputSchema, TypedArraySchemaOptions>;
308
- export declare class VectorSimilarityTask extends ArrayTask<VectorSimilarityTaskInput, VectorSimilarityTaskOutput, JobQueueTaskConfig> {
76
+ export declare class VectorSimilarityTask extends GraphAsTask<VectorSimilarityTaskInput, VectorSimilarityTaskOutput, JobQueueTaskConfig> {
309
77
  static readonly type = "VectorSimilarityTask";
310
78
  static readonly category = "Analysis";
311
79
  static readonly title = "Vector Similarity";
@@ -313,22 +81,19 @@ export declare class VectorSimilarityTask extends ArrayTask<VectorSimilarityTask
313
81
  static readonly cacheable = true;
314
82
  static inputSchema(): DataPortSchema;
315
83
  static outputSchema(): DataPortSchema;
316
- executeReactive({ query, input, similarity, topK }: VectorSimilarityTaskInput, oldOutput: VectorSimilarityTaskOutput): Promise<{
317
- output: TypedArray[];
84
+ executeReactive({ query, vectors, method, topK }: VectorSimilarityTaskInput): Promise<{
85
+ output: import("@workglow/util").TypedArray[];
318
86
  score: number[];
319
87
  }>;
320
88
  }
321
89
  export declare const similarity: (input: VectorSimilarityTaskInput, config?: JobQueueTaskConfig) => Promise<{
322
- output: TypedArray[];
323
90
  score: number[];
91
+ output: import("@workglow/util").TypedArray[];
324
92
  }>;
325
93
  declare module "@workglow/task-graph" {
326
94
  interface Workflow {
327
95
  similarity: CreateWorkflow<VectorSimilarityTaskInput, VectorSimilarityTaskOutput, JobQueueTaskConfig>;
328
96
  }
329
97
  }
330
- export declare function inner(arr1: TypedArray, arr2: TypedArray): number;
331
- export declare function magnitude(arr: TypedArray): number;
332
- export declare function normalize(vector: TypedArray): TypedArray;
333
98
  export {};
334
99
  //# sourceMappingURL=VectorSimilarityTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VectorSimilarityTask.d.ts","sourceRoot":"","sources":["../../src/task/VectorSimilarityTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EACT,cAAc,EACd,kBAAkB,EAInB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAoB,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE7F,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;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WAG7B,YAAY,IAAI,cAAc;IAI/C,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,yBAAyB;;;;CAoBlF;AAED,eAAO,MAAM,UAAU,GAAI,OAAO,yBAAyB,EAAE,SAAS,kBAAkB;;;EAEvF,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,UAAU,EAAE,cAAc,CACxB,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,CACnB,CAAC;KACH;CACF"}
@@ -8,41 +8,37 @@
8
8
  */
9
9
  import { Job } from "@workglow/job-queue";
10
10
  import { JobQueueTask, JobQueueTaskConfig, TaskInput, type TaskOutput } from "@workglow/task-graph";
11
+ import { type ServiceRegistry } from "@workglow/util";
11
12
  import { AiJobInput } from "../../job/AiJob";
12
- import type { ModelConfig, ModelRecord } from "../../model/ModelSchema";
13
+ import type { ModelConfig } from "../../model/ModelSchema";
13
14
  export interface AiSingleTaskInput extends TaskInput {
14
15
  model: string | ModelConfig;
15
16
  }
16
- export interface AiArrayTaskInput extends TaskInput {
17
- model: string | ModelConfig | (string | ModelConfig)[];
18
- }
19
17
  /**
20
18
  * A base class for AI related tasks that run in a job queue.
21
19
  * Extends the JobQueueTask class to provide LLM-specific functionality.
20
+ *
21
+ * Model resolution is handled automatically by the TaskRunner before execution.
22
+ * By the time execute() is called, input.model is always a ModelConfig object.
22
23
  */
23
- export declare class AiTask<Input extends AiArrayTaskInput = AiArrayTaskInput, Output extends TaskOutput = TaskOutput, Config extends JobQueueTaskConfig = JobQueueTaskConfig> extends JobQueueTask<Input, Output, Config> {
24
+ export declare class AiTask<Input extends AiSingleTaskInput = AiSingleTaskInput, Output extends TaskOutput = TaskOutput, Config extends JobQueueTaskConfig = JobQueueTaskConfig> extends JobQueueTask<Input, Output, Config> {
24
25
  static type: string;
25
- private modelCache?;
26
26
  /**
27
27
  * Creates a new AiTask instance
28
28
  * @param config - Configuration object for the task
29
29
  */
30
- constructor(input?: Input, config?: Config);
30
+ constructor(input?: Partial<Input>, config?: Config);
31
31
  /**
32
32
  * Get the input to submit to the job queue.
33
33
  * Transforms the task input to AiJobInput format.
34
- * @param input - The task input
34
+ *
35
+ * Note: By the time this is called, input.model has already been resolved
36
+ * to a ModelConfig by the TaskRunner's input resolution system.
37
+ *
38
+ * @param input - The task input (with resolved model)
35
39
  * @returns The AiJobInput to submit to the queue
36
40
  */
37
41
  protected getJobInput(input: Input): Promise<AiJobInput<Input>>;
38
- /**
39
- * Resolves a model configuration for the given input.
40
- *
41
- * @remarks
42
- * - If `input.model` is a string, it is resolved via the global model repository.
43
- * - If `input.model` is already a config object, it is used directly.
44
- */
45
- protected getModelConfigForInput(input: AiSingleTaskInput): Promise<ModelConfig>;
46
42
  /**
47
43
  * Creates a new Job instance for direct execution (without a queue).
48
44
  * @param input - The task input
@@ -50,15 +46,21 @@ export declare class AiTask<Input extends AiArrayTaskInput = AiArrayTaskInput, O
50
46
  * @returns Promise<Job> - The created job
51
47
  */
52
48
  createJob(input: Input, queueName?: string): Promise<Job<AiJobInput<Input>, Output>>;
53
- protected getModelForInput(input: AiSingleTaskInput): Promise<ModelRecord>;
49
+ /**
50
+ * Gets the default queue name based on the model's provider.
51
+ * After TaskRunner resolution, input.model is a ModelConfig.
52
+ */
54
53
  protected getDefaultQueueName(input: Input): Promise<string | undefined>;
55
54
  /**
56
- * Validates that a model name really exists
57
- * @param schema The schema to validate against
58
- * @param item The item to validate
59
- * @returns True if the item is valid, false otherwise
55
+ * Validates that model inputs are valid ModelConfig objects.
56
+ *
57
+ * Note: By the time this is called, string model IDs have already been
58
+ * resolved to ModelConfig objects by the TaskRunner's input resolution system.
59
+ *
60
+ * @param input The input to validate
61
+ * @returns True if the input is valid
60
62
  */
61
63
  validateInput(input: Input): Promise<boolean>;
62
- narrowInput(input: Input): Promise<Input>;
64
+ narrowInput(input: Input, registry: ServiceRegistry): Promise<Input>;
63
65
  }
64
66
  //# sour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KAAK,CAAM,EAAE,MAAM,GAAE,MAAqB;IAiBrE;;;;;;;;;OASG;cACsB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAkB9E;;;;;OAKG;IACY,SAAS,CACtB,KAAK,EAAE,KAAK,EACZ,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;IAc1C;;;OAGG;cACsB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAKvF;;;;;;;;OAQG;IACG,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;IAmD7C,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC;CAoC3E"}
@@ -3,104 +3,7 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { DataPortSchemaNonBoolean, FromSchema, JsonSchema } from "@workglow/util";
7
- export type TypedArray = Float64Array | Float32Array | Int32Array | Int16Array | Int8Array | Uint32Array | Uint16Array | Uint8Array | Uint8ClampedArray;
8
- declare const TypedArraySchemaOptions: {
9
- readonly deserialize: [{
10
- readonly pattern: {
11
- readonly format: "TypedArray";
12
- };
13
- readonly output: TypedArray;
14
- }];
15
- readonly parseNotKeyword: true;
16
- readonly parseIfThenElseKeywords: true;
17
- readonly keepDefaultedPropertiesOptional: true;
18
- readonly references: false;
19
- };
20
- export type TypedArraySchemaOptions = typeof TypedArraySchemaOptions;
21
- export declare const TypedArraySchema: (annotations?: Record<string, unknown>) => {
22
- readonly oneOf: readonly [{
23
- readonly type: "array";
24
- readonly items: {
25
- readonly type: "number";
26
- readonly format: "Float64";
27
- };
28
- readonly title: "Float64Array";
29
- readonly description: "A 64-bit floating point array";
30
- readonly format: "Float64Array";
31
- }, {
32
- readonly type: "array";
33
- readonly items: {
34
- readonly type: "number";
35
- readonly format: "Float32";
36
- };
37
- readonly title: "Float32Array";
38
- readonly description: "A 32-bit floating point array";
39
- readonly format: "Float32Array";
40
- }, {
41
- readonly type: "array";
42
- readonly items: {
43
- readonly type: "number";
44
- readonly format: "Int32";
45
- };
46
- readonly title: "Int32Array";
47
- readonly description: "A 32-bit integer array";
48
- readonly format: "Int32Array";
49
- }, {
50
- readonly type: "array";
51
- readonly items: {
52
- readonly type: "number";
53
- readonly format: "Int16";
54
- };
55
- readonly title: "Int16Array";
56
- readonly description: "A 16-bit integer array";
57
- readonly format: "Int16Array";
58
- }, {
59
- readonly type: "array";
60
- readonly items: {
61
- readonly type: "number";
62
- readonly format: "Int8";
63
- };
64
- readonly title: "Int8Array";
65
- }, {
66
- readonly type: "array";
67
- readonly items: {
68
- readonly type: "number";
69
- readonly format: "Uint8";
70
- };
71
- readonly title: "Uint8Array";
72
- readonly description: "A 8-bit unsigned integer array";
73
- readonly format: "Uint8Array";
74
- }, {
75
- readonly type: "array";
76
- readonly items: {
77
- readonly type: "number";
78
- readonly format: "Uint16";
79
- };
80
- readonly title: "Uint16Array";
81
- readonly description: "A 16-bit unsigned integer array";
82
- readonly format: "Uint16Array";
83
- }, {
84
- readonly type: "array";
85
- readonly items: {
86
- readonly type: "number";
87
- readonly format: "Uint32";
88
- };
89
- readonly title: "Uint32Array";
90
- readonly description: "A 32-bit unsigned integer array";
91
- readonly format: "Uint32Array";
92
- }, {
93
- readonly type: "array";
94
- readonly items: {
95
- readonly type: "number";
96
- readonly format: "Uint8Clamped";
97
- };
98
- readonly title: "Uint8ClampedArray";
99
- readonly description: "A 8-bit unsigned integer array with values clamped to 0-255";
100
- readonly format: "Uint8ClampedArray";
101
- }];
102
- readonly format: "TypedArray";
103
- };
6
+ import { DataPortSchemaNonBoolean } from "@workglow/util";
104
7
  export declare const TypeLanguage: (annotations?: Record<string, unknown>) => {
105
8
  readonly type: "string";
106
9
  readonly title: "Language";
@@ -208,37 +111,11 @@ export declare function TypeModel<S extends TypeModelSemantic = "model", O exten
208
111
  } & O & {
209
112
  readonly format: TypeModelSemantic;
210
113
  };
211
- export declare const TypeReplicateArray: <T extends DataPortSchemaNonBoolean>(type: T, annotations?: Record<string, unknown>) => {
212
- readonly "x-replicate": true;
213
- readonly format?: string | undefined;
214
- readonly oneOf: readonly [T, {
114
+ export declare function TypeSingleOrArray<const T extends DataPortSchemaNonBoolean>(type: T): {
115
+ readonly anyOf: readonly [T, {
215
116
  readonly type: "array";
216
117
  readonly items: T;
217
118
  }];
218
- readonly title: string | undefined;
219
- readonly description: string | undefined;
220
- };
221
- export type TypedArrayFromSchema<SCHEMA extends JsonSchema> = FromSchema<SCHEMA, TypedArraySchemaOptions>;
222
- /**
223
- * Removes array types from a union, leaving only non-array types.
224
- * For example, `string | string[]` becomes `string`.
225
- * Used to extract the single-value type from schemas with x-replicate annotation.
226
- * Uses distributive conditional types to filter out arrays from unions.
227
- * Checks for both array types and types with numeric index signatures (FromSchema array output).
228
- * Preserves TypedArray types like Float64Array which also have numeric indices.
229
- */
230
- type UnwrapArrayUnion<T> = T extends readonly any[] ? T extends TypedArray ? T : never : number extends keyof T ? "push" extends keyof T ? never : T : T;
231
- /**
232
- * Transforms a schema by removing array variants from properties marked with x-replicate.
233
- * Properties with x-replicate use {@link TypeReplicateArray} which creates a union of
234
- * `T | T[]`, and this type extracts just `T`.
235
- */
236
- export type DeReplicateFromSchema<S extends {
237
- properties: Record<string, any>;
238
- }> = {
239
- [K in keyof S["properties"]]: S["properties"][K] extends {
240
- "x-replicate": true;
241
- } ? UnwrapArrayUnion<TypedArrayFromSchema<S["properties"][K]>> : TypedArrayFromSchema<S["properties"][K]>;
242
119
  };
243
120
  export type ImageSource = ImageBitmap | OffscreenCanvas | VideoFrame;
244
121
  /**
@@ -396,5 +273,4 @@ export declare const TypeCategory: {
396
273
  readonly title: "Category";
397
274
  readonly description: "Classification category with label and score";
398
275
  };
399
- export {};
400
276
  //# sourceMappingURL=AiTaskSchemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AiTaskSchemas.d.ts","sourceRoot":"","sources":["../../../src/task/base/AiTaskSchemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,wBAAwB,EACxB,UAAU,EAGV,UAAU,EACX,MAAM,gBAAgB,CAAC;AAGxB,MAAM,MAAM,UAAU,GAClB,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,GACX,UAAU,GACV,iBAAiB,CAAC;AAKtB,QAAA,MAAM,uBAAuB;;;;;;;;;;;CA2ES,CAAC;AAEvC,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAC;AAErE,eAAO,MAAM,gBAAgB,GAAI,cAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmExC,CAAC;AAEnC,eAAO,MAAM,YAAY,GAAI,cAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;;;;;;CAQzD,CAAC;AAEd,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,MAAM,EAAE,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG,wBAAwB,GAAG;IAClD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;CACpC,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,CAAC,SAAS,iBAAiB,GAAG,OAAO,EACrC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EACtC,QAAQ,GAAE,CAAgB,EAAE,OAAO,GAAE,CAAW;;;;;;EAkBjD;AAED,wBAAgB,iBAAiB,CA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BAAiB,CAC/B,CAAC,SAAS,iBAAiB,GAAG,OAAO,EACrC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EACtC,QAAQ,GAAE,CAAgB,EAAE,OAAO,GAAE,CAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASjD;AAED,wBAAgB,SAAS,CACvB,CAAC,SAAS,iBAAiB,GAAG,OAAO,EACrC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EACtC,QAAQ,GAAE,CAAgB,EAAE,OAAO,GAAE,CAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMjD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,CAAC,SAAS,wBAAwB,EAAE,IAAI,EAAE,CAAC;;;;;EAIlF;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,eAAe,GAAG,UAAU,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2EI,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;CAKI,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYG,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;CAgBM,CAAC"}
@@ -13,14 +13,11 @@ import { AiTask } from "./AiTask";
13
13
  export interface AiVisionTaskSingleInput extends TaskInput {
14
14
  model: string | ModelConfig;
15
15
  }
16
- export interface AiVisionArrayTaskInput extends TaskInput {
17
- model: string | ModelConfig | (string | ModelConfig)[];
18
- }
19
16
  /**
20
17
  * A base class for AI related tasks that run in a job queue.
21
18
  * Extends the JobQueueTask class to provide LLM-specific functionality.
22
19
  */
23
- export declare class AiVisionTask<Input extends AiVisionArrayTaskInput = AiVisionArrayTaskInput, Output extends TaskOutput = TaskOutput, Config extends JobQueueTaskConfig = JobQueueTaskConfig> extends AiTask<Input, Output, Config> {
20
+ export declare class AiVisionTask<Input extends AiVisionTaskSingleInput = AiVisionTaskSingleInput, Output extends TaskOutput = TaskOutput, Config extends JobQueueTaskConfig = JobQueueTaskConfig> extends AiTask<Input, Output, Config> {
24
21
  static type: string;
25
22
  /**
26
23
  * Get the input to submit to the job queue.
@@ -1 +1 @@
1
- {"version":3,"file":"AiVisionTask.d.ts","sourceRoot":"","sources":["../../../src/task/base/AiVisionTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,uBAAwB,SAAQ,SAAS;IACxD,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,CAAC,MAAM,GAAG,WAAW,CAAC,EAAE,CAAC;CACxD;AAED;;;GAGG;AACH,qBAAa,YAAY,CACvB,KAAK,SAAS,sBAAsB,GAAG,sBAAsB,EAC7D,MAAM,SAAS,UAAU,GAAG,UAAU,EACtC,MAAM,SAAS,kBAAkB,GAAG,kBAAkB,CACtD,SAAQ,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IACrC,OAAc,IAAI,EAAE,MAAM,CAAkB;IAC5C;;;;;OAKG;cACsB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,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